Errors
#1

look at this CMD:

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
Reply
#2

Sorry for double posting but , i fixed an error , like this :

Withdraw CMD :

pawn Код:
if(strcmp(cmd, "/withdraw", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid, 5.0, 1432.8818,-997.5147,1639.7911))||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;
    }

Deposit CMD:

pawn Код:
if(strcmp(cmd, "/deposit", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1432.8818,-997.5147,1639.7911))||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: /bank [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: /bank [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][pCash] || cashdeposit < 1)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   You don't have that much !");
                return 1;
            }
            PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-cashdeposit;
            GivePlayerMoney(playerid,-cashdeposit);
            new curfunds = PlayerInfo[playerid][pAccount];
            PlayerInfo[playerid][pAccount] = cashdeposit+PlayerInfo[playerid][pAccount];
            SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATEMENT ___|");
            format(string, sizeof(string), "  Old Balance: $%d", curfunds);
            SendClientMessage(playerid, COLOR_GRAD2, string);
            format(string, sizeof(string), "  Deposit: $%d",cashdeposit);
            SendClientMessage(playerid, COLOR_GRAD4, string);
            SendClientMessage(playerid, COLOR_GRAD6, "|------------------------------------------|");
            format(string, sizeof(string), "  New Balance: $%d", PlayerInfo[playerid][pAccount]);
            SendClientMessage(playerid, COLOR_WHITE, string);
            return 1;
        }
        return 1;
    }
, now it give those errors :


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) : error 001: expected token: ";", but found ")"
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) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#3

lines?
Reply
#4

Would be easier to me to find where is this error, if you comment in a line where this problem happens...
Reply
#5

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1432.8818,-997.5147,1639.7911) || !IsPlayerInRangeOfPoint(playerid, 5.0, 2316.3171,-1916.4500,828.1979))
            {
Reply
#6

well.. i tried like sascha did and it don't give me errors now but... when i do /deposit - /withdraw at the bank.. it tells me you not in bank
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)