SA-MP Forums Archive
SetPlayerMarkerForPlayer isn't working correctly - 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: SetPlayerMarkerForPlayer isn't working correctly (/showthread.php?tid=655605)



[SOLVED] SetPlayerMarkerForPlayer isn't working correctly - Adamoneoone - 25.06.2018

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.

PHP код:
CMD:police(playeridparams[])
{
     
//previous blabla
     
for(new 0MAX_PLAYERSi++)
     {
        if(
GetPlayerWantedLevel(i) >= 1)
        {
            
SetPlayerMarkerForPlayer(playeridi0xFF0000FF);
        }
     }
     return 
1;

Any ideas?

Thanks for your help!


Re: SetPlayerMarkerForPlayer isn't working correctly - SubGames - 25.06.2018

https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer


Re: SetPlayerMarkerForPlayer isn't working correctly - Beckett - 25.06.2018

The red marker doesn't appear?


Re: SetPlayerMarkerForPlayer isn't working correctly - Adamoneoone - 25.06.2018

Quote:
Originally Posted by SubGames
Посмотреть сообщение
What's the point of redirecting me over there?

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
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