Need help with announce command
#10

Download here ZCMD, put it in pawno/include and then in pawn
pawn Код:
#include <zcmd>
and then here's your code:
pawn Код:
//Announcer script by Seven_of_Nine :]
COMMAND:announce(playerid,params[]) {
    new
        poster[40],
        mess[128];
    sscanf(params,"s",mess);
    if(PlayerInfo[playerid][pAdminLevel] >= 3) {
        if(!isnull(mess)) {
            new text[128];
            GetPlayerName(playerid,poster,sizeof(poster));
            format(text,sizeof(text),"[Announce] | Administrator \"%s\" has announced his message. (%s)",poster,mess);
            SendClientMessageToAll(COLOR_LIGHTBLUE,text);
            GameTextForAll(mess,5000,3);
        } else {
            return SendClientMessage(playerid,red,"USAGE: /announce [message], and all players will see this message on-screen.");
        }
    } else {
        return SendClientMessage(playerid,red,"Only lvl3 admins can use this command. Looking for a way to announce? Try /message!");
    }
    return 1;
}
tested, it's in my admin script, feel free to edit it.
Make sure it's not in OnPlayerCommandText!

:]

EDIT: I know sscanf() would be better done with 'if' but I didn't know that before
Reply


Messages In This Thread
Need help with announce command - by SomebodyAndMe - 14.04.2011, 12:09
Re: Need help with announce command - by iJumbo - 14.04.2011, 12:26
Re: Need help with announce command - by SomebodyAndMe - 14.04.2011, 12:29
Re: Need help with announce command - by iJumbo - 14.04.2011, 12:31
Re: Need help with announce command - by SomebodyAndMe - 14.04.2011, 12:33
Re: Need help with announce command - by iJumbo - 14.04.2011, 12:37
Re: Need help with announce command - by SomebodyAndMe - 14.04.2011, 12:56
Re: Need help with announce command - by iJumbo - 14.04.2011, 12:58
Re: Need help with announce command - by SomebodyAndMe - 14.04.2011, 13:00
Re: Need help with announce command - by Seven_of_Nine - 14.04.2011, 13:42

Forum Jump:


Users browsing this thread: 1 Guest(s)