15.02.2012, 16:04
@Neo
Lol, you forgot again an "else if" statement, at "Mafia"!
@MrFames
I recommend you to use cases, which are better instead of the "else if" statement! The "cases" are here the skin-numbers, starting from 0! This, for example, is mine:
Also, at the color-callback:
Lol, you forgot again an "else if" statement, at "Mafia"!
@MrFames
I recommend you to use cases, which are better instead of the "else if" statement! The "cases" are here the skin-numbers, starting from 0! This, for example, is mine:
PHP код:
SetPlayerTeamFromClass(playerid, classid)
{
switch(classid)
{
case 0 .. 2:
{
gTeam[playerid] = BALLA;
}
case 3 .. 7:
{
gTeam[playerid] = GROVE;
}
case 8 .. 10:
{
gTeam[playerid] = VAGOS;
}
case 11 .. 14:
{
gTeam[playerid] = AZTECAS;
}
case 15 .. 23:
{
gTeam[playerid] = POLICE;
}
case 24 .. 26:
{
gTeam[playerid] = RIFAS;
}
case 27 .. 31:
{
gTeam[playerid] = LOCO;
}
}
}
PHP код:
SetPlayerToTeamColor(playerid)
{
switch(gTeam[playerid])
{
case GROVE:
{
SetPlayerColor(playerid, TEAM_GROVE_COLOR);
}
case BALLA:
{
SetPlayerColor(playerid, TEAM_BALLA_COLOR);
}
case VAGOS:
{
SetPlayerColor(playerid, TEAM_VAGOS_COLOR);
}
case AZTECAS:
{
SetPlayerColor(playerid, TEAM_AZTECAS_COLOR);
}
case POLICE:
{
SetPlayerColor(playerid, TEAM_POLICE_COLOR);
}
case RIFAS:
{
SetPlayerColor(playerid, TEAM_RIFAS_COLOR);
}
case LOCO:
{
SetPlayerColor(playerid, TEAM_LOCO_COLOR);
}
}
}