tags help
#1

how can i get a player team and show that team only the player tag
like if a player "x" is in team "y" , only the team "y" members can see the tags of their team mates , other teams can't . suggest me what to do.
Reply
#2

I bet this is what you're looking for:

https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer

You could hide the enemy team's tags in OnPlayerSpawn.
Reply
#3

That is for only player to player , i want to disable it for all the players of other team , if i and you are in different team i must not be able to see your nametag..
Reply
#4

You can loop that function through all enemy players to hide your tag from them, that way you can disable it for all players of the other team.
Reply
#5

Can you give me an small example?
Reply
#6

Код:
for(new x = 0; x <= GetPlayerPoolSize(); x++) if(GetPlayerTeam(playerid) == X) // This loops through all the players and checks what team they are in. Change the vars PlayerInTeam and X according to your script.
{
     ShowPlayerNameTagForPlayer(playerid, x, show);
     return 1;
}
Change show to your desire:
1-show name tag, 0-hide name tag
Reply
#7

Ok if I do that all teams can't see any other teams tag? Btw there are 8 teams

Ad that if(PlayerInTeam = X)

Will that get the players team ? I checked at ****** I didn't find that..
Reply
#8

so you should only see team-mates tags not the enemy, correct?
Reply
#9

Ye that's what I want..
Reply
#10

Код:
for(new i = 0; i <= GetPlayerPoolSize(); i++) 
{
     if(GetPlayerTeam(i) != X)
          ShowPlayerNameTagForPlayer(playerid, i, false);
     else
          ShowPlayerNameTagForPlayer(playerid, i, true);

     if(GetPlayerTeam(i) != Y)
          ShowPlayerNameTagForPlayer(playerid, i, false);
     else
          ShowPlayerNameTagForPlayer(playerid, i, true);
     // etc.
     return 1;
}
Hope this makes more sense.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)