SHARE
TWEET

Untitled

Omatter Jul 19th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define         DIALOG_ATM                  (5079)
  2. #define         DIALOG_ATMRUTTIEN           (5080)
  3. #define         DIALOG_ATMGUITIEN           (5081)
  4. #define         DIALOG_ATMCHUYENTIEN        (5082)
  5. #define         DIALOG_ATMCHUYENTIEN2       (5083)
  6.  
  7. // tim onplayerkeystatechange
  8.     if(newkeys & KEY_CTRL_BACK)
  9.     {
  10.         if(IsAtATM(playerid))
  11.         {
  12.             ShowPlayerDialog(playerid, DIALOG_ATM, DIALOG_STYLE_LIST, "ATM","Kiem Tra Tai Khoan\nRut Tien\nGui Tien\nChuyen Khoan","Dong Y","Huy");
  13.             PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
  14.         }
  15.     }
  16.    
  17. // tim ondialogresponse
  18.     new strsi[128];
  19.     if(dialogid == DIALOG_ATM)
  20.     {
  21.         if(response)
  22.         {
  23.             if(listitem == 0) // kiem tra tai khoan
  24.             {
  25.                 return cmd_ataikhoan(playerid, "");
  26.             }
  27.             if(listitem == 1)
  28.             {
  29.                 ShowPlayerDialog(playerid, DIALOG_ATMRUTTIEN, DIALOG_STYLE_INPUT, "Rut Tien","Nhap So Tien Ban Muon Rut","Dong Y","Huy");
  30.             }
  31.             if(listitem == 2)
  32.             {
  33.                 ShowPlayerDialog(playerid, DIALOG_ATMGUITIEN, DIALOG_STYLE_INPUT, "Gui Tien","Nhap So Tien Ban Muon Gui","Dong Y","Huy");
  34.             }
  35.             if(listitem == 3)
  36.             {
  37.                 ShowPlayerDialog(playerid, DIALOG_ATMCHUYENTIEN, DIALOG_STYLE_INPUT, "Chuyen Khoan","Nhap ID Nguoi Ban Can Chuyen Tien","Tiep Tuc","Huy");
  38.             }
  39.         }
  40.     }
  41.     if(dialogid == DIALOG_ATMCHUYENTIEN)
  42.     {
  43.         if(response)
  44.         {
  45.             new giveplayerid = strval(inputtext);
  46.             if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, "Error: Inactive userid!");
  47.             SetPVarInt(playerid, "PlayerSelected", giveplayerid);
  48.             ShowPlayerDialog(playerid, DIALOG_ATMCHUYENTIEN2, DIALOG_STYLE_INPUT, "Chuyen Khoan", "Nhap So Tien Muon Chuyen", "Dong Y", "Huy");
  49.         }
  50.     }
  51.     if(dialogid == DIALOG_ATMCHUYENTIEN2)
  52.     {
  53.         if(response)
  54.         {
  55.                 new amount = strval(inputtext);
  56.                 new giveplayerid = GetPVarInt(playerid, "PlayerSelected");
  57.                 new playermoney = PlayerInfo[playerid][pAccount] ;
  58.  
  59.                 if (amount < 1 && playermoney < amount) return SendClientMessageEx(playerid, COLOR_GRAD1, "Vui Long Nhap Dung.");
  60.                 GivePlayerCashEx(playerid, TYPE_BANK, -amount);
  61.                 GivePlayerCashEx(giveplayerid, TYPE_BANK, amount);
  62.  
  63.                 PlayerInfo[playerid][pAccount] -= amount;
  64.                 PlayerInfo[giveplayerid][pAccount] += amount;
  65.  
  66.                 format(Strsi, sizeof(Strsi), "   Ban Da Gui $%s Cho Tai Khoan %s's.", number_format(amount), GetPlayerNameEx(giveplayerid),giveplayerid);
  67.                 PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  68.                 SendClientMessageEx(playerid, COLOR_GRAD1, Strsi);
  69.                 format(Strsi, sizeof(Strsi), "   Ban Da Nhan Duoc $%s vao tai khoan cua ban %s.", number_format(amount), GetPlayerNameEx(playerid), playerid);
  70.                 SendClientMessageEx(giveplayerid, COLOR_GRAD1, Strsi);
  71.                 new ip[32], ipex[32];
  72.                 GetPlayerIp(playerid, ip, sizeof(ip));
  73.                 GetPlayerIp(giveplayerid, ipex, sizeof(ipex));
  74.                 format(Strsi, sizeof(Strsi), "[BANK] %s (IP:%s) da chuyen $%s den %s (IP:%s).", GetPlayerNameEx(playerid), ip, number_format(amount), GetPlayerNameEx(giveplayerid), ipex);
  75.  
  76.                 if(amount >= 500000)
  77.                 {
  78.                     ABroadCast(COLOR_YELLOW,Strsi,2);
  79.                 }
  80.                 Log("logs/pay.log", Strsi);
  81.                 PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
  82.                 SetPVarInt(playerid, "LastTransaction", gettime());
  83.         }
  84.     }
  85.     if(dialogid == DIALOG_ATMRUTTIEN && response == 1)
  86.     {
  87.         //===========================================================================================================================================
  88.         if(strfind(inputtext, "%", true) != -1) {
  89.             return ShowPlayerDialog(playerid, DIALOG_ATMRUTTIEN, DIALOG_STYLE_INPUT, "Rut Tien","Nhap So Tien Ban Muon Rut","Dong Y","Huy");
  90.         }
  91.         if(strfind(inputtext, "c", true) != -1) {
  92.             return ShowPlayerDialog(playerid, DIALOG_ATMRUTTIEN, DIALOG_STYLE_INPUT, "Rut Tien","Nhap So Tien Ban Muon Rut","Dong Y","Huy");
  93.         }
  94.         new amount = strval(inputtext);
  95.         if (amount > PlayerInfo[playerid][pAccount] || amount < 1)
  96.         {
  97.             SendClientMessageEx(playerid, COLOR_GRAD2, " Ban Khong Co Nhieu Tien Nhu The!");
  98.             return 1;
  99.         }
  100.         if(gettime()-GetPVarInt(playerid, "LastTransaction") < 10) return SendClientMessageEx(playerid, COLOR_GRAD2, "Hay Doi 10s!");
  101.         SetPVarInt(playerid, "LastTransaction", gettime());
  102.         if(PlayerInfo[playerid][pDonateRank] == 0)
  103.         {
  104.             new fee;
  105.             fee = 3*amount/100;
  106.             PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-fee;
  107.             format(Strsi, sizeof(Strsi), "-$%d tru 3% tien phi!", fee);
  108.             SendClientMessageEx(playerid, COLOR_GRAD2, Strsi);
  109.         }
  110.         PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-amount;
  111.         GivePlayerCash(playerid,amount);
  112.         format(Strsi, sizeof(Strsi), "  Ban da rut $%s tu atm. Tai Khoan Con Lai: $%s ", number_format(amount), number_format(PlayerInfo[playerid][pAccount]));
  113.         SendClientMessageEx(playerid, COLOR_YELLOW, Strsi);
  114.         SendClientMessageToAll(COLOR_LIGHTBLUE,"ATM By Thien");
  115.         OnPlayerStatsUpdate(playerid);
  116.     }
  117.     //==================================================================
  118.     if(dialogid == DIALOG_ATMGUITIEN && response == 1)
  119.     {
  120.         if(strfind(inputtext, "%", true) != -1) {
  121.             return ShowPlayerDialog(playerid, DIALOG_ATMGUITIEN, DIALOG_STYLE_INPUT, "Gui Tien","Nhap So Tien Ban Muon Gui","Dong Y","Huy");
  122.         }
  123.         if(strfind(inputtext, "c", true) != -1) {
  124.             return ShowPlayerDialog(playerid, DIALOG_ATMGUITIEN, DIALOG_STYLE_INPUT, "Gui Tien","Nhap So Tien Ban Muon Gui","Dong Y","Huy");
  125.         }
  126.         new amount = strval(inputtext);
  127.         if (amount > GetPlayerCash(playerid) || amount < 1)
  128.         {
  129.             SendClientMessageEx(playerid, COLOR_GRAD2, "   Ban Khong Co Nhieu Tien Nhu The.");
  130.             return 1;
  131.         }
  132.         if(gettime()-GetPVarInt(playerid, "LastTransaction") < 10) return SendClientMessageEx(playerid, COLOR_GRAD2, "Hay Doi 10s!");
  133.         SetPVarInt(playerid, "LastTransaction", gettime());
  134.         if(PlayerInfo[playerid][pDonateRank] == 0)
  135.         {
  136.             new fee;
  137.             fee = 3*amount/100;
  138.             PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-fee;
  139.             format(Strsi, sizeof(Strsi), "-$%d tru 3% tien phi!", fee);
  140.             SendClientMessageEx(playerid, COLOR_GRAD2, Strsi);
  141.         }
  142.         GivePlayerCash(playerid,-amount);
  143.         new curfunds = PlayerInfo[playerid][pAccount];
  144.         PlayerInfo[playerid][pAccount]=amount+PlayerInfo[playerid][pAccount];
  145.         SendClientMessageEx(playerid, COLOR_WHITE, "|___ ATM Thong Tin ___|");
  146.         format(Strsi, sizeof(Strsi), "  Tai Khoan Cu: $%s", number_format(curfunds));
  147.         SendClientMessageEx(playerid, COLOR_GRAD2, Strsi);
  148.         format(Strsi, sizeof(Strsi), "  So Tien Moi Gui: $%s", number_format(amount));
  149.         SendClientMessageEx(playerid, COLOR_GRAD4, Strsi);
  150.         SendClientMessageEx(playerid, COLOR_GRAD6, "|-----------------------------------------|");
  151.         format(Strsi, sizeof(Strsi), "  Tai Khoan Moi: $%s", number_format(PlayerInfo[playerid][pAccount]));
  152.         SendClientMessageEx(playerid, COLOR_WHITE, Strsi);
  153.         SendClientMessageToAll(COLOR_LIGHTBLUE,"ATM By Thien");
  154.         OnPlayerStatsUpdate(playerid);
  155.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top