01.07.2009, 07:25
Код:
if(strcmp(cmd, "/withdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(5.0,playerid,BankPosition[X],BankPosition[Y],BankPosition[Z]))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /withdraw [amount]");
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "USAGE: /withdraw [amount]");
return 1;
}
if(cashdeposit > 1000000 && cashdeposit < 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You are not allowed to withdraw that much");
return 1;
}
if(PlayerInfo[playerid][pBank] >= cashdeposit)
{
GivePlayerCash(playerid,cashdeposit);
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-cashdeposit;
format(string, sizeof(string), "[INFO:] You have withdrawn $%d, new balance: $%d", cashdeposit,PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerActionMessage(playerid,15.0,"recieves a package full of money from the bank clerk.");
OnPlayerDataSave(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You don't have that much in your bank!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You are not at the bank!");
}
}
return 1;
}
A lot of people abused this bug in my server, so I need to find a way to fix that?
Any help please?

