Posting both the methods below. To use this command you will need ZCMD by Zeek and sscanf by ******.
EDIT:
The SendClientMessage one!
pawn Код:
COMMAND:announce(playerid, params[])
{
new string[128],msg[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
if(sscanf(params,"s[128]",msg)) return SendClientMessage(playerid,-1, "USAGE: /ann [Admin Message]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1, "You are not authorised to use this command!");
format(string,sizeof(string),"* [Admin] : %s %s *",pname,msg);
SendClientMessageToAll(-1,string);
return 1;
}
Game Text one!
pawn Код:
COMMAND:announce(playerid, params[])
{
new string[128],msg[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
if(sscanf(params,"s[128]",msg)) return SendClientMessage(playerid,-1, "USAGE: /ann [Admin Message]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1, "You are not authorised to use this command!");
format(string,sizeof(string),"[%s]: %s",pname,msg);
GameTextForPlayer( playerid, string, 5000, 3 );
return 1;
}