Admins Hid Until They Type /aduty
#2

pawn Код:
new VisableDuty[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
VisableDuty[playerid] = 0;
return 1;
}

//On your /aduty command add
VisableDuty[playerid] = 1;

//On your /oduty command add
VisableDuty[playerid] = 0;

//Now back to /admins
COMMAND:admins(playerid, params[])
{
    // 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 i; i < MAX_PLAYERS; i++)
        {
            // Check if this player is connected
            if (IsPlayerConnected(i))
            {
                // Get the name of the player
                GetPlayerName(i, Name, sizeof(Name));

                // Check if this player is an RCON admin
                if (IsPlayerAdmin(i))
                {
                    // Add all admin players to the list
                    format(AdminList, 500, "%s%s: %s (id: %i), admin-level: %i (RCON admin)\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[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)
                {
                    if(VisableDuty[i] == 1)
                    {
                    // Add all admin players to the list
                    format(AdminList, 500, "%s%s: %s (id: %i), admin-level: %i\n", AdminList, AdminLevelName[APlayerData[i][PlayerLevel]], Name, i, APlayerData[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(playerid, DialogNoResponse, DIALOG_STYLE_MSGBOX, "European Trucking Admins:", AdminList, "OK", "Cancel");
        else
            SendClientMessage(playerid, 0xFF0000FF, "No admin online"); // No admins are online
    }
    else
        return 0;

    // Let the server know that this was a valid command
    return 1;
}
Should work
Reply


Messages In This Thread
Admins Hid Until They Type /aduty - by [LHT]Bally - 12.01.2013, 23:44
Re: Admins Hid Until They Type /aduty - by Infinity90 - 12.01.2013, 23:49
Re: Admins Hid Until They Type /aduty - by [LHT]Bally - 13.01.2013, 00:08
Re: Admins Hid Until They Type /aduty - by Threshold - 13.01.2013, 00:11
Re: Admins Hid Until They Type /aduty - by [LHT]Bally - 13.01.2013, 00:11
Re: Admins Hid Until They Type /aduty - by Infinity90 - 13.01.2013, 00:33
Re: Admins Hid Until They Type /aduty - by [LHT]Bally - 13.01.2013, 00:40
Re: Admins Hid Until They Type /aduty - by [LHT]Bally - 13.01.2013, 15:55
Re: Admins Hid Until They Type /aduty - by Infinity90 - 13.01.2013, 16:00
Re: Admins Hid Until They Type /aduty - by [LHT]Bally - 13.01.2013, 20:33

Forum Jump:


Users browsing this thread: 1 Guest(s)