Zombie Reloaded 3.1 is installed and running properly, but I want to re-enable the objectives (hostages and bombs) to force the humans to be more proactive.
I tried editing roundstart.inc to remove the script responsible for deleting the objectives. I then compiled zombiereloaded.smx again (from zombiereloaded.sp), replaced the original plugin and restarted the server. This didn't do anything -- the plugin compiles and runs normally, without any hostages, c4, bomb sites or rescue zones.
I'm at a loss for what to do now. If anyone could point out where I'm going wrong, I'd appreciate it.
I've included the unmodified code from roundstart.inc below:
Code:
/**
* List of objective entities.
*/
#define ROUNDSTART_OBJECTIVE_ENTITIES "func_bomb_target|func_hostage_rescue|c4|hostage_entity"
/**
* Client is spawning into the game.
*
* @param client The client index.
*/
RoundStartOnClientSpawn(client)
{
// If client hasn't spawned yet, then stop.
if (!IsPlayerAlive(client))
{
return;
}
// Print to client, how to access ZMenu.
TranslationPrintToChat(client, "General zmenu reminder", SAYHOOKS_CHAT_PUBLIC_DEFAULT, SAYHOOKS_KEYWORD_ZMENU);
}
/**
* The round is starting.
*/
RoundStartOnRoundStart()
{
// Print round objective to all clients.
TranslationPrintToChatAll(true, false, "General round objective");
// Kill all objective entities.
RoundStartKillObjectives();
}
/**
* Kills all objective entities.
*/
stock RoundStartKillObjectives()
{
decl String:classname[64];
// Get max entity count.
new maxentities = GetMaxEntities();
// x = entity index.
for (new x = 0; x <= maxentities; x++)
{
// If entity isn't valid, then stop.
if(!IsValidEdict(x))
{
continue;
}
// Get valid edict's classname.
GetEdictClassname(x, classname, sizeof(classname));
// Check if it matches any objective entities, then stop if it doesn't.
if(StrContains(ROUNDSTART_OBJECTIVE_ENTITIES, classname) > -1)
{
// Entity is an objective, kill it.
AcceptEntityInput(x, "Kill");
}
}
}
EDIT: As it turns out, the method above is correct. However, as it also turns out, all the plugins in the "plugins" folder are loaded, even if they are in a sub-folder (except for the "disabled" folder). My backup folder was sabotaging me. If you want to keep handy backups, move them to the "disabled" folder.
Hostages function out of the box.
The bomb requires further tampering to be functional as zombies can't pick up the bomb. My fix was editing infect.inc to swap Terrorists and Counter-Terrorists, so that the zombies were CTs and the humans Ts.
If all the Humans died after the bomb was planted, the Zombies won, so I deleted the win condition of all Humans being infected/killed from roundend.inc. In order to trigger CS:S's default win, the last Human must be stabbed to death. (Otherwise, the round continues with no humans alive, regardless of whether the bomb was planted or not.) You can achieve this by editing playerclasses.txt, or installing the Last Human Resistance from the Addons section.
EDIT EDIT: The Last Human Resistance plugin seems to be responsible for a sporadic server crash I've been experiencing.
EDIT EDIT EDIT: It was definitely Last Human Resistance causing the crash; I wouldn't recommend using it.