[Ajuda] No /Admins , playeres normais aparecendo também.
#1

Code:
	if(strcmp(cmd, "/AdminsTeste", true) == 0)
{
	new CargoAdmin[80];
	new StatusOnline[80];
	new StringCat[1000];
	new String[1000];
	new ContarAdmins;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if(IsPlayerConnected(i))
	    {
	            if( aInfo[ i ][ Ajudante ] ) CargoAdmin = "{00FF00}Ajudante";
                if( aInfo[ i ][ Moderador ] ) CargoAdmin = "{00FF00}Moderador";
                if( aInfo[ i ][ Admin ] ) CargoAdmin = "{00FF00}Administrador";
				if( pInfo[ i ][ AFK ] == 0 ) StatusOnline = "{00CD00}Online";
				if( pInfo[ i ][ AFK ] == 1 ) StatusOnline = "{FF0000}Ausente";
				format(String, sizeof(String), "{1E90FF}%s {FFFFFF}[ %s {FFFFFF}] [ %s {FFFFFF}]\n", PlayerName( i ) , CargoAdmin, StatusOnline);
				strcat(StringCat, String);
				ContarAdmins++;
			}
		}
	if(ContarAdmins == 0)
	{
	    ShowPlayerDialog(playerid, DIALOG_MENSAGEM, DIALOG_STYLE_MSGBOX, "{FF0000}0 {FFFFFF}Admins Online", "{FF0000}Não tem Administradores online!", "Fechar", "");
	}
	else if(ContarAdmins == 1)
	{
	    format(String, sizeof(String), "{00FF00}1 {FFFFFF}Admin Online", ContarAdmins);
	    ShowPlayerDialog(playerid, DIALOG_MENSAGEM, DIALOG_STYLE_MSGBOX, String, StringCat, "Fechar", "");
	}
	else
	{
	    format(String, sizeof(String), "{00FF00}%d {FFFFFF}Admins Online", ContarAdmins);
	    ShowPlayerDialog(playerid, DIALOG_MENSAGEM, DIALOG_STYLE_MSGBOX, String, StringCat, "Fechar", "");
	}
	return 1;
}
E ja aproveitando está dando 2 warning aqui !
Code:
				if( pInfo[ i ][ AFK ] == 0 ) StatusOnline = "{00CD00}Online";
				if( pInfo[ i ][ AFK ] == 1 ) StatusOnline = "{FF0000}Ausente";
Reply
#2

PHP Code:
    if(!strcmp(cmd"/admins"true))
    {
        new 
admladmmdrhlpcrg;
        new 
stg2[1500];
        
strcat(stg2"Nome\tCargo\tStatus\n");
        foreach(
Playeri)
        {
            if(
DOF2_GetInt(f(i), "AdminL") == 1)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
adml ++;
                     
format(gStrsizeof(gStr), "{FFFFFF}%s[{76EEC6}%d{FFFFFF}] \t{FF1493}Dono(a) \t{00FF00}Online\n"PlayerName(i), i);
                    
strcat(stg2gStr);
                }
            }
            if(
aInfo[i][Admin] == && DOF2_GetInt(f(i), "AdminL") == 0)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
adm ++;
                     
format(gStrsizeof(gStr), "{FFFFFF}%s[{76EEC6}%d{FFFFFF}] \t{1E90FF}Administrador(a) \t{00FF00}Online\n"PlayerName(i), i);
                     
strcat(stg2gStr);
                }
            }
              if(
aInfo[i][Moderador] == && DOF2_GetInt(f(i), "AdminL") == 0)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
mdr ++;
                     
format(gStrsizeof(gStr), "{FFFFFF}%s[{76EEC6}%d{FFFFFF}] \t{FF7F24}Moderador(a) \t{00FF00}Online\n"PlayerName(i), i);
                     
strcat(stg2gStr);
                }
            }
               if(
aInfo[i][Ajudante] == && DOF2_GetInt(f(i), "AdminL") == 0)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
hlp ++;
                     
format(gStrsizeof(gStr), "{FFFFFF}%s[{76EEC6}%d{FFFFFF}] \t{43CD80}Ajudante \t{00FF00}Online\n"PlayerName(i), i);
                     
strcat(stg2gStr);
                }
            }
               if(
aInfo[i][Corregedor] == && DOF2_GetInt(f(i), "AdminL") == 0)
            {
                if(
aInfo[i][Oculto] == false)
                {
                    
crg ++;
                     
format(gStrsizeof(gStr), "{FFFFFF}%s[{76EEC6}%d{FFFFFF}] \t{98F5FF}Corregedor(a) \t{00FF00}Online\n"PlayerName(i), i);
                     
strcat(stg2gStr);
                }
            }
        }
        new 
teste crg+adml+adm+mdr+hlp;
        if(
teste == 0) return SendClientMessage(playeridCOR_ERRO"| INFO ADMIN |{FFFFFF} Nenhum Staff online no momento [L.S]!");
        
format(hFilesizeof(hFile), "{FFFFFF}•{FFFFFF} Staff PFL Online [{76EEC6}%d{FFFFFF}]",teste);
        
ShowPlayerDialog(playerid1447DIALOG_STYLE_TABLIST_HEADERShFilestg2"Fechar""");
        return 
1;
    } 
Tenta ai, caso ajude adapte para seu uso!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)