SA-MP Forums Archive
[Ajuda] Admins - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Admins (/showthread.php?tid=486519)



Admins - iMix - 09.01.2014

Alguem me ajuda a arruma esse comando ja tentei mas nгo consegui quem poder ajuda eu agradeзo.

Код:
#include a_samp
#include zcmd

command(administradores,playerid, params[])
{
    new AdminList[3000], AdminON = 0, Name[24], i;
	SendAdminText(playerid, "/admins", params);
	do {
	   i++;
	   if ( IsPlayerConnected ( i ) )
           GetPlayerName(i, Name, sizeof(Name));
           if (IsPlayerAdmin(i)) {
              AdminON++;
			  format(AdminList, 3000, "{FFFFFF}%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
			  continue;
	       }
		   if (APlayerData[i][PlayerLevel] > 1) {
              AdminON++;
			  format(AdminList, 3000, "{FFFFFF}%s%s (%i) й um %s [level %i]\n", AdminList, Name, i, AdminLevelName[APlayerData[i][PlayerLevel]], APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
		   }
	   }
	}
	while(i < MAX_PLAYERS);
	if( AdminON > 0)
	{
	   ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_MSGBOX, "{FFA500}#{FFFFFF}Administradores disponiveis:", AdminList, "OK", "");
	} else { GameTextForPlayer(playerid, "~r~SEM ADMINISTRADORES~n~~w~ONLINE", 4000, 5); }
	return 1;
}



Re: Admins - PT - 09.01.2014

tente

pawn Код:
command(administradores,playerid, params[])
{
    new string[1000], fstring[1000], xptc = 0, Name[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if (IsPlayerAdmin(i))
            {
                GetPlayerName(i, Name, sizeof(Name));
                format(fstring, 1000, "{FFFFFF}%s: %s (id: %i), Admin-Level: %i\n", AdminLevelName[APlayerData[i][PlayerLevel], Name, i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                strcat(string, fstring, 1000);
            }
            if (APlayerData[i][PlayerLevel] != 0)
            {
                GetPlayerName(i, Name, sizeof(Name));
                format(fstring, 3000, "{FFFFFF}%s (%i) й um %s [level %i]\n", Name, i, AdminLevelName[APlayerData[i][PlayerLevel]], APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list
                strcat(string, fstring, 1000);
            }
            xptc++;
        }
    }
    if(xptc == 0) return GameTextForPlayer(playerid, "~r~SEM ADMINISTRADORES~n~~w~ONLINE", 4000, 5);
    else ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_MSGBOX, "{FFFFFF}Administradores disponiveis:", string, "OK", "");
    return 1;
}



Re: Admins - Eudes - 09.01.2014

em zcmd nao se declara comando assim:
pawn Код:
command(administradores,playerid, params[])

o correto й assim:

pawn Код:
COMMAND:administradores(playerid, params[])
ou assim:

pawn Код:
CMD:administradores(playerid, params[])



Re: Admins - PT - 09.01.2014

Quote:
Originally Posted by Eudes
Посмотреть сообщение
em zcmd nao se declara comando assim:
pawn Код:
command(administradores,playerid, params[])

o correto й assim:

pawn Код:
COMMAND:administradores(playerid, params[])
ou assim:

pawn Код:
CMD:administradores(playerid, params[])
nao fala asneiras ta?

procure saber mais antes de falar.

Olhe:

https://sampforum.blast.hk/showthread.php?tid=91354


Re: Admins - Eudes - 09.01.2014

verdade PT, й pq nunca usei nem vi ninguem usar desta outra forma.


Re: Admins - iMix - 09.01.2014

PT, Continua dando erro olhe: http://tinypic.com/view.php?pic=4ha9u9&s=5







------------------------


Re: Admins - unamed - 09.01.2014

tente trocar
pawn Код:
command(administradores,playerid, params[])
por
pawn Код:
CMD:administradores(playerid,params[])



Re: Admins - iMix - 09.01.2014

Ainda continua o mesmo erro


Re: Admins - PT - 09.01.2014

vc tem ao menos

pawn Код:
#include "zcmd"
no topo?


Re: Admins - iMix - 09.01.2014

Deu obrigado. valeu ae