10.10.2012, 22:17
When i type /withdraw 100 results with this Cannot go under 1 or above 10000000
pawn Код:
}
if(strcmp(x_nr,"withdraw",true) == 0)
{
if(amount == (-1)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /bizz [withdraw] [amount]");
if(amount < 1 || amount > 10000000) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 1 or above 10000000.");
if(PlayerInfo[playerid][pBizzKey] == 255) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You dont own a business.");
new key = PlayerInfo[playerid][pBizzKey];
if(strcmp(PlayerName(playerid), BizzInfo[key][bOwner], true) == 0)
{
for(new b = 0; b < sizeof(BizzInfo); b++)
{
if(IsPlayerInRangeOfPoint(playerid,20.0,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]))
{
if(BizzInfo[key][bMoney] >= amount)
{
BizzInfo[key][bMoney] -= amount;
GivePlayerPCash(playerid,amount);
format(string, sizeof(string), "INFO: You have withdrawed: $%d from your business inventory leaving you with $%d left.", amount, BizzInfo[key][bMoney]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "INFO: You dont have that much in your business inventory.");
}
}
}
}
}


