[Ajuda] Comando nгo surte efeito
#1

Simplesmente, nгo surte efeito:

PHP код:
COMMAND:admins(playeridparams[])
{
    
// Setup local variables
    
new AdminList[500], Name[24];
    
// Send the command to all admins so they can see it
    
SendAdminText(playerid"/admins"params);
    
// Check if the player has logged in
    
if (APlayerData[playerid][LoggedIn] == true)
    {
        
// Scan through all players
        
for (new iMAX_PLAYERSi++)
        {
            
// Check if this player is connected
            
if (IsPlayerConnected(i))
            {
                
// Get the name of the player
                
GetPlayerName(iNamesizeof(Name));
                
// Check if this player is an RCON admin
                
if (IsPlayerAdmin(i))
                {
                    
// Add all admin players to the list
                    
format(AdminList500"%s%s: %s (id: %i), Level de admin: %i (RCON admin)\n"AdminListAdminLevelName[APlayerData[i][PlayerLevel]], NameiAPlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                    // Re-start the for loop (skipping the remaining code for this iteration)
                    
continue;
                }
                
//Check if that player is an admin (using the PlayerLevel)
                
if (APlayerData[i][PlayerLevel] > 0)
                {
                    
// Add all admin players to the list
                    
format(AdminList500"%s%s: %s (id: %i), Level de admin: %i\n"AdminListAdminLevelName[APlayerData[i][PlayerLevel]], NameiAPlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                
}
            }
        }
        
// Check if there were admin-names added to the list
        
if (strlen(AdminList) > 0)
            
ShowPlayerDialog(playeridDialogNoResponseDIALOG_STYLE_LIST"Admins Online:"AdminList"OK""Cancelar");
        else
            
SendClientMessage(playerid0xFF0000FF"[ Thunder Truck ]: Administraзгo Indisponнvel no momento!"); // No admins are online
    
}
    else
        return 
0;
    
// Let the server know that this was a valid command
    
return 1;

O que pode ser?
Reply
#2

Tenta este ...

pawn Код:
COMMAND:admins(playerid, params[])
{
    new AdminList[500], Name[24], s[100];
    SendAdminText(playerid, "/admins", params);
    if (APlayerData[playerid][LoggedIn] == true)
    {
        for (new i; i < MAX_PLAYERS; i++)
        {
            GetPlayerName(i, Name, sizeof(Name));
            if (APlayerData[i][PlayerLevel] > 0 && IsPlayerConnected(i))
            {
                format(AdminList, 500, "%s%s: %s (id: %i), Level de admin: %i\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[i][PlayerLevel]);
                strcat(s, AdminList);
            }
        }
        if (strlen(AdminList) > 0)
            ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_MSGBOX, "Admins Online:", s, "OK", " ");
        else SendClientMessage(playerid, 0xFF0000FF, "[TCB] Nгo tem admins online!");
    }
    return 1;
}
Reply
#3

Nгo surtiu efeito algum..
Reply
#4

pawn Код:
CMD:admins(playerid, params[])
{
    new DialogThiago[1200];
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerDados[i][Escondido] == false)
            {
                if(PlayerDados[i][Admin] == 2) AdminNivel = "2";
                if(PlayerDados[i][Admin] == 3) AdminNivel = "3";
                if(PlayerDados[i][Admin] == 4) AdminNivel = "4";
                if(PlayerDados[i][Admin] == 5) AdminNivel = "5";
                if(PlayerDados[i][Escondido] == false)
                {
                if(PlayerDados[i][Admin] > 1)
                    {
                        format(String, 300, "   {009DFF}[ID:%i] - {FFFFFF}%s{009DFF} - [Nнvel: %s]\n", i, Nome(i), AdminNivel); // Add the name of the admin-player to the list
                        strcat(DialogThiago, String);
                    }
                }
            }
        }
    }
    if (strlen(DialogThiago) > 0)
        ShowPlayerDialog(playerid, 9000, DIALOG_STYLE_MSGBOX, "{FF0000}Administradores Online", DialogThiago, "Fechar", ""); // Depois Mude se quiser ^^
    else
        SendClientMessage(playerid, BRANCO, "{FF0000}Administraзгo offline no momento !"); // No admins are online
       
    return true;
}
Caso de erro, substitua de acordo com seu Script!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)