Admin Rank in Admin chat
#1

Hey
how can i make that the Admin Rang will show in the admin chat? /a
Examples:
Owner XXX[ID]: Text
Server Admin XX[ID]: Text
Reply
#2

in gm I downloaded, that is created like this:
Код:
stock RPALN(playerid)
{
	new name[32];
	if(PlayerInfo[playerid][pAdmin] == 1) format(name, sizeof(name), "Secret Administrator");
	else if(PlayerInfo[playerid][pAdmin] == 2) format(name, sizeof(name), "Trial Administrator");
	else if(PlayerInfo[playerid][pAdmin] == 3) format(name, sizeof(name), "Junior Administrator");
	else if(PlayerInfo[playerid][pAdmin] == 4) format(name, sizeof(name), "General Administrator");
	else if(PlayerInfo[playerid][pAdmin] == 5) format(name, sizeof(name), "Senior Administrator");
	else if(PlayerInfo[playerid][pAdmin] == 6) format(name, sizeof(name), "Head Administrator");
	else if(PlayerInfo[playerid][pAdmin] == 7) format(name, sizeof(name), "Community Manager");
	else if(PlayerInfo[playerid][pAdmin] == 8) format(name, sizeof(name), "Excecutive Administrator");
	return name;
}
You code should look like:
Код:
format(string, sizeof(string), "** %s %s: %s", RPALN(playerid), RPN(playerid), params);
and RPN is:
Код:
stock RPNU(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	return name;
}
Reply
#3

Here is the stock for the rank names.
pawn Код:
stock GetAdminLevelName(playerid)
{
    new name[32];
    if(PlayerInfo[playerid][pAdmin] == 1) format(name, sizeof(name), "Rank Name");
    else if(PlayerInfo[playerid][pAdmin] == 2) format(name, sizeof(name), "Rank Name");
    else if(PlayerInfo[playerid][pAdmin] == 3) format(name, sizeof(name), "Rank Name");
    else if(PlayerInfo[playerid][pAdmin] == 4) format(name, sizeof(name), "Rank Name");
    else if(PlayerInfo[playerid][pAdmin] == 1336) format(name, sizeof(name), "Rank Name");
    else if(PlayerInfo[playerid][pAdmin] == 1337) format(name, sizeof(name), "Rank Name");
    else if(PlayerInfo[playerid][pAdmin] == 99999) format(name, sizeof(name), "Rank Name");
    return name;
}
GetPlayerNameEx
pawn Код:
stock GetPlayerNameEx(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}
Make a string for the text.
pawn Код:
format(string, sizeof(string), "* %s %s: %s", GetAdminLevelName(playerid), GetPlayerNameEx(playerid), params);
Then send it to your admins, you can add in the playerid yourself.
Reply
#4

example
pawn Код:
//this is under the admin chat command off course
new pName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "%s %s says: %s", PlayerInfo[playerid][pAdmin], pName, parameter);
// with "parameter" being the parameter in your CMD, hope you're following here
SendAdminMessage(string, COLOR_GREEN);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)