Mask bug !
#1

Hello,
I have a little problem again, mainly when I use the command MASK I should mask a player and his nametag wouldn't be visible, but instead his nametag is only hidden for me, not for everyone else.

Код:
CMD:mask ( playerid,params[])
{
	if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid,-1,""RED"ERROR:"GREY" You must logg in!");
	if(PlayerInfo[playerid][Admin] < 3) return SendClientMessage( playerid, -1, ""RED"ERROR:"GREY" You are not authorized to use this command.");
	new giveid;
	if(sscanf(params,"u", giveid)) return SendClientMessage(playerid,USAGE,"{F07F1D}USAGE:{BBFF00} /mask <ID>");
	if(PlayerInfo[giveid][inDM] == 1 && 2 && 3) return SendClientMessage(playerid,-1,""RED"ERROR:"GREY" The ID of the player you want to mask iz in DM");
	if(PlayerInfo[giveid][Mask] == 0)
	{
	    for(new i = 0; i < MAX_PLAYERS; i++)
	    {
			ShowPlayerNameTagForPlayer(i, giveid, 0);
			new string[128];
			format(string,sizeof(string),""STEELBLUE"- AS - Administrator {%06x}%s(%d)"STEELBLUE" has masked a player.", (GetPlayerColor(playerid) >>> 8),GetName(playerid),playerid);
			SendClientMessageToAll(-1,string);
			new str[128];
			format(str,sizeof(str),""STEELBLUE"- AS - Administrator {%06x}%s(%d)"STEELBLUE" has masked you.", (GetPlayerColor(playerid) >>> 8),GetName(playerid),playerid);
			SendClientMessage(giveid,-1,str);
			PlayerInfo[giveid][Mask] = 1;
		}
	}
	if(PlayerInfo[giveid][Mask] == 1)
	{
		SendClientMessage(playerid,-1,""RED"ERROR:"GREY" That player is masked.");
	}
	return 1;
}
Reply
#2

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

Read the important note on that page. What it's saying is that every time a player streams in for another player, the Name Tag will always be visible, unless you make it hidden again. Make sure you're hiding the nametag here:
https://sampwiki.blast.hk/wiki/OnPlayerStreamIn
Reply
#3

is there any code of the mask in OnPlayerStreamIn?
Reply
#4

I don't have nothing in public OnPlayerStreamIn... what am I supposed to add there?
Reply
#5

You're supposed to check if the player has a mask on, and if so, hide his nametag for the streamed in player.
Reply
#6

Thank you very much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)