Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.33 KB | None | 0 0
  1. private ["_finished","_finishedTime","_posplr","_dirplr","_object"];
  2.  
  3. if (dayz_combat == 1) exitWith {
  4.     cutText [format["You cannot deploy vehicles while in combat!."], "PLAIN DOWN"];
  5. };
  6. if ("ItemToolbox","PartGeneric" in weapons Player) then {
  7. call spawnBike;
  8. } else {
  9. cutText [format["You do not have a the required materials."], "PLAIN DOWN"];
  10. };
  11.  
  12. spawnBike = {
  13.     player removeWeapon "PartGeneric";
  14.  
  15.     player playActionNow "Medic";
  16.     [player,"repair",0,false,10] call dayz_zombieSpeak;
  17.     [player,10,true,(getPosATL player)] spawn player_alertZombies;
  18.    
  19.     r_doLoop = true;
  20.  
  21.     _finished = false;
  22.     _finishedTime = diag_tickTime+3;
  23.     while {r_doLoop} do {
  24.         if (diag_tickTime >= _finishedTime) then {
  25.             r_doLoop = false;
  26.             _finished = true;
  27.         };
  28.     };
  29.     if (_finished) then {
  30.        
  31.         _posplr = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0];
  32.        
  33.         _dirplr = getDir player;
  34.  
  35.         _object = "Old_bike_TK_CIV_EP1" createVehicle (_posplr);
  36.         _object setVariable ["ObjectID", "1", true];
  37.         _object setVariable ["ObjectUID", "1", true];
  38.         _object setVariable ["SpawnedBike",1,true];
  39.         _object setVariable ["Sarge",1,true];
  40.  
  41.         player reveal _object;
  42.  
  43.         cutText [format["You deployed a bike!."], "PLAIN DOWN"];
  44.         sleep 10;
  45.         cutText [format["Warning: Deployed vehicles despawn on restart!"], "PLAIN DOWN"];      
  46.     };
  47. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement