error 029: invalid expression, assumed zero
#1

Hi!

I got this errorcode while compiling!
Код:
error 029: invalid expression, assumed zero
Here my scripted lines:

Код:
SetPlayerTeamFromClass(playerid, classid)
{
    if (classid == 0)
    {
        gTeam[playerid] = TEAM_BALLA;
    }
    else
    {
        gTeam[playerid] = TEAM_GROVE;
    }

    else                                             //THIS IS THE LINE WITH ERROR!
    {
        gTeam[playerid] = TEAM_VAGOS;
    }
}
Reply
#2

You can't tell him to else, when you already did.
And to set classid, you need to if(classid == X), all of them.

EDIT:
pawn Код:
if(classid == X) { }
else if(classid == X) {}
else if(classid == X) {}

//AND SO ON
Reply
#3

Huh? Where should I put that classids??
Reply
#4

Seriously?
pawn Код:
SetPlayerTeamFromClass(playerid, classid) {
    if(classid == 0) gTeam[playerid] = TEAM_BALLA;
    else if(classid == 1) gTeam[playerid] = TEAM_GROVE;
    else if(classid == 2) gTeam[playerid] = TEAM_VAGOS;
    // AND SO ON
}
Reply
#5

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    if (classid == 0)
    {
        gTeam[playerid] = TEAM_BALLA;
    }
    else if(classid == 1)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
    else if(classid == 2)
    {
        gTeam[playerid] = TEAM_VAGOS;
    }
}
E: I was late
Reply
#6

Ok thanks, I understood!^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)