Advertisement
Guest User

123

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