Colour Update
#1

If the player is a Police officer how do i get the color blue but i get the red color to everyone to see

OnPlayerUpdate:

Код:
forward IsWanted(playerid);
public IsWanted(playerid)
{
	if (Team[playerid] == TEAM_COP)
	for (new PlayerToCheck; PlayerToCheck < MAX_PLAYERS; PlayerToCheck++)
	{
		if (IsPlayerConnected(PlayerToCheck))
		{
			//if (GetPlayerWantedLevel(PlayerToCheck) > 0) && PoliceDuty[playerid])
			if(GetPlayerWantedLevel(PlayerToCheck) > 0 && PoliceDuty[playerid])
			{
                if(Team[playerid] == TEAM_COP)
				{
                    SetPlayerColor(PlayerToCheck, COLOUR_BLUE); // set officer color
                }
                SetPlayerColor(PlayerToCheck,COLOUR_RED);
			    SetPlayerMarkerForPlayer(playerid, PlayerToCheck, 0xFF0000FF);
			}
			else if(GetPlayerWantedLevel(PlayerToCheck) == 0 || !PoliceDuty[playerid])
			{
			      SetPlayerToTeamColour(PlayerToCheck);
			}
		}
	}
}
Reply
#2

Anyone?
Reply
#3

Just set the color when the police officer chooses the class, and set the criminals color to red when he commits a crime.

BTW you should know better, don't bump every hour.
Reply
#4

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
Just set the color when the police officer chooses the class, and set the criminals color to red when he commits a crime.

BTW you should know better, don't bump every hour.
I did that... and still not working.
and i did bump a hour ago.
Reply
#5

use this


pawn Код:
forward WantedLevelColor(playerid);

public OnPlayerUpdate(playerid)
{
    WantedLevelColor(playerid);
    return 1;
}

public WantedLevelColor(playerid)
{
    new pwl = GetPlayerWantedLevel(playerid);
    if(Civilian[playerid] == 1)
    {
    if(pwl >= 6)
    {
        SetPlayerColor(playerid, COLOR_RED);
    }
    if(pwl == 5)
    {
        SetPlayerColor(playerid, COLOR_ORANGE);
    }
    if(pwl == 4)
    {
        SetPlayerColor(playerid, COLOR_ORANGE);
    }
    if(pwl == 3)
    {
        SetPlayerColor(playerid, COLOR_YELLOW);
    }
    if(pwl == 2)
    {
        SetPlayerColor(playerid, COLOR_YELLOW);
    }
    if(pwl == 1)
    {
        SetPlayerColor(playerid, COLOR_YELLOW);
    }
    if(pwl == 0)
    {
        SetPlayerColor(playerid,COLOR_WHITE);
    }
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
use this


pawn Код:
forward WantedLevelColor(playerid);

public OnPlayerUpdate(playerid)
{
    WantedLevelColor(playerid);
    return 1;
}

public WantedLevelColor(playerid)
{
    new pwl = GetPlayerWantedLevel(playerid);
    if(Civilian[playerid] == 1)
    {
    if(pwl >= 6)
    {
        SetPlayerColor(playerid, COLOR_RED);
    }
    if(pwl == 5)
    {
        SetPlayerColor(playerid, COLOR_ORANGE);
    }
    if(pwl == 4)
    {
        SetPlayerColor(playerid, COLOR_ORANGE);
    }
    if(pwl == 3)
    {
        SetPlayerColor(playerid, COLOR_YELLOW);
    }
    if(pwl == 2)
    {
        SetPlayerColor(playerid, COLOR_YELLOW);
    }
    if(pwl == 1)
    {
        SetPlayerColor(playerid, COLOR_YELLOW);
    }
    if(pwl == 0)
    {
        SetPlayerColor(playerid,COLOR_WHITE);
    }
    }
    return 1;
}
I want to cop to see, not all players to see...
Reply
#7

Bump
Reply
#8

I think this is what you are looking for: https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)