W tej chwili gdy nikt nie gra na mapie, a mapa sie zmieni, bedzie glosowanie i tak. I jak ktos wbije to plugin odpowiedzialny za hs juz jest wlaczony. Wiec bardzo bym prosil aby plugin zostal tak przerobiony zeby dzialal dopiero gdy zostanie wlaczony plugin auto_restart_knives.amxx. Albo inne rozwiazane, dziala dopiero jak jest x osob online ( nie liczac botow ). I jak zrobic aby glosowanie bylo tylko na wybranych mapach ?
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "HS czy nie?" #define VERSION "1.0" #define AUTHOR "Mlody" new choice[2] new cvar, g_time, w_time, h_time public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) cvar = register_cvar("vote", "1") g_time = register_cvar("vote_time", "65") w_time = register_cvar("vote_wait", "15") h_time = register_cvar("vote_hold", "15") register_menucmd(register_menuid("menu_1"),(1<<0)|(1<<1),"licz_glosy") new Float:votetime = get_pcvar_float(g_time) set_task(votetime,"votemod") server_cmd("amx_pausecfg pause hitbox.amxx") server_cmd("amx_hitbox abcdefg") register_clcmd("say /hsonly", "votemod") } public votemod() { if (get_pcvar_num(cvar) == 1) { new hold = get_pcvar_num(h_time) show_menu(0,(1<<0)|(1<<1), "Chcesz na tej mapie grac tylko na headshoty?^n^n1: Tak ***** !^n2: Nie i **** !", hold, "menu_1") new Float:timer = get_pcvar_float(w_time) set_task(timer,"sprawdz_glosy") choice[0] = 0 choice[1] = 0 return PLUGIN_HANDLED } return PLUGIN_CONTINUE } public licz_glosy(id,key) { new name[32] get_user_name(id,name,31) new co[8] = "Tak" if (key == 1) co = "Nie" client_print(0,print_chat,"* %s zaglosowal na %s", name, co) ++choice[key] return PLUGIN_HANDLED } public sprawdz_glosy(id) { if (choice[0] >= choice[1]) { client_print(0,print_chat,"* Zaczynamy rzeznie! Gramy tylko na Headshot! *",choice[0],choice[1]) server_cmd("amx_pausecfg enable hitbox.amxx") server_cmd("amx_hitbox a") server_cmd("amx_nukem_jk") set_hudmessage(205,55,55,-1.0,-1.0,0,6.0,12.0,0.1); show_hudmessage(id, "Zaczynamy rzeznie! Gramy tylko na Headshot!") } else { client_print(0,print_chat,"* Gramy zwyczajnie! *",choice[1],choice[0]) server_cmd("amx_hitbox abcdefg") server_cmd("amx_nukem_jk") set_hudmessage(118,238,0,-1.0,-1.0,0,6.0,12.0,0.1); show_hudmessage(id, "Gramy zwyczajnie!") } return PLUGIN_CONTINUE }
oraz jeszcze raz to zapisywanie nickow i ip. Czy jest mozliwosc aby IP ktore sie powtarzalo nie byly juz dodawane ( chyba ze nick sie rozni ).
Bo teraz to u mnie wyglada tak:
Nick: Wogidek (jak sie w to gra?) <!!> IP: 192.168.1.1 Nick: Kemot <!!> IP: 11.111.111.111 Nick: Kemot <!!> IP: 11.111.111.111 Nick: Kemot <!!> IP: 11.111.111.111 Nick: Borens <!!> IP: 22.2.222.22 Nick: Kemot <!!> IP: 11.111.111.111
kod:
#include <amxmodx> #include <amxmisc> #define PLUGIN "IP LOger" #define VERSION "1.0" #define AUTHOR "GuTeK" #define LOGER_TASK 1133 public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar("amx_iploger", "1") } public loger(id) { id-=LOGER_TASK new logfile[64],text[128],timme[9] new name[33], ip[16]; get_time("%d%m%Y",timme,8) get_user_name(id, name, 32) get_user_ip(id, ip, 15, 1) if(get_cvar_num("amx_iploger") == 1) { client_print(0, print_chat, "Nazywam sie %s wrazie gdybym cheatowal podajcie moje ip adminowi %s", name,ip) if (!equal(ip, "127.0.0.1")) { format (text, 63, "Nick: %s <!!> IP: %s",name,ip) format( logfile, 63, "addons/amxmodx/logs/loger%s.log",timme) write_file( logfile, text ) } } if(get_cvar_num("amx_iploger") == 2) { client_print(0, print_chat, "Nazywam sie %s wrazie gdybym cheatowal podajcie moje ip adminowi %s", name,ip) } if(get_cvar_num("amx_iploger") == 3 && !equal(ip, "127.0.0.1")) { format (text, 63, "Nick: %s <!!> IP: %s",name,ip) format( logfile, 63, "addons/amxmodx/logs/loger%s.log",timme) write_file( logfile, text ) } } public client_putinserver(id) { set_task(3.0, "loger",id+LOGER_TASK) }
Pozdrawiam i licze na pomoc !