Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Usage example: [1,"Exile_Chopper_Hellcat_Green",[0,0,0]] call JohnO_fnc_spawnPersistentVehicle;
- New ini file in extDB\My_sql_custom = persistant.ini
- Contents of persistant.ini:
- [getVehicleId]
- SQL1_1 = SELECT account_uid FROM vehicle WHERE uid = ?
- Number of Inputs = 1
- SQL1_INPUTS = 1
- OUTPUT = 1
- */
- _vehicleID = _this select 0;
- _vehClass = _this select 1;
- _vehSpawnPos = _this select 2;
- _isAliveVehicle = format["getVehicleId:%1", _vehicleID] call ExileServer_system_database_query_selectSingleField; //Get the vehicle ID from the DB
- if !(_isAliveVehicle isEqualTo _vehicleID) then // If the vehicle id in the DB does not equal the DB called from the function do nothing, else create the vehicle at pos
- {
- _class = _vehClass
- _vehPos = _vehSpawnPos;
- _vehDir = random 360;
- _useATL = false;
- _pin = 0000;
- _persistantVehicle = [_class, _vehPos, _vehDir, _useATL, _pin] call ExileServer_object_vehicle_createPersistentVehicle;
- _vehicleObject setVariable ["ExileOwnerUID", _vehicleID]; // Define the vehicle account_uid (ill have my reference 1 = X 2 = Y etc)
- _vehicleObject setVariable ["ExileIsLocked",0];
- _vehicleObject lock 0;
- _vehicleObject call ExileServer_object_vehicle_database_insert;
- _vehicleObject call ExileServer_object_vehicle_database_update;
- };
Advertisement
Add Comment
Please, Sign In to add comment