Funkcja od zwykłej infekcji:
// Start the default infection mode
start_infection_mode(id, mode)
{
// Get alive players count
static iPlayersnum
iPlayersnum = fnGetAlive()
static forward_id
// Single Infection Mode
g_currentmode = MODE_INFECTION
g_lastmode = MODE_INFECTION
// Allow Infection
g_allowinfection = true
// Choose player randomly?
if (mode == MODE_NONE)
id = fnGetRandomAlive(random_num(1, iPlayersnum))
// Turn player into the first zombie
zombieme(id, 0, 0, 0, 0, 0)
// Remember id for calling our forward later
forward_id = id
// Remaining players should be humans (CTs)
for (id = 1; id <= g_maxplayers; id++)
{
// Not alive
if (!g_isalive[id])
continue;
// First zombie
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)
}
}
// Show First Zombie HUD notice
set_hudmessage(255, 0, 0, HUD_EVENT_X, HUD_EVENT_Y, 0, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "%L",LANG_PLAYER, "NOTICE_FIRST", g_playername[forward_id])
// Start ambience sounds
if (g_ambience_sounds[AMBIENCE_SOUNDS_INFECTION])
{
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_INFECTION, forward_id);
}Dzięki za pomoc.


Dodatki SourceMod



Temat jest zamknięty









