[Pedido] /admin em dialog
#1

queria que alguem pudesse me encinar ou ajuda a criar um comando /admins em dialog,para aparecer os admin logados na rcon
Reply
#2

alguem ai ajuda?
Reply
#3

Exemplo
Code:
if(!strcmp(cmd, "/admins", true)) 
{ 
    new string[200], rank[21], count; // if "200" is not enough and cut the text out in case you have many admins online, increase it. 
    for(new i; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i)) //foreach(new i : Player) 
    { 
        switch (PInfo[i][AdminLevel]) 
        { 
            case 0: continue; 
            case 1: rank = "Moderator"; 
            case 2: rank = "Junior Administrator"; 
            case 3: rank = "Senior Administrator"; 
            case 4: rank = "Head Administrator"; 
            case 5: rank = "Server Owner"; 
        } 
        format(string, sizeof(string), "%s{FFFFFF}%s: {1B8AE4}%s(%d)", string, rank, PlayerName(i), i); 
        ++count; 
    } 
    if (!count) return SendClientMessage(playerid, -1, "No admins online"); 
    else ShowPlayerDialog(playerid, 364, DIALOG_STYLE_MSGBOX, "Server staff currently online:", string, "Close", ""); 
    return 1; 
}
Reply
#4

Isso mostrarб os administradores RCON online:
Code:
CMD:radmins(playerid)
{
	new name[MAX_PLAYER_NAME], str[256];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerAdmin(i))
            {
                GetPlayerName(i, name, sizeof(name));
                if(str[0] == EOS) format(str, sizeof(str), "{00FF00}Administrador(es) RCON online:\n");
				format(str, sizeof(str), "%s\n{828282}%s (ID: %i)", str, name, i);
			}
		}
	}
	if(str[0] == EOS) format(str, sizeof(str), "{FF0000}Nenhum admin RCON online");
	ShowPlayerDialog(playerid, 3295, DIALOG_STYLE_MSGBOX, "RCON Admins", str, "Fechar", "");
	return 1;
}
Reply
#5

Quote:
Originally Posted by RodrigoMSR
View Post
Isso mostrarб os administradores RCON online:
Code:
CMD:radmins(playerid)
{
	new name[MAX_PLAYER_NAME], str[256];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerAdmin(i))
            {
                GetPlayerName(i, name, sizeof(name));
                if(str[0] == EOS) format(str, sizeof(str), "{00FF00}Administrador(es) RCON online:\n");
				format(str, sizeof(str), "%s\n{828282}%s (ID: %i)", str, name, i);
			}
		}
	}
	if(str[0] == EOS) format(str, sizeof(str), "{FF0000}Nenhum admin RCON online");
	ShowPlayerDialog(playerid, 3295, DIALOG_STYLE_MSGBOX, "RCON Admins", str, "Fechar", "");
	return 1;
}
vlw ae funcionou
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)