Advertisement
jingles14

Untitled

Feb 12th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. private ["_garageowner","_garagefriends","_garageallowed","_friend"];
  2. _garageowner = _cursorTarget getVariable ["ownerPUID","0"]; //<-- We get the PUID of the owner. Here with P4L
  3. _friend = _cursorTarget getVariable ["GarageFriends",[]];
  4. _garagefriends = [];
  5. {
  6. _garagefriends set [count _garagefriends,(_x select 0)];
  7. } count _friend;
  8. _garageallowed = [_owner] + _garagefriends;
  9. if ((_typeOfCursorTarget in DZE_Garage) && (speed player <= 1) && _canDo) then {
  10. if (s_player_garage < 0) then {
  11. if ((getPlayerUID player) in _garageallowed) then {
  12. s_player_garage = player addAction ["<t color='#FFAA00'>Garage Menu</t>", "Garage\player_virtualgarage.sqf", _cursorTarget, 2, false];
  13. } else {
  14. s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>", "",_cursorTarget, 2, true, true, "", ""];
  15. };
  16. };
  17. } else {
  18. player removeAction s_player_garage;
  19. s_player_garage = -1;
  20. };
  21.  
  22.  
  23. ////////////////////////////////////// REPLACE THIS CODE WITH THIS ONE //////////////////////////////////////////////////////////////////
  24.  
  25. private ["_nearestPoles","_pole","_garagefriends","_garageallowed","_friends"];
  26. _nearestPoles = nearestObjects [(vehicle player),["Plastic_Pole_EP1_DZ"],(DZE_PlotPole select 0)];
  27. if (count _nearestPoles > 0) then
  28. {
  29. _pole = _nearestPoles select 0;
  30. _friends = _pole getVariable ["plotfriends",[]];
  31. _owner = _pole getVariable ["ownerPUID","0"];
  32. _garagefriends = [];
  33. {
  34. _garagefriends set [_forEachIndex,(_x select 0)];
  35. } forEach _friends;
  36. _garageallowed = _garagefriends + [_owner];
  37.  
  38. if ((_typeOfCursorTarget in DZE_Garage) && (speed player <= 1) && _canDo) then
  39. {
  40. if (s_player_garage < 0) then
  41. {
  42. if ((getPlayerUID player) in _garageallowed) then
  43. {
  44. s_player_garage = player addAction ["<t color='#FFAA00'>Garage Menu</t>","Garage\player_virtualgarage.sqf",_cursorTarget,2,false];
  45. }
  46. else
  47. {
  48. s_player_garage = player addAction ["<t color='#FF0000'>Garage Locked</t>","",_cursorTarget,2,true,true,"",""];
  49. };
  50. };
  51. }
  52. else
  53. {
  54. player removeAction s_player_garage;
  55. s_player_garage = -1;
  56. };
  57. }
  58. else
  59. {
  60. player removeAction s_player_garage;
  61. s_player_garage = -1;
  62. };
  63.  
  64.  
  65.  
  66. ///////////////////////////////////////////////// ROUND ABOUT LINE 225.....ISH///////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement