Advertisement
Guest User

repair.sqf

a guest
Jun 6th, 2013
1,541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. private ["_target", "_caller", "_id"];
  2.  
  3. _target = _this select 0;
  4. _caller = _this select 1;
  5. _id = _this select 2;
  6. _args = _this select 3;
  7. _amount = _args select 0;
  8. _amount2 = _args select 1;
  9.  
  10. if (isNil "ib_refueling_in_progress") then { ib_refueling_in_progress = false; };
  11.  
  12. if (!ib_refueling_in_progress) then {
  13.  
  14. ib_refueling_in_progress = true;
  15.  
  16. titleText ["Refueling and Repairing", "PLAIN DOWN", 3];
  17.  
  18. while {(vehicle _caller == _target) and (local _target)} do {
  19. private ["_velocity", "_cfcust","_cfcust2"];
  20.  
  21. _velocity = velocity _target;
  22. _cfcust = fuel _target;
  23. _cfcust2 = damage _target;
  24.  
  25. if ((_velocity select 0 > 1) or (_velocity select 1 > 1) or (_velocity select 2 > 1)) exitWith {
  26. titleText ["Refueling and Repairs Stopped", "PLAIN DOWN", 3];
  27. };
  28. if (_cfcust >= 1.0 and _cust2 <= 0) exitWith {
  29. titleText ["Refueling and Repairs Finished", "PLAIN DOWN", 3];
  30. };
  31.  
  32. sleep 0.5;
  33.  
  34. _cfcust = _cfcust + _amount;
  35.  
  36. if (_cfcust >= 1.0) then { _cfcust = 1.0; };
  37.  
  38. _target setFuel _cfcust;
  39.  
  40. _cfcust2 = _cfcust2 - _amount2;
  41. if (_cfcust2 <= 0.0) then { _cfcust2 = 0.0; };
  42. _target setDamage _cfcust2;
  43. };
  44.  
  45. titleFadeOut 1;
  46.  
  47. ib_refueling_in_progress = false;
  48. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement