SA-MP Forums Archive
Mask system - 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 system (/showthread.php?tid=568677)



Mask system - kevin1990 - 24.03.2015

Any idea why this hides everyone elses names but keeps mine visible lol. I want it to hide the name of the person who does /mask

Код:
/*
Mask Maded By Paul_Saint & VIPAwesome
*/
#include <a_samp>
#include <ZCMD>
#define COLOR_GREY 0xAFAFAFAA
new masked[MAX_PLAYERS];
CMD:mask(playerid, params[])
{
   
   if(masked[playerid] == 0)
   {
   masked[playerid] = 1;
   SendClientMessage(playerid, -1,"You are now masked and your name is hidden.");
   for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, 1);
   }
   else
   {
   masked[playerid] = 0;
   SendClientMessage(playerid, -1,"You are no longer masked and your name is visble.");
   for(new a = 0; a < MAX_PLAYERS; a++) ShowPlayerNameTagForPlayer(playerid, a, 0);
   }
   return true;
}



Re: Mask system - Aly - 24.03.2015

Try this:

Код:
/*
Mask Maded By Paul_Saint & VIPAwesome
*/
#include <a_samp>
#include <ZCMD>
#define COLOR_GREY 0xAFAFAFAA
new masked[MAX_PLAYERS];
CMD:mask(playerid, params[])
{
   
   if(masked[playerid] == 0)
   {
   masked[playerid] = 1;
   SendClientMessage(playerid, -1,"You are now masked and your name is hidden.");
   for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i,playerid, false);
   }
   else
   {
   masked[playerid] = 0;
   SendClientMessage(playerid, -1,"You are no longer masked and your name is visble.");
   for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i,playerid, true);
   }
   return true;
}



Respuesta: Mask system - kevin1990 - 24.03.2015

Thanks that worked. Two mroe questions though. 1. How could I change the text... so when I type its says stranger instead of my name? and 2. How can I make it so admins can view masked players?


Re: Mask system - Wolfe - 24.03.2015

-SNIP THIS POST-


Respuesta: Mask system - kevin1990 - 24.03.2015

Snip?


Re: Mask system - Wolfe - 24.03.2015

Didnt mean to post lol


Re: Mask system - Aly - 24.03.2015

1.
Код:
//Put this under OnPlayerText
if(masked[playerid] == 1)
		{
		    format(string,sizeof(string), "Stranger: %s",text);
		    ProxDetector(20.0, playerid, string,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
		}
		else
		{
        	format(string, sizeof(string), "%s: %s", sendername,text);
			ProxDetector(20.0, playerid, string,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
		}
2.
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    if(PlayerInfo[i][pAdmin] < 1)
        ShowPlayerNameTagForPlayer(i,playerid, false);
//Replace PlayerInfo[i][pAdmin] with your variable