// @file Version: 1.0 // @file Name: vehicleCreation.sqf // @file Author: [404] Deadbeat, [404] Costlyy // @file Created: 20/11/2012 05:19 // @file Args: //Edited the positionthing //Removed the vehicle.sqf, replaced with one running script in hope of better performance //Simplified with case. //Papuwarfare, Viba if(!X_Server) exitWith {}; private ["_marker","_cartype","_car","_num","_tipped","_carpos","_type","_townpos"]; //1 = CIV, 2 = MIL, 3=ARM MIL _type = _this select 1; _markerpos = _this select 0; _pos = [_markerpos select 0, _markerpos select 1, 0]; switch (_type) do { case 0: { _cartype = civilianVehicles select (random (count civilianVehicles - 1)); }; case 1: { _cartype = militaryVehicles select (random (count militaryVehicles - 1)); }; case 2: { _cartype = armedMilitaryVehicles select (random (count armedMilitaryVehicles - 1)); }; }; _car = createVehicle [_cartype,_pos,[], 20,"None"]; //Clear Cars Inventory clearMagazineCargoGlobal _car; clearWeaponCargoGlobal _car; //Attach objects to cars. if (_car isKindOf "Ikarus_TK_CIV_EP1" || _car isKindOf "Tractor") then { _attachments = [_car] execVM "Fixes\vehspawnattachto.sqf"; waitUntil {scriptDone _attachments}; }; //Set Cars Attributes _car setFuel (1-(random 0.75)); _car setDamage (random 0.50); _car setDir (random 360); _car setVelocity [0,0,1]; [_car] call randomWeapons; if (_type == 2) then { _car setVehicleAmmo (random 0.90); }; //Set original posistion then add to vehicle array _car setVariable["newVehicle",1,true];