Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Jungle 2 Vehicle 1
- neb_fnc_core_randomVehicleSpawnB = {
- //Create Marker
- createMarker ["LSVJ2V1",[2487.66,12914.6]];
- "LSVJ2V1" setMarkerType "Empty";
- "LSVJ2V1" setMarkerSize [2, 2];
- while{true} do{
- if (isServer) then {
- disableSerialization;
- private["_position","_direction","_nearestTargets","_scanArea"];
- //Check if the marker has any cars near it
- _position = getMarkerPos "LSVJ2V1";
- _scanArea = 5;
- _direction = 60;
- _nearestTargets = nearestObjects[_position,["landVehicle","Air","Ship"],_scanArea] select 0;
- //if the marker has no cars near it then spawn the new car with nothing in inventory
- if (!isNil "_nearestTargets") then {
- sleep 20;
- }else{
- _choices = ["C_Offroad_02_unarmed_F","O_T_LSV_02_unarmed_F","B_T_LSV_01_unarmed_F"] call BIS_fnc_selectRandom;
- _veh = createVehicle [_choices, _position, [], 0, "FLY"];
- _veh setVariable ["BIS_enableRandomization", false];
- _veh setDir _direction;
- clearWeaponCargoGlobal _veh;
- clearMagazineCargoGlobal _veh;
- clearItemCargoGlobal _veh;
- _veh setVehicleVarName "J2LSV1";
- J2LSV1 = _veh;
- [J2LSV1] call neb_fnc_addBounty;
- //Respawn Vehicle If It Dies
- waitUntil {!alive J2LSV1};
- sleep 10;
- };
- };
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement