Need Help with this error
#1

Hello need help with this error,

I get it alot and always have to post it here,

but maybe someone can fix it and also tell why i get that error...

pawn Код:
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(15034) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
command(driveroute, playerid, params[])
{
    for(new h = 0; h < sizeof(Jobs); h++)
            {
    if(Player[playerid][Job] == h && Jobs[Player[playerid][Job]][JobType] == 6)
    if(IsPlayerInVehicle(playerid, bus1) || IsPlayerInVehicle(playerid, bus2) || IsPlayerInVehicle(playerid, bus3) || IsPlayerInVehicle(playerid, bus4) || IsPlayerInVehicle(playerid, bus5))
    {
        TogglePlayerControllable(playerid, 1);
        CP[playerid] = 200;
        SetPlayerCheckpoint(playerid, 1810.2170,-1890.1097,13.4072, 4.0);
        DrivingRoute[playerid] = 1;
        SendClientMessage(playerid, COLOR_RED, "Please follow the checkpoints and drive safety!");
        }
    }
    else
    {
        SCM(playerid, COLOR_RED,"You are not in a bus.");
    }
    return 1;
}
Reply
#2

If you indent the code properly, maybe you can see the mistake then?

pawn Код:
command(driveroute, playerid, params[])
{
    for(new h = 0; h < sizeof(Jobs); h++)
    {
        if(Player[playerid][Job] == h && Jobs[Player[playerid][Job]][JobType] == 6)
        if(IsPlayerInVehicle(playerid, bus1) || IsPlayerInVehicle(playerid, bus2) || IsPlayerInVehicle(playerid, bus3) || IsPlayerInVehicle(playerid, bus4) || IsPlayerInVehicle(playerid, bus5))
        {
            TogglePlayerControllable(playerid, 1);
            CP[playerid] = 200;
            SetPlayerCheckpoint(playerid, 1810.2170,-1890.1097,13.4072, 4.0);
            DrivingRoute[playerid] = 1;
            SendClientMessage(playerid, COLOR_RED, "Please follow the checkpoints and drive safety!");
        }
    }
    else
    {
        SCM(playerid, COLOR_RED,"You are not in a bus.");
    }
    return 1;
}
It should be if - else, not for - else
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)