Results 1 to 2 of 2

Thread: Action Menu Help

  1. #1
    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 &#91;&#34;Break Fence&#34;, &#34;fence_action.sqs&#34;&#93;[/QUOTE]

    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 &#34;AinvPknlMstpSlayWrflDnon_medic&#34;
    ~8.2
    position _player nearestObject 3922 setDamage 1

    exit[/QUOTE]

    Anyone got any ideas? I&#39;ve tried like thislist select 0 removeaction fenceact and stuff but the Break Fence still shows up even if i&#39;m miles away from the trigger (after activating it once)
    [img]http://cache.www.gametracker.com/server_....mg]
    31st MEU -***Cpl. Roe - 2/4 Echo Co. 1st Rifle PLT, 1st SQD, 2nd FT TL

  2. #2
    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 &#91;&#34;My action&#34;, &#34;someScript.sqf&#34;,&#91;&#93;,-1, false, false, &#34;&#34;&#93;;
    _newAction
    [/QUOTE]

    Hope it helps

    [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&#39;t work, only removing the variable(action object) does.
    You stated that, and I confirm it

    [edit3]
    I tested this when trying the addWeaponCargo thing mentioned in another thread.
    And it seems that the action isn&#39;t added to the other players.

    I didn&#39;t have time to test what happens if two players entering the trigger at the same time tho&#39;




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •