15.09.2013, 16:34
pawn Код:
GetColor(colorcount)
{
static const Colors[] = {
0x0071BD00,
0xFF00FE00,
0x78227D00,
0x00930900,
0x00FF0100,
0xFFFF0400,
0xFACB0100,
0xFF7C0000,
0xFE000000,
0xD5030400
};
if(colorcount >= sizeof(Colors)) return -1;
return (Colors[colorcount] >>> 8);
}
CMD:announce(playerid,params[])
{
if(!IsPlayerAdminLevel(playerid, 1)) SendClientMessage(playerid, RED, "You Have To Be Admin To Use This Command");
else if(isnull(params)) SendClientMessage(playerid, RED, "SYNTAX /announce [text]");
else{
new str[144],name[MAX_PLAYER_NAME + 1],pos,colorcount,color[9];
strcat(str,params);
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
while((pos = strfind(str," ",true,pos+1))
{
colorcount %= 10;
format(color,sizeof color,"{%06x}",GetColor(colorcount++));
strins(str,color,pos+1);
}
format(string,sizeof str,"[ADMIN:%s] %s",name,str);
SendClientMessageToAll(PINK, str);
SendClientMessage(playerid, LIGHTBLUE, "MessageSent");
}
return 1;
}
