sm-plugins/CrowdSpawnWarning/scripting/CrowdSpawnWarning.sp
zaCade c8b3433700 Spring break cleanup.
Cleaning up all useless tabs, spaces, indents, you name it.
2018-07-23 17:06:03 +02:00

59 lines
2.2 KiB
SourcePawn

#include <sourcemod>
#include <multicolors>
#pragma newdecls required
/* CONVARS */
ConVar g_cvCrowdSpawn;
ConVar g_cvWarningEnabled;
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public Plugin myinfo =
{
name = "CrowdSpawnWarning",
author = "Neon",
description = "",
version = "1.0.0",
url = "https://steamcommunity.com/id/n3ontm"
};
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
void OnAllPluginsLoaded()
{
g_cvCrowdSpawn = FindConVar("zr_infect_mzombie_respawn");
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnPluginStart()
{
g_cvWarningEnabled = CreateConVar("sm_crowd_spawn_warning", "1", "", FCVAR_NONE, true, 0.0, true, 1.0);
HookEvent("round_start", OnRoundStart);
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
{
CreateTimer(5.0, OnRoundStartPost, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public Action OnRoundStartPost(Handle timer)
{
if (!GetConVarBool(FindConVar("zr_infect_mzombie_respawn")))
{
CPrintToChatAll("{red}[WARNING] {white}Zombies will be spawning {red}inbetween {white}the humans!!!");
CPrintToChatAll("{red}[WARNING] {white}Zombies will be spawning {red}inbetween {white}the humans!!!");
CPrintToChatAll("{red}[WARNING] {white}Zombies will be spawning {red}inbetween {white}the humans!!!");
}
}