Players Not Showing on Map After Respawn?
#1

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?
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)