[Ajuda] Comando /admins
#1

Bom dia. Utilizo essa base para estudo e uso: https://sampforum.blast.hk/showthread.php?tid=459241

Nгo contйm muita coisa, mas era do que precisava. Criei alguns comandos /admins, mas todos falhos, entгo acabei me irritando e apagando ;-;

Dentro desse sistema, como ficaria esse cmd?
Reply
#2

Код:
CMD:admins(playerid)
{
	new i = 0, fmt[50], nome[24];
	
    while(i<MAX_PLAYERS)
	{
		if(pAdmin[i][Level])
		{
			GetPlayerName(i, nome, sizeof nome);
			format(fmt, sizeof fmt, "%s | Level %d", nome, pAdmin[i][Level]);
			SendClientMessage(playerid, -1, fmt);
		}
		
		i ++;
	}
    return 1;
}
Reply
#3

Код:
CMD:admins(playerid)
{
	new Nome[24];
	for(new i; i < MAX_PLAYERS; i++)
 	{
 	    if(pAdmin[i][Level] > 0)
 	    {
 	        GetPlayerName(i,Nome, sizeof Nome);
		format(frm,sizeof(frm), "%s | Level %d",Nome, pAdmin[i][Level]);
		SendClientMessage(playerid,1,frm);
 	    }
	}
	return 1;
}
Reply
#4

Quote:
Originally Posted by G4M30V3R
Посмотреть сообщение
Код:
CMD:admins(playerid)
{
	new i = 0, fmt[50], nome[24];
	
    while(i<MAX_PLAYERS)
	{
		if(pAdmin[i][Level])
		{
			GetPlayerName(i, nome, sizeof nome);
			format(fmt, sizeof fmt, "%s | Level %d", nome, pAdmin[i][Level]);
			SendClientMessage(playerid, -1, fmt);
		}
		
		i ++;
	}
    return 1;
}
Quote:
Originally Posted by vPunisheR
Посмотреть сообщение
Код:
CMD:admins(playerid)
{
	new Nome[24];
	for(new i; i < MAX_PLAYERS; i++)
 	{
 	    if(pAdmin[i][Level] > 0)
 	    {
 	        GetPlayerName(i,Nome, sizeof Nome);
		format(frm,sizeof(frm), "%s | Level %d",Nome, pAdmin[i][Level]);
		SendClientMessage(playerid,1,frm);
 	    }
	}
	return 1;
}
Obrigado aos dois. Uma ъltima dъvida. Como eu faria pro comando pegar a "descriзгo" dos leveis administrativos na stock?

pawn Код:
stock GetLevelAdmin(levelid)
{
    new str[50];
    if(levelid == 1)
    {
        str = "{8FF7BF}Helper";
    }
    else if (levelid == 2)
    {
        str = "{00CCFF}Moderador";
    }
    else if (levelid == 3)
    {
        str = "{0000FF}Administrador";
    }
    else if (levelid == 4)
    {
        str = "{FF0000}Inspetor";
    }
    else if (levelid == 5)
    {
        str = "{23E605}Gerente";
    }
    return str;
}
Reply
#5

@removido
Reply
#6

Consegui desenrolar hauaha

pawn Код:
CMD:admins(playerid)
{
    SendClientMessage(playerid, Vermelho, "• • • Administradores online • • •");

    new Name[50], frm[50];
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(pAdmin[i][Level] == 1)
        {
        GetPlayerName(i, Name, sizeof Name);
        format(frm,sizeof(frm), "{8FF7BF}%s | Helper", Name, pAdmin[i][Level]);
        SendClientMessage(playerid, -1, frm);
        }
        if(pAdmin[i][Level] == 2)
        {
        GetPlayerName(i, Name, sizeof Name);
        format(frm,sizeof(frm), "{00CCFF}%s | Moderador", Name, pAdmin[i][Level]);
        SendClientMessage(playerid, -1, frm);
        }
        if(pAdmin[i][Level] == 3)
        {
        GetPlayerName(i, Name, sizeof Name);
        format(frm,sizeof(frm), "{0000FF}%s | Administrador", Name, pAdmin[i][Level]);
        SendClientMessage(playerid, -1, frm);
        }
        if(pAdmin[i][Level] == 4)
        {
        GetPlayerName(i, Name, sizeof Name);
        format(frm,sizeof(frm), "{FF0000}%s | Inspetor", Name, pAdmin[i][Level]);
        SendClientMessage(playerid, -1, frm);
        }
        if(pAdmin[i][Level] == 5)
        {
        GetPlayerName(i, Name, sizeof Name);
        format(frm,sizeof(frm), "{23E605}%s | Gerente", Name, pAdmin[i][Level]);
        SendClientMessage(playerid, -1, frm);
        }
    }
    return 1;
}
Reply
#7

Usa a stock ali amigo, vai diminuir bastante o cуdigo.

Vocк pode usar assim:

GetLevelAdmin(pAdmin[i][Level])

Formatando ficaria:

format(frm, sizeof(frm), "%s", GetLevelAdmin(pAdmin[i][Level]));
Reply
#8

Код:
CMD:admins(playerid)
{
	new Nome[24];
	for(new i; i < MAX_PLAYERS; i++)
 	{
 	    if(pAdmin[i][Level] > 0)
 	    {
 	        GetPlayerName(i,Nome, sizeof Nome);
		format(frm,sizeof(frm), "%s | Level %d | %s",Nome, pAdmin[i][Level],GetLevelAdmin(playerid));
		SendClientMessage(playerid,1,frm);
 	    }
	}
	return 1;
}
Tenta assim amigo.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)