Not able to see the opposite teams name tags?
#1

Alright as I stated in the title, "Not able to see the opposite teams name tag".

Is it possible to do that you can't see the opposite teams name tag? And if then how?

I'm not really sure how to do it but I think first off it should loop through all the players,
Check their teams, then it should check your(playerid) team and after that it should like
if player opposite team ShowPlayerNameTagForPlayer(playerid, i, false);

I atleast would need some help how to start the function.

Anyone?
Reply
#2

Text behind his head ?

Like
Team
Mr_Djole
Reply
#3

pawn Код:
for(new i;i<MAX_PLAYERS;i++)
{

    for(new x;x<MAX_PLAYERS;x++)
    {
        if(GetPlayerTeam(i) != GetPlayerTeam(x)
        {
            ShowPlayerNameTagForPlayer(x, i, false);
        }

    }

}
something like the above should work
must be done before they stream in for the players.

note untested.


[/pawn]
Reply
#4

You shouldn't be able to see the nametags for the other team. Like the health, name and etc.
Reply
#5

A error is showing up, tried to crack it but couldn't.

(1187) : error 001: expected token: ")", but found "{"

pawn Код:
{
And when I change the "{" to ")" it will give you a new error:

1192) : error 010: invalid function or declaration

pawn Код:
return 1;
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
    for(new i;i<MAX_PLAYERS;i++)
    {

        for(new x;x<MAX_PLAYERS;x++)
        {
            if(GetPlayerTeam(i) != GetPlayerTeam(x)
            {
                ShowPlayerNameTagForPlayer(x, i, false);
            }
        }
    }
    return 1;
}
Reply
#6

pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
    for(new i;i<MAX_PLAYERS;i++)
    {

        for(new x;x<MAX_PLAYERS;x++)
        {
            if(GetPlayerTeam(i) != GetPlayerTeam(x))
            {
                ShowPlayerNameTagForPlayer(x, i, false);
            }
        }
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by Dodo9655
Посмотреть сообщение
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
    for(new i;i<MAX_PLAYERS;i++)
    {

        for(new x;x<MAX_PLAYERS;x++)
        {
            if(GetPlayerTeam(i) != GetPlayerTeam(x))
            {
                ShowPlayerNameTagForPlayer(x, i, false);
            }
        }
    }
    return 1;
}
Thanks, no errors showed up! I'll try it out right now.

Alright it didn't work, it didn't affect the game at all.
Reply
#8

Sorry for double posting, anyone ?
Reply
#9

pawn Код:
public OnPlayerSpawn(playerid)
{
    Hide();
    return 1;
}
stock Hide()
{
    for(new i = 0;i<MAX_PLAYERS;++i)
    {
        if(IsPlayerCOnnected(i))
        {
            for(new j=0;i<MAX_PLAYERS;++j)
            {
                if(IsPlayerConnected(j))
                {
                    if(GetPlayerTeam(i) != GetPlayerTeam(x))
                    {
                        ShowPlayerNameTagForPlayer(x, i, false);
                    }
                }
            }
        }
    }
    return 1;
}
Reply
#10

You guys are pretty crazy's, Why the hell PUT 1 LOOP INSIDE OF ANOTHER LOOP?

This function below may work.
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
   for(new i = 0;i<MAX_PLAYERS;i++)
   {
      if(IsPlayerCOnnected(i))
      {
          if(GetPlayerTeam(i) == GetPlayerTeam(i)) // comparing their teams, if they are equal, they'll be able to see.
          {
             ShowPlayerNameTagForPlayer(x, i, true);
          }
          else return ShowPlayerNameTagForPlayer(x, i, false); // if they aren't they will not be able to see.
      }
   }
   return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)