SA-MP Forums Archive
Player Color Bug - 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: Player Color Bug (/showthread.php?tid=240882)



Player Color Bug - Unknown123 - 16.03.2011

Colors:
White == Innocent
Orange == Wanted (4 stars)


I (Unknown123) rob The_Killer, and then i get 4 stars and my color change (Sounds like no bug? no, there is no bu there) but when The_Killer open TAB then he see me as white (but i have 4 stars.. Orange)

Summary:
i rob a player, gets orange in tab list
but other players see me as white




Contact me if you wanna see the bug ingame (You will need Hamachi)
pawn Код:
public ResetWanted()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new wanted = GetPlayerWantedLevel(i);
        if(GetPVarInt(i, "AdminDuty") == 0)
        {
            if(IsSpawned[i] == 1)
            {
                if(wanted > 0)
                {
                    if(wanted > 0 && wanted < 4)
                    {
                        SetPlayerColor(i, COLOR_YELLOW);
                    }

                    else if(wanted > 3 && wanted < 10)
                    {
                        SetPlayerColor(i, COLOR_ORANGE);
                    }

                    else if(wanted > 9)
                    {
                        SetPlayerColor(i, COLOR_RED);
                    }
                }
                else if(wanted == 0)
                {
                    SetPlayerTeamColor(i);
                    return 1;
                }
            }
            else if(IsSpawned[i] == 0)
            {
                SetPlayerColor(i, 0x404040FF);
                return 1;
            }
        }
    }
    return 1;
}
pawn Код:
stock SetPlayerTeamColor(playerid)
{
    if(gTeam[playerid] == TEAM_COP)
    {
        SetPlayerColor(playerid, 0x0000FFAA);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_AIRCOP)
    {
        SetPlayerColor(playerid, 0x007F0EAA);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_MARINECOP)
    {
        SetPlayerColor(playerid, 0x007F0EAA);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_CASINOGUARD)
    {
        SetPlayerColor(playerid, 0x1E90FFAA);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_SWAT)
    {
        SetPlayerColor(playerid, 0xD2691EAA);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_ARMY)
    {
        SetPlayerColor(playerid, 0x8A2BE2AA);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_MEDIC)
    {
        SetPlayerColor(playerid, 0xFF6EC7AA);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_MECHANIC)
    {
        SetPlayerColor(playerid, COLOR_WHITE);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_BISTRO)
    {
        SetPlayerColor(playerid, COLOR_WHITE);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_DRIVER)
    {
        SetPlayerColor(playerid, 0x00330EAA);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_UNKNOWN)
    {
        SetPlayerColor(playerid, COLOR_WHITE);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_RAPTIST)
    {
        SetPlayerColor(playerid, COLOR_WHITE);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_WEAPON_DEALER)
    {
        SetPlayerColor(playerid, COLOR_WHITE);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_DRUG_SELLER)
    {
        SetPlayerColor(playerid, COLOR_WHITE);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_SALES_MAN)
    {
        SetPlayerColor(playerid, COLOR_WHITE);
        return 1;
    }
    return 1;
}



Re: Player Color Bug - maramizo - 16.03.2011

Without even reading the whole of your script, use foreach.


Re: Player Color Bug - Unknown123 - 16.03.2011

Quote:
Originally Posted by maramizo
Посмотреть сообщение
Without even reading the whole of your script, use foreach.
Changed to foreach, and now it will work?


Re: Player Color Bug - AH.1990 - 16.03.2011

lol are you sure thay are not pressing on the name ?? cuz that will make it white

pressing means clicking on the name in TAB