Hi,
this is respawn system in zombie plague , what i should do to make it limited respawn in nemesis/survivor rounds ? (only 2 , 3 times respawn in surv/nemes rounds)
PHP Code:
// Respawn Player Task (deathmatch)
public respawn_player_task(taskid)
{
// Already alive or round ended
if (g_isalive[ID_SPAWN] || g_endround)
return;
// Get player's team
static team
team = fm_cs_get_user_team(ID_SPAWN)
// Player moved to spectators
if (team == FM_CS_TEAM_SPECTATOR || team == FM_CS_TEAM_UNASSIGNED)
return;
// Respawn player automatically if allowed on current round
if (!g_swarmround || get_pcvar_num(cvar_allowrespawnswarm))
&& (!g_nemround || get_pcvar_num(cvar_allowrespawnnem))
&& (!g_plagueround || get_pcvar_num(cvar_allowrespawnplague))
&& ((!g_survround || get_pcvar_num(cvar_allowrespawnsurv))
{
// Infection rounds = none of the above
if (!get_pcvar_num(cvar_allowrespawninfection) && !g_survround && !g_nemround && && !g_swarmround && !g_plagueround)
return;
// Respawn if only the last human is left? (ignore this setting on survivor rounds)
if (!g_survround && !get_pcvar_num(cvar_respawnafterlast) && fnGetHumans() <= 1)
return;
// Respawn as zombie?
if (get_pcvar_num(cvar_deathmatch) == 2 || (get_pcvar_num(cvar_deathmatch) == 3 && random_num(0, 1)) || (get_pcvar_num(cvar_deathmatch) == 4 && fnGetZombies() < fnGetAlive()/2))
g_respawn_as_zombie[ID_SPAWN] = true
// Override respawn as zombie setting on nemesis and survivor rounds
if (g_survround) g_respawn_as_zombie[ID_SPAWN] = true
else if (g_nemround) g_respawn_as_zombie[ID_SPAWN] = false
respawn_player_manually(ID_SPAWN)
}
}
// Respawn Player Check Task (if killed by worldspawn)
public respawn_player_check_task(taskid)
{
// Successfully spawned or round ended
if (g_isalive[ID_SPAWN] || g_endround)
return;
// Get player's team
static team
team = fm_cs_get_user_team(ID_SPAWN)
// Player moved to spectators
if (team == FM_CS_TEAM_SPECTATOR || team == FM_CS_TEAM_UNASSIGNED)
return;
// If player was being spawned as a zombie, set the flag again
if (g_zombie[ID_SPAWN]) g_respawn_as_zombie[ID_SPAWN] = true
else g_respawn_as_zombie[ID_SPAWN] = false
respawn_player_manually(ID_SPAWN)
}
// Respawn Player Manually (called after respawn checks are done)
respawn_player_manually(id)
{
// Set proper team before respawning, so that the TeamInfo message that's sent doesn't confuse PODBots
if (g_respawn_as_zombie[id])
fm_cs_set_user_team(id, FM_CS_TEAM_T)
else
fm_cs_set_user_team(id, FM_CS_TEAM_CT)
// Respawning a player has never been so easy
ExecuteHamB(Ham_CS_RoundRespawn, id)
}
Thanks.