Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "\life_server\script_macros.hpp"
- /*
- File: fn_chopShopSell.sqf
- Author: Bryan "Tonic" Boardwine
- Description:
- Checks whether or not the vehicle is persistent or temp and sells it.
- */
- private ["_unit","_vehicle","_price","_cash"];
- _unit = [_this,0,objNull,[objNull]] call BIS_fnc_param;
- _vehicle = [_this,1,objNull,[objNull]] call BIS_fnc_param;
- //Error checks
- if (isNull _vehicle || isNull _unit) exitWith {
- life_action_inUse = false;
- owner _unit publicVariableClient "life_action_inUse";
- };
- _displayName = FETCH_CONFIG2(getText,"CfgVehicles",typeOf _vehicle, "displayName");
- _unit = owner _unit;
- _playeruid = getPlayerUID player;
- _dbInfo = _vehicle getVariable ["dbInfo",[]];
- if (count _dbInfo > 0) then {
- _uid = (_dbInfo select 0);
- _plate = (_dbInfo select 1);
- _dbInfo set[0,_playeruid];
- _query = format ["UPDATE vehicles SET pid='%3' WHERE pid='%1' AND plate='%2'",_uid,_plate,_playeruid ];
- _sql = [_query,1] call DB_fnc_asyncCall;
- _vehicle setVariable ["dbInfo",_dbInfo,true];
- };
- [_vehicle,false,_unit,"Véhicule entreposé"] spawn TON_fnc_vehicleStore;
- life_action_inUse = false;
- _unit publicVariableClient "life_action_inUse";
- [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