Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // kh_vehicle_repair.sqf
- private ["_target", "_caller", "_id"];
- _target = _this select 0;
- _caller = _this select 1;
- _id = _this select 2;
- _args = _this select 3;
- _amount = _args select 0;
- if (isNil "ib_repairing_in_progress") then { ib_repairing_in_progress = false; };
- if (!ib_repairing_in_progress) then {
- ib_repairing_in_progress = true;
- titleText ["Repairing", "PLAIN DOWN", 3];
- while {(vehicle _caller == _target) and (local _target)} do {
- private ["_velocity", "_damage"];
- _velocity = velocity _target;
- _damage = getDammage _target;
- if ((_velocity select 0 > 1) or (_velocity select 1 > 1) or (_velocity select 2 > 1)) exitWith {
- titleText ["Repairing Stopped", "PLAIN DOWN", 3];
- };
- if (_damage == 0) exitWith {
- titleText ["Done Repairing", "PLAIN DOWN", 3];
- };
- if ((_damage > 0) && (_damage != 0) && (isNearRepair >= 1)) then {
- _damage = (_damage - _amount);
- if (_damage < 0) then {
- _damage = 0;
- };
- };
- _target setdammage _damage;
- };
- titleFadeOut 1;
- ib_repairing_in_progress = false;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement