SA-MP Forums Archive
problem with nameoff cmd - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: problem with nameoff cmd (/showthread.php?tid=124779)



problem with nameoff cmd - jasonnw666 - 31.01.2010

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


Re: problem with nameoff cmd - Mr L - 31.01.2010

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


Re: problem with nameoff cmd - jasonnw666 - 31.01.2010

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


Re: problem with nameoff cmd - Mr L - 31.01.2010

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



Re: problem with nameoff cmd - jasonnw666 - 01.02.2010

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


Re: problem with nameoff cmd - MadeMan - 01.02.2010

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

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


Re: problem with nameoff cmd - jasonnw666 - 01.02.2010

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

this script must work?


Re: problem with nameoff cmd - MadeMan - 01.02.2010

Yes, it should.


Re: problem with nameoff cmd - jasonnw666 - 01.02.2010

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



Re: problem with nameoff cmd - jasonnw666 - 01.02.2010

nobody have idea?