SA-MP Forums Archive
Players Not Showing on Map After Respawn? - 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: Players Not Showing on Map After Respawn? (/showthread.php?tid=601620)



Players Not Showing on Map After Respawn? - Metharon - 23.02.2016

I'm using this script when a gang war starts:

Код:
	foreach(new igor : Player)
	{
		if(PlayerInfo[igor][pMember] == 5 || PlayerInfo[igor][pMember] == 6)
		{
			foreach(new igor2 : Player)
			{
				if(PlayerInfo[igor2][pMember] == 5 || PlayerInfo[igor2][pMember] == 6)
				{
					SetPlayerMarkerForPlayer(igor, igor2, GetPlayerGColor(igor2));
					SetPlayerMarkerForPlayer(igor2, igor, GetPlayerGColor(igor));
				}
			}
		}
	}
The problem is:When i use this function OnPlayerSpawn is not working.

And also the player dissapear on respawn

Код:
new igor = playerid;
if(PlayerInfo[igor][pMember] == 5 || PlayerInfo[igor][pMember] == 6)
{
	foreach(new igor2 : Player)
	{
		if(PlayerInfo[igor2][pMember] == 5 || PlayerInfo[igor2][pMember] == 6)
		{
			SetPlayerMarkerForPlayer(igor, igor2, GetPlayerGColor(igor2));
			SetPlayerMarkerForPlayer(igor2, igor, GetPlayerGColor(igor));
		}
	}
}
Where i'm wrong ? How i FIX IT to make on spawn to see the gangsters?


Re: Players Not Showing on Map After Respawn? - xEF - 24.02.2016

I advice you to use global loop as for(new), to set a variable checking all players.
Maybe foreach not working as well.
And you shouldn't define playerid as a new array.