SA-MP Forums Archive
SetPlayerToTeamColor - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetPlayerToTeamColor (/showthread.php?tid=253018)



SetPlayerToTeamColor - Kuruskt - 04.05.2011

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?


Re: SetPlayerToTeamColor - Vince - 04.05.2011

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



Re: SetPlayerToTeamColor - Kuruskt - 04.05.2011

Solved, thanks.