problem with nameoff cmd
#1

Код:
	if(strcmp(cmd, "/nameOn", true) == 0)
	{
	if(PlayerInfo[playerid][pAdmin] >3)
	{
      SendClientMessage(playerid,COLOR_GREY, "You Turned Name Tags ON");
      SetNameTagDrawDistance(2);
			return 1;
			}
	}
	if(strcmp(cmd, "/nameOff", true) == 0)
	{
	if(PlayerInfo[playerid][pAdmin] >3)
	{
      SendClientMessage(playerid,COLOR_GREY, "You Turned Name Tags Off");
      SetNameTagDrawDistance(0);
			return 1;
			}
	}
i do /nameon but the name always can be see.. what can be the problem?
Reply
#2

delete this SetNameTagDrawDistance(0);
and put this
Код:
ShowPlayerNameTagForPlayer(i, playerid, 0);
or
Код:
ShowPlayerNameTagForPlayer(i, playerid, 1);
0=On
1=Off
Reply
#3

i did it
Код:
	if(strcmp(cmd, "/nameOn", true) == 0)
	{
			if(PlayerInfo[playerid][pAdmin] >3)
			{
		  	for(new i = 0; i < GetMaxPlayers(); i++)
				{
					ShowPlayerNameTagForPlayer(i, playerid, 1);
				}
	      SendClientMessage(playerid,COLOR_GREY, "You Turned Name Tags ON");
			}
			return 1;
	}
	if(strcmp(cmd, "/nameOff", true) == 0)
	{
			if(PlayerInfo[playerid][pAdmin] >3)
			{
	      SendClientMessage(playerid,COLOR_GREY, "You Turned Name Tags Off");
				for(new i = 0; i < GetMaxPlayers(); i++)
				{
					ShowPlayerNameTagForPlayer(i, playerid, 0);
				}
			}
			return 1;
	}
but i always see the playername
Reply
#4

you got this?
Код:
SetNameTagDrawDistance(30.0);
if you dont have it put this on , OnGameModeInit
Код:
SetNameTagDrawDistance(30.0);
Reply
#5

i did it but always i can see the playernames
nobody have one idea?
Reply
#6

You have to update the name tags when players stream in.

https://sampwiki.blast.hk/wiki/OnPlayerStreamIn
Reply
#7

public OnPlayerStreamIn(playerid, forplayerid)
{
if(PlayerInfo[playerid][pMasked] == 1)
{
ShowPlayerNameTagForPlayer(forplayerid, playerid, false);
}
return 1;
}

this script must work?
Reply
#8

Yes, it should.
Reply
#9

i added but that don't work
Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
if(PlayerInfo[playerid][pMasked] == 1)
{
ShowPlayerNameTagForPlayer(forplayerid, playerid, false);
}
return 1;
}
	if(strcmp(cmd, "/nameOn", true) == 0)
	{
	
			if(PlayerInfo[playerid][pAdmin] >3)
			{
		  	for(new i = 0; i < GetMaxPlayers(); i++)
				{
					PlayerInfo[i][pMasked] = 1;
					//ShowPlayerNameTagForPlayer(i, playerid, 1);
				}
	      SendClientMessage(playerid,COLOR_GREY, "You Turned Name Tags ON");
			}
			return 1;
	}
	if(strcmp(cmd, "/nameOff", true) == 0)
	{
			if(PlayerInfo[playerid][pAdmin] >3)
			{
	      SendClientMessage(playerid,COLOR_GREY, "You Turned Name Tags Off");
				for(new i = 0; i < GetMaxPlayers(); i++)
				{
					PlayerInfo[i][pMasked] = 0;
					//ShowPlayerNameTagForPlayer(i, playerid, 0);
				}
			}
			return 1;
	}
Reply
#10

nobody have idea?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)