Próbuje przerobić Auto-Restart by -ThX-, tak aby pokazywał się czas do restartu rundy w różnych kolorach. Tak jak jest to w pluginie ROund STart REstart. Pewnie zapytacie czemu po prostu nie pójdę na łatwiznę i nie użyję tego 2? Ponieważ ma on parę wad, min. Restart z nożówką jest tylko po zmianie mapy, a gdy serwer zrobi się pusty (0 graczy) i znów ktoś wejdzie (np. 2 graczy) to już nie ma restartu. A w tym 1 jest restart. Druga wada to ROund STart REstart korzysta z zewnętrznego pluginu aby była runda nożowa. W pierwszym jest to już zintegrowane.
Udało mi się połączyć i przebudować odpowiednio do moich upodobań, ale mam problem z 1 rzeczą. A mianowicie: Po restarcie powinno się dać wyciągnąć bronie, a jednak blokuje się cały czas na nożu. Domyślam się że jest to coś z pauzowaniem.
Kod pluginu:
#include <amxmodx> #include <amxmisc> new onoff[8] new bool:AutoRR = true new bool:AutoHud = true new czas = 45 new pokaz_czas public plugin_init() { register_plugin("Auto-Restart","1.1.2","-ThX- edit by XvAK") register_event("TextMsg","restart_time","a","2Game_C") register_event("TextMsg","auto_tasks","a","2Game_C") register_cvar("amx_auto_rr_time","45.0") register_cvar("amx_auto_rr_knives","0") register_clcmd("amx_auto_rr","amx_auto_rr",ADMIN_SLAY,"amx_auto_rr : < 0 | 1> Turns ability to Auto-Restart (Game Commencing) on and off") register_event("CurWeapon","switchweapon","be","1=1","2!29") pause("b","switchweapon") return PLUGIN_CONTINUE } public auto_tasks() { set_task(1.0,"wyswietl_res",8188,"",0,"b") set_task(5.0,"muza",0) set_task(45.0,"restart",0) set_task(46.0,"pauza_noz",0) } public wyswietl_res(){ new jac1=random_num(0,255) new jac2=random_num(0,255) new jac3=random_num(0,255) pokaz_czas = czas set_hudmessage(jac1, jac2, jac3, 0.65, 0.75, 2, 0.02, 1.0, 0.01, 0.1, 10) show_hudmessage(0,"==================^n* www.RzeZnia.eu *^n RESTART ZA: %i sec^n==================", pokaz_czas) czas-- } public muza(){ client_cmd(0,"spk misc/start.wav") } public restart(){ remove_task(8188) czas = 45 set_hudmessage(10, 255, 40, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 4) show_hudmessage(0,"=============^n* GAME LIVE *^n=============") client_cmd(0,"stopsound") } public pauza_noz(){ pause("b","switchweapon") } /* Pozostale */ public switchweapon(id) engclient_cmd(id,"weapon_knife") public amx_auto_rr(id){ if (!(get_user_flags(id)&ADMIN_SLAY)){ client_print(id,print_console,"[AMX] nie masz dostepu do tej komendy!") return PLUGIN_HANDLED } if (read_argc() < 2){ checkmode() client_print(id,print_console,"[AMX] Uzycie: amx_auto_rr < 0 | 1 > | Aktualnie: * %s *", onoff) return PLUGIN_HANDLED } read_argv(1,onoff,2) if (equal(onoff,"1", 1)){ AutoRR = true client_print(id,print_console,"[AMX] Auto-Restart wlaczony!") if (AutoHud == true){ hudstyle() } else { clientstyle() } } else { AutoRR = false client_print(id,print_console,"Auto-Restart wylaczony") if (AutoHud == true){ hudstyle() } else { clientstyle() } } return PLUGIN_HANDLED } public checkmode() { if(AutoRR == true){ copy(onoff, 8, "enabled") } else { copy(onoff, 8, "disabled") } return PLUGIN_CONTINUE } public hudstyle() { new message[128] checkmode() format(message,127,"Auto-Restart",onoff) set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2) show_hudmessage(0,message) return PLUGIN_CONTINUE } public clientstyle() { new message[128] checkmode() format(message,127,"Auto-Restart",onoff) client_print(0,print_chat,message) } public restart_time(){ set_task (1.0,"restart_knives") set_task (get_cvar_float("amx_auto_rr_time"),"restart_map",0) } public restart_knives() { if (get_cvar_num("amx_auto_rr_knives")==0){ pause("b","switchweapon") } else{ unpause("b","switchweapon") } } public restart_map() { if (AutoRR==true){ set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2) show_hudmessage(0,"Milego fragowania i dobrej zabawy !") set_cvar_float("sv_restart",1.0) pause("b","switchweapon") } else { client_print(0,print_chat,"[AMX] Autorestart wylaczony, nie mozna uruchomic autorestartu!") } } public plugin_precache() { precache_sound("misc/start.wav") return PLUGIN_CONTINUE }
[ Dodano: 2008-03-20, 09:08 ]
Nikt nie potrafi pomóc? Tzn. zapauzować pluginu? ..