Advertisement
MaxenceTP

Untitled

Mar 13th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.36 KB | None | 0 0
  1. /*
  2. Author: 3rk
  3. Contact : https://steamcommunity.com/id/KR3KZ/
  4. Teamspeak 3: ts.the-programmer.com
  5. Web site: www.the-programmer.com
  6.  
  7. Terms of use:
  8. - This file is forbidden unless you have permission from the author. If you have this file without permission to use it please do not use it and do not share it.
  9. - If you have permission to use this file, you can use it on your server however it is strictly forbidden to share it.
  10. - Out of respect for the author please do not delete this information.
  11.  
  12. */
  13.  
  14. _display = findDisplay 786000;
  15. _button_pay = _display displayCtrl 786005;
  16. _exit = false;
  17. _cash = false;
  18. _bank = false;
  19. _vInfo = TP_carPainter_currentVeh getVariable ["dbInfo",[]];
  20. _config = missionConfigFile >> "The_Programmer_CarPainter_Config";
  21. _animation = getText (_config >> "repaint_animation");
  22.  
  23. if ((getNumber (_config >> "means_of_payment")) isEqualTo 1) then {
  24. if (TP_carPainter_currentVeh_price > life_cash) then {
  25. _cash = true;
  26. };
  27. } else {
  28. if (TP_carPainter_currentVeh_price > life_atmbank) then {
  29. _bank = true;
  30. };
  31.  
  32. if (TP_carPainter_currentVeh_price > life_cash) then {
  33. _cash = true;
  34. };
  35. };
  36.  
  37. if (_bank && _cash) exitWith {
  38. closeDialog 0;
  39. hint (["not_enough_money","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  40. };
  41.  
  42. TP_carPainter_currentVeh setVariable ["TP_CarPainter_carPainted", (time + 600), true];
  43. TP_carPainter_currentVeh_payed = true;
  44. closeDialog 0;
  45.  
  46. if !(count _vInfo > 0) then {
  47. _exit = true;
  48. };
  49.  
  50. if (_exit) exitWith {
  51. closeDialog 0;
  52. hint (["vehicle_is_rented","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  53. TP_carPainter_currentVeh setObjectTexture [0, TP_carPainter_currentVeh_texture];
  54. TP_carPainter_currentVeh = nil;
  55. };
  56.  
  57. player setpos (TP_carPainter_currentVeh getRelPos [1.3, 90]);
  58.  
  59. _plate = _vInfo select 1;
  60. _uid = _vInfo select 0;
  61.  
  62. _title = (["paint_step_0","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  63. TP_carPainter_currentVeh setObjectTexture [0, TP_carPainter_currentVeh_texture];
  64.  
  65. disableSerialization;
  66. "progressBar" cutRsc ["life_progress","PLAIN"];
  67.  
  68. _ui = uiNamespace getVariable "life_progress";
  69. _progressBar = _ui displayCtrl 38201;
  70. _titleText = _ui displayCtrl 38202;
  71. _titleText ctrlSetText format["%2 (1%1)...","%",_title];
  72. _progressBar progressSetPosition 0.01;
  73. _cP = 1;
  74.  
  75. life_action_inUse = true;
  76.  
  77. while {true} do {
  78. switch (_cP) do {
  79. case 10: {
  80. _title = (["paint_step_1","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  81. TP_carPainter_currentVeh say3d "sanding";
  82. };
  83. case 20: {
  84. _title = (["paint_step_2","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  85. TP_carPainter_currentVeh say3d "polish";
  86. };
  87. case 30: {
  88. _title = (["paint_step_3","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  89. TP_carPainter_currentVeh say3d "spray";
  90. };
  91. case 40: {
  92. _title = (["paint_step_4","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  93. TP_carPainter_currentVeh say3d "spray";
  94. };
  95. case 50: {
  96. _title = (["paint_step_5","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  97. TP_carPainter_currentVeh say3d "spray";
  98. };
  99. case 60: {
  100. _title = (["paint_step_6","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  101. TP_carPainter_currentVeh say3d "spray";
  102. };
  103. case 70: {
  104. _title = (["paint_step_7","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  105. TP_carPainter_currentVeh say3d "untapecar";
  106. };
  107. case 80: {
  108. _title = (["paint_step_8","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  109. TP_carPainter_currentVeh say3d "drycar";
  110. };
  111. case 90: {
  112. _title = (["paint_step_9","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  113. TP_carPainter_currentVeh say3d "cleanupcar";
  114. };
  115. };
  116.  
  117. _progressBar progressSetPosition (_cP/100);
  118. _titleText ctrlSetText format["%3 (%1%2)...",floor(_cP),"%",_title];
  119.  
  120. if ((animationState player) != _animation) then {
  121. [player,_animation] remoteExecCall ["life_fnc_animSync",0];
  122. player playMoveNow _animation;
  123. };
  124.  
  125. if (_cP >= 100 OR !alive player) exitWith {
  126. [TP_carPainter_currentVeh_texture_final,_uid,_plate,TP_carPainter_currentVeh_rgbOrTexture,TP_carPainter_currentVeh_comboboxTextureIndex] remoteExec ["the_programmer_carpainter_fnc_carPainter_updateCarColor",2];
  127. TP_carPainter_currentVeh setObjectTextureGlobal [0, TP_carPainter_currentVeh_texture_final];
  128. hint format [(["paint_step_final","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize), ([TP_carPainter_currentVeh_price] call life_fnc_numberText)];
  129. };
  130.  
  131. if (life_istazed) then {_exit = true;};
  132. if (life_isknocked) then {_exit = true;};
  133. if (life_interrupted) then {_exit = true;};
  134. if ((vehicle player) != player) then {_exit = true;};
  135.  
  136. if (_exit) exitWith {};
  137.  
  138. _cP = _cP + 1;
  139. sleep 0.7;
  140. };
  141.  
  142. "progressBar" cutText ["","PLAIN"];
  143. player playActionNow "stop";
  144.  
  145. if ((getNumber (_config >> "means_of_payment")) isEqualTo 1) then {
  146. if (TP_carPainter_currentVeh_price > life_cash) then {
  147. hint (["not_enough_money","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  148. } else {
  149. life_cash = life_cash - TP_carPainter_currentVeh_price;
  150. [0] call SOCK_fnc_updatePartial;
  151. };
  152. } else {
  153. if (TP_carPainter_currentVeh_price > life_cash) then {
  154. if (TP_carPainter_currentVeh_price > life_atmbank) then {
  155. hint (["not_enough_money","The_Programmer_CarPainter_Config","CarPainter_Localization"] call theprogrammer_core_fnc_localize);
  156. } else {
  157. life_atmbank = life_atmbank - TP_carPainter_currentVeh_price;
  158. [1] call SOCK_fnc_updatePartial;
  159. };
  160. } else {
  161. life_cash = life_cash - TP_carPainter_currentVeh_price;
  162. [0] call SOCK_fnc_updatePartial;
  163. };
  164. };
  165.  
  166.  
  167. TP_carPainter_currentVeh setVariable ["TP_CarPainter_carPainted", nil, true];
  168. TP_carPainter_currentVeh = nil;
  169. TP_carPainter_currentVeh_texture_final = nil;
  170. TP_carPainter_currentVeh_rgbOrTexture = nil;
  171. TP_carPainter_currentVeh_comboboxTextureIndex = nil;
  172. life_action_inUse = false;
  173. life_interrupted = false;
  174. TP_carPainter_currentVeh_price = nil;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement