[Ajuda] Comando /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] Comando /admins (
/showthread.php?tid=297441)
[Ajuda] Comando /admins -
Slayer1 - 15.11.2011
Ei pessoal, eu tenho o comando /admins para mostra para os players os admins que estгo em serviзo, mas o que esta acontecendo й que quando o players faz o comando apenas aparece um admin, mesmo que estejam 5 admins em serviзo apenas aparece 1 ....
O comando й o seguinte:
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new count = 0;
SendClientMessage(playerid, COLOR_GREEN, "____________________[ Admins em Serviзo ]____________________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
new admtext[64];
if(PlayerInfo[i][pAdmin] == 1337) { admtext = "{00FF00}Dono"; }
else if(PlayerInfo[i][pAdmin] == 10) { admtext = "Administrador - Nнvel 10"; }
else if(PlayerInfo[i][pAdmin] == 15) { admtext = "Administrador - Nнvel 15"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Game-Master - Nнvel 2"; }
else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Game-Master - Nнvel 5"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Game-Master - Nнvel 1"; }
else { admtext = "Moderador Nivel 1"; }
if(IsPlayerConnected(i))
SendClientMessage(playerid, COLOR_GREEN, "_______________________________________________________________________");
{
GetPlayerName(i, sendername, sizeof(sendername));
if(PlayerInfo[i][pAdmin] >= 1 && AdminDuty[i] == 1)
{
format(string, 256, "%s - [ %s {FFFAFA}]", sendername, admtext);
count++;
}
}
}
SendClientMessage(playerid, COLOR_WHITE, string);
if(count == 0)
{
SendClientMessage(playerid,COLOR_RED,"[INFO:] De momento nгo estб nenhum membro da Staff em serviзo.");
}
}
return 1;
}
Re: [Ajuda] Comando /admins -
Pharrel - 15.11.2011
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
{
new count = 0;
SendClientMessage(playerid, COLOR_GREEN, "____________________[ Admins em Serviзo ]____________________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
new admtext[64];
switch(PlayerInfo[i][pAdmin])
{
case 1337: admtext = "{00FF00}Dono";
case 10: admtext = "Administrador - Nнvel 10";
case 15: admtext = "Administrador - Nнvel 15";
case 2: admtext = "Game-Master - Nнvel 2";
case 5: admtext = "Game-Master - Nнvel 5";
case 1: admtext = "Game-Master - Nнvel 1";
default: admtext = "Moderador Nivel 1";
}
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && AdminDuty[i] == 1)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "%s - [ %s {FFFAFA}]", sendername, admtext);
SendClientMessage(playerid, COLOR_WHITE, string);
count++;
}
}
}
if(count == 0) SendClientMessage(playerid,COLOR_RED,"[INFO:] De momento nгo estб nenhum membro da Staff em serviзo.");
return SendClientMessage(playerid, COLOR_GREEN, "_______________________________________________________________________");
}