cmd_admins should return a value
#1

pawn Код:
CMD:admins(playerid, params[])
{
        new string[128], count = 0;
        SendClientMessage(playerid, COLOR_WHITE, "Admins Online");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdmin] >= 1)
                {
                    if(PlayerInfo[i][pAdminDuty] == 1)
                    {
                        if(IsAFK[i] == 0)
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {FF0000}Roleplaying", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                        else
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {FF6600}Away From Keyboard", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                    }
                    else
                    {
                        if(IsAFK[i] == 0)
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {4BB74C}Administrating", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                        else
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {FF6600}Away From Keyboard", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                    }
                }
            }
        if(count == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "There are currently no Admins online.");
        }
        return 1;
    }
}
Whats wrong with the code?
Reply
#2

Just add
Код:
return 1;
above last bracket.

Код:
CMD:admins(playerid, params[])
{
        new string[128], count = 0;
        SendClientMessage(playerid, COLOR_WHITE, "Admins Online");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdmin] >= 1)
                {
                    if(PlayerInfo[i][pAdminDuty] == 1)
                    {
                        if(IsAFK[i] == 0)
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {FF0000}Roleplaying", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                        else
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {FF6600}Away From Keyboard", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                    }
                    else
                    {
                        if(IsAFK[i] == 0)
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {4BB74C}Administrating", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                        else
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {FF6600}Away From Keyboard", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                    }
                }
            }
        if(count == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "There are currently no Admins online.");
        }
        return 1;
    }
return 1;
}
Reply
#3

Quote:
Originally Posted by zaibaslr2
Посмотреть сообщение
Just add
Код:
return 1;
above last bracket.

Код:
CMD:admins(playerid, params[])
{
        new string[128], count = 0;
        SendClientMessage(playerid, COLOR_WHITE, "Admins Online");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdmin] >= 1)
                {
                    if(PlayerInfo[i][pAdminDuty] == 1)
                    {
                        if(IsAFK[i] == 0)
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {FF0000}Roleplaying", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                        else
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {FF6600}Away From Keyboard", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                    }
                    else
                    {
                        if(IsAFK[i] == 0)
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {4BB74C}Administrating", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                        else
                        {
                            format(string, sizeof(string), "%s: %s(ID: %d) Status: {FF6600}Away From Keyboard", AdminRankName(i), RemoveUnderScore(i), i);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            count++;
                        }
                    }
                }
            }
        if(count == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "There are currently no Admins online.");
        }
        return 1;
    }
return 1;
}
Oh yeah, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)