error 029: invalid expression, assumed zero
#1

Can you guys see whats wrong here?

Код:
C:\Users\N0FeaR\Desktop\Gangwar\gamemodes\LSGTDM.pwn(192) : error 029: invalid expression, assumed zero

pawn Код:
}

SetPlayerTeamFromClass(playerid, classid)
{
    if (0<=classid<=3)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
    else
    {
        gTeam[playerid] = TEAM_COPS;
    }
    line 192 else
    {
        gTeam[playerid] = TEAM_VAGOS;
    }
}
Reply
#2

You cant put two else behind each other, how should that work ?
Reply
#3

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
You cant put two else behind each other, how should that work ?
That's true... so how should i do it?
Reply
#4

Make it else if and then else.. I think
Reply
#5

You need to use an else if between
pawn Код:
if(classid <= 3) {
    // classes from 0 - 3
} else if(classid <= 7) {
    // classes from 4 - 7
} else {
    // all other classes
}
Reply
#6

Too late. but by the way here's some simple example that they way i do mine.

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    if(classid >= /*Grove classid here*/)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
    if(classid >= /*Cop classid here*/)
    {
        gTeam[playerid] = TEAM_COPS;
    }
    if(classid >= /*Vagos classid here*/)
    {
        gTeam[playerid] = TEAM_VAGOS;
    }
}
PS: you can do Nero_3D or my ones. but it depends on you.
Reply
#7

Thank you =)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)