Advertisement
Guest User

drink_Water.sqf

a guest
Aug 7th, 2013
1,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. private["_playerPos","_canDrink","_isPond","_isWell","_pondPos","_objectsWell","_objectsPond","_display"];
  2.  
  3. call gear_ui_init;
  4. _playerPos = getPosATL player;
  5. _canDrink = count nearestObjects [_playerPos, ["Land_pumpa","Land_water_tank"], 4] > 0;
  6. _isPond = false;
  7. _isWell = false;
  8. _pondPos = [];
  9. _objectsWell = [];
  10.  
  11. if (!_canDrink) then {
  12. _objectsWell = nearestObjects [_playerPos, [], 4];
  13. {
  14. //Check for Well
  15. _isWell = ["_well",str(_x),false] call fnc_inString;
  16. if (_isWell) then {_canDrink = true};
  17. } forEach _objectsWell;
  18. };
  19.  
  20. if (!_canDrink) then {
  21. _objectsPond = nearestObjects [_playerPos, [], 50];
  22. {
  23. //Check for pond
  24. _isPond = ["pond",str(_x),false] call fnc_inString;
  25. if (_isPond) then {
  26. _pondPos = (_x worldToModel _playerPos) select 2;
  27. if (_pondPos < 0) then {
  28. _canDrink = true;
  29. };
  30. };
  31. } forEach _objectsPond;
  32. };
  33.  
  34. if (_canDrink) then {
  35.  
  36. if ((floor (random 100) < 25)) then {
  37.  
  38. player playActionNow "PutDown";
  39. r_player_infected = true;
  40. player setVariable["USEC_infected",true,true];
  41. player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
  42.  
  43. dayz_lastDrink = time;
  44. dayz_thirst = 0;
  45.  
  46. //Ensure Control is visible
  47. _display = uiNamespace getVariable 'DAYZ_GUI_display';
  48. (_display displayCtrl 1302) ctrlShow true;
  49. //cutText ["Das Wasser ist lauwarm und schmeckt irgendwie komisch, aber dein Durst ist gestillt.", "PLAIN DOWN"];
  50. cutText ["The water is warm and tastes kinda strange, but your thirst is quenched.", "PLAIN DOWN"];
  51.  
  52. } else {
  53.  
  54. player playActionNow "PutDown";
  55. dayz_lastDrink = time;
  56. dayz_thirst = 0;
  57.  
  58. //Ensure Control is visible
  59. _display = uiNamespace getVariable 'DAYZ_GUI_display';
  60. (_display displayCtrl 1302) ctrlShow true;
  61. //cutText ["Das Wasser ist kühl und schmeckt etwas schal, aber dein Durst ist gestillt.", "PLAIN DOWN"];
  62. cutText ["The water is cool and tastes a bit stale, but your thirst is quenched.", "PLAIN DOWN"];
  63. };
  64.  
  65. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement