Jump to content
Sign in to follow this  
Shadow_Spyder

Action Menu Help

Recommended Posts

Ok, so i've got my action in the menu, it does what it's soposed to do. Heres the catch. I'm trying to get it to NOT show up if the player is NOT inside the trigger zone. Here is what i've got inside the trigger onact field:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">fenceact = thislist select 0 addAction ["Break Fence", "fence_action.sqs"]

Here is the script:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_player = _this select 0

_id = _this select 2

; remove the action once it is activated

_player removeAction _id

_player playmove "AinvPknlMstpSlayWrflDnon_medic"

~8.2

position _player nearestObject 3922 setDamage 1

exit

Anyone got any ideas? I've tried like thislist select 0 removeaction fenceact and stuff but the Break Fence still shows up even if i'm miles away from the trigger (after activating it once)

Share this post


Link to post
Share on other sites

Hm, had to try, and I got this to work just moments ago

Trigger1:

Activation:Side

player in thisList

OnAct: myAction = player call addAction;

OnDeAct: player removeAction myAction;

in init

addAction = compile preProcessFile "addAction.sqf";

addAction.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_plr = _this;

_newAction = _plr addAction ["My action", "someScript.sqf",[],-1, false, false, ""];

_newAction

Hope it helps smile_o.gif

[edit]

Note:

I do not know how this will do in MP, if it will be triggered only for the player entering the trigger, or all players online...

i.e.

will the action be added to all players, or only the one currently in the trigger

[edit2]

And.

For some reason, in the script you exec from the addAction array.

_player removeAction _id

Doesn't work, only removing the variable(action object) does.

You stated that, and I confirm it wink_o.gif

[edit3]

I tested this when trying the addWeaponCargo thing mentioned in another thread.

And it seems that the action isn't added to the other players.

I didn't have time to test what happens if two players entering the trigger at the same time tho'

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  

×