[Help] Online Admins/Vips - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Online Admins/Vips (
/showthread.php?tid=574909)
[Help] Online Admins/Vips -
kalanerik99 - 21.05.2015
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;
}
Re: [Help] Online Admins/Vips -
Midzi - 21.05.2015
Put
Код:
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, ""COL_GREEN"UGF - Online Admins / Vips", string, "OK", "");
after loop?
Re: [Help] Online Admins/Vips -
Konstantinos - 21.05.2015
You overwrite fstring.
PHP код:
CMD:admins(playerid, params[])
{
new string[512] = ""COL_GREEN"Online Administrators:\n\n"COL_WHITE"", fstring[256] = ""COL_GREEN"Online Very Important Players:\n\n"COL_WHITE"";
foreach(Player, i) //foreach(new i : Player)
{
if(PlayerInfo[i][AdminLevel] > 0) format(string, sizeof(string), "%s^ %s(%i) (Admin Level %d)\n", string, PlayerName(i), i, PlayerInfo[i][AdminLevel]);
if(PlayerInfo[i][VIP]) format(fstring, sizeof(fstring), "%s^ %s(%i)\n", fstring, PlayerName(i), i);
}
strcat(string, fstring);
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, ""COL_GREEN"UGF - Online Admins / Vips", string, "OK", "");
return 1;
}