aeroson

Untitled

Nov 6th, 2015
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. /*
  2. File: fn_trackViewDistance.sqf
  3. Author: Bryan "Tonic" Boardwine
  4.  
  5. Description:
  6. Constantly monitors the players state.
  7.  
  8. i.e Player gets in landvehicle then adjust viewDistance.
  9. */
  10. private["_oldVehiclePlayer"];
  11. while {true} do
  12. {
  13.  
  14. if(isNil{tawvd_action}) then {
  15. tawvd_player = player;
  16. tawvd_action = tawvd_player addAction["<t color='#FF0000'>Settings</t>",TAWVD_fnc_openTAWVD,[],-99,false,false,"",''];
  17. };
  18.  
  19. if(tawvd_player != player) then
  20. {
  21. tawvd_player removeAction tawvd_action;
  22. tawvd_player = player;
  23. tawvd_action = player addAction["<t color='#FF0000'>Settings</t>",TAWVD_fnc_openTAWVD,[],-99,false,false,"",''];
  24. };
  25.  
  26.  
  27. if(isNil{_oldVehiclePlayer} || {_oldVehiclePlayer != vehicle player}) then {
  28. _oldVehiclePlayer = vehicle player;
  29. [] call TAWVD_fnc_updateViewDistance;
  30. };
  31.  
  32. waitUntil {_oldVehiclePlayer != vehicle player || tawvd_player != player};
  33.  
  34. if(!isNil{tawvd_disable} && {tawvd_disable}) exitWith {
  35. tawvd_player removeAction tawvd_action;
  36. };
  37.  
  38. };
Advertisement
Add Comment
Please, Sign In to add comment