14.04.2011, 13:42
Download here ZCMD, put it in pawno/include and then in pawn
and then here's your code:
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
pawn Код:
#include <zcmd>
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;
}
Make sure it's not in OnPlayerCommandText!
:]
EDIT: I know sscanf() would be better done with 'if' but I didn't know that before
![Cheesy](images/smilies/biggrin.png)