07.09.2011, 11:39
Код:
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; } format(string,sizeof(string),""color_white"Account: "color_green"%d$\n"color_white"How much money do you want to send:",PlayerInfo[playerid][pAccount]); ShowPlayerDialog(playerid,450,DIALOG_STYLE_INPUT,""color_yellow"Bank:",string,"Ok","Exit"); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; } return 1; }
Код:
if(dialogid==450) { if(response) { if(IsPlayerConnected(playerid)) { ShowPlayerDialog(playerid,451,DIALOG_STYLE_MSGBOX,""color_yellow"Bank:",""color_white"This player isn't online.","Ok","Exit"); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; } format(string,sizeof(string),""wh"You want to send the money to:"color_red"%s\n"color_white"Balance: "color_green"%d$", playerid, PlayerInfo[playerid][pAccount]); ShowPlayerDialog(playerid,452,DIALOG_STYLE_MSGBOX,""color_yellow"Bank:",string,"Ok","Exit"); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; } } if(dialogid==452) { if(response) { new cashdeposit = strval(inputtext); if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1) { ShowPlayerDialog(playerid,451,DIALOG_STYLE_MSGBOX,""color_yellow"Bank:",""color_white"You don't have so much money!","Ok","Exit"); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; } PlayerInfo[playerid][pAccount] = -cashdeposit; PlayerInfo[giveplayerid][pAccount] = +cashdeposit; format(string,sizeof(string),""color_white"You send: "color_green"%d$\n"color_white"New Balance: "color_green"%d$", cashdeposit, PlayerInfo[playerid][pAccount]); ShowPlayerDialog(playerid,452,DIALOG_STYLE_MSGBOX,""color_yellow"Bank:",string,"Ok","Exit"); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; } }