[AJUDA] /Admins
#1

Pessoa,й o seguinte...Eu queria que quando o Jogador digitar-se o comando /admins e nenhum Administrador estiver conectado,aparecer-se assim:

Administradores Conectados:
~> Nenhum Administrador conectado.

Ta Aк o cуdigo:
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
    {
        SendClientMessage(playerid, 0x0080C0AA, "~> Administradores conectados:");
            for(new i = 0; i < MAX_PLAYERS; i++)
                if(admtrampando[i] == 1)
                {
            {
                if(IsPlayerConnected(i))
                {
                        if(PlayerInfo[i][pAdmin] == 0)
                        {
                        }
                        else if(PlayerInfo[i][pAdmin] >= 1)
                        {
                          GetPlayerName(i, sendername, sizeof(sendername));
                          format(string, 256, "%s [Administrador]", sendername);
                          SendClientMessage(playerid, 0xFFFFFFAA, string);
                        }
                       }
            }
    }
            return 1;
    }
Grato
Reply
#2

Код:
if (strcmp(cmd, "/admins", true) == 0)
{ 
      SendClientMessage(playerid, 0x0080C0AA, "~> Administradores conectados:");
      for(new i = 0; i < MAX_PLAYERS; i++)
      if(admtrampando[i] == 1)
      {
          if(IsPlayerConnected(i))
          {
                if(PlayerInfo[i][pAdmin] >= 1)
                { 
                             GetPlayerName(i, sendername, sizeof(sendername));
                          format(string, 256, "%s [Administrador]", sendername);
                          SendClientMessage(playerid, 0xFFFFFFAA, string);       
                        }
                     }
                 }
        return 1;
    }
Creio eu Que Pegue.
Reply
#3

What? Nгo tem nada nesse cуdigo .______.'
Reply
#4

Aqui Pegou Direitinho...

pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
{
    SendClientMessage(playerid, 0x0080C0AA, "~> Administradores conectados:");
    for(new i = 0; i < MAX_PLAYERS; i++)
    if(admtrampando[i] == 1)
    {
       if(IsPlayerConnected(i))
       {
          if(PlayerInfo[i][pAdmin] >= 1)
          {
                GetPlayerName(i, sendername, sizeof(sendername));
                format(string, 256, "%s [Administrador]", sendername);
                SendClientMessage(playerid, 0xFFFFFFAA, string);      
                }
             }
          }
 return true;
}
Quer cуdigo Bonito й ?
Reply
#5

Cara,cade a SendClientMessage?
Reply
#6

allan, a sendclientmessage ta ali sim:
pawn Код:
format(string, 256, "%s [Administrador]", sendername);
                SendClientMessage(playerid, 0xFFFFFFAA, string);
Reply
#7

pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
    {
    SendClientMessage(playerid, 0x0080C0AA, "~> Administradores conectados:");
    for(new i = 0; i < MAX_PLAYERS; i++)
    if(admtrampando[i] == 1)
    {
       if(!IsPlayerConnected(i)) return SendClientMessage(playerid, 0xFFFFFFFF, "Nenhum administrador conectado");
       if(PlayerInfo[i][pAdmin] >= 1)
       {
           GetPlayerName(i, sendername, sizeof(sendername));
           format(string, 256, "%s [Administrador]", sendername);
           SendClientMessage(playerid, 0xFFFFFFAA, string);
       }
       }
     return true;
    }
Jб tentou assim?
Reply
#8

Quote:
Originally Posted by Josma_cmd
Посмотреть сообщение
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
    {
    SendClientMessage(playerid, 0x0080C0AA, "~> Administradores conectados:");
    for(new i = 0; i < MAX_PLAYERS; i++)
    if(admtrampando[i] == 1)
    {
       if(!IsPlayerConnected(i)) return SendClientMessage(playerid, 0xFFFFFFFF, "Nenhum administrador conectado");
       if(PlayerInfo[i][pAdmin] >= 1)
       {
           GetPlayerName(i, sendername, sizeof(sendername));
           format(string, 256, "%s [Administrador]", sendername);
           SendClientMessage(playerid, 0xFFFFFFAA, string);
       }
       }
     return true;
    }
Jб tentou assim?
Ainda nгo! D:
Reply
#9

Код:
if( strcmp ( cmd, "/admins", true ) == 0 )
{
	new 
	     Admins = 0
	;
	SendClientMessage( playerid, 0x0080C0AA, "~> Administradores conectados:" );
	for ( new i = 0; i < MAX_PLAYERS; i++ )
	{
		if( IsPlayerConnected ( i ) && admtrampando[i] == 1 )
		{
			if( PlayerInfo[i][pAdmin] >= 1 )   		
			{
				GetPlayerName( i, sendername, sizeof ( sendername ) );
				format ( string, 50, "%s [Administrador]", sendername );
				SendClientMessage( playerid, 0xFFFFFFAA, string ); 
				Admins++;
			}
		}
	}
	if( Admins == 0 ) 
	SendClientMessage ( playerid, Cor , "Nгo hб Administradores Online!" );
	return 1;
}
Reply
#10

Quote:
Originally Posted by LuxurioN™
Посмотреть сообщение
Код:
if( strcmp ( cmd, "/admins", true ) == 0 )
{
	new 
	     Admins = 0
	;
	SendClientMessage( playerid, 0x0080C0AA, "~> Administradores conectados:" );
	for ( new i = 0; i < MAX_PLAYERS; i++ )
	{
		if( IsPlayerConnected ( i ) && admtrampando[i] == 1 )
		{
			if( PlayerInfo[i][pAdmin] >= 1 )   		
			{
				GetPlayerName( i, sendername, sizeof ( sendername ) );
				format ( string, 50, "%s [Administrador]", sendername );
				SendClientMessage( playerid, 0xFFFFFFAA, string ); 
				Admins++;
			}
		}
	}
	if( Admins == 0 ) 
	SendClientMessage ( playerid, Cor , "Nгo hб Administradores Online!" );
	return 1;
}
Opa Luxurion,Vlw funcionou direitinho!

Valeu a todos!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)