"OnPlayerUpdate Wanted"
#1

If a player wanted. he get the red color but it's display for all players. I don't want to display it for teams, i wanted it to display it to playerid

Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWantedLevel(playerid) > 0) // Check if player have wanted stars
    {
                SetPlayerMarkerForPlayer(playerid, playerid, COLOUR_RED); // set criminals color
		SetPlayerColor(playerid, COLOUR_RED); <--- this display to all players
    }
    else if(GetPlayerWantedLevel(playerid) == 0) // If player have 0 stars. it sets player colour back.
    {
                SetPlayerToTeamColour(playerid); //restart player colour
    }
}
should be like but its now working?

Код:
 if(playerid)
    {
        if(GetPlayerWantedLevel(playerid) > 0)
        {
                SetPlayerMarkerForPlayer(playerid, playerid, COLOUR_RED); // set criminals color
				SetPlayerColor(playerid, COLOUR_RED);
        }
        else if(GetPlayerWantedLevel(playerid) == 0)
        {
                SetPlayerToTeamColour(playerid); // restart criminals team color
        }
    }
Reply
#2

0xFF000000 will make the color correct, and invisible to the rest of the server. It's all to do with the alpha channel of the color you are using. You'll likely have 0xFF0000FF as COLOR_RED.

Using SetPlayerMarkerForPlayer, for playerid, and playerid is stupid, as you can't see your own marker.


Also, I'd say this isn't a good way at all to use OnPlayerUpdate... That callback fires so fast, and every millisecond you are checking the wanted level of the player...

Chances are you'll have the server lag out if more than a couple of people are on the server.
Reply
#3

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
0xFF000000 will make the color correct, and invisible to the rest of the server. It's all to do with the alpha channel of the color you are using. You'll likely have 0xFF0000FF as COLOR_RED.

Using SetPlayerMarkerForPlayer, for playerid, and playerid is stupid, as you can't see your own marker.


Also, I'd say this isn't a good way at all to use OnPlayerUpdate... That callback fires so fast, and every millisecond you are checking the wanted level of the player...

Chances are you'll have the server lag out if more than a couple of people are on the server.
But if wanted player check tab the hes not red or the text when he chat. i don't want it to display for all players
Reply
#4

Incorrect. 0xFF000000 will be red in the player list, and in the chat, and will not turn up in the marker.


Did you even try what I said, or are you simply speculating?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)