27.01.2013, 19:50
Hi,
I'm doing a function but I have a problem, first I will explain the behavior of this "function".
I want to get the name of "Administrator Level" by a number.
0 = Junior Administrator
0 = number(quantitative value)
Junior Administrator = Administrator level name(qualitative value)
For example someone wants to know how is called the level "1".
This function will send the name.
Under my "CMD:makeadmin":
It prints in game:
The help will be appreciated.
I'm doing a function but I have a problem, first I will explain the behavior of this "function".
I want to get the name of "Administrator Level" by a number.
0 = Junior Administrator
0 = number(quantitative value)
Junior Administrator = Administrator level name(qualitative value)
For example someone wants to know how is called the level "1".
This function will send the name.
PHP код:
stock GetAdmNameLevelByNumber(lvl)
{
new string[21];
switch(lvl)
{
case 0: string = "Newbie";
case 1: string = "Operator";
case 2: string = "Moderator";
case 3: string = "Junior Administrator";
case 4: string = "Senior Administrator";
case 5: string = "Head Administrator";
case 6: string = "Hero Administrator";
case 7: string = "Community Owner";
}
return lvl;
}
PHP код:
//stuff here
//stuff here
//stuff here
new string[128], str2[128];
format(string, sizeof(string), "You have made %s, Level %s(%d)", Name(player), GetAdmNameLevelByNumber(alevel), alevel);
SendClientMessage(playerid, SUCCESS, string);
format(str2, sizeof(str2), "Administrator %s has made you %s(%d)", Name(playerid), GetAdmNameLevelByNumber(alevel), alevel);
SendClientMessage(player, SUCCESS, str2);
PlayerInfo[player][pAdmin] = alevel;
PHP код:
You have made Drake, Level @Drake(7)
Administrator Drake has made you @Drake(7)