Docelowo = rozgrzewka 45 sekund + autorespawn
Teraz = rozgrzewka 45 sekund + autorespawn cały czas nawet po rozgrzewce
Wygląda to tak:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <hamsandwich> #define PLUGIN "rozgrzewka" #define VERSION "1.0" #define AUTHOR "Change" #define MAX_PLAYERS 32 #define SPAWN_TASKID 9999 new g_cvarSpawnDelay; new bool:AutoRR = true new bool:knifeArena = true public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_dictionary("rozgrzewka.txt") register_cvar("czas_rozgrzewki","45") register_event("DeathMsg","onDeath","a"); register_logevent("eventRoundEnd",2,"1=Round_End"); g_cvarSpawnDelay=register_cvar("restart_spawndelay","2.0",0,2.0); } public switchweapon(id) { if (!knifeArena) return PLUGIN_CONTINUE engclient_cmd(id,"weapon_knife") return PLUGIN_CONTINUE } public restart_time() { if (AutoRR==true) { new restart_time=get_cvar_num("czas_rozgrzewki") knifeArena = true set_hudmessage(0, 255, 0, -1.0, -1.0) show_hudmessage(0, "%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",restart_time) set_task(float(restart_time),"restart_map",0) set_task(float(restart_time)-1,"restart_1s",0) set_task(float(restart_time)-2,"restart_2s",0) set_task(float(restart_time)-3,"restart_3s",0) set_task(float(restart_time)-4,"restart_4s",0) set_task(float(restart_time)-5,"restart_5s",0) if (restart_time > 6) { set_task(float(restart_time)-6,"restart_6s",0) } if (restart_time > 7) { set_task(float(restart_time)-7,"restart_7s",0) } if (restart_time > 8) { set_task(float(restart_time)-8,"restart_8s",0) } if (restart_time > 9) { set_task(float(restart_time)-9,"restart_9s",0) } if (restart_time > 10) { set_task(float(restart_time)-10,"restart_10s",0) } if (restart_time > 11) { set_task(float(restart_time)-11,"restart_11s",0) } if (restart_time > 12) { set_task(float(restart_time)-12,"restart_12s",0) } if (restart_time > 13) { set_task(float(restart_time)-13,"restart_13s",0) } if (restart_time > 14) { set_task(float(restart_time)-14,"restart_14s",0) } if (restart_time > 15) { set_task(float(restart_time)-15,"restart_15s",0) } if (restart_time > 16) { set_task(float(restart_time)-16,"restart_16s",0) } if (restart_time > 17) { set_task(float(restart_time)-17,"restart_17s",0) } if (restart_time > 18) { set_task(float(restart_time)-18,"restart_18s",0) } if (restart_time > 19) { set_task(float(restart_time)-19,"restart_19s",0) } if (restart_time > 20) { set_task(float(restart_time)-20,"restart_20s",0) } if (restart_time > 21) { set_task(float(restart_time)-21,"restart_21s",0) } if (restart_time > 22) { set_task(float(restart_time)-22,"restart_22s",0) } if (restart_time > 23) { set_task(float(restart_time)-23,"restart_23s",0) } if (restart_time > 24) { set_task(float(restart_time)-24,"restart_24s",0) } if (restart_time > 25) { set_task(float(restart_time)-25,"restart_25s",0) } if (restart_time > 26) { set_task(float(restart_time)-26,"restart_26s",0) } if (restart_time > 27) { set_task(float(restart_time)-27,"restart_27s",0) } if (restart_time > 28) { set_task(float(restart_time)-28,"restart_28s",0) } if (restart_time > 29) { set_task(float(restart_time)-29,"restart_29s",0) } if (restart_time > 30) { set_task(float(restart_time)-30,"restart_30s",0) } if (restart_time > 31) { set_task(float(restart_time)-31,"restart_31s",0) } if (restart_time > 32) { set_task(float(restart_time)-32,"restart_32s",0) } if (restart_time > 33) { set_task(float(restart_time)-33,"restart_33s",0) } if (restart_time > 34) { set_task(float(restart_time)-34,"restart_34s",0) } if (restart_time > 35) { set_task(float(restart_time)-35,"restart_35s",0) } if (restart_time > 36) { set_task(float(restart_time)-36,"restart_36s",0) } if (restart_time > 37) { set_task(float(restart_time)-37,"restart_37s",0) } if (restart_time > 38) { set_task(float(restart_time)-38,"restart_38s",0) } if (restart_time > 39) { set_task(float(restart_time)-39,"restart_39s",0) } if (restart_time > 40) { set_task(float(restart_time)-40,"restart_40s",0) } if (restart_time > 41) { set_task(float(restart_time)-41,"restart_41s",0) } if (restart_time > 42) { set_task(float(restart_time)-42,"restart_42s",0) } if (restart_time > 43) { set_task(float(restart_time)-43,"restart_43s",0) } if (restart_time > 44) { set_task(float(restart_time)-44,"restart_44s",0) } if (restart_time > 45) { set_task(float(restart_time)-45,"restart_45s",0) } } } public restart_45s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",45) } public restart_44s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",44) } public restart_43s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",43) } public restart_42s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",42) } public restart_41s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",41) } public restart_40s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",40) } public restart_39s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",39) } public restart_38s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",38) } public restart_37s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",37) } public restart_36s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",36) } public restart_35s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",35) } public restart_34s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",34) } public restart_33s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",33) } public restart_32s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",32) } public restart_31s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",31) } public restart_30s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",30) } public restart_29s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",29) } public restart_28s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",28) } public restart_27s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",27) } public restart_26s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",26) } public restart_25s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",25) } public restart_24s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",24) } public restart_23s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",23) } public restart_22s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",22) } public restart_21s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",21) } public restart_20s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",20) } public restart_19s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",19) } public restart_18s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",18) } public restart_17s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",17) } public restart_16s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",16) } public restart_15s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",15) } public restart_14s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",14) } public restart_13s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",13) } public restart_12s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",12) } public restart_11s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",11) } public restart_10s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",10) } public restart_9s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",9) } public restart_8s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",8) } public restart_7s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",7) } public restart_6s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",6) } public restart_5s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",5) } public restart_4s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",4) } public restart_3s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0, "TRZY") } public restart_2s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0, "DWA") } public restart_1s() { set_hudmessage(255, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1) show_hudmessage(0, "JEDEN") } public restart_map() { if (AutoRR==true) { set_cvar_float("sv_restart",1.0) knifeArena = false } } public hudmess_show() { set_hudmessage(255, 0, 0, -1.0, 0.01) show_hudmessage(0, "Zaczynamy! Milej gry") } public onDeath(){ new vid=read_data(2); if(hasAliveTeamMate(vid)) set_task(get_pcvar_float(g_cvarSpawnDelay),"respawn",SPAWN_TASKID+vid); return PLUGIN_CONTINUE; } public respawn(task_id){ ExecuteHamB(Ham_CS_RoundRespawn,task_id-SPAWN_TASKID); } public eventRoundEnd(){ for(new i=1;i<=MAX_PLAYERS;i++){ if(task_exists(SPAWN_TASKID+i)) remove_task(SPAWN_TASKID+i); } } bool:hasAliveTeamMate(id){ new iTeam=get_user_team(id); new Players[32], playerCount; new id2; get_players(Players, playerCount); for (new i=0; i<playerCount; i++){ id2 = Players[i]; if(is_user_alive(id2)){ if(get_user_team(id2) == iTeam) return true; } } return false; }
Jak zakończyć respawn po zakończeniu rozgrzewki? :>