Jump to content

Recommended Posts

i have created this if statement with the hopes it would detect when the player is within 200m of a marker and show a message at the bottom right corner of the screen, however i keep getting an error on mission start regarding a missing bracket in line 1.
 

if(player (getMarkerPos gatoro) < 200) then
{
  _gatoro = ["Gatoro"] spawn BIS_fnc_infoText;
}else {};

this script is called through the init.sqf with []execVM

Share this post


Link to post
Share on other sites

waitUntil {player distance (getMarkerPos "gatoro") < 200};

//code

 

If your current code is all you're using then it'll run the if statement once at mission start and never again. If you put it in a waitUntil then it'll do just that, wait until the condition is true before executing the code. 

 

You will probably want to have a look at this too to see how to use those commands (and others in the future) properly:https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3

Share this post


Link to post
Share on other sites

waitUntill works perfectly thank you, however its not repeatable... Any idea how id go about making it so?

Share this post


Link to post
Share on other sites

@SantoJ,

Quote

waitUntill works perfectly thank you, however its not repeatable... Any idea how id go about making it so?


1) exec the script again at the end of itself (so remove from init)
2) Make a function
3) Make it while {true} with a condition
4) exec it again from somewhere

Have fun!

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

×