ShowPlayerMarkers only for a single playerid?
#1

I bet it is used by stock functions,but I am not good with stock functions,can someone tell me a method to remove the player from the map,but not all players,only a specified playerid.

Probs it is the function : ShowPlayerMarkers();
Reply
#2

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

Example code:

pawn Код:
foreach(new i : Player)
{
   SetPlayerMarkerForPlayer( playerid, i, 0xFFFFFF00 );
}
The above code will loop through all players (using foreach), and hide playerid's marker from everyone.
Reply
#3

I have an error:

pawn Код:
stock RemovePlayerIcon(playerid)
{
    foreach(new i : Player)
    {
    SetPlayerMarkerForPlayer( playerid, i, 0xFFFFFF00 );
    }
    return 1;
}
stock ShowPlayerIcon(playerid)
{
    foreach(new i : Player)
    {
    if(GetPlayerTeam(i) == 1)
    {
    SetPlayerMarkerForPlayer( playerid, i, 0x0000FFFF );
    }
    if(GetPlayerTeam(i) == 2)
    {
    SetPlayerMarkerForPlayer( playerid, i, 0xFF0000AA );
    }
    return 1;
}
Код:
 error 017: undefined symbol "foreach"
error 029: invalid expression, assumed zero
error 017: undefined symbol "i"
fatal error 107: too many error messages on one line
Reply
#4

Change
pawn Код:
foreach(new i : Player)
with
pawn Код:
for( new i = 0; i < MAX_PLAYERS; i ++ ) if( IsPlayerConnected( i ) )
Reply
#5

Lol? Is this even an error? Or not? I did what you wrote and this is the thing that happened: First time I see this.

:S I am really confused.

Can someone help me with this? I just want it to remove the player from the map,for all players -.- Help is appreciated.

Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           4596 bytes
Code size:           108304 bytes
Data size:            97068 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4294 cells (17176 bytes)
Total requirements:  226352 bytes
Reply
#6

No, it's no an error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)