Jump to content
Sign in to follow this  
misinformed

Add Actions and vehicles

Recommended Posts

Ive been trying to add an action that only the pilot of the current chopper (or any pilot class at least, while in the chopper) can use, rather than anyone in cargo being able to use it. However you can only add actions to the entire chopper, hence everyone gets said new action in their action menu. In my case i want the pilot to have the ability to drop the odd flare.

So one way i can think of to get around this is to:

Somehow run the addaction so that it is local only to the driver (pilot class of the current chopper). Since a vehicle is local to its driver others in chopper wont see it. And i cant call the add action from the editor, because as you all know triggers in the editor are executed on all clients. So im looking for suggestions in how that can be done.

The other way approach is the exact opposite and remove the action from other players machines. Except all pilot classes and/or the current driver of said chopper.

I suppose the final way is to allow the addaction .sqs to check for said classes and exit if the player that activated the script is not a "SoldierWpilot". So an array that gets the current choppers crew so it doesnt even give them the add action or a check in the add action script would do. IF not a check for the class what about a check for a unitname, so would ? isPlayer pilot1 : goto "flare" do the trick?

Ive spent hours thinking about this and im pretty exhausted, so any help would be great.

Thx in advance.

Share this post


Link to post
Share on other sites

All that I did was to add the action, and the script launched by the action checked if the activaotr was the pilot. If you have found a better way would you be prepared to share?

Share this post


Link to post
Share on other sites

I think the addaction command is local so you could have the action added to the heli only on the pilots computer.

If (player==pilot1) then {heli addaction ["Flare","Flare.sqs"]}

Not tested.

Share this post


Link to post
Share on other sites

Yea i just did:

if (local player and group player == group3 and player == driver heli1) then {fdrop = heli1 addAction["Drop Flares","Flare1.sqf",[],-2,false]}

In the end, after twisting various body parts in ways they shouldn't be twisted.

So nothing special.

Now ive got to work out a way to get a flare put on the map by the server that is triggered the flare.sqf of this client. Just need a way to trigger it across.

Share this post


Link to post
Share on other sites

Will that work? I mean will all players, clients, see it if the createunit is called by said addaction that is only local to the driver of a given vehicle?

Also will setting a particular trigger to true via the addaction of this one player set all of said flare triggers to true with the above code work on all machines? im skeptical. I know that if the trigger is fired it has global effect. But im still not sure.

Ie

Quote[/b] ]

if (local player and group player==group3 and player == driver heli1) then {fdrop = heli1 addAction ["Drop Flares","f.sqs",[],-2,false]}

f.sqs

Quote[/b] ]

flare=true

~2

flare=false

Flare (trigger)

Quote[/b] ]

Cond: flare

On Act: flarewhite = "F_40mm_white" createvehicle [getpos heli1 select 0,getpos heli1 select 1, getpos heli1 select 2]

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  

×