Witam.
Otóż mam mały problem z tym pluginem (spoiler)
Wszystko działa (najlepszy gracz rundy, poszukiwany, dzwieki + napisy), ale jedno nie działa! Jest to "Szalenstwo zabijania zatrzymane przez..."
Dlaczego?
co jest źle?
Kod był skopiowany i tyle
Uwaga!
Celowo usnąłem plugin_precache i kilka nieistotnych rzeczy (lista dzwieków, napisów)
#include <amxmodx> #include <amxmisc> #define LEVELS 8 #define PREPARE_HUD() set_hudmessage(42, 255, 42, 0.02, -1.0, 0, 6.0, 6.0, _, _, 1) //rozrabiaka #define PREPARE_HUD2() set_hudmessage(42, 42, 255, 0.62, -1.0, 0, 6.0, 6.0, _, _, 4) //koniec szalenstwa #define PREPARE_HUD3() set_hudmessage(255, 0, 0, 0.02, 0.4, 0, 6.0, 6.0, _, _, -1) //poszukiwany new levels[8] = {3, 5, 7, 9, 11, 13, 14, 15}; new kills[33] = {0, ...}; new g_pointsHs[MAX_PLAYERS+1] new g_pointsThisRound[MAX_PLAYERS+1][2]; //[1] to HS public plugin_init() { register_plugin("Ultimate Sounds", "1.3", "xxx") register_event("DeathMsg", "DeathMsg", "a"); register_event("TextMsg", "ResetAll", "a", "2&#Game_will_restart_in" ); register_event("TextMsg", "ResetAll", "a", "2&#Game_C"); register_logevent("ResetAllThisRound", 2, "1=Round_Start"); register_logevent("Podsumuj", 2, "1=Round_End"); return PLUGIN_CONTINUE } public DeathMsg(id) { new killer = read_data(1); new victim = read_data(2); new szKillNick[33]; get_user_name(killer, szKillNick, 32); g_pointsThisRound[killer][0]++; kills[killer] += 1; kills[victim] = 0; if(!is_user_connected(killer)) { reset(victim); return PLUGIN_CONTINUE; } if(read_data(3)) { g_pointsHs[killer]++; g_pointsThisRound[killer][1]++; } for (new i = 0; i < LEVELS; i++) { if (kills[killer] == levels[i]) { announce(killer, i); return PLUGIN_CONTINUE; } } if(kills[victim]>3 && get_playersnum()>3) { new szVicNick[33]; get_user_name(victim, szVicNick, 32); PREPARE_HUD2(); show_hudmessage(0, "Szalenstwo zabijania^n%s^n[%d w tym %d HS]^n^nzatrzymane przez:^n%s", szVicNick, kills[victim], g_pointsHs[victim], szKillNick); } if(kills[killer]==10 || kills[killer]==12 || kills[killer]==15) { PREPARE_HUD3(); show_hudmessage(0, "Poszukiwany:^n%s", szKillNick); set_task(1.0, "Poszukiwany", TASKID_POSZUKWIANY,.flags="a",.repeat=3); } reset(victim); return PLUGIN_CONTINUE; } public podsumowanie() { new bool:double=false; new id=0; for(new i=1;i<=MAX_PLAYERS;i++) { if(g_pointsThisRound[id][0]==g_pointsThisRound[i][0]) { if(g_pointsThisRound[id][1] == g_pointsThisRound[i][1]) double=true; else if(g_pointsThisRound[id][1] < g_pointsThisRound[i][1]) { id=i; double=false; } } else if(g_pointsThisRound[id][0] < g_pointsThisRound[i][0]) { id=i; double=false; } } if(!double && id && get_playersnum()>2) { PREPARE_HUD(); new szNick[33]; get_user_name(id, szNick, 32); show_hudmessage(0, "Najbardziej narozrabial:^n%s^n[%d w tym %d HS]", szNick, g_pointsThisRound[id][0], g_pointsThisRound[id][1]); } } public Podsumuj() set_task(0.5, "podsumowanie"); public Poszukiwany() client_cmd(0, "spk ultimate_sounds_by_rivit/klaxon.wav"); public client_connect(id) kills[id] = 0; public client_putinserver(id) { reset(id); resetRound(id); } public client_disconnect(id) { reset(id); resetRound(id); } resetRound(id) { g_pointsThisRound[id][0]=0; g_pointsThisRound[id][1]=0; } public ResetAllThisRound() { for(new i=0;i<=MAX_PLAYERS;i++) resetRound(i); } public ResetAll() { for(new i=0;i<=MAX_PLAYERS;i++) reset(i); } announce(killer, level) { new name[32]; get_user_name(killer, name, 32); set_hudmessage(0, 255, 0, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 3); show_hudmessage(0, stkmessages[level], name); client_cmd(0, "spk %s", stksounds[level]); } reset(id) { kills[id]=0; g_pointsHs[id]=0; }