JohnO1985

Untitled

Jan 13th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.29 KB | None | 0 0
  1. /*
  2.  
  3. Usage example: [1,"Exile_Chopper_Hellcat_Green",[0,0,0]] call JohnO_fnc_spawnPersistentVehicle;
  4.  
  5. New ini file in extDB\My_sql_custom = persistant.ini
  6. Contents of persistant.ini:
  7.  
  8. [getVehicleId]
  9. SQL1_1 = SELECT account_uid FROM vehicle WHERE uid = ?
  10. Number of Inputs = 1
  11. SQL1_INPUTS = 1
  12. OUTPUT = 1
  13.  
  14. */
  15.  
  16. _vehicleID = _this select 0;
  17. _vehClass = _this select 1;
  18. _vehSpawnPos = _this select 2;
  19.  
  20. _isAliveVehicle = format["getVehicleId:%1", _vehicleID] call ExileServer_system_database_query_selectSingleField; //Get the vehicle ID from the DB
  21.  
  22. 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
  23.  
  24. {  
  25.     _class = _vehClass
  26.     _vehPos = _vehSpawnPos;
  27.     _vehDir = random 360;
  28.     _useATL = false;
  29.     _pin = 0000;
  30.  
  31.     _persistantVehicle = [_class, _vehPos, _vehDir, _useATL, _pin] call ExileServer_object_vehicle_createPersistentVehicle;
  32.  
  33.     _vehicleObject setVariable ["ExileOwnerUID", _vehicleID]; // Define the vehicle account_uid (ill have my reference 1 = X 2 = Y etc)
  34.     _vehicleObject setVariable ["ExileIsLocked",0];
  35.     _vehicleObject lock 0;
  36.     _vehicleObject call ExileServer_object_vehicle_database_insert;
  37.     _vehicleObject call ExileServer_object_vehicle_database_update;
  38. };
Advertisement
Add Comment
Please, Sign In to add comment