SA-MP Forums Archive
Player Markers - 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: Player Markers (/showthread.php?tid=330024)



Player Markers - Skribblez - 31.03.2012

Is there a way to show player markers without using ShowPlayerMarkers in different instances?

Generally, I don't want player markers enabled for everyone so I set it to 0 under OnGameModeInit(), now whenever I use SetPlayerMarkerForPlayer() for a command it doesn't show up.

Any suggestions? Thanks.


Re: Player Markers - D3XT3R - 31.03.2012

I'am Not Sure but i think there is No Other Way But let's Wait for Others Reply


Re: Player Markers - Harish - 31.03.2012

hey..

I never Experienced this to .. try this

remove ShowPlayerMarkers in your gamemodeinit()

and add a loop like this
pawn Код:
for(new i=0;i<MAX_PAYERS;i++)
{
SetPlayerColor(i, 0xFFFFFF00);//this will alpha transperent color of player
}
and then use your SetPlayerMarkerForPlayer() .. well i think it will work fine and remember to use FF at last color code to see the marker


Re: Player Markers - Skribblez - 31.03.2012

Tried that too, didn't work.


Re: Player Markers - AndreT - 31.03.2012

Show us your code.

Note that SetPlayerMarkerForPlayer has a 3rd parameter - color. Setting the alpha channel to 00 will effectively hide the marker. And most likely you'd need to use the function in a loop.
pawn Код:
// playerid - the player whose marker you want to hide from players in gTeam 2
for(new i = 0; i != MAX_PLAYERS; i++)
{
    if(!IsPlayerConnected(i) || gTeam[i] != 2) // Don't continue the loop for unconnected IDs or if the player is in any team other than 2.
        continue;

    SetPlayerMarkerForPlayer(i, playerid, 0xFFFFFF00);
}



Re: Player Markers - Skribblez - 31.03.2012

Like I said, I've tried that too and it didn't work. There's not much to show with regards to my code since it's similar with what you guys have posted. I didn't use ShowPlayerMarkers() and used a loop through all the players to show a transparent player marker. In the end, it still shows up player markers for everyone.