Advertisement
Guest User

Untitled

a guest
Apr 15th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. #include "\life_server\script_macros.hpp"
  2. /*
  3. File: fn_chopShopSell.sqf
  4. Author: Bryan "Tonic" Boardwine
  5.  
  6. Description:
  7. Checks whether or not the vehicle is persistent or temp and sells it.
  8. */
  9. private ["_unit","_vehicle","_price","_cash"];
  10. _unit = [_this,0,objNull,[objNull]] call BIS_fnc_param;
  11. _vehicle = [_this,1,objNull,[objNull]] call BIS_fnc_param;
  12.  
  13. //Error checks
  14. if (isNull _vehicle || isNull _unit) exitWith {
  15. life_action_inUse = false;
  16. owner _unit publicVariableClient "life_action_inUse";
  17. };
  18.  
  19. _displayName = FETCH_CONFIG2(getText,"CfgVehicles",typeOf _vehicle, "displayName");
  20. _unit = owner _unit;
  21. _playeruid = getPlayerUID player;
  22.  
  23. _dbInfo = _vehicle getVariable ["dbInfo",[]];
  24. if (count _dbInfo > 0) then {
  25. _uid = (_dbInfo select 0);
  26. _plate = (_dbInfo select 1);
  27.  
  28. _dbInfo set[0,_playeruid];
  29. _query = format ["UPDATE vehicles SET pid='%3' WHERE pid='%1' AND plate='%2'",_uid,_plate,_playeruid ];
  30.  
  31. _sql = [_query,1] call DB_fnc_asyncCall;
  32. _vehicle setVariable ["dbInfo",_dbInfo,true];
  33. };
  34.  
  35. [_vehicle,false,_unit,"Véhicule entreposé"] spawn TON_fnc_vehicleStore;
  36. life_action_inUse = false;
  37. _unit publicVariableClient "life_action_inUse";
  38. [2,"STR_NOTF_ChopSoldCar",true,[_displayName,[_price] call life_fnc_numberText]] remoteExecCall ["life_fnc_broadcast",_unit];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement