Jump to content

Recommended Posts

Hello, I need a script that will display my holdaction if the player has an item in his inventory. 
My script that doesn't work:
 

        if (playerside == west) then {
    {
        [_x,"<t color='#FFAA00'>Remove!</t>",
        "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa",
        "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa",
        "_this distance _target < 4",
        "(_caller distance _target < 4) && ("ToolKit" in items _caller)",
        {[_target, "wire_s",100] spawn CBA_fnc_globalSay3d;},
        {},
        {deleteVehicle _target;},
        {},
        [],
        9,
        0,
        true,
        false] call BIS_fnc_holdActionAdd;
    } forEach wire;
};

Arma writes that there is an error in the line:  "(_caller distance _target < 4) && ("ToolKit" in items _caller)",
Where is the error and why it doesn't work?

Share this post


Link to post
Share on other sites

at least there's problem with the quotes with "ToolKit". try changing those to the ' .  like so: 'ToolKit'

  • Thanks 1

Share this post


Link to post
Share on other sites

You can't use " inside ", which will break the string. Use ' instead.

"(_caller distance _target < 4) && ('ToolKit' in items _caller)"

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
7 minutes ago, POLPOX said:

You can't use " inside ", which will break the string. Use ' instead.


"(_caller distance _target < 4) && ('ToolKit' in items _caller)"

  

Yes, now it is working, thank you very much!

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  

×