Advertisement
Guest User

Untitled

a guest
Feb 16th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.95 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3.     File: fn_vehicleGive.sqf
  4.     Author: Deathblade
  5.  
  6.     Description:
  7.     Check if not temp and transfer the vehicle ownership to another player.
  8.    
  9. */
  10.  
  11. private ["_vehiclesold","_destinationuid","_plaque","_sourceuid","_thread","_inInsured","_dbInfolist"];
  12. _vehiclesold = [_this,0,objNull,[objNull]] call BIS_fnc_param;
  13. _destinationuid = [_this,1,objNull,[objNull]] call BIS_fnc_param;
  14.  
  15. _dbInfolist = _vehiclesold getVariable ["dbInfo",[]];
  16.  
  17. if (count _dbInfolist > 0) then {
  18.     _sourceuid = (_dbInfolist select 0);
  19.     _plaque = (_dbInfolist select 1);
  20.     _isInsured = (_dbInfolist select 2);
  21.     };
  22.    
  23.     _query = format ["UPDATE vehicles SET pid='%1' WHERE plate='%2'",_destinationuid,_plaque];
  24.         _query spawn
  25.         {
  26.             waitUntil {!DB_Async_Active};
  27.             _thread = [_this,1] call DB_fnc_asyncCall;
  28.         };
  29.  
  30.         _vehiclesold setVariable ["dbInfo",[_destinationuid,_plaque,_isInsured],true];
  31. life_action_inUse = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement