[HELP] Admin chat
#1

Hello I've been searching the forum on how to make a admin chat like /a [text] but i couldn't find anything in dcmd. It was all strcmp and which in that case i am not using strcmp. I copied the one with the prefix one of xadmin and i tryed the v admin one but they got me lots of errors...
Does anyone have any thing simular to it...

ok thx
Reply
#2

Quote:
Originally Posted by ((Lorenc))
Hello I've been searching the forum on how to make a admin chat like /a [text] but i couldn't find anything in dcmd. It was all strcmp and which in that case i am not using strcmp. I copied the one with the prefix one of xadmin and i tryed the v admin one but they got me lots of errors...
Does anyone have any thing simular to it...

ok thx
it's like the /pm commmand the different is just change "/pm" to "/a" and change "true" to "false"

can you send me the /pm script ?
Reply
#3

Umm download the server package and use base.pwn........
Reply
#4

i would recommend u to download an rp script or an admin script and study it
Reply
#5

Try this.
pawn Код:
dcmd_a(playerid, params[]) {
    new str[128], msg[128];
    if(sscanf(params, "s[128]", msg)) return SendClientMessage(playerid, -1, "USAGE: /a [text]");
    format(str, sizeof(str), "Admin %s says: %s", GetPlayerNameEx(playerid), msg);
    SendClientMessageToAll(-1, str);
    return 1;
}

stock GetPlayerNameEx(playerid) {
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    return PlayerName;
}
Reply
#6

shitty troll is shitty
Reply
#7

pawn Код:
COMMAND:a(playerid, cmdtext[])
{
    if(PlayerInfo[i][Adminlevel] >= 1 || IsPlayerAdmin(i))
    {
        new string[128], name[24]
        GetPlayerName(playerid, name, sizeof name);
        format(string, sizeof string, "|- Admin chat -| %s(%i): %s", name, playerid, cmdtext[3]);
        SendAdminMessage(-1, string);
    } else return SendClientMessage(playerid, -1, "You need to be admin to use this");
    return 1;
}

SendAdminMessage(color, text[])
{
    foreach(Player, i)
    {
        if(PlayerInfo[i][Adminlevel] >= 1 || IsPlayerAdmin(i))
        {
            SendClientmessage(i, color, text);
        }
    }
    return 0;
}
This will send a message between the admins. So if youre not an admin, you wouldnt be able to see this. Also, change the PlayerInfo[i][Adminlevel] to your own variable
Untested
Reply
#8

With admin chat you mean a chat that only administrators can see right? Do you have a admin script in your gamemode?

EDIT :Wesley got it above, check that ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)