07.09.2011, 16:15
(
Последний раз редактировалось qUick1337; 07.09.2011 в 22:28.
)
Код:
if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pIsaBank] != 1) { SendClientMessage(playerid, COLOR_GREY, " You are not at the Bank !"); return 1; } if(PlayerToPoint(1.0, playerid, 321.5792,129.2914,1007.9657)) { SCM(playerid, COLOR_GREY, " You are not in the right place !"); return 1; } new str[256]; format(str,256,"%s\t"wh"Type the player "color_red"ID\t\n\n",str); ShowPlayerDialog(playerid,TransferDialog,DIALOG_STYLE_INPUT,""color_yellow"Bank:",str,"Ok","exit"); return 1; } return 1; }
Код:
if(dialogid == TransferDialog) { if(response) { if (IsPlayerConnected(playerid)) { new giveplayerid = strval(inputtext); if (giveplayerid == playerid) { format(string, 256, "%s"wh"You can't send money to yourself.\n\n",string); ShowPlayerDialog( playerid, 1559, DIALOG_STYLE_MSGBOX, ""color_yellow"Bank:", string, "Exit", "" ); return 1; } else { format(string, 256, "%s"wh"Type how much money do you want to transfer.\t\n",string); format(string, 256, "%s"wh"Balance: "color_green"%d$"wh".\t\n\n",string, PlayerInfo[playerid][pAccount]); ShowPlayerDialog(playerid,TransferDialog+1,DIALOG_STYLE_INPUT,""color_yellow"Bank:", string,"Ok","Exit"); PlayerInfo[playerid][pAccount] = giveplayerid; } } } return 1; } if(dialogid == TransferDialog+1) { if(response) { new giveplayerid = PlayerInfo[playerid][pAccount]; if (IsPlayerConnected(giveplayerid)) { if (giveplayerid == playerid) { format(string, 256, "%s"wh"Type how much money do you want to transfer.\t\n",string); format(string, 256, "%s"wh"Balance: "color_green"%d$"wh".\t\n\n",string, PlayerInfo[playerid][pAccount]); ShowPlayerDialog(playerid,TransferDialog+1,DIALOG_STYLE_INPUT,""color_yellow"Bank:", string,"Ok","Exit"); } else { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); playermoney = PlayerInfo[playerid][pAccount]; if (moneys > 0 && playermoney >= moneys) { PlayerInfo[playerid][pAccount] = -moneys; PlayerInfo[giveplayerid][pAccount] = moneys; format(string, sizeof(string), "%s"wh"You've send "color_green"%d$"wh" to "color_red"%s"wh".\t\n",string,moneys,giveplayer); ShowPlayerDialog( playerid, 1560, DIALOG_STYLE_MSGBOX, ""color_yellow"Bank:", string, "Exit", "" ); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); format(string, sizeof(string), "** You have recieved $%d from %s(player: %d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, COLOR_GRAD1, string); PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0); } else { format(string, 256, "%s"wh"Invalid tranzaction amount.\n",string); ShowPlayerDialog( playerid, 1551, DIALOG_STYLE_MSGBOX, ""color_yellow"Bank:", string, "Exit", "" ); return 1; } } } else { format(string, 256, "%s"wh"This player isn't online.\n",string); ShowPlayerDialog( playerid, 1559, DIALOG_STYLE_MSGBOX, ""color_yellow"Bank:", string, "Exit", "" ); return 1; } } return 1; }