SetPlayerToTeamColor
#1

I've got 6 AddPlayerClass'es, and two teams with their own colors, but colors are not given to AddPlayerClass corectly on spawn.

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    if (classid == 1 && 2 && 3)
    {
        gTeam[playerid] = TEAM_POLICE;
    }
    if(classid == 4 && 5 && 6)
    {
        gTeam[playerid] = TEAM_MAFIA;
    }
}
pawn Код:
SetPlayerToTeamColor(playerid)
{
    if (gTeam[playerid] == TEAM_POLICE)
    {
        SetPlayerColor(playerid, COLOR_AQUA);
    }
    else if (gTeam[playerid] == TEAM_MAFIA)
    {
        SetPlayerColor(playerid, COLOR_BROWN);
    }
}
How may I fix it?
Reply
#2

pawn Код:
switch(classid)
{
    case 1..3: gTeam[playerid] = TEAM_POLICE;
    case 4..6: gTeam[playerid] = TEAM_MAFIA;
}
Reply
#3

Solved, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)