Код:
if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " You must be level 3 !");
return 1;
}
if(PlayerInfo[playerid][pLocal] != 103)
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the Bank !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Koriscenje: /transfer [playerID/DeoImena] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Koriscenje: /transfer [playerID/DeoImena] [amount]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
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), " You have transferd $%d to %s's account", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " You have recieved $%d to into your account from %s", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
if(moneys >= 99999)
{
format(string, sizeof(string), "[AntiCheat]: %s transferd $%d to %s", sendername, moneys, giveplayer);
SendAdminMessage(COLOR_YELLOW,string);
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /transfer %s $%d",d,m,y,h,mi,s,sendername,giveplayer,moneys);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
I know how to make deposit, withdraw, balance in dialog, but i have problem with this, i dont know how to make it :S
Can someone help? Or if someone have /transfer in dialog from another script please send it to me...