Advertisement
Nebulazer

Untitled

Aug 24th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.27 KB | None | 0 0
  1. //Jungle 2 Vehicle 1
  2. neb_fnc_core_randomVehicleSpawnB = {
  3.     //Create Marker
  4.             createMarker ["LSVJ2V1",[2487.66,12914.6]];
  5.             "LSVJ2V1" setMarkerType "Empty";
  6.             "LSVJ2V1" setMarkerSize [2, 2];
  7.            
  8.     while{true} do{
  9.         if (isServer) then {
  10.             disableSerialization;
  11.             private["_position","_direction","_nearestTargets","_scanArea"];
  12.    
  13.     //Check if the marker has any cars near it
  14.             _position = getMarkerPos "LSVJ2V1";
  15.             _scanArea = 5;
  16.             _direction = 60;
  17.             _nearestTargets = nearestObjects[_position,["landVehicle","Air","Ship"],_scanArea] select 0;
  18.     //if the marker has no cars near it then spawn the new car with nothing in inventory
  19.     if (!isNil "_nearestTargets") then {
  20.                 sleep 20;
  21.             }else{
  22.                     _choices = ["C_Offroad_02_unarmed_F","O_T_LSV_02_unarmed_F","B_T_LSV_01_unarmed_F"] call BIS_fnc_selectRandom;
  23.                     _veh = createVehicle [_choices, _position, [], 0, "FLY"];
  24.                     _veh setVariable ["BIS_enableRandomization", false];
  25.                     _veh setDir _direction;
  26.                     clearWeaponCargoGlobal _veh;
  27.                     clearMagazineCargoGlobal _veh;
  28.                     clearItemCargoGlobal _veh;
  29.                     _veh setVehicleVarName "J2LSV1";
  30.                     J2LSV1 = _veh;
  31.                     [J2LSV1] call neb_fnc_addBounty;
  32.     //Respawn Vehicle If It Dies
  33.                     waitUntil {!alive J2LSV1};
  34.                     sleep 10;
  35.                    
  36.             };
  37.         };
  38.     };
  39. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement