ShowPlayerNameTag - 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: ShowPlayerNameTag (
/showthread.php?tid=378474)
ShowPlayerNameTag -
kbalor - 17.09.2012
Any know how to make simple ShowPlayerNameTag only on his screen.
Lets say if I do /nameon - show name tag of players then if I do /nameoff - then all player name tag should hide.
Re: ShowPlayerNameTag -
SmithyComp - 17.09.2012
Research about the mask systems already made.
Re: ShowPlayerNameTag -
ViniBorn - 17.09.2012
You can use
ShowNameTags
Re: ShowPlayerNameTag -
antonio112 - 17.09.2012
pawn Код:
// Somewhere in your script
new NameTag[MAX_PLAYERS];
if (strcmp("/nameoff", cmdtext, true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(i, playerid, false);
NameTag[playerid] = 0;
GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
return 1;
}
if (strcmp("/nameon", cmdtext, true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(i, playerid, true);
NameTag[playerid] = 1;
GameTextForPlayer(playerid, "~W~Nametags ~G~ON", 5000, 5);
return 1;
}
public OnPlayerConnect(playerid)
{
NameTag[playerid] = 1;
for(new i = 0; i < MAX_PLAYERS; i++)
if(NameTag[i] == 0)
ShowPlayerNameTagForPlayer(playerid, i, false);
return 1;
}
Remember, this only disables / enables name tag for online players. If you want to hide names to players who joins the server, you have to create a variables