Tranformar meu /admins em dialogo -
Pietrotm2013 - 02.05.2013
eae galera vim pedir uma coisinha pra vcs й transformar meu /admins em dialogo pff!!!
pawn Код:
CMD:admins(playerid, params[])
{
new tot;
SendClientMessage(playerid, 0x99FF00AA, "***Admininstradores Onlines***");
loop(i, MAX_PLAYERS) {
if (IsPlayerConnected(i)) {
if (PlayerInfo[i][AdminLevel] >= 1) {
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(i, PlayerName, sizeof(PlayerName));
tot++;
format(szString, sizeof(szString), "* Admin %s(%d) (Nivel: %d) (%s)", PlayerName, i, PlayerInfo[i][AdminLevel], GetLevelAdmin(i));
SendClientMessage(playerid, 0x99FF00AA, szString);
}
}
}
if (tot == 0) {
SendClientMessage(playerid, 0x99FF00AA, "Nгo hб admins online");
}
else {
format(szString, sizeof(szString), "Hб ~~ %d ~~ Admins online..", tot);
SendClientMessage(playerid, 0x99FF00AA, szString);
}
return 1;
}
Re: Tranformar meu /admins em dialogo -
Alado - 02.05.2013
Cara, й sу vocк trocar 'SendClientMessage' por 'ShowPlayerDialog', nгo tem segredo.. Isso й muito fбcil, tente fazer, se vocк nгo conseguir, posta novamente que eu ti ajudo a arrumar..
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Re: Tranformar meu /admins em dialogo -
AlucardSnow - 02.05.2013
Coloca ae =)
ShowPlayerDialog
pawn Код:
// 8001, 8002, 8003 й o ID das dialogs, confira para nгo dar conflito.
CMD:admins(playerid, params[])
{
new tot;
loop(i, MAX_PLAYERS) {
if (IsPlayerConnected(i)) {
if (PlayerInfo[i][AdminLevel] >= 1) {
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(i, PlayerName, sizeof(PlayerName));
tot++;
format(szString, sizeof(szString), "***Admininstradores Onlines***\n* Admin %s(%d) (Nivel: %d) (%s)", PlayerName, i, PlayerInfo[i][AdminLevel], GetLevelAdmin(i));
ShowPlayerDialog(playerid, 8001, DIALOG_STYLE_MSGBOX, "Admins", szString, "Ok", "");
}
}
}
if (tot == 0) {
ShowPlayerDialog(playerid, 8002, DIALOG_STYLE_MSGBOX, "Admins", "Nгo hб admins online", "Ok", "");
}
else {
format(szString, sizeof(szString), "Hб ~~ %d ~~ Admins online..", tot);
ShowPlayerDialog(playerid, 8003, DIALOG_STYLE_MSGBOX, "Admins", szString, "Ok", "");
}
return 1;
}
Re: Tranformar meu /admins em dialogo -
PT - 02.05.2013
Ola
Tenta ae
pawn Код:
#define PTD 1231 // cuidado com os conflitos
CMD:admins(playerid, params[])
{
new str[1000], pt[256], adm = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (PlayerInfo[i][AdminLevel] >= 1)
{
new PTName[MAX_PLAYER_NAME];
GetPlayerName(i, PTName, sizeof(PTName));
format(str, sizeof(str), "* Admin %s(%d) (Nivel: %d) (%s)\n", PTName, playerid, PlayerInfo[i][AdminLevel], GetLevelAdmin(i));
strcat(pt, str, sizeof(pt));
adm++;
}
}
}
if(adm == 0)
{
ShowPlayerDialog(playerid, PTD, DIALOG_STYLE_MSGBOX, ".:: - ADM's Online - ::.", "{FF0000}Nгo tem ADM's online.", "OK", "");
}
else
{
ShowPlayerDialog(playerid, PTD, DIALOG_STYLE_MSGBOX, ".:: - ADM's Online - ::.", pt, "OK", "");
}
return 1;
}
espero ajudar
PT