SA-MP Forums Archive
Lil help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Lil help (/showthread.php?tid=269483)



Lil help - FireCat - 16.07.2011

pawn Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params
    new string[450],count = 0,level[100][20];
    for(new i = 0;i < MAX_PLAYERS; i++)
    {
        if(PInfo[i][Level] > 2)
        {
            if(PInfo[i][Level] == 2) { format(level[i],30,"%s","Newbie Administrator"); }
            if(PInfo[i][Level] == 3) { format(level[i],30,"Lead Administrator"); }
            if(PInfo[i][Level] == 4) { format(level[i],30,"%s","Head Administrator"); }
            if(PInfo[i][Level] == 5) { format(level[i],30,"%s","Master/Owner Administrator"); }
            format(string,sizeof(string),"%s"lgreen2"%s(ID:%d) - %s \n",string,GetPName(i),i,PInfo[i][Level],level[i]);
            ShowPlayerDialog(playerid,4565,0,"Admins Online",string,"OK","");
            count++;
        }
        else if(count == 0)
        {
            ShowPlayerDialog(playerid,4565,0,"Admins Online",""lred"No Admins Online!","OK","");
        }
    }
    return 1;
}
Like it doesn't show the var of the level.
I want it to do
Firecat(id: ..) Head Administrator (its an example)
I bet you're wondering why the %s leading to string for.
It's to show other admins otherwise it would only show 1 admin even if there were more online.