Mask bug ! - 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: Mask bug ! (
/showthread.php?tid=562155)
Mask bug ! -
DokiStone - 07.02.2015
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;
}
Re: Mask bug ! -
HazardouS - 07.02.2015
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
Re: Mask bug ! -
JaydenJason - 07.02.2015
is there any code of the mask in OnPlayerStreamIn?
Re: Mask bug ! -
DokiStone - 07.02.2015
I don't have nothing in public OnPlayerStreamIn... what am I supposed to add there?
Re: Mask bug ! -
CalvinC - 07.02.2015
You're supposed to check if the player has a mask on, and if so, hide his nametag for the streamed in player.
Re: Mask bug ! -
DokiStone - 07.02.2015
Thank you very much.