SA-MP Forums Archive
I have a problem with the admin ranks - 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: I have a problem with the admin ranks (/showthread.php?tid=646475)



I have a problem with the admin ranks - Barnwell - 17.12.2017

I have a problem with the admin ranks
The problem level 6 admin rank is not appear on the /admins cmd

pawn Код:
stock NameA(playerid)
{
    new name[88];
    if(pInfo[playerid][pAdmin] == 1) format(name, sizeof(name), "Junior Admin");
    else if(pInfo[playerid][pAdmin] == 2) format(name, sizeof(name), "Basic Admin");
    else if(pInfo[playerid][pAdmin] == 3) format(name, sizeof(name), "General Admin");
    else if(pInfo[playerid][pAdmin] == 4) format(name, sizeof(name), "Advanced Admin");
    else if(pInfo[playerid][pAdmin] >= 5) format(name, sizeof(name), "Senior Admin");
    else if(pInfo[playerid][pAdmin] >= 6) format(name, sizeof(name), "Head Admin");
    return name;
}
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}Administrators Online");
    foreach(Player, i)
    {
        if(pInfo[i][pAdmin])
        {
            format(string, sizeof(string), "%s %s{%d}", NameA(i), NameL(i),playerid);
            SendClientMessage(playerid, COLOR_WHITE, string);
        }
    }



Re: I have a problem with the admin ranks - Gameluner - 17.12.2017

Код:
stock NameA(playerid){
	new rank[80];
	switch(pInfo[playerid][pAdmin]){
                case 7: rank = "Management";
                case 6: rank = "Head Admin";
                case 5: rank = "Senior Admin";
		case 4: rank = "Advanced Admin";
		case 3: rank = "General Admin";
		case 2: rank = "Basic Admin";
		case 1: rank = "Junior Admin";
		default: rank = "Player";
	}
	return rank;
}
Usage:
Код:
SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}Administrators Online");
foreach(Player, i){
    if(pInfo[i][pAdmin] > 0){
        format(string, sizeof(string), "%s %s{%d}", NameA(i), NameL(i),playerid);
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
}



Re: I have a problem with the admin ranks - Barnwell - 17.12.2017

what is Hrac?


Re: I have a problem with the admin ranks - Gameluner - 17.12.2017

It's player in Czech.


Re: I have a problem with the admin ranks - xMoBi - 17.12.2017

use an array and put it on top of script

PHP код:
new const gAdminRanks[MAX_ADMINRANKS][] =
{
    {
"Player"}, // if level = 0
    
{"Junior Admin"}, // if level = 1
    
{"Basic Admin"}, // if level = 2
    
{"Advanced Admin"}, // if level = 3
    
{"Senior Admin"}, // if level = 4
    
{"Head Admin"}, // if level = 5
    
{"Executive Admin"// if level = 6
}; 
then in script

PHP код:
SendClientMessage(playeridCOLOR_WHITE"{FFFFFF}Administrators Online");
foreach(new 
Player)
{
    if(
pInfo[i][pAdmin])
    {
        
format(stringsizeof(string), "%s %s{%d}"gAdminRankspInfo[i][pAdmin] ], NameL(i),playerid);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }




Re: I have a problem with the admin ranks - Barnwell - 17.12.2017

Thanks +REP to Gameluner