Script small question
#1

I made this little script just so that people could not see certain player's Tagname, however It seems like when I use the command It masks everyone's Tagname but not mine, on my screen I can't see Tagnames, and other players are indeed able to see my tagname, How can I turn it so that people won't be able to see a certain player's Tagname when he uses the command ?
PHP код:
if (strcmp("/mask"cmdtexttrue) == 0)
{
    for(new 
0playeridi++) ShowPlayerNameTagForPlayer(playeridifalse);
    
GameTextForPlayer(playerid"~W~You have put mask ~g~ on"50005);
    return 
1;

Reply
#2

Use it like this maybe?
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
   			{
   		    	if(IsPlayerConnected(i))
   		    	{
		   			ShowPlayerNameTagForPlayer(i, playerid, 0);
				}
and for showing it again
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
   			{
   		    	if(IsPlayerConnected(i))
   		    	{
		   			ShowPlayerNameTagForPlayer(i, playerid, 1);
Reply
#3

Could you summarize it into a one script, I can't use it, I'm messed up.
Reply
#4

PHP код:
if (strcmp("/mask"cmdtexttrue) == 0)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
         {
            
ShowPlayerNameTagForPlayer(iplayerid0);
            
GameTextForPlayer(playerid"~W~You have put mask ~g~ on"50005);
        }
    }
    return 
1;
}
if (
strcmp("/maskoff"cmdtexttrue) == 0)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
         {
            
ShowPlayerNameTagForPlayer(iplayerid1);
            
GameTextForPlayer(playerid"~W~You have put mask ~g~ off"50005);
        }
    }
    return 
1;

It should work.
Reply
#5

Wow it works, thanks a lot !
Can you help me with one more small thing, I want to add "Mask" into a shop list, so that people could use it only when they have it.
how can I do it ?
I already have a purchase menu, can you help me add it ?
Reply
#6

It's also very simple... If you are using pInfo's you can do it like this.
PHP код:
if (strcmp("/buymask"cmdtexttrue) == 0)
{
    if(
IsPlayerConnected(playerid))
    {
        
SetPlayerMoney(playerid, -45);
        
PlayerInfo[playerid][pHasMask] = 1;
        
SendClientMessage(playeridCOLOR_RED"You bought a mask! [/maskoff or /mask]");
    }

And Mask code should look like this
PHP код:
if (strcmp("/mask"cmdtexttrue) == 0)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
         {
             if(
PlayerInfo[playerid][pHasMask] == 1)
             {
                
ShowPlayerNameTagForPlayer(iplayerid0);
                
GameTextForPlayer(playerid"~W~You have put mask ~g~ on"50005);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"You don't have mask!");
                 }
    }
    return 
1;

Reply
#7

I tired to put it on the store Dialog menu but it doesn't work,
How can I put the purchase feature on the shop menu, so that they won't have to use the command, and if they purchase it then they can use it.
Reply
#8

oh jeez, how could we know how ur dialog looks like.... either post the code here or send me a pm with details
Reply
#9

Alright, I was able to make it work, but there is a bug, when people use the mask, and a player logs in the mask won't work, the user who uses the mask will have to use /mask again to cover his Tagname.
How can I add it ?

This is my command :
PHP код:
 if(strcmp(cmdtext,"/mask",true) == 0)
{
for(new 
0MAX_PLAYERSi++)
 
ShowPlayerNameTagForPlayer(i,playerid,0);
 if(
Mask == 0)return SendClientMessage(playerid,0xFF6C6CFF,"You don't have a mask !");
 
DisableNameTagLOS();
  
GameTextForPlayer(playerid"~W~You have put mask ~g~ on"50005);
 return 
1;
 } 
Reply
#10

maybe

pawn Код:
if(IsPlayerConnected(i))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)