#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Clear Chat"
#define VERSION "1.0"
#define AUTHOR "Alyi"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /cc", "ClearChat");
}
public ClearChat(id)
{
if(!is_user_admin(id))
return 1;
new AdminName[32];
get_user_name(id, AdminName, sizeof AdminName - 1);
client_print_green(0, "*~~~* ADMIN[+] %s a curatat chatul!*~~~*", AdminName);
client_print_green(0,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
client_print_green(0,"~~~~~~~~Motiv : Reclama/Vulgaritati/Nume Obscen");
client_print_green(0," ----|--------|JailBreak|---------|---- ");
client_print_green(0,"~~~~~~~~~~~~ --| PLUGIN by T3hNoLoGy |-- ~~~~~~~~~~~~~~~~~~~~");
client_cmd(0, "spk misc/clearchat.wav");
return 1;
}
public plugin_precache()
{
precache_sound("misc/clearchat.wav");
return 1;
}
stock client_print_green(index, const message[], {Float, Sql, Result,_}:...) { //color by (Alka)
new Buffer[512], Buffer2[512], id, msg_type;
formatex(Buffer2, sizeof Buffer2 - 1, "^x04%s", message);
vformat(Buffer, sizeof Buffer - 1, Buffer2, 3);
if(index) {
id = index;
msg_type = MSG_ONE;
}
else {
id = FindPlayer();
msg_type = MSG_ALL;
}
message_begin(msg_type, get_user_msgid("SayText"), _, id);
write_byte(id);
write_string(Buffer);
message_end();
}
public FindPlayer()
{
new players[32], num;
get_players(players, num);
new i = -1;
while(i < num)
{
if(is_user_connected(++i))
{
return i;
}
}
return -1;
}