"OnPlayerUpdate Wanted" - 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)
+--- Thread: "OnPlayerUpdate Wanted" (
/showthread.php?tid=627032)
"OnPlayerUpdate Wanted" -
DerickClark - 22.01.2017
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
}
}
Re: "OnPlayerUpdate Wanted" -
Sew_Sumi - 23.01.2017
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.
Re: "OnPlayerUpdate Wanted" -
DerickClark - 24.01.2017
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
Re: "OnPlayerUpdate Wanted" -
Sew_Sumi - 24.01.2017
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?