/admins em Dialog -
Hauo - 17.08.2012
Entгo, como diz o titulo, eu gostaria de colocar o meu comando de /admins em Dialog.
Para os administradores online, mostrar eles online mas em dialog.
pawn Код:
if(!strcmp(cmdtext, "/admins", true))
{
SendClientMessage(playerid,0x008000AA, "[»] Administradores Online:");
new count=0;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)){
if(admin[i]){
new str[256];
new pname[24];
GetPlayerName(i, pname, 24);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(pAdmin[i] == 1){
format(str,sizeof(str),"%s (%d) » Administrador [Helper]", pname,i);
}
if(pAdmin[i] == 2){
format(str,sizeof(str),"%s (%d) » Administrador [Moderador]", pname,i);
}
if(pAdmin[i] == 3){
format(str,sizeof(str),"%s (%d) » Administrador [Geral]", pname,i);
}
if(pAdmin[i] == 4){
format(str,sizeof(str),"%s (%d) » Administrador [Master]", pname,i);
}
if(pAdmin[i] == 5){
format(str,sizeof(str),"%s (%d) » Administrador [Dono]", pname,i);
}
SendClientMessage(playerid, 0x0080FFAA, str);
count++;
}
}
}
if(count == 0)
{
SendClientMessage(playerid, Vermelho, "");
}
return 1;
}
Como coloco
Re: /admins em Dialog -
s4kuL - 17.08.2012
Eu acho que й isso:
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_MS GBOX, "Administradores:",str,"Fechar","");
Re: /admins em Dialog -
mau.tito - 17.08.2012
https://sampwiki.blast.hk/wiki/Strcat
Re: /admins em Dialog - rjjj - 17.08.2012
Aqui estб o seu comando em dialog

:
pawn Код:
if(!strcmp(cmdtext, "/admins", true))
{
new Count;
new const Ranks[][] =
{
"Helper",
"Moderador",
"Geral",
"Master",
"Dono"
};
new STR[1400];
for(new x = 0, y = GetMaxPlayers(); x != y; x++)
{
if(!IsPlayerConnected(x)) continue;
if(admin[x])
{
new NickName[25];
GetPlayerName(x, NickName, 25);
if(pAdmin[x] >= 1 && pAdmin[x] <= 5)
{
format(STR, 1400, "%s%s (%d) » Administrador [%s]\n", STR, NickName, x, Ranks[pAdmin[x] - 1]);
}
Count++;
}
}
Count || strcat(STR, "Nenhum administrador online.\n");
ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "Administradores Online", STR, "Fechar", "");
return 1;
}
Espero ter ajudado

.
Re: /admins em Dialog -
Hauo - 17.08.2012
Quote:
Originally Posted by rjjj
Aqui estб o seu comando em dialog  :
pawn Код:
if(!strcmp(cmdtext, "/admins", true)) { new Count; new const Ranks[][] = { "Helper", "Moderador", "Geral", "Master", "Dono" }; new STR[1400]; for(new x = 0, y = GetMaxPlayers(); x != y; x++) { if(!IsPlayerConnected(x)) continue; if(admin[x]) { new NickName[25]; GetPlayerName(x, NickName, 25); if(pAdmin[x] >= 1 && pAdmin[x] <= 5) { format(STR, 1400, "%s%s (%d) » Administrador [%s]\n", STR, NickName, x, Ranks[pAdmin[x] - 1]); } Count++; } } Count || strcat(STR, "Nenhum administrador online.\n"); ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "Administradores Online", STR, "Fechar", ""); return 1; }
Espero ter ajudado  .
|
Muito obrigado, seu cуdigo deu certo aqui, mas ficou com o seguinte warning: warning 219: local variable "Count" shadows a variable at a preceding level
Pode dizer como tiro
Re: /admins em Dialog -
Maklister - 17.08.2012
No topo do seu gamemode ja deve ter
troque o nome ou apague o new Count; do cmd /admins
Re: /admins em Dialog -
Hauo - 17.08.2012
Quote:
Originally Posted by Murilo_sousa
No topo do seu gamemode ja deve ter
troque o nome ou apague o new Count; do cmd /admins
|
Nгo nгo, olhei aqui e nгo tinha new Count; no topo do GM.
@Edit
Mas eu apaguei aqui, e saiu o warning. Obrigado.
Re: /admins em Dialog -
Maklister - 17.08.2012
Quote:
Originally Posted by Hauo
Nгo nгo, olhei aqui e nгo tinha new Count; no topo do GM.
@Edit
Mas eu apaguei aqui, e saiu o warning. Obrigado. 
|
ele estava definido em outro local ja