Cain_ 10 Posted November 17, 2010 (edited) Im call this script from init.sqf, this script is also in sqf. When i run it I get an error saying "Error Generic Error in expression sleep 1.0" What have i done wrong now? team_score=0; while {team_score<=180} do { if (player distance fire_team_a<= 50) then {team_score=team_score+1;]}; hint "Team Score"; team_score=team_score+1; sleep 1.0; }; Edited November 17, 2010 by Cain_ Share this post Link to post Share on other sites
[frl]myke 14 Posted November 17, 2010 Do you call it with exec or execVM? Share this post Link to post Share on other sites
Cain_ 10 Posted November 17, 2010 (edited) exec not execVM with execVM I get the whole file as an error Edited November 17, 2010 by Cain_ Share this post Link to post Share on other sites
[frl]myke 14 Posted November 17, 2010 http://community.bistudio.com/wiki/exec http://community.bistudio.com/wiki/execVM Then not the sleep command is the problem but the rest of your script. sqf files requests execVM, exec is for .sqs scripts. With exec, the engine doesn't "know" the sleep command. :EDITH: Check the brackets. Share this post Link to post Share on other sites
neokika 62 Posted November 17, 2010 exec not execVMwith execVM I get the whole file as an error Exec is for .sqs files, execVM is for .sqf files. team_score=0; while {team_score<=180} do { if ((player distance fire_team_a) <= 50) then { team_score = team_score + 1; hint "Team Score"; }; sleep 1; }; _neo_ Share this post Link to post Share on other sites
Cain_ 10 Posted November 17, 2010 Myke;1791143']/QUOTE] _neo_ Thanks guys, got it working. :) :bounce3::bounce3: Share this post Link to post Share on other sites
CarlGustaffa 4 Posted November 18, 2010 You did the same kind of mixup in another thread (mixing sqf and sqs syntax and not starting them correctly), so here is something to learn from: http://community.bistudio.com/wiki/Category:Syntax Share this post Link to post Share on other sites
sbsmac 0 Posted November 18, 2010 Cain, do yourself a favour and download squint - it would have told you about the extraneous square bracket in that last example before you'd even run the script. Share this post Link to post Share on other sites
Cain_ 10 Posted November 18, 2010 Cain, do yourself a favour and download squint - it would have told you about the extraneous square bracket in that last example before you'd even run the script. I never could get it to run on my x64 system, says program is 32 bit. :confused: jesus it works now :) thanks! Share this post Link to post Share on other sites