19.05.2017, 16:31
Try this
Код:
if(dialogid == BANK_MENU_2) { if(response) { new username[24]; if(sscanf(inputtext, "s[24]", username)) { ShowPlayerDialog(playerid, BANK_MENU_2, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", ""STEELBLUE"Please enter the exact username of the player to whom you would like to transfer funds:", "Proceed", "Cancel"); SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Please enter a valid USERNAME"); return 1; } if(strcmp(GetName(playerid), username, true) == 0) { ShowPlayerDialog(playerid, BANK_MENU_2, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", ""STEELBLUE"Please enter the exact username of the player to whom you would like to transfer funds:", "Proceed", "Cancel"); SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You cannot transfer funds to your own account!"); return 1; } format(Bank_Transfer_To[playerid], 24, "%s", username); mysql_format(MySQL, gQuery, 256, "SELECT * FROM `"Banks_Table"` WHERE `Holder` = '%e'", username); mysql_tquery(MySQL, gQuery, "Safe_IsBankHolder", "i", playerid); /*format(str, sizeof str, ""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:", username); ShowPlayerDialog(playerid, BANK_MENU_2_1, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", str, "Transfer", "Cancel");*/ } } if(dialogid == BANK_MENU_2_1) { if(response) { new money, str[256]; if((sscanf(inputtext, "i", money))) { format(str, sizeof str, ""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:", Bank_Transfer_To[playerid]); ShowPlayerDialog(playerid, BANK_MENU_2_1, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", str, "Transfer", "Cancel"); SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Please enter a valid amount!"); return 1; } if(Bank_Balance[playerid] < money) { format(str, sizeof str, ""STEELBLUE"You're now transferring funds to "RED"%s"STEELBLUE". Please enter a amount to transfer:", Bank_Transfer_To[playerid]); ShowPlayerDialog(playerid, BANK_MENU_2_1, DIALOG_STYLE_INPUT, ""RED"Bank - Transfer Funds", str, "Transfer", "Cancel"); SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You don't have enough money!"); return 1; } if(IsPlayerConnected(GetPlayerID(Bank_Transfer_To[playerid]))) { format(Bank_Transfer_From[(GetPlayerID(Bank_Transfer_To[playerid]))], 24, "%s", GetName(playerid)); format(str, sizeof str, ""RED"Bank of SFS "WHITE"- "PREMIUM"Your bank account has been credited with "RED"$%i "PREMIUM"by "RED"%s", money, GetName(playerid)); SendClientMessage(GetPlayerID(Bank_Transfer_To[playerid]), -1, str); Bank_Balance[GetPlayerID(Bank_Transfer_To[playerid])] += money; } else { mysql_format(MySQL, str, sizeof str, "UPDATE "Banks_Table" SET Balance = Balance + '%i' WHERE Holder = '%e'", money, Bank_Transfer_To[playerid]); mysql_tquery(MySQL, str, "", ""); } format(str, sizeof str, ""RED"Bank of SFS "WHITE"- "PREMIUM"You have successfully transferred "RED"$%i "PREMIUM"to "RED"%s"PREMIUM".", money, Bank_Transfer_To[playerid]); SendClientMessage(playerid, -1, str); Bank_Balance[playerid] -= money; format(IQuery, 256, "4[Bank of SFS] 1 - 14%s(%i) transferred 4$%i 14to %s!", GetName(playerid), playerid, money, Bank_Transfer_To[playerid]); IRC_GroupSay(gGroupAdminID, IRC_Admin, IQuery); } }