Zależy mi na edycji tego pluginu, tak aby był on tylko i wyłącznie na noże.
Próbowałem zrobić w ten sposób:
new typ = 2 // 0 - nic, 1 - granaty, 2 - nozeWyszło teraz, że jest cały czas rozgrzewka na tarcze, a nie na tym mi zależy.
Całość kodu poniżej.
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> #define PLUGIN "Granatowka" #define VERSION "1.0" #define AUTHOR "Sn!ff3r" //new czas new bool:granatowka new czas = 60 new typ // 0 - nic, 1 - granaty, 2 - noze public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("TextMsg","restart_time","a","2Game_Ci") register_event("HLTV","round_starthltv","a","1=0","2=0") register_event("DeathMsg","death_msg","a") register_logevent("round_start", 2, "1=Round_Start") granatowka = false typ = 0 } public death_msg() { if(!granatowka) return new id = read_data(2) set_task(1.0,"respawn_player",id) } public restart_time() { set_cvar_num("mp_freezetime",4) set_task(1.0,"odliczanie_hud",1339,_,_,"b") granatowka = true typ = random_num(1,2) set_cvar_num("mp_friendlyfire",0) switch(typ) { case 1: server_cmd("weaponarena -2") case 2: server_cmd("weaponarena -1") } } public round_start_hltv() { set_task(1.0,"odliczanie",3) set_task(2.0,"odliczanie",2) set_task(3.0,"odliczanie",1) set_task(4.0,"odliczanie",0) } public odliczanie(ile) { if(!granatowka) return switch(ile) { case 3: client_cmd(0,"speak vox/three") case 2: client_cmd(0,"speak vox/two") case 1: client_cmd(0,"speak vox/one") case 0: client_cmd(0,"speak ^"vox/go and kill all^"") } } public odliczanie_hud() { if(!granatowka) return new c1 = random_num(0,255) new c2 = random_num(0,255) new c3 = random_num(0,255) if(czas >= 4) set_hudmessage(c1, c2, c3, 0.03, 0.1, 1, 6.0, -1.0,0.1,0.1) else set_hudmessage(c1, c2, c3, 0.03, 0.1, 1, 6.0, 1.0) show_hudmessage(0, "** Puchatek [RealMod]!^n** Restart rundy za^n** %d sekund!") switch(czas) { case 3: client_cmd(0,"speak vox/three") case 2: client_cmd(0,"speak vox/two") case 1: client_cmd(0,"speak vox/one") case 0: { client_cmd(0,"speak vox/exit") remove_task(1339) do_restart() } } czas -- } public round_start() { if(!granatowka) return set_task(0.5,"show_messages",1338,_,_,"a",4) } public show_messages() { set_hudmessage(random_num(0,255),random_num(0,255),random_num(0,255),random_float(0.01,0.8),random_float(0.1,0.9),0,1.0,2.0) switch(typ) { case 1: ShowSyncHudMsg(0, CreateHudSyncObj(),"! Granaty !") case 2: ShowSyncHudMsg(0, CreateHudSyncObj(),"! Tarcze !") } } public do_restart() { server_cmd("weaponarena off") set_cvar_num("sv_restart",1) set_cvar_num("mp_freezetime",4) set_cvar_num("mp_friendlyfire",1) granatowka = false czas = 60 typ = 0 } public respawn_player(id) { if(is_user_connected(id)) ExecuteHamB(Ham_CS_RoundRespawn, id) }