[Ajuda] Dois em um
#1

Estou apanhando para fazer dois em um, no caso /mascara pra ativar e pra desativar. Fiz uma variбvel de "mascara" mas nгo dб certo. Podem me ajudar? (Podem remover a variбvel mascara[playerid] == 0, foi uma tentativa que nгo funcionou)

Код:
	if(strcmp(cmd, "/mascara", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
            if(mascara[playerid] == 0)
            {
		    	if(PlayerInfo[playerid][pMask] == 0)
		   	 	{
		   		     SendClientMessage(playerid, COR_LARANJA, "Vocк nгo possui este item.");
	                 return 0x01;
		   		}
				if(pInfo[playerid][pMaskNumber] == 0)
		   		{
		   		    pInfo[playerid][pMaskNumber] = random(99999);
				}
	            for(new i = 0; i <= MAX_PLAYERS; ++i)
	   			{
	   		    	if(IsPlayerConnected(i))
	   		    	{
			   			ShowPlayerNameTagForPlayer(i, playerid, 0);
					}
				}
				pInfo[playerid][pMaskuse] = 1;
	      		format(string, sizeof(string), "* %s coloca sua mascara.", GetPlayerNameEx(playerid));
	      		ProxDetector(30.0, playerid, string, COR_PURPLE);
	        }
	        else
	        {
		    	if(pInfo[playerid][pMask] == 0)
		    	{
	                SendClientMessage(playerid, COR_LARANJA, "Vocк nгo estб mascarado.");
		        	pInfo[playerid][pMaskuse] = 0;
	                return 0x01;
		    	}
	            for(new i = 0; i <= MAX_PLAYERS; ++i)
	   			{
	   		    	if(IsPlayerConnected(i))
	   		    	{
			   			ShowPlayerNameTagForPlayer(i, playerid, 1);
					}
				}
				RemovePlayerAttachedObject(playerid,1);
	            pInfo[playerid][pMaskuse] = 0;
				GetPlayerName(playerid, sendername, sizeof(sendername));
	      		format(string, sizeof(string), "* %s removeu sua mascara.", GetPlayerNameMasc(playerid));
	      		ProxDetector(30.0, playerid, string, COR_PURPLE);
			}
		}
        return 0x01;
	}
Reply
#2

Tenta ae
PHP код:
if(strcmp(cmd"/mascara"true) == 0)
{
    if(
IsPlayerConnected(playerid))
    {
        if(
mascara[playerid] == 0)
        {
            if(
PlayerInfo[playerid][pMask] == 0)
                {
                    
SendClientMessage(playeridCOR_LARANJA"Vocк nгo possui este item.");
                 return 
0x01;
               }
            if(
pInfo[playerid][pMaskNumber] == 0)
               {
                   
pInfo[playerid][pMaskNumber] = random(99999);
            }
            for(new 
0<= MAX_PLAYERS; ++i)
               {
                   if(
IsPlayerConnected(i))
                   {
                       
ShowPlayerNameTagForPlayer(iplayerid0);
                }
            }
            
pInfo[playerid][pMaskuse] = 1;
            
mascara[playerid] = 1;
              
format(stringsizeof(string), "* %s coloca sua mascara."GetPlayerNameEx(playerid));
              
ProxDetector(30.0playeridstringCOR_PURPLE);
        }
        else if(
mascara[playerid] == 1)
        {
            if(
pInfo[playerid][pMask] == 0)
            {
                
SendClientMessage(playeridCOR_LARANJA"Vocк nгo estб mascarado.");
                
pInfo[playerid][pMaskuse] = 0;
                return 
0x01;
            }
            for(new 
0<= MAX_PLAYERS; ++i)
               {
                   if(
IsPlayerConnected(i))
                   {
                       
ShowPlayerNameTagForPlayer(iplayerid1);
                }
            }
            
RemovePlayerAttachedObject(playerid,1);
            
pInfo[playerid][pMaskuse] = 0;
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
mascara[playerid] = 0;
              
format(stringsizeof(string), "* %s removeu sua mascara."GetPlayerNameMasc(playerid));
              
ProxDetector(30.0playeridstringCOR_PURPLE);
        }
    }
    return 
0x01;

Reply
#3

Maravilhoso. Quais foram adiзхes/modificaзхes?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)