SetPlayerMarkerForPlayer not working?
#1

I'm making my own gamemode and my problem is that SetPlayerMarkerForPlayer isn't settings a marker on the radar, and is only changing the color of the players's name. I have ShowPlayerMarkers set to 0, so maybe this is why? It works when I have ShowPlayerMarkers set to 1, however I don't want markers for every player.. Please help .
Reply
#2

You should provide us the code to help you. Use the [ pawn ] [ /pawn ] tags and enclose the code within.
Reply
#3

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
You should provide us the code to help you. Use the [ pawn ] [ /pawn ] tags and enclose the code within.
Sorry, here you go:
pawn Код:
public OnGameModeInit()
{
    ShowPlayerMarkers(0);
}
CMD:backup(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SetPlayerMarkerForPlayer(playerid, i, 0xFF0000FF);
        SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
    }
}
I want everyone the server (including the player that did the /backup command) to have a red marker where they're located on the mini map/radar once this command is executed, however it only is changing everyone's name color to 0xFF0000FF (Red) and not creating a marker on the radar. It does work when I set ShowPlayerMarkers to 1 however, but then the problem is that everyone has a marker all the time which I don't want.
Reply
#4

bump
Reply
#5

bump
Reply
#6

Using "0" inside ShowPlayerMarker turns markers off, use 1 or 2

Quote:

0 PLAYER_MARKERS_MODE_OFF
1 PLAYER_MARKERS_MODE_GLOBAL
2 PLAYER_MARKERS_MODE_STREAMED

Reply
#7

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
Using "0" inside ShowPlayerMarker turns markers off, use 1 or 2
1 works (haven't tried 2, mind explaining that that does in comparison to 1?), however I don't want player markers to be enabled AT ALL unless I do the /backup command.
Reply
#8

Quote:
Originally Posted by unSatisfied
Посмотреть сообщение
1 works (haven't tried 2, mind explaining that that does in comparison to 1?)
1 PLAYER_MARKERS_MODE_GLOBAL Shows all the markers to everybody however the distance between them is
2 PLAYER_MARKERS_MODE_STREAMED Shows the markers only to nearby players

Quote:
Originally Posted by unSatisfied
Посмотреть сообщение
however I don't want player markers to be enabled AT ALL unless I do the /backup command.
You've got to hide them when a player connects and show it for the player you want to show it for, this should be easily done at "OnPlayerConnect" or wherever you set their color at.

This should explain how, notice that the last two characters are called Alpha, setting them to "00" makes the marker invisible and to "FF" make the marker solid
pawn Код:
SetPlayerMarkerForPlayer( 42, 1, 0xFF0000FF );// Make player 42 see player 1 as a red marker
SetPlayerMarkerForPlayer( 42, 1, 0xFFFFFF00 );// Make the players marker an invisible white (chat will be white but marker will be gone).
SetPlayerMarkerForPlayer( 42, 1, ( GetPlayerColor( 1 ) & 0xFFFFFF00 ) );// Make the players marker invisible to the player while keeping chat colour the same. Will only work correctly if SetPlayerColor has been used:
SetPlayerMarkerForPlayer( 42, 1, ( GetPlayerColor( 1 ) | 0x000000FF ) );// Make the players marker fully opaque (solid) to the player while keeping chat colour the same. Will only work correctly if SetPlayerColor has been used:
Reply
#9

Why do you want to use this twice, just refer to wiki page and from it you can make out this:
pawn Код:
CMD:backup(playerid)
{
    //make the player marker red while keeping the chat color the same
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) | 0xFF0000FF));
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)