Mask system
#1

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;
}
Reply
#2

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;
}
Reply
#3

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?
Reply
#4

-SNIP THIS POST-
Reply
#5

Snip?
Reply
#6

Didnt mean to post lol
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)