fackstah 1 Posted April 10, 2013 in the mission i have been working on there are areas that can be captured with seized by side trigger after 5 minutes and it Exec's a script The script i am using is : if(str(playerSide) in ["WEST"]) then player setVariable["cmoney", (player getVariable "cmoney")+200,true]; hint format["You got 200$ for capturing the territory!"]; I also tried : if(str(playerSide) == "WEST") then player setVariable["cmoney", (player getVariable "cmoney")+200,true]; hint format["You got 200$ for capturing the territory!"]; but i seem to be having trouble getting it to work as now it does not give money at all Originally i had player setVariable["cmoney", (player getVariable "cmoney")+200,true]; hint format["You got 200$ for capturing the territory!"]; but that gave it to everyone in the map anyone have any ideas of how to fix this ? Cheers, Roman Share this post Link to post Share on other sites
giallustio 770 Posted April 10, 2013 if () then {code}; I think you have to define the variable too, so in the init.sqf set: player setVariable["cmoney", 0,true]; Share this post Link to post Share on other sites
fackstah 1 Posted April 10, 2013 thanks, but im pretty sure the variable is already set since its a wasteland mission im hooking into the cmoney with a second script to add the money when the trigger is set . my old version worked but i cannot get it to give it to only the side that captured the territory it gives it to everybody in game when somthing gets captured MY old code: player setVariable["cmoney", (player getVariable "cmoney")+200,true]; hint format["You got 200$ for capturing the territory!"]; so i tried adding if(str(playerSide) == "WEST") then so that it would only give to "WEST" Side but now it is just not working Cheers Share this post Link to post Share on other sites
giallustio 770 Posted April 10, 2013 Ah ok! I think it should work: if (playerSide == west) then {player setVariable["cmoney", (player getVariable "cmoney")+200,true];hint format["You got 200$ for capturing the territory!"];}; Share this post Link to post Share on other sites