Jump to content
Sign in to follow this  
edbusana

How to Add Class in the Unit addAction?

Recommended Posts

I'm not getting add that besides the B_Helipilot_F could be used by the action B_officer_F.

I have this in the init Unit:

this addAction ["<t color='#FFFFFF'>Supply Fuel</t>","scripts\misc\SupplyCrates\Supply_Fuel.sqf",[],21,true,true,"",'((vehicle player) == player) && ((player distance _target) < 5) && (player isKindOf "B_Helipilot_F")']

already tried

this addAction ... && (player isKindOf "B_Helipilot_F", "B_officer_F")']

this addAction ... && (player isKindOf ("B_Helipilot_F", "B_officer_F"))']

this addAction ... && (player isKindOf "B_Helipilot_F") && (player isKindOf "B_officert_F")']

Does the solution would be to copy the whole script just changing the class as well:

this addAction ["<t color='#FFFFFF'>Supply Fuel</t>","scripts\misc\SupplyCrates\Supply_Fuel.sqf",[],21,true,true,"",'((vehicle player) == player) && ((player distance _target) < 5) && (player isKindOf "B_Helipilot_F")'];
this addAction ["<t color='#FFFFFF'>Supply Fuel</t>","scripts\misc\SupplyCrates\Supply_Fuel.sqf",[],21,true,true,"",'((vehicle player) == player) && ((player distance _target) < 5) && (player isKindOf "B_officer_F")']

Share this post


Link to post
Share on other sites
typeOf player isEqualTo 'B_Helipilot_F' || typeOf player isEqualTo 'B_Officer_F'

Edited by JShock

Share this post


Link to post
Share on other sites

Use

((player isKindOf "B_Helipilot_F") or (player isKindOf "B_officer_F"))

or

((typeOf player) in ["B_Helipilot_F", "B_officer_F"])

or

copy the whole script just changing the class as well

Share this post


Link to post
Share on other sites

Thanks Schaten and JShock , but tested only this:

((typeOf player) in ["B_Helipilot_F", "B_officer_F"])

Has worked.

Share this post


Link to post
Share on other sites
Class is acquired, not born with.

Jk I'm just here.

Get it, like class and good looks, etc.

Whatever, 10/10

???????

Created some units as rising B_officer_F.

Project without rank.

Share this post


Link to post
Share on other sites
Class is acquired, not born with.

Jk I'm just here.

Get it, like class and good looks, etc.

Whatever, 10/10

Don't worry EGW, I understood your joke, and I laughed very hard. I was going to write something similar

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×