On player marker
#1

Hey guys i have a War sistem but i want to make a marker for every player in War attackers and defenders i have only this

Код HTML:
public OnPlayerStreamIn(playerid, forplayerid)
{
    if(Undercover[playerid] == 1)
	{
	    TeamColor(playerid);
		ShowPlayerNameTagForPlayer(forplayerid, playerid, 0);
		SetPlayerMarkerForPlayer( playerid, forplayerid, ( GetPlayerColor( forplayerid ) & 0xFFFFFF00 ) );
		SetPlayerMarkerForPlayer( forplayerid, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
		return 1;
	}
 	if(IsInWar1(playerid) && IsInWar1(forplayerid) || IsInWar2(playerid) && IsInWar2(forplayerid))
	{
	    new zone = GetPlayerZone(playerid);
	    if(zone == -1 || TakeON[zone] == 0 || !IsPlayerInZone(forplayerid, zone))
	    {
	        SetPlayerMarkerForPlayer( playerid, forplayerid, ( GetPlayerColor( forplayerid ) ) );
			SetPlayerMarkerForPlayer( forplayerid, playerid, ( GetPlayerColor( playerid ) ) );
	    }
	}
	else
	{
	    if(PlayerPaintballing[playerid] && PlayerPaintballing[forplayerid] || InClanWar[playerid] && InClanWar[forplayerid])
		{
			SetPlayerMarkerForPlayer( playerid, forplayerid, GetPlayerColor( forplayerid ) );
			SetPlayerMarkerForPlayer( forplayerid, playerid, GetPlayerColor( playerid ) );
		}
		else
		{
			SetPlayerMarkerForPlayer( playerid, forplayerid, ( GetPlayerColor( forplayerid ) & 0xFFFFFF00 ) );
			SetPlayerMarkerForPlayer( forplayerid, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
		}
	}
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	if(!IsInWar1(playerid) && !IsInWar2(playerid) && !IsInWar1(forplayerid) && !IsInWar2(forplayerid))
	{
	    SetPlayerMarkerForPlayer( playerid, forplayerid, ( GetPlayerColor( forplayerid ) & 0xFFFFFF00 ) );
		SetPlayerMarkerForPlayer( forplayerid, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
	}
	return 1;
}
nothing else is something wrong why i can't see my team mate's or oponent's ? can some1 help me ?
Reply
#2

If you set Player Markers to global, you wouldn't need all of this...
Reply
#3

yea but i want only for players who have war in that zone
Reply
#4

I'm semi-sure what you need to do is check the if statements, as they seem excessive, relative to what you are checking.


&& != ==, If you confirm one, you then don't need to confirm the other.


What also will happen, is if someone gets away from someone, and doesn't stream back in before the war is finished, their marker will be visible to the player all the time. Same in regards to Undercover. If they switch the state outside of the stream area, they'll be visible until they stream back in.


-Edit- Ignore my comment regarding the usage of SetPlayerColor and the way I said about SetPlayerMarkerForPlayer. It appears I haven't looked at my own code for a long while.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)