SA-MP Forums Archive
Online /admins in Dialog - 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: Online /admins in Dialog (/showthread.php?tid=575167)



Online /admins in Dialog - KDark - 24.05.2015

How to Make this in a dialog form for online admins??

Quote:

if(strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, "{FFFFFF}————————————————————————————————————————— ——");
SendClientMessage(playerid, COLOR_BLUE, "Server staff currently online:");
//foreach(Player, i)
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PInfo[i][AdminLevel] > 0)
{
new rank[128];
if(PInfo[i][AdminLevel] == 1)
{
format(rank, sizeof(rank), "Moderator");
}
else if(PInfo[i][AdminLevel] == 2)
{
format(rank, sizeof(rank),"Junior Administrator");
}
else if(PInfo[i][AdminLevel] == 3)
{
format(rank, sizeof(rank),"Senior Administrator");
}
else if(PInfo[i][AdminLevel] == 4)
{
format(rank, sizeof(rank),"Head Administrator");
}
else if(PInfo[i][AdminLevel] == 5)
{
format(rank, sizeof(rank),"Server Owner");
}
format(string, sizeof(string), "{FFFFFF}%s: {1B8AE4}%s(%d)",rank, PlayerName(i), i);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
}
SendClientMessage(playerid, COLOR_GREEN, "{FFFFFF}————————————————————————————————————————— ——");
}
return 1;
}




Re: Online /admins in Dialog - Konstantinos - 24.05.2015

PHP код:
if(!strcmp(cmd"/admins"true))
{
    new 
string[200], rank[21], count// if "200" is not enough and cut the text out in case you have many admins online, increase it.
    
for(new ii<MAX_PLAYERSi++) if(IsPlayerConnected(i)) //foreach(new i : Player)
    
{
        switch (
PInfo[i][AdminLevel])
        {
            case 
0: continue;
            case 
1rank "Moderator";
            case 
2rank "Junior Administrator";
            case 
3rank "Senior Administrator";
            case 
4rank "Head Administrator";
            case 
5rank "Server Owner";
        }
        
format(stringsizeof(string), "%s{FFFFFF}%s: {1B8AE4}%s(%d)"stringrankPlayerName(i), i);
        ++
count;
    }
    if (!
count) return SendClientMessage(playerid, -1"No admins online");
    else 
ShowPlayerDialog(playerid364DIALOG_STYLE_MSGBOX"Server staff currently online:"string"Close""");
    return 
1;




Re: Online /admins in Dialog - KDark - 25.05.2015

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
PHP код:
if(!strcmp(cmd"/admins"true))
{
    new 
string[200], rank[21], count// if "200" is not enough and cut the text out in case you have many admins online, increase it.
    
for(new ii<MAX_PLAYERSi++) if(IsPlayerConnected(i)) //foreach(new i : Player)
    
{
        switch (
PInfo[i][AdminLevel])
        {
            case 
0: continue;
            case 
1rank "Moderator";
            case 
2rank "Junior Administrator";
            case 
3rank "Senior Administrator";
            case 
4rank "Head Administrator";
            case 
5rank "Server Owner";
        }
        
format(stringsizeof(string), "%s{FFFFFF}%s: {1B8AE4}%s(%d)"stringrankPlayerName(i), i);
        ++
count;
    }
    if (!
count) return SendClientMessage(playerid, -1"No admins online");
    else 
ShowPlayerDialog(playerid364DIALOG_STYLE_MSGBOX"Server staff currently online:"string"Close""");
    return 
1;

Thank You Very Much It Works..