[Ajuda] colocar status de adm(ocupado e disponivel)
#9

Quote:
Originally Posted by Hades12
Посмотреть сообщение
cara esse й o comando: queria colocar o status nele.

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 {FFFFFF}%s {FFFFFF}(id: {FF8000}%i{FFFFFF}) - {FF8000}%s {FFFFFF}(Level de adm {FF8000}%i{FFFFFF})\n", AdminList, Name, i, AdminLevelName[APlayerData[i][PlayerLevel]], 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)
{
// Add all admin players to the list
format(AdminList, 500, "%s {FFFFFF}%s {FFFFFF}(id: {FF8000}%i{FFFFFF}) - {FF8000}%s {FFFFFF}(Level de adm {FF8000}%i{FFFFFF})\n", AdminList, Name, i, AdminLevelName[APlayerData[i][PlayerLevel]], 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, "Admins Online:", AdminList, "OK", "Cancelar");
else
SendClientMessage(playerid, 0xFF0000FF, "Administraзгo Offline no Momento!"); // No admins are online
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}
Tente assim e utilizando o sistema que jб deixei acima.
PHP код:
COMMAND:admins(playeridparams[])
{
    new 
AdminList[500], Name[24];
    
SendAdminText(playerid"/admins"params);
    if(
APlayerData[playerid][LoggedIn] == false) return SendClientMessage(playerid, -1"[ ERRO ] {FF0000}Vocк nгo estб logado no servidor!");
    for(new 
iMAX_PLAYERSi++)
    {
        if (
IsPlayerConnected(i))
        {
            
GetPlayerName(iNamesizeof(Name));
            if(
IsPlayerAdmin(i))
            {
                
format(AdminList500"%s {FFFFFF}%s {FFFFFF}(id: {FF8000}%i{FFFFFF}) - {FF8000}%s {FFFFFF}(Level de adm {FF8000}%i{FFFFFF}) [%s]\n"AdminListNameiAdminLevelName[APlayerData[i][PlayerLevel]], APlayerData[i][PlayerLevel], PegarStatus(i));
                continue;
            }
            if(
APlayerData[i][PlayerLevel] > 0format(AdminList500"%s {FFFFFF}%s {FFFFFF}(id: {FF8000}%i{FFFFFF}) - {FF8000}%s {FFFFFF}(Level de adm {FF8000}%i{FFFFFF}) [%s]\n"AdminListNameiAdminLevelName[APlayerData[i][PlayerLevel]], APlayerData[i][PlayerLevel], PegarStatus(i));
        }
    }
    if(
strlen(AdminList) > 0ShowPlayerDialog(playeridDialogNoResponseDIALOG_STYLE_MSGBOX"Admins Online:"AdminList"OK""Cancelar");
    else 
SendClientMessage(playerid0xFF0000FF"Administraзгo Offline no Momento!");
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)