19.02.2010, 02:35
If you're gonna use "if" you'll need to do it like this:
But wait, there's an easier way!
I'd do it like:
pawn Код:
if(classid == 105 || classid == 106 || classid == 107)
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
switch(classid)
{
case 105, 106, 107:
{
// code
}
case 108:
{
// code for if(classid == 108)
}
case 109 .. 120: // this mean from 109 to 120 (if (classid == 109 || classif == 110...)
{
// code
}
default: // this is "else"
{
// code
}
}
return 1;
}
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
switch(classid)
{
case 105 .. 107: gTeam[playerid] = TeamGrovest;
}
return 1;
}