/withdraw bug
#1

Код:
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;
	}
I can not withdraw cash that I do not have in my bank account, buy if I type /withdraw 1000000+, it gives me the cash and makes a "-" with the same ammount in my bank account.
A lot of people abused this bug in my server, so I need to find a way to fix that?
Any help please?
Reply


Messages In This Thread
/withdraw bug - by tomnidi - 01.07.2009, 07:25
Re: /withdraw bug - by Brendan_Thomson - 01.07.2009, 07:29
Re: /withdraw bug - by tomnidi - 01.07.2009, 07:32
Re: /withdraw bug - by Brendan_Thomson - 01.07.2009, 07:34
Re: /withdraw bug - by Andom - 01.07.2009, 08:11
Re: /withdraw bug - by Brendan_Thomson - 01.07.2009, 08:20
Re: /withdraw bug - by Ignas1337 - 01.07.2009, 10:52
Re: /withdraw bug - by Brendan_Thomson - 01.07.2009, 13:42

Forum Jump:


Users browsing this thread: 1 Guest(s)