Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. life_action_inUse = true;
  2. _displayName = FETCH_CONFIG2(getText,"CfgVehicles",(typeOf _veh),"displayName");
  3. _upp = format [localize "STR_NOTF_Repairing",_displayName];
  4.  
  5. //Setup our progress bar.
  6. disableSerialization;
  7. "progressBar" cutRsc ["life_progress","PLAIN"];
  8. _ui = uiNamespace getVariable "life_progress";
  9. _progress = _ui displayCtrl 38201;
  10. _pgText = _ui displayCtrl 38202;
  11. _pgText ctrlSetText format ["%2 (1%1)...","%",_upp];
  12. _progress progressSetPosition 0.01;
  13. _cP = 0.01;
  14.  
  15. for "_i" from 0 to 1 step 0 do {
  16. if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
  17. [player,"AinvPknlMstpSnonWnonDnon_medic_1",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
  18. player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";
  19. player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
  20. };
  21.  
  22. uiSleep 0.27;
  23. _cP = _cP + 0.01;
  24. _progress progressSetPosition _cP;
  25. _pgText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_upp];
  26. if (_cP >= 1) exitWith {};
  27. if (!alive player) exitWith {};
  28. if !(isNull objectParent player) exitWith {};
  29. if (life_interrupted) exitWith {};
  30. };
  31.  
  32. life_action_inUse = false;
  33. "progressBar" cutText ["","PLAIN"];
  34. player playActionNow "stop";
  35. if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
  36. if !(isNull objectParent player) exitWith {titleText[localize "STR_NOTF_ActionInVehicle","PLAIN"];};
  37.  
  38. _sideRepairArray = LIFE_SETTINGS(getArray,"vehicle_infiniteRepair");
  39.  
  40. //Check if playerSide has infinite repair enabled
  41. if (playerSide isEqualTo civilian && (_sideRepairArray select 0) isEqualTo 0) then {
  42. [false,"toolkit",1] call life_fnc_handleInv;
  43. };
  44. if (playerSide isEqualTo west && (_sideRepairArray select 1) isEqualTo 0) then {
  45. [false,"toolkit",1] call life_fnc_handleInv;
  46. };
  47. if (playerSide isEqualTo independent && (_sideRepairArray select 2) isEqualTo 0) then {
  48. [false,"toolkit",1] call life_fnc_handleInv;
  49. };
  50. if (playerSide isEqualTo east && (_sideRepairArray select 3) isEqualTo 0) then {
  51. [false,"toolkit",1] call life_fnc_handleInv;
  52. };
  53.  
  54. _dep = (independent countSide playableUnits);
  55.  
  56. If ((_dep < 1) || (_veh isKindOf "Ship") || (_veh isKindOf "Air")) Then {
  57. _veh setDamage 0;
  58. hint "Vous avez réparé votre véhicule avec succès car il y a moins de 5 membres du service public de connecté.";
  59. } else {
  60. _veh setDamage 0.5;
  61. hint "Vos compétences laborieuses en mécanique vous ont permis de rendre le véhicule plus ou moins en état de rouler. Vous devriez contacter un dépanneur.";
  62. };
  63. };
  64. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement