Advertisement
infiSTAR23

ExileClient_gui_wasteDumpDialog_event_onSellButtonClick

Nov 20th, 2016
1,633
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.71 KB | None | 0 0
  1. /*
  2. * ExileClient_gui_wasteDumpDialog_event_onSellButtonClick
  3. *
  4. * Exile Mod
  5. * www.exilemod.com
  6. * © 2015 Exile Mod Team
  7. *
  8. * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10.  
  11. note:
  12.     120 seconds because if they try to do the "lag-out" dupe, BE would kick them for client not responding! :)
  13.  
  14. how do I do this?
  15. https://share.infistar.de/aob10RUJiGrVNROariVZI.mp4
  16. */
  17. if(!isNil'wastedump_button_click')exitWith{closeDialog 0;true};
  18. _fn_block_wasteDumpSellButton = {
  19.     disableSerialization;
  20.     _timer = time + 120;
  21.     _gd = {(findDisplay 24011) displayCtrl _this};
  22.     waitUntil {
  23.         (4000 call _gd) ctrlEnable false;
  24.         (4002 call _gd) ctrlEnable false;
  25.         if(isNull (findDisplay 24011))then
  26.         {
  27.             hintSilent '';
  28.         }
  29.         else
  30.         {
  31.             hintSilent parseText format['<t size=''1.5'' font=''OrbitronLight'' color=''#FFFFFF''>please wait %1s, anti dupe sell waiting</t>',round(_timer - time)];
  32.         };
  33.         time > _timer
  34.     };
  35.     hintSilent '';
  36.     (4000 call _gd) ctrlEnable true;
  37.     (4002 call _gd) ctrlEnable true;
  38.     wastedump_button_click = nil;
  39. };
  40. disableSerialization;
  41. _display = uiNameSpace getVariable ['RscExileWasteDumpDialog', displayNull];
  42. _lbctrl = _display displayCtrl 4002;
  43. _index = lbCurSel _lbctrl;
  44. _vehicleNetID = _lbctrl lbData _index;
  45. _vehicle = objectFromNetId _vehicleNetID;
  46. _mode = _lbctrl lbValue _index;
  47.  
  48. if(isNull _vehicle)exitWith{closeDialog 0;true};
  49. wastedump_button_click = [] spawn _fn_block_wasteDumpSellButton;
  50.  
  51. if(ctrlEnabled _lbctrl)then{
  52.     ['wasteDumpRequest', [_vehicleNetID, _mode]] call ExileClient_system_network_send;
  53. };
  54. closeDialog 0;true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement