SA-MP Forums Archive
tags help - 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: tags help (/showthread.php?tid=575463)



tags help - fuckingcruse - 27.05.2015

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.


Re: tags help - shadowdog - 27.05.2015

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.


Re: tags help - fuckingcruse - 27.05.2015

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..


Re: tags help - shadowdog - 27.05.2015

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.


Re: tags help - fuckingcruse - 27.05.2015

Can you give me an small example?


Re: tags help - Sledgehammer - 27.05.2015

Код:
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


Re: tags help - fuckingcruse - 27.05.2015

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..


Re: tags help - Sledgehammer - 27.05.2015

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


Re: tags help - fuckingcruse - 27.05.2015

Ye that's what I want..


Re: tags help - Sledgehammer - 27.05.2015

Код:
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.