Advertisement
MGT

ExileClient_gui_vehicleTraderDialog_event_onInputBoxChars.sq

MGT
Jan 6th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. private["_inputBox","_character","_dialog","_purchaseButton","_vehicleClass","_salesPrice","_quality","_requiredRespect","_ctrlText"];
  2. disableSerialization;
  3. _inputBox = _this select 0;
  4. _character = _this select 1;
  5. _dialog = uiNameSpace getVariable ["RscExileVehicleTraderDialog", displayNull];
  6. _purchaseButton = _dialog displayCtrl 4002;
  7. _vehicleClass = uiNamespace getVariable ["RscExileVehicleTraderDialogVehicleClass",""];
  8. _salesPrice = getNumber(missionConfigFile >> "CfgExileArsenal" >> _vehicleClass >> "price");
  9. _quality = getNumber(missionConfigFile >> "CfgExileArsenal" >> _vehicleClass >> "quality");
  10. _requiredRespect = getNumber(missionConfigFile >> "CfgTrading" >> "requiredRespect" >> format["Level%1",_quality]);
  11. _ctrlText = (ctrlText _inputBox);
  12. if((count _ctrlText) <= 4)then
  13. {
  14. if!(_character in [48,49,50,51,52,53,54,55,56,57])then
  15. {
  16. _ctrlText = _ctrlText select [0,(count _ctrlText) - 1];
  17. };
  18. if((count _ctrlText) isEqualTo 4)then
  19. {
  20. if(_requiredRespect <= ExileClientPlayerScore)then
  21. {
  22. _purchaseButton ctrlEnable (_salesPrice <= (player getVariable ["ExileMoney", 0]));
  23. };
  24. }
  25. else
  26. {
  27. _purchaseButton ctrlEnable false;
  28. };
  29. }
  30. else
  31. {
  32. if!(_vehicleClass isEqualTo "")then
  33. {
  34. if(_requiredRespect <= ExileClientPlayerScore)then
  35. {
  36. _purchaseButton ctrlEnable (_salesPrice <= (player getVariable ["ExileMoney", 0]));
  37. };
  38. };
  39. _ctrlText = _ctrlText select [0,(count _ctrlText) - 1];
  40. };
  41. _inputBox ctrlSetText _ctrlText;
  42. _inputBox ctrlCommit 0;
  43. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement