PDA

View Full Version : SetPlayerMarkerForPlayer isn't working correctly


Adamoneoone
25/06/2018, 01:21 PM
Hey guys i'm trying to setup a police system. When a player has wanted level, his name and map icons should turn red.
So far I have this code, but it isn't working.

CMD:police(playerid, params[])
{
//previous blabla
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerWantedLevel(i) >= 1)
{
SetPlayerMarkerForPlayer(playerid, i, 0xFF0000FF);
}
}
return 1;
}

Any ideas???????

Thanks for your help! :D

SubGames
25/06/2018, 03:36 PM
http://wiki.sa-mp.com/wiki/SetPlayerMarkerForPlayer

DaniceMcHarley
25/06/2018, 03:43 PM
The red marker doesn't appear?

Adamoneoone
25/06/2018, 04:13 PM
http://wiki.sa-mp.com/wiki/SetPlayerMarkerForPlayer
What's the point of redirecting me over there?

The red marker doesn't appear?
Yep, that's the problem, i still got the original color.

// EDIT: Something weird happens, when I do /police on PC A, the PC A doesn't see any color change, but PC B's player color changes. However, when PC B writes in the chat, PC A doesn't see the color change.

// UPDATE: Just Put the SetPlayerMarkerForPlayer in another command, now the color changing is working fine, however, on the wanted player's screen, his color changes when he types text.

// UPDATE: PROBLEM SOLVED. For some reason, the SetPlayerColor in the OnPlayerSpawn was not working and messing things up. Thanks for your help guys