18.03.2011, 22:23
pawn Код:
CMD:announce(playerid, params[])
{
#define Msg SendClientMessage
if (!IsPlayerAdmin(playerid)) return
Msg(playerid, 0xFF0000AA, "Only for admins.");
new text[64], timems, style;
if (sscanf(params, "iis[64]", style, timems, text)) return
Msg(playerid, 0xFF0000AA, "Usage: /announce <style[0-6]> <time in ms> <text>");
if (strlen(text) > 64) return
Msg(playerid, 0xFF0000AA, "Message is too long (64 characters)");
if (style < 0 || style > 6) return
Msg(playerid, 0xFF0000AA, "Invalid style");
if (time > 20*1000) return
Msg(playerid, 0xFF0000AA, "No longer than 20 seconds");
GameTextForAll(text, timems, style);
#undef Msg
return true;
}