Gonobob 1 Posted May 1, 2013 (edited) Hi all, I have a problem) I need to start and stop script executing when i bress one button on keyboard. if (_dikCode == 0x0D) then { _nill = execvm "player_do.sqf"; }; and player_do.sqf; while {true} do { player playMove ""; sleep .1; }; its working, but i need: press button = start hint infinitely press second time = stop player_do.sqf Thanks)) Edited May 1, 2013 by Gonobob Share this post Link to post Share on other sites
xxanimusxx 2 Posted May 1, 2013 Put this anywhere BEFORE you add the displayEventHandler: player_do_active = false; Now you change your handler to this: if (_dikCode == 0x0D) then { player_do_active = !player_do_active; if (player_do_active) then { execVm "player_do.sqf"; }; }; and finally change your sqf's content to this: if (isNil "player_do_active") then { player_do_active = false; }; while {player_do_active} do { player playMove ""; sleep .1; }; Et voilà :D Share this post Link to post Share on other sites
Gonobob 1 Posted May 2, 2013 (edited) Big Thanks!!! i did it :) Edited May 2, 2013 by Gonobob Share this post Link to post Share on other sites
Gonobob 1 Posted May 2, 2013 i have another question ) Can i create parameter in mpmission like units = ["1","2","3"]; and get this "units" in my addon? Share this post Link to post Share on other sites