#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Yeni Plugin"
#define VERSION "1.0"
#define AUTHOR "Kalipso22"
#define TAG "REKLAM"
new cvar_enable,cvar_admin,cvar_bilgi,cvar_sure,g_time[33];
new bool:g_NoSay[33];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_enable = register_cvar("say_acik", "1");
cvar_admin = register_cvar("say_admins", "1");
cvar_bilgi = register_cvar("say_bilgi", "1");
cvar_sure = register_cvar("say_sure" , "120");
register_clcmd("say", "chat")
register_clcmd("say_team", "chat")
}
public client_connected(id){
g_NoSay[id] = true;
g_time[id] = get_pcvar_num(cvar_sure);
//set_task(1.0,"Count",id);
Count(id);
}
public Count(id){
if(g_time[id] > get_pcvar_num(cvar_sure)){
g_time[id]--
set_task(1.0,"Count");
}
else{
g_NoSay[id] = false;
}
}
public chat(id) {
if(!get_pcvar_num(cvar_enable) && !g_NoSay[id])
return PLUGIN_CONTINUE
if(get_pcvar_num(cvar_admin) && is_user_admin(id))
return PLUGIN_CONTINUE
if(get_pcvar_num(cvar_bilgi))
renkli_yazi(id, "!t[!g%s!t] !nKonusmak Icin !g%d !nSaniye Daha Beklemelisin.", TAG,g_time[id])
return PLUGIN_HANDLED_MAIN
}
stock renkli_yazi(const id, const Input[], any:...)
{
static Message[191];
vformat(Message, 190, Input, 3);
replace_all(Message, 190, "!n", "^x01");
replace_all(Message, 190, "!g", "^x04");
replace_all(Message, 190, "!t", "^x03");
#if AMXX_VERSION_NUM < 183
new Count = 1, Players[32];
if(id) Players[0] = id; else get_players(Players, Count, "ch");{
for(new i = 0; i < Count; i++)
{
if(is_user_connected(Players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, Players[i]);
write_byte(Players[i]);
write_string(Message);
message_end();
}
}
}
#else
client_print_color(id, id, Message);
#endif
}