01.08.2011, 08:53
look at this CMD:
it give me those errors when i complie :
Note : there is also a /deposit CMD which is the same - so 2 errors for /withdraw and 2 for /deposit - that happened after i made that you can do that CMD's at TWO places
pawn Код:
if(strcmp(cmd, "/withdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1432.8818,-997.5147,1639.7911))||if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2316.3171,-1916.4500,828.1979))
{
SendClientMessage(playerid, COLOR_NICEGREEN, " You are not at the bank !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /withdraw [amount]");
format(string, sizeof(string), " You have $%d in your bank account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strvalEx(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /withdraw [amount]");
format(string, sizeof(string), " You have $%d in your bank account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if(cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You don't have that much !");
return 1;
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+cashdeposit;
GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), " You have withdrawn $%d from your bank account, Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
return 1;
}
it give me those errors when i complie :
pawn Код:
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(22654) : error 029: invalid expression, assumed zero
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(22654) : warning 215: expression has no effect
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(22654) : error 001: expected token: ";", but found "if"
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(22734) : error 029: invalid expression, assumed zero
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(22734) : warning 215: expression has no effect
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(22734) : error 001: expected token: ";", but found "if"
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(25555) : warning 217: loose indentation
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(27477) : warning 217: loose indentation
E:\GTA SanAndreas\X-Zone RPG\gamemodes\xzrpg.pwn(28738) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Note : there is also a /deposit CMD which is the same - so 2 errors for /withdraw and 2 for /deposit - that happened after i made that you can do that CMD's at TWO places