Jump to content
Sign in to follow this  
-FW- Shaanguy

Set Variable & Get Variable help

Recommended Posts

I just want to make a deliver materials in my lan mission, but i cant continue the mission because of this problem.

in my init

---------------------

player setVariable ["materials",0];

and i made a waypoint, in my waypoint statements, i wrote this

---------------------

player setVariable ["materials", + 100];

in the second waypoint my statement

---------------------

player setVariable ["materials", + 5];

// and the variable does not become 105, the variable is changing to 5, this is my problem.

i hope a other good :dj: scripter know how to solve this, because its really confusing :confused:

Share this post


Link to post
Share on other sites

_materials = player getVariable "materials";
_materials = _materials + 100;
player setVariable ["materials", _materials];

_materials = player getVariable "materials";
_materials = _materials + 5;
player setVariable ["materials", _materials];

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  

×