[Help] Online Admins/Vips
#1

Hi!
I want that it will shot admins/vips dialog like that.
There is something wrong with code!
Can some tell me how to fix it(or fix it)?
Regards DarkBo$$

Код:
Online Administators:
(if none clear here)
[UGF]DarkBo$$(0) (AdminLevel 5)
[UGF]RedDragon(1) (AdminLevel 3)
...

Online Very Important Players:
(if none clear here)
[UGF]DarkBo$$(0)
....
Код:
CMD:admins(playerid,params[])
{
new string[1024];
new fstring[1024];
foreach(Player, i)
{
if(PlayerInfo[i][AdminLevel] > 0)
{
strcat(fstring, ""COL_GREEN"Online Administrators:\n\n");
format(fstring, sizeof(fstring), ""COL_WHITE"^ %s(%i) (Admin Level %d)\n",PlayerName(i),i,PlayerInfo[i][AdminLevel]);
}
if(PlayerInfo[i][VIP])
{
strcat(fstring, ""COL_GREEN"Online Very Important Players:\n\n");
format(fstring, sizeof(fstring), ""COL_WHITE"^ %s(%i)\n",PlayerName(i),i);
}
strcat(string, fstring);
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, ""COL_GREEN"UGF - Online Admins / Vips", string, "OK", "");
}
return 1;
}
Reply
#2

Put
Код:
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, ""COL_GREEN"UGF - Online Admins / Vips", string, "OK", "");
after loop?
Reply
#3

You overwrite fstring.

PHP код:
CMD:admins(playeridparams[])
{
    new 
string[512] = ""COL_GREEN"Online Administrators:\n\n"COL_WHITE""fstring[256] = ""COL_GREEN"Online Very Important Players:\n\n"COL_WHITE"";
    foreach(
Playeri//foreach(new i : Player)
    
{
        if(
PlayerInfo[i][AdminLevel] > 0format(stringsizeof(string), "%s^ %s(%i) (Admin Level %d)\n"stringPlayerName(i), iPlayerInfo[i][AdminLevel]);
        if(
PlayerInfo[i][VIP]) format(fstringsizeof(fstring), "%s^ %s(%i)\n"fstringPlayerName(i), i);
    }
    
strcat(stringfstring);
    
ShowPlayerDialog(playeridDIALOG_ADMINSDIALOG_STYLE_MSGBOX""COL_GREEN"UGF - Online Admins / Vips"string"OK""");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)