Rtv Eklenti İstek
Gönderilme zamanı: Pzr Ara 16, 2018 1:12 pm
Kod: Tümünü seç
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "RockTheVote"
#define AUTHOR "DA"
#define VERSION "1.8"
new rtv[33], howmanyvotes, count;
new howmanyvotesperc, timevote;
new gSure_Degeri
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say", "rockthevote");
register_menu("Rtvv", 1023, "gonna_chose");
howmanyvotes = register_cvar("amx_rtvsayi", "8");
howmanyvotesperc = register_cvar("amx_rtvyuzde", "0.30");
timevote = register_cvar("amx_rtvsure", "5");
gSure_Degeri = register_cvar("mp_timelimit_sure", "1")
}
public client_disconnect(id)
{
if (rtv[id-1] == id)
{
rtv[id-1] = 0;
count--;
}
}
public rockthevote(id)
{
new said[192];
read_args(said, 192);
if ((contain(said, "/degis") != -1) || (contain(said, "rtv") != -1) || (contain(said, "/mapdegis") != -1))
{
if (get_gametime() < (get_pcvar_float(timevote) * 60.0))
client_print(id, print_chat, "Oylama Henuz Kullanilamaz. %d Dakika Bekleyin.", (floatround(((get_pcvar_float(timevote) * 60.0) - get_gametime()) / 60.0)));
else
{
if (rtv[id-1] == id)
client_print(id, print_chat, "Zaten oy verdin!");
else
{
rtv[id-1] = id;
count++;
static num;
num = get_playersnum();
num = floatround((get_pcvar_float(howmanyvotesperc) * num));
if ((num == count) || (count >= get_pcvar_num(howmanyvotes)))
{
StartTheVote();
return PLUGIN_CONTINUE;
}
static name[32];
get_user_name( id, name, charsmax( name ) );
client_print ( 0, print_chat, "%s map degisimine oy verdi. Oylama baslamasi icin %d kisi veya %d^%^% gerekiyor!", name, (get_pcvar_num(howmanyvotes)-count), (floatround(get_pcvar_float(howmanyvotesperc) * 100.00)))
}
}
}
return PLUGIN_CONTINUE;
}
public gonna_chose(id, key)
{
}
StartTheVote()
{
set_cvar_num("sv_restart", 1),set_task(1.0,"devam");
client_cmd(0, "spk ambience/siren");
}
public devam() set_cvar_num("mp_timelimit", get_pcvar_num(gSure_Degeri));