SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 24/08/2011, 09:48 AM   #1
Hoss
Huge Clucker
 
Join Date: Sep 2010
Posts: 200
Reputation: 85
Default Please help

Code:
dcmd_admins(playerid,params[])
{
    #pragma unused params
    new string[256], result[256];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(Variables[i][Level] >0 && Variables[i][Level] < 10)
        {
            format(string, sizeof(string), "{FF0000}ADMINISTRATOR: %s ID[%d]{15D4ED}[Level %d]\n", RealName[i],playerid, Variables[i][Level]);
            strcat(result, string, sizeof(result));      
        }
    }
    ShowPlayerDialog(playerid, 5591, 0, "{1B1BE0}Online Admins:", result, "Done", ""); 
    return 1;
}
Can anyone help me to make 2 admin lines,cuz when here are 2+ admins in admin list is only 1 admin
Help me please
Hoss is offline  
Old 24/08/2011, 09:50 AM   #2
Tigerbeast11
Gangsta
 
Join Date: Aug 2009
Posts: 771
Reputation: 2
Default Re: Please help

I'll give you mine from XAdmin:

Code:
dcmd_admins(playerid,params[]) {
	#pragma unused params
	new Count,i,name[24],string[128];
	for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerXAdmin(i)) Count++;
	if(!Count) return SendClientMessage(playerid,green,"Admins Online: None");
	if(Count == 1) {
	    for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerXAdmin(i)) break;
	    GetPlayerName(i,name,24); format(string,128,"Admins Online: %s [LVL:%d] [ID:%d]",name,Variables[i][Level],i);
	    return SendClientMessage(playerid,green,string);
	}
	if(Count >= 1) {
	    new bool:First = false;
	    for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerXAdmin(i)) {
     		GetPlayerName(i,name,24);
			if(!First) { format(string,128,"Admins Online: %s [LVL:%d] [ID:%d],",name,Variables[i][Level],i); First = true; }
	        else format(string,128,"%s %s [LVL:%d] [ID:%d]",string,name,Variables[i][Level],i);
	    }
	    return SendClientMessage(playerid,green,string);
	}
	return 1;
}
Tigerbeast11 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 04:31 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.