Advertisement
infiSTAR23

send.sqf

May 2nd, 2014
699
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.41 KB | None | 0 0
  1. all_money = myMoneyZ;
  2. send_amount = nil;
  3. sendnow =
  4. [
  5.     ["",true],
  6.     ["How much would you like to send?", [-1], "", -5, [["expression", ""]], "1", "1"],
  7.     ["", [], "", -5, [["expression", ""]], "1", "1"],
  8.     ["10", [], "", -5, [["expression", "send_amount = 10;"]], "1", "1"],
  9.     ["50", [], "", -5, [["expression", "send_amount = 50;"]], "1", "1"],
  10.     ["100", [], "", -5, [["expression", "send_amount = 100;"]], "1", "1"],
  11.     ["200", [], "", -5, [["expression", "send_amount = 200;"]], "1", "1"],
  12.     ["300", [], "", -5, [["expression", "send_amount = 300;"]], "1", "1"],
  13.     ["400", [], "", -5, [["expression", "send_amount = 400;"]], "1", "1"],
  14.     ["500", [], "", -5, [["expression", "send_amount = 500;"]], "1", "1"],
  15.     ["1000", [], "", -5, [["expression", "send_amount = 1000;"]], "1", "1"],
  16.     ["1500", [], "", -5, [["expression", "send_amount = 1500;"]], "1", "1"],
  17.     ["2000", [], "", -5, [["expression", "send_amount = 2000;"]], "1", "1"],
  18.     ["5000", [], "", -5, [["expression", "send_amount = 5000;"]], "1", "1"],
  19.     ["10000", [], "", -5, [["expression", "send_amount = 10000;"]], "1", "1"],
  20.     ["ALL", [], "", -5, [["expression", "send_amount = myMoneyZ;"]], "1", "1"],
  21.     ["", [], "", -5, [["expression", ""]], "1", "0"],
  22.     ["Exit", [], "", -3, [["expression", ""]], "1", "1"]
  23. ];
  24. showCommandingMenu "#USER:sendnow";
  25.  
  26. waitUntil {!isNil ("send_amount")};
  27. closeDialog 0;
  28. disableSerialization;
  29. createDialog "RscDisplayPassword";
  30. ctrlSetText [1001,"Money Transfer"];
  31. ctrlSetText [1002,"Players Name:"];
  32. //ctrlSetText [101,"Code goes here..."];
  33. ctrlshow [1,true];
  34. ctrlshow [2,true];
  35.  
  36.  
  37. _display = findDisplay 64;
  38. _btn1 = _display displayctrl 2;
  39. _btn1 ctrlSetText "Cancel";
  40. _btn1 buttonSetAction "closeDialog 0;";
  41. fnc_btn2 =
  42. {
  43.     disableSerialization;
  44.     _text = ctrlText 101;
  45.     all_money = myMoneyZ;
  46.     _player = [];
  47.     {
  48.         if (getPlayerUID _x != '') then
  49.         {
  50.             _player = _player + [_x];
  51.         };
  52.     } forEach (entities 'AllVehicles');
  53.     {
  54.         if (name _x == _text) then
  55.         {
  56.             if (mymoneyz >= send_amount) then
  57.             {
  58.                 _x setVariable['Cmoney',send_amount, true];
  59.                 cutText [format['You gave player %1 a total of $%2', _text, send_amount], 'PLAIN'];
  60.                 myMoneyZ = myMoneyZ - send_amount;
  61.             }
  62.             else
  63.             {
  64.                 cutText [format['You dont have %1 to send', send_amount], 'PLAIN'];
  65.             };
  66.         }; 
  67.     } forEach _player;
  68. };
  69. _display = findDisplay 64;
  70. _btn2 = _display displayctrl 1;
  71. _btn2 ctrlSetText "Send";
  72. _btn2 buttonSetAction "call fnc_btn2;";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement