Bellow is my function in which the sleep command isn't working, and I need some delay's to get it just right. What alternative is there? I've tried using a time delay but thats not working too well either, any ideas?
Code:civim_fnc_suicide = { private ["_target","_player","_delayTimer","_delay"]; _target = _this select 0; _player = _this select 1; _target lookAt _player; _target disableAI "ANIM"; _target disableAI "MOVE"; _target disableAI "TARGET"; _target disableAI "AUTOTARGET"; if (civim_debug) then {format ["DEBUG: %1 is commiting suicide. (Global)", (name _target)] call CBA_fnc_systemChat}; _target addWeapon "Colt1911"; [-2, {_target switchMove "ActsPercMstpSnonWpstDnon_suicide1B"}] call CBA_fnc_globalExecute; if (!isMultiplayer) then {_target switchMove "ActsPercMstpSnonWpstDnon_suicide1B"}; _delayTimer = time; _delay = 4; waituntil {(time > (_delaytimer + _delay))}; sleep 4; [_target, "m1911"] call CBA_fnc_globalSay3d; _delayTimer = time; _delay = 2; waituntil {(time > (_delaytimer + _delay))}; sleep 2; _target setDammage 1; };
HOME 
Reply With Quote
