Descriere: Un sistem de mix/war (5 vs 5, dar poate fi modificat) pe 2 reprize
- SMA | Afiseaza codul
[code]#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "Advanced Mix System" #define VERSION "1.1" #define AUTHOR "dystopiA" #define TAG "MIX" new mixon = 0 new schimbate = 0 new teamA[2] = 0 new teamB[2] = 0 new bool:user_can_speak = true new bool:pwon = false new bool:demo_on[33] = false public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /mix", "cmdMixMenu", ADMIN_LEVEL_G, "- Deschide meniul de mix") register_clcmd("say /scor", "cmdScor", ADMIN_ALL, "- Afiseaza scorul") register_clcmd("say /setari", "cmdSetari", ADMIN_LEVEL_G, "- Forteaza setari jucatorilor") register_clcmd("say /nopass", "cmdNoPass", ADMIN_PASSWORD, "- Scoate parola serverului") register_clcmd("say", "check") register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin") register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin") register_event("HLTV", "swap", "a", "1=0", "2=0") register_event("HLTV", "end_mix", "a", "1=0", "2=0") register_logevent("announce", 2, "1=Round_End") register_logevent("announce_winner", 2, "1=Round_End") } public cmdMixMenu(id) { if(!get_user_flags(id) && ADMIN_KICK) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } new menu = menu_create("\wAdvanced Mix System^n", "menu_handler") menu_additem(menu, "\wDa restart rundei/reprizei", "1", 0) menu_additem(menu, "\wPorneste alegerile", "2", 0) menu_additem(menu, "\wPorneste prima repriza", "3", 0) menu_additem(menu, "\wPorneste a doua repriza", "4", 0) menu_additem(menu, "\wOpreste mix-ul", "5", 0) menu_display(id, menu, 0) return PLUGIN_HANDLED } public menu_handler(id, menu, item) { new name[32] get_user_name(id, name, charsmax(name)) if(!get_user_flags(id) && ADMIN_KICK) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } switch(item) { case 0: { switch(mixon) { case 0: { set_cvar_string("sv_restart", "1") set_cvar_string("mp_freezetime", "0") set_cvar_string("mp_startmoney", "16000") switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a dat restart", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a dat restart", TAG, name) } menu_destroy(menu) } case 1: { teamA[0] = 0 teamB[0] = 0 set_cvar_string("sv_restart", "1") switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a dat restart primei reprize", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a dat restart primei reprize", TAG, name) } menu_destroy(menu) } case 2: { set_cvar_string("sv_restart", "1") set_cvar_string("mp_startmoney", "16000") set_cvar_string("mp_freezetime", "0") set_cvar_string("mp_friendlyfire", "0") switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a dat restart", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a dat restart", TAG, name) } menu_destroy(menu) } case 3: { teamA[1] = 0 teamB[1] = 0 set_cvar_string("sv_restart", "1") switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a dat restart celei de-a doua reprize", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a dat restart celei de-a doua reprize", TAG, name) } menu_destroy(menu) } } } case 1: { switch(mixon) { case 0: { new players[32], num get_players(players, num, "h") if(num >= 10) { for(new i = 0; i < num; i++) { new team team = get_user_team(players) switch(team) { case 1: { if(!is_user_alive(players)) { cs_set_user_team(players, CS_TEAM_SPECTATOR) } else { user_kill(players, 1) cs_set_user_team(players, CS_TEAM_SPECTATOR) } } case 2: { if(!is_user_alive(players)) { cs_set_user_team(players, CS_TEAM_SPECTATOR) } else { user_kill(players, 1) cs_set_user_team(players, CS_TEAM_SPECTATOR) } } } } switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a pornit alegerile", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a pornit alegerile", TAG, name) } menu_destroy(menu) } else { client_print(id, print_chat, "[%s] Alegerile nu pot incepe deoarece nu sunt conectati 10 jucatori", TAG) menu_destroy(menu) } } case 1, 2, 3: { client_print(id, print_chat, "[%s] Mix-ul este deja pornit", TAG) menu_destroy(menu) } } } case 2: { switch(mixon) { case 0: { new players[32], num get_players(players, num, "h") if(num >= 10) { mixon = 1 client_cmd(0, "cl_updaterate 101") client_cmd(0, "cl_cmdrate 101") client_cmd(0, "rate 100000") client_cmd(0, "fps_max 101") client_cmd(0, "ex_interp 0.01") set_cvar_string("sv_restart", "1") set_cvar_string("mp_freezetime", "10") set_cvar_string("mp_startmoney", "800") set_cvar_string("mp_friendlyfire", "1") set_cvar_string("mp_timelimit", "0") set_cvar_string("mp_roundtime", "1.75") set_cvar_string("mp_c4timer", "35") set_cvar_string("mp_buytime", "0.25") set_cvar_string("mp_forcecamera", "2") set_cvar_string("mp_fadetoblack", "0") set_cvar_string("mp_tkpunish", "0") switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a pornit prima repriza. GL & HF!", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a pornit prima repriza. GL & HF!", TAG, name) } menu_destroy(menu) } else { client_print(id, print_chat, "[%s] Mix-ul nu poate incepe deoarece nu sunt conectati 10 jucatori", TAG) menu_destroy(menu) } } case 1: { client_print(id, print_chat, "[%s] Prima repriza este deja pornita", TAG) menu_destroy(menu) } case 2: { client_print(id, print_chat, "[%s] Pirma repriza s-a sfarsit deja", TAG) menu_destroy(menu) } case 3: { client_print(id, print_chat, "[%s] A doua repriza este in desfasurare", TAG) menu_destroy(menu) } } } case 3: { switch(mixon) { case 0: { client_print(id, print_chat, "[%s] Mix-ul nu este pornit", TAG) menu_destroy(menu) } case 1: { client_print(id, print_chat, "[%s] Prima repriza este in desfasurare", TAG) menu_destroy(menu) } case 2: { mixon = 3 client_cmd(0, "cl_updaterate 101") client_cmd(0, "cl_cmdrate 101") client_cmd(0, "rate 100000") client_cmd(0, "fps_max 101") client_cmd(0, "ex_interp 0.01") set_cvar_string("sv_restart", "1") set_cvar_string("mp_freezetime", "10") set_cvar_string("mp_startmoney", "800") set_cvar_string("mp_friendlyfire", "1") set_cvar_string("mp_timelimit", "0") set_cvar_string("mp_roundtime", "1.75") set_cvar_string("mp_c4timer", "35") set_cvar_string("mp_buytime", "0.25") set_cvar_string("mp_forcecamera", "2") set_cvar_string("mp_fadetoblack", "0") set_cvar_string("mp_tkpunish", "0") switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a pornit a doua repriza. GL & HF!", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a pornit a doua repriza. GL & HF!", TAG, name) } menu_destroy(menu) } case 3: { client_print(id, print_chat, "[%s] A doua repriza este deja pornita", TAG) menu_destroy(menu) } } } case 4: { switch(mixon) { case 0: { client_print(id, print_chat, "[%s] Mix-ul nu este pornit", TAG) menu_destroy(menu) } case 1, 2, 3: { mixon = 0 teamA[0] = 0 teamB[0] = 0 teamA[1] = 0 teamB[1] = 0 schimbate = 0 set_cvar_string("sv_restart", "1") set_cvar_string("mp_freezetime", "0") set_cvar_string("mp_startmoney", "800") set_cvar_string("mp_friendlyfire", "0") switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a oprit mix-ul", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a oprit mix-ul", TAG, name) } menu_destroy(menu) } } } case MENU_EXIT: { menu_destroy(menu) return PLUGIN_HANDLED } } return PLUGIN_HANDLED } public cmdScor(id) { switch(mixon) { case 0: client_print(id, print_chat, "[%s] Mix-ul nu este pornit", TAG) case 1, 2, 3: { switch(schimbate) { case 0: { if(teamA[0] + teamA[1] > teamB[0] + teamB[1]) { client_print(id, print_chat, "[%s] Echipa celor de la T conduce echipa celor de la CT cu %d - %d", TAG, teamA[0] + teamA[1], teamB[0] + teamB[1]) } else if(teamA[0] + teamA[1] < teamB[0] + teamB[1]) { client_print(id, print_chat, "[%s] Echipa celor de la CT conduce echipa celor de la T cu %d - %d", TAG, teamB[0] + teamB[1], teamA[0] + teamA[1]) } else if(teamA[0] + teamA[1] == teamB[0] + teamB[1]) { client_print(id, print_chat, "[%s] Echipele sunt la egalitate cu %d - %d", TAG, teamA[0] + teamA[1], teamB[0] + teamB[1]) } } case 1: { if(teamA[0] + teamA[1] > teamB[0] + teamB[1]) { client_print(id, print_chat, "[%s] Echipa celor de la CT conduce echipa celor de la T cu %d - %d", TAG, teamA[0] + teamA[1], teamB[0] + teamB[1]) } else if(teamA[0] + teamA[1] < teamB[0] + teamB[1]) { client_print(id, print_chat, "[%s] Echipa celor de la T conduce echipa celor de la CT cu %d - %d", TAG, teamB[0] + teamB[1], teamA[0] + teamA[1]) } else if(teamA[0] + teamA[1] == teamB[0] + teamB[1]) { client_print(id, print_chat, "[%s] Echipele sunt la egalitate cu %d - %d", TAG, teamA[0] + teamA[1], teamB[0] + teamB[1]) } } } } } return PLUGIN_HANDLED } public cmdSetari(id) { new name[32] get_user_name(id, name, charsmax(name)) if(!get_user_flags(id) && ADMIN_KICK) return PLUGIN_HANDLED client_cmd(0, "cl_updaterate 101") client_cmd(0, "cl_cmdrate 101") client_cmd(0, "rate 100000") client_cmd(0, "fps_max 101") client_cmd(0, "ex_interp 0.01") return PLUGIN_HANDLED } public cmdNoPass(id) { new name[32] get_user_name(id, name, charsmax(name)) if(!get_user_flags(id) && ADMIN_PASSWORD) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } switch(pwon) { case false: client_print(id, print_chat, "[%s] Serverul nu are parola", TAG) case true: { pwon = false set_cvar_string("sv_password", "") switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a scos parola serverului", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a scos parola serverului", TAG, name) } } } return PLUGIN_HANDLED } public check(id) { new said[192], name[32] read_args(said, charsmax(said)) remove_quotes(said) get_user_name(id, name, charsmax(name)) if(equal(said, "/say off")) { if(!get_user_flags(id) && ADMIN_LEVEL_G) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } switch(user_can_speak) { case true: { user_can_speak = false switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a blocat canalul SAY", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a blocat canalul SAY", TAG, name) } } case false: client_print(id, print_chat, "[%s] Canalul SAY este deja blocat", TAG) } return PLUGIN_HANDLED } else if(equal(said, "/say on")) { if(!get_user_flags(id) && ADMIN_LEVEL_G) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } switch(user_can_speak) { case false: { user_can_speak = true switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a deblocat canalul SAY", TAG) case 2: client_print(0, print_chat, "[%s] Adminul %s a deblocat canalul SAY", TAG, name) } } case true: client_print(id, print_chat, "[%s] Canalul SAY nu este blocat", TAG) } return PLUGIN_HANDLED } else if(equal(said, "/pass") || equal(said, "/pass ")) { if(!get_user_flags(id) && ADMIN_PASSWORD) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } client_print(id, print_chat, "[%s] Comanda: /pass <parola> - Seteaza parola serverului", TAG) return PLUGIN_HANDLED } else if(said[0] == '/' && said[1] == 'p' && said[2] == 'a' && said[3] == 's' && said[4] == 's') { if(!get_user_flags(id) && ADMIN_PASSWORD) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } switch(pwon) { case false: { pwon = true new password[50], name[32] strbreak(said, said, 6, password, charsmax(password)) get_user_name(id, name, charsmax(name)) set_cvar_string("sv_password", password) switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a schimbat parola serverului in ^"%s^"", TAG, password) case 2: client_print(0, print_chat, "[%s] Adminul %s a schimbat parola serverului in ^"%s^"", TAG, name, password) } } case true: { new password[50], name[32] strbreak(said, said, 6, password, charsmax(password)) get_user_name(id, name, charsmax(name)) set_cvar_string("sv_password", password) switch(get_cvar_num("amx_show_activity")) { case 1: client_print(0, print_chat, "[%s] Adminul a schimbat parola serverului in ^"%s^"", TAG, password) case 2: client_print(0, print_chat, "[%s] Adminul %s a schimbat parola serverului in ^"%s^"", TAG, name, password) } } } return PLUGIN_HANDLED } else if(equal(said, "/demo") || equal(said, "/demo ")) { if(!get_user_flags(id) && ADMIN_KICK) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } client_print(id, print_chat, "[%s] Comanda: /demo <nume sau #userid> - Inregistreaza un demo jucatorului", TAG) return PLUGIN_HANDLED } else if(said[0] == '/' && said[1] == 'd' && said[2] == 'e' && said[3] == 'm' && said[4] == 'o') { if(!get_user_flags(id) && ADMIN_KICK) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } new arg[32] read_argv(1, arg, charsmax(arg)) copy(arg, charsmax(arg), said[6]) new player = cmd_target(id, arg, CMDTARGET_NO_BOTS | CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF) if(!player) return PLUGIN_HANDLED new name[32], name2[32] get_user_name(id, name, charsmax(name)) get_user_name(player, name2, charsmax(name2)) switch(demo_on[player]) { case false: { demo_on[player] = true client_cmd(player, "record ^"demo@%s^"", name2) client_print(id, print_chat, "[%s] Inregistrez un demo jucatorului %s", TAG, name2) } case true: client_print(id, print_chat, "[%s] Un demo este deja pornit pe jucatorul %s", TAG, name2) } return PLUGIN_HANDLED } else if(equal(said, "/stopdemo") || equal(said, "/stopdemo ")) { if(!get_user_flags(id) && ADMIN_KICK) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } client_print(id, print_chat, "[%s] Comanda: /stopdemo <nume sau #userid> - Opresti demo-ul jucatorului", TAG) return PLUGIN_HANDLED } else if(said[0] == '/' && said[1] == 's' && said[2] == 't' && said[3] == 'o' && said[4] == 'p' && said[5] == 'd' && said[6] == 'e' && said[7] == 'm' && said[8] == 'o') { if(!get_user_flags(id) && ADMIN_KICK) { client_print(id, print_chat, "[%s] Nu ai acces la aceasta comanda", TAG) return PLUGIN_HANDLED } new arg[32] read_argv(1, arg, charsmax(arg)) copy(arg, charsmax(arg), said[10]) new player = cmd_target(id, arg, CMDTARGET_NO_BOTS | CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF) if(!player) return PLUGIN_HANDLED new name[32], name2[32] get_user_name(id, name, charsmax(name)) get_user_name(player, name2, charsmax(name2)) switch(demo_on[player]) { case true: { demo_on[player] = false client_cmd(player, "stop") client_print(id, print_chat, "[%s] Am oprit demo-ul jucatorului %s", TAG, name2) } case false: client_print(id, print_chat, "[%s] Nici un demo nu este pornit pe jucatorul %s", TAG, name2) } return PLUGIN_HANDLED } switch(user_can_speak) { case false: { client_print(id, print_chat, "[%s] Canalul SAY este dezactivat pe parcursul meciului. Foloseste say_team", TAG) return PLUGIN_HANDLED } } return PLUGIN_CONTINUE } public t_win() { switch(mixon) { case 1: teamA[0] += 1 case 3: teamB[1] += 1 } } public ct_win() { switch(mixon) { case 1: teamB[0] += 1 case 3: teamA[1] += 1 } } public announce() { switch(mixon) { case 1, 3: { switch(schimbate) { case 0: { if(teamA[0] + teamA[1] > teamB[0] + teamB[1]) { client_print(0, print_chat, "[%s] Echipa celor de la T conduce echipa celor de la CT cu %d - %d", TAG, teamA[0] + teamA[1], teamB[0] + teamB[1]) } else if(teamA[0] + teamA[1] < teamB[0] + teamB[1]) { client_print(0, print_chat, "[%s] Echipa celor de la CT conduce echipa celor de la T cu %d - %d", TAG, teamB[0] + teamB[1], teamA[0] + teamA[1]) } else if(teamA[0] + teamA[1] == teamB[0] + teamB[1]) { client_print(0, print_chat, "[%s] Echipele sunt la egalitate cu %d - %d", TAG, teamA[0] + teamA[1], teamB[0] + teamB[1]) } } case 1: { if(teamA[0] + teamA[1] > teamB[0] + teamB[1]) { client_print(0, print_chat, "[%s] Echipa celor de la CT conduce echipa celor de la T cu %d - %d", TAG, teamA[0] + teamA[1], teamB[0] + teamB[1]) } else if(teamA[0] + teamA[1] < teamB[0] + teamB[1]) { client_print(0, print_chat, "[%s] Echipa celor de la T conduce echipa celor de la CT cu %d - %d", TAG, teamB[0] + teamB[1], teamA[0] + teamA[1]) } else if(teamA[0] + teamA[1] == teamB[0] + teamB[1]) { client_print(0, print_chat, "[%s] Echipele sunt la egalitate cu %d - %d", TAG, teamA[0] + teamA[1], teamB[0] + teamB[1]) } } } } } } public announce_winner() { switch(mixon) { case 3: { switch(schimbate) { case 0: { if(teamA[0] + teamA[1] == 16) { client_print(0, print_chat, "[%s] Echipa celor de la T castiga mix-ul cu %d - %d", TAG, teamA[0] + teamA[1], teamB[0] + teamB[1]) } else if(teamB[0] + teamB[1] == 16) { client_print(0, print_chat, "[%s] Echipa celor de la CT castiga mix-ul cu %d - %d", TAG, teamB[0] + teamB[1], teamA[0] + teamA[1]) } } case 1: { if(teamA[0] + teamA[1] == 16) { client_print(0, print_chat, "[%s] !cEchipa celor de la CT castiga mix-ul cu %d - %d", TAG, teamA[0] + teamA[1], teamB[0] + teamB[1]) } else if(teamB[0] + teamB[1] == 16) { client_print(0, print_chat, "[%s] Echipa celor de la T castiga mix-ul cu %d - %d", TAG, teamB[0] + teamB[1], teamA[0] + teamA[1]) } } } } } } public swap() { switch(mixon) { case 1: { if(teamA[0] + teamB[0] == 15) { switch(schimbate) { case 0: { mixon = 2 schimbate = 1 set_cvar_string("sv_restart", "1") set_cvar_string("mp_friendlyfire", "0") set_cvar_string("mp_freezetime", "0") set_cvar_string("mp_startmoney", "16000") new players[32], num get_players(players, num, "h") for(new i = 0; i < num; i++) { switch(cs_get_user_team(players)) { case CS_TEAM_T: cs_set_user_team(players[i], CS_TEAM_CT) case CS_TEAM_CT: cs_set_user_team(players[i], CS_TEAM_T) } } client_print(0, print_chat, "[%s] Prima repriza s-a incheiat. A doua repriza poate incepe", TAG) } } } } } } public end_mix() { switch(mixon) { case 3: { if(teamA[0] + teamA[1] == 16 || teamB[0] + teamB[1] == 16) { mixon = 0 schimbate = 0 teamA[0] = 0 teamB[0] = 0 teamA[1] = 0 teamB[1] = 0 if(pwon == true) { pwon = false set_cvar_string("sv_password", "") client_print(0, print_chat, "[%s] Parola serverului a fost scoasa automat", TAG) } if(user_can_speak == false) { user_can_speak = true client_print(0, print_chat, "[%s] Canalul SAY a fost deblocat automat", TAG) } set_cvar_string("sv_restart", "1") set_cvar_string("mp_friendlyfire", "0") set_cvar_string("mp_freezetime", "0") set_cvar_string("mp_startmoney", "800") } } } } public client_disconnect(id) { if(demo_on[id] == true) { demo_on[id] = false } } [/code]
Nume: Advanced Mix System
Versiune: 1.1
Autor: EpsiloN
Link oficial: Aici
Link download: Aici
Instalare:
1. Fișierul advanced_mix_system.sma îl puneti în addons/amxmodx/scripting
2. Fișierul advanced_mix_system.amxx îl puneti in addons/amxmodx/plugins
3. Intrati în fisierul addons/amxmodx/configs/plugins.ini și adăugati la urma:
Code: Select all
advanced_mix_system.amxx
- Nu are
Comenzi administrative (se tastează în consola și trebuie să fiți administrator):
say /mix - Deschide meniul cu comenzi pentru mix
say /pass <parolă> - Pune parolă serverului
say /nopass - Scoate parola serverului
say /say off - Blochează canalul SAY
say /say on - Deblochează canalul SAY
say /setari - Forțează setări jucătorilor (ex: ex_interp 0.01, cl_updaterate 101, cl_cmdrate 101 etc)
Comenzi publice (se tastează în joc prin apasarea tastei Y):
say /scor - Afișează scorul (doar dacă mix-ul este pornit)
Module necesare (se şterge ";" din faţa modulului de mai jos; acestea le găsiţi în fişierul amxmodx\configs\modules.ini):
- cstrike
Imagini:
- Vă las să descoperiți singuri :) ;)