02.09.2013, 01:39
It's about my admin chat command , any one type /ac he get my name and rank for example my friend if he type /ac text he it show me this [Owner]SilentSoul:text....
Codes
About GetPlayerAdminRank
And SendMessage To Admins stock
Sorry for my bad english :/
Codes
pawn Код:
CMD:ac(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] == 0)return SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}You are not{FF0000} Administrator {FAF5F5}to use admin chat");
new name[1024],i , text[126];
if(sscanf(params, "s[126]", text))return SendClientMessage(playerid,-1,"{FF0000}[System Usage]:{FAF5F5}/ac [text]");
GetPlayerName(i, name, sizeof(name));
format(text, sizeof(text), "{FFD700}[%s] %s: %s", GetPlayerAdminRank(i),name ,text);
SendMessageToAdmins(text);
return 1;
}
pawn Код:
stock GetPlayerAdminRank(playerid)
{
new rankname[32];
switch(PlayerInfo[playerid][pAdminLevel])
{
case 1: { rankname = "Moderator"; }
case 2: { rankname = "Admin"; }
case 3: { rankname = "Head Admin"; }
case 4: { rankname = "Owner"; }
}
return rankname;
}
pawn Код:
stock SendMessageToAdmins(text[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdminLevel] > 0)
{
SendClientMessage(i, -1, text);
}
}
}