snkman 351 Posted July 4, 2007 Hey guy's, well i just started converting some script from .sqs to .sqf and now i have a little problem... How do i convert this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ? (random 100 < 50) : exit Seem's like there is no way to exit a .sqf script. I tryed with: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (random 100 < 50) then exitWith {}; but this gives me an error... Please someone can help me with this? Share this post Link to post Share on other sites
Nutty_101 0 Posted July 4, 2007 if (floor (random 100) < 50) exitwith {}; That might be it. Share this post Link to post Share on other sites
snkman 351 Posted July 4, 2007 Greate it works Thanks a lot Nutty_101. Share this post Link to post Share on other sites
squeeze 22 Posted July 4, 2007 just to add to that.....exitwith dosen't exit the script if it's in {...} it will just exit that function. so in the below eg: both exitwith commands execute. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> if(true)then { ....code.... if(true)exitwith{hint"exit if statment"}; ....code.... }; if(true)exitwith{hint"exit script"}; Share this post Link to post Share on other sites
zaphod 0 Posted July 5, 2007 if (random(100) < 50) then {exit;}; Share this post Link to post Share on other sites