SA-MP Forums Archive
ShowPlayerMarkers only for a single playerid? - 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: ShowPlayerMarkers only for a single playerid? (/showthread.php?tid=416584)



ShowPlayerMarkers only for a single playerid? - Tamer - 17.02.2013

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();


Re: ShowPlayerMarkers only for a single playerid? - Scenario - 17.02.2013

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.


Re: ShowPlayerMarkers only for a single playerid? - Tamer - 17.02.2013

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



Re: ShowPlayerMarkers only for a single playerid? - IstuntmanI - 17.02.2013

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



Re: ShowPlayerMarkers only for a single playerid? - Tamer - 17.02.2013

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



Re: ShowPlayerMarkers only for a single playerid? - DaRk_RaiN - 17.02.2013

No, it's no an error.