Код:
if(dialogid == TRANSFERIR)
{
if(!response) return SendClientMessage(playerid, COLOR_RED, "Error: Vocк cancelou."); // Checa a Senha
new string[128];
if(!strlen(inputtext)) return SendClientMessage(playerid, COLOR_RED, "Error: Vocк nгo inseriu um nome para transferencia.");
idfavorecido = ReturnUser(inputtext);
GetPlayerName(idfavorecido, nomefavorecido, sizeof (nomefavorecido));
//format(file2, sizeof(file2), "users/%s", inputtext);
if(idfavorecido == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Error: Nome invбlido.");
//SetPVarString(playerid, "nome_transferencia", inputtext);
format(string, sizeof(string), "Digite o valor que deseja transferir para %s\nSaldo: %d", nomefavorecido, PlayerInfo[playerid][pAccount]);
ShowPlayerDialog(playerid, valortransferencia, DIALOG_STYLE_INPUT, "Sistema Bancario [TERRA:RPG]", string, "Ok", "Fechar");
}
if(dialogid == valortransferencia)
{
//GetPVarString(playerid, "nome_transferencia", nomefavorecido, sizeof(nomefavorecido));
new string[128];
new valor = strval(inputtext);
new dinheirobanco = PlayerInfo[playerid][pAccount];
if(!IsPlayerConnected(playerid) || !IsPlayerConnected(idfavorecido)) return SendClientMessage(playerid, COLOR_RED, "Error: O Player precisa estar ONLINE.");
if(strval(inputtext) > dinheirobanco || valor <= 0) return SendClientMessage(playerid, COLOR_RED, "Error: Valor de transferencia invбlido.");
PlayerInfo[playerid][pAccount] -= valor;
//new diretorio[128];
//format(diretorio, sizeof(diretorio), "users/%s.ini", nomefavorecido);
//dini_IntSet(diretorio, "Bank", dini_Int(diretorio, "Bank")+valor);
PlayerInfo[idfavorecido][pAccount] += valor;
GetPlayerName(idfavorecido, nomefavorecido, sizeof(nomefavorecido));
format(string, sizeof(string), "Vocк depositou %d na Conta Bancбria de %s", valor, nomefavorecido);
ShowPlayerDialog(playerid, conftrans, DIALOG_STYLE_MSGBOX, "Sistema Bancario [TERRA:RPG]", string, "Ok", "Fechar");
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "%s depositou %d em sua Conta Bancбria.", nomeplayer, valor);
SendClientMessage(idfavorecido, COLOR_GRAD1, string);
PlayerPlaySound(idfavorecido, 1052, 0.0, 0.0, 0.0);
for(new i = 0; i < MAX_PLAYERS; i++){
if (PlayerInfo[i][pAdmin] >= 1)
{
if(valor >= 250000)
{
format(string, sizeof(string), "-----------------------------\nA.T.E.N.З.Г.O:\n%s Transferiu $%d para %s\n-----------------------------", nomeplayer, valor, nomefavorecido);
SendClientMessage(i, COLOR_RED, string);
}
}
}
return 1;
}