SA-MP Forums Archive
Not able to see the opposite teams name tags? - 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: Not able to see the opposite teams name tags? (/showthread.php?tid=354026)



Not able to see the opposite teams name tags? - .Wicked - 25.06.2012

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?


Re: Not able to see the opposite teams name tags? - Djole1337 - 25.06.2012

Text behind his head ?

Like
Team
Mr_Djole


Re: Not able to see the opposite teams name tags? - Jonny5 - 25.06.2012

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]


Re: Not able to see the opposite teams name tags? - .Wicked - 25.06.2012

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


Re: Not able to see the opposite teams name tags? - .Wicked - 25.06.2012

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;
}



Re: Not able to see the opposite teams name tags? - Dodo9655 - 25.06.2012

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;
}



Re: Not able to see the opposite teams name tags? - .Wicked - 25.06.2012

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.


Re: Not able to see the opposite teams name tags? - .Wicked - 25.06.2012

Sorry for double posting, anyone ?


Re: Not able to see the opposite teams name tags? - [MM]RoXoR[FS] - 25.06.2012

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;
}



Re: Not able to see the opposite teams name tags? - leonardo1434 - 25.06.2012

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;
}