Ogólnie wszystko zrobiłem, zostało tylk0 to, że po zabiciu 1 nemka robi sie 2 automatycznie, bez zmiany rundy. Zrobiłem to, ale coś źle działało. Czasami po zabiciu nemka serwer stawał. Myślę, że to wina tego, że serwer próbował dać nemka osobie, która nim przed chwilą była. Więc jak zrobić to losowanie omijając tego gracza?
Wywoływałem nemka tak w funkcji fw_PlayerKilled tak:
if(bylo_juz2 == 0 && g_nemesis[victim]) start_nemesis_mode(0, MODE_NONE)
Nemek losuje się tak:
if (bylo_juz2 == 0) { // Nemesis Mode g_nemround = true g_currentmode = MODE_NEMESIS g_lastmode = MODE_NEMESIS // Prevent Infection g_allowinfection = false // Choose player randomly? id = fnGetRandomAlive(random_num(1, iPlayersnum)) // Remember id for calling our forward later forward_id = id // Turn player into nemesis zombieme(id, 0, 1, 0, 0, 0) // Remaining players should be humans (CTs) for (id = 1; id <= g_maxplayers; id++) { // Not alive if (!g_isalive[id]) continue; // First nemesis if (g_zombie[id]) continue; // Switch to CT if (fm_cs_get_user_team(id) != FM_CS_TEAM_CT) // need to change team? { remove_task(id+TASK_TEAM) fm_cs_set_user_team(id, FM_CS_TEAM_CT) fm_user_team_update(id) } } // Play Nemesis sound ArrayGetString(sound_nemesis, random_num(0, ArraySize(sound_nemesis) - 1), sound, charsmax(sound)) PlaySound(sound); // Show Nemesis HUD notice set_hudmessage(255, 20, 20, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1) ShowSyncHudMsg(0, g_MsgSync, "%L", LANG_PLAYER, "NOTICE_NEMESIS", g_playername[forward_id]) // Start ambience sounds if (g_ambience_sounds[AMBIENCE_SOUNDS_NEMESIS]) { remove_task(TASK_AMBIENCESOUNDS) set_task(2.0, "ambience_sound_effects", TASK_AMBIENCESOUNDS) } // Mode fully started! g_modestarted = true // No more a new round g_newround = false // Round start forward ExecuteForward(g_fwRoundStart, g_fwDummyResult, MODE_NEMESIS, forward_id); // Stop here return; }
Dzięki za pomoc.