Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_storeVehicle.sqf
  4. Author: Bryan "Tonic" Boardwine
  5. Description:
  6. Stores the vehicle in the garage.
  7. */
  8. private ["_nearVehicles","_vehicle"];
  9. if !(isNull objectParent player) then {
  10. _vehicle = vehicle player;
  11. } else {
  12. _nearVehicles = nearestObjects[getPos (_this select 0),["Car","Air","Ship"],30]; //Fetch vehicles within 30m.
  13. if (count _nearVehicles > 0) then {
  14. {
  15. if (!isNil "_vehicle") exitWith {}; //Kill the loop.
  16. _vehData = _x getVariable ["vehicle_info_owners",[]];
  17. if (count _vehData > 0) then {
  18. _vehOwner = ((_vehData select 0) select 0);
  19. if ((getPlayerUID player) == _vehOwner) exitWith {
  20. _vehicle = _x;
  21. };
  22. };
  23. } forEach _nearVehicles;
  24. };
  25. };
  26.  
  27. if (isNil "_vehicle") exitWith {hint localize "STR_Garage_NoNPC"};
  28. if (isNull _vehicle) exitWith {};
  29. if (!alive _vehicle) exitWith {hint localize "STR_Garage_SQLError_Destroyed"};
  30.  
  31. _storetext = localize "STR_Garage_Store_Success";
  32.  
  33. if (life_HC_isActive) then {
  34. [_vehicle,false,(_this select 1),_storetext] remoteExec ["HC_fnc_vehicleStore",HC_Life];
  35. } else {
  36. [_vehicle,false,(_this select 1),_storetext] remoteExec ["TON_fnc_vehicleStore",RSERV];
  37. };
  38.  
  39. hint localize "STR_Garage_Store_Server";
  40. life_garage_store = true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement