Need help with name Tags and Map Blips
#1

I need help to make blips and Names only seeable for your own Team so the other side will be stealthed.
I already Disabled it for everyone but that doesn't work perfect for TDM.
Hope someone can help.

Ty already!
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
    for (new i = 0, max = GetMaxPlayers(); i < max; i++)
    {
        if (i != playerid)
        {
            if (playerid's team is not the same as i's team)
            {
                // Make the players marker invisible to the player while keeping chat colour the same. Will only work correctly if SetPlayerColor has been used
                SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
               
                ShowPlayerNameTagForPlayer(i, playerid, false);
            }
        }
    }
    return 1;
}
Reply
#3

How can i put that in my script?
Mine is:

Код:
public OnPlayerSpawn(playerid)
{
	SetPlayerToTeamColor(playerid);

	if(gTeam[playerid] == TEAM_GREEN) {
	  GameTextForPlayer(playerid,
		  "~b~Kill Spetznatz",
		  6000,5);
	}
	else if(gTeam[playerid] == TEAM_BLUE) {
	  GameTextForPlayer(playerid,
		  "~b~Kill USA",
		  6000,5);
	}
	return 0;
}
Reply
#4

Can someone please help me with that?
You are coming in the Credits!
Reply
#5

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerToTeamColor(playerid);

    if(gTeam[playerid] == TEAM_GREEN) {
      GameTextForPlayer(playerid,
          "~b~Kill Spetznatz",
          6000,5);
    }
    else if(gTeam[playerid] == TEAM_BLUE) {
      GameTextForPlayer(playerid,
          "~b~Kill USA",
          6000,5);
    }
    for (new i = 0, max = GetMaxPlayers(); i < max; i++)
        {
            if (i != playerid)
            {
                if (playerid's team is not the same as i's team)
                {
                    // Make the players marker invisible to the player while keeping chat colour the same. Will only work correctly if SetPlayerColor has been used
                    SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
               
                    ShowPlayerNameTagForPlayer(i, playerid, false);
                }
            }
        }
        return 1;
    }
    return 0;
}
Reply
#6

Thank you if this works i will add both of your names in Credits.
Reply
#7

Doesn't work.
I get these Errors:

Код:
C:\Users\**SECRET**\Desktop\SA-MP\SA-MP 2\gamemodes\**SECRET-GM**.pwn(172) : warning 219: local variable "max" shadows a variable at a preceding level
C:\Users\**SECRET**\Desktop\SA-MP\SA-MP 2\gamemodes\**SECRET-GM**.pwn(176) : error 027: invalid character constant
C:\Users\**SECRET**\Desktop\SA-MP\SA-MP 2\gamemodes\**SECRET-GM**.pwn(176) : warning 215: expression has no effect
C:\Users\**SECRET**\Desktop\SA-MP\SA-MP 2\gamemodes\**SECRET-GM**.pwn(176) : error 001: expected token: ";", but found "-identifier-"
C:\Users\**SECRET**\Desktop\SA-MP\SA-MP 2\gamemodes\**SECRET-GM**.pwn(176) : error 017: undefined symbol "team"
C:\Users\**SECRET**\Desktop\SA-MP\SA-MP 2\gamemodes\**SECRET-GM**.pwn(176) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#8

You need to edit this line:

pawn Код:
if (playerid's team is not the same as i's team)
How do you define your teams?
Do you use gTeam or SetPlayerTeam or something else?
Reply
#9

So like this

if (gTeam)
Reply
#10

Quote:
Originally Posted by MadeMan
You need to edit this line:

pawn Код:
if (playerid's team is not the same as i's team)
How do you define your teams?
Do you use gTeam or SetPlayerTeam or something else?
gTeam
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)