20.03.2012, 00:26
try this:
declare this callback above.
the actual callback. this would send the message to all admins online.
the command, i used zcmd and sscanf for it. you can always use the default "OnPlayerCommandText" though.
hope this helps you, give me a reputation if it does, thanks!
pawn Код:
forward AdminChat(color, message[])
pawn Код:
public AdminChat(color, message[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerAdmin(i))
{
SendClientMessage(i, color, message);
}
}
return 1;
}
pawn Код:
command(achat, playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new message[128], string[128], playername[24];
GetPlayerName(playerid, playername, sizeof(playername));
if(sscanf(params, "S", message)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /achat [message]");
format(string, sizeof(string), "[ADMIN] %s: %s", playername, message);
AdminChat(0xFFFF00FF, string);
}
else SendClientMessage(playerid, 0xAAAAAAFF, "You're not an admin.");
return 1;
}
hope this helps you, give me a reputation if it does, thanks!