What is the problem there ?
#1

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
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;
}
About GetPlayerAdminRank

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;
}
And SendMessage To Admins stock
pawn Код:
stock SendMessageToAdmins(text[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)

    {
        if(PlayerInfo[i][pAdminLevel] > 0)
        {
            SendClientMessage(i, -1, text);
        }
    }
}
Sorry for my bad english :/
Reply


Messages In This Thread
What is the problem there ? - by SilentSoul - 02.09.2013, 01:39
Re: What is the problem there ? - by Borg - 02.09.2013, 01:46
Re: What is the problem there ? - by SilentSoul - 02.09.2013, 01:47

Forum Jump:


Users browsing this thread: 1 Guest(s)