SadBoy1981 Posted September 20, 2014 Report Share Posted September 20, 2014 On my server players after spawn get old bike. How to set timer for those vehicles? I have this code: private ["_object","_uniqueid"]; if (dayz_combat == 1) then { titleText ["You can't select a class while in combat.", "PLAIN DOWN", 3]; sleep 5; titleFadeOut 1; } else { titleText ["Spawn Vehicle...", "PLAIN DOWN", 3]; sleep 2; [dayz_playerUID,dayz_characterID,'Survivor2_DZ'] spawn player_humanityMorph; sleep 2; showCommandingMenu ''; reload player; _object = 'Old_bike_TK_CIV_EP1' createVehicle (position player); _object setVariable ["malsar",1,true]; _uniqueid = str(round(random 999999)); _object setVariable ["ObjectID", _uniqueid, true]; _object setVariable ["ObjectUID", _uniqueid, true]; clearMagazineCargo _object; clearWeaponCargo _object; sleep 2; titleText ["After restart vehicle disappear!", "PLAIN DOWN", 3]; sleep 5; titleFadeOut 1; execVM "custom\spawning\vision_execute.sqf"; }; Link to comment Share on other sites More sharing options...
0 SadBoy1981 Posted September 22, 2014 Author Report Share Posted September 22, 2014 Fixed! New code with timer: private ["_object","_uniqueid"]; _wait_time = 600; // ===============================================================set timer here in seconds titleText ["Spawn vehicle...", "PLAIN DOWN", 3]; sleep 2; [dayz_playerUID,dayz_characterID,'US_Delta_Force_Assault_EP1'] spawn player_humanityMorph; sleep 2; showCommandingMenu ''; reload player; _object = 'Old_bike_TK_CIV_EP1' createVehicle (position player); _object setVariable ["malsar",1,true]; _uniqueid = str(round(random 999999)); _object setVariable ["ObjectID", _uniqueid, true]; _object setVariable ["ObjectUID", _uniqueid, true]; clearMagazineCargo _object; clearWeaponCargo _object; sleep 2; titleText ["Vehicle disappear after 10 minutes!", "PLAIN DOWN", 3]; sleep 5; titleFadeOut 1; execVM "custom\spawning\vision_execute.sqf"; }; sleep _wait_time; //=================================================================timer start deleteVehicle _object//===============================================================delete vehicle after time is end Link to comment Share on other sites More sharing options...
Question
SadBoy1981
On my server players after spawn get old bike.
How to set timer for those vehicles?
I have this code:
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now