670 lines
23 KiB
SourcePawn
670 lines
23 KiB
SourcePawn
#include <cstrike>
|
|
#include <multicolors>
|
|
#include <sourcemod>
|
|
#include <sdkhooks>
|
|
#include <sdktools>
|
|
#include <zombiereloaded>
|
|
|
|
#pragma semicolon 1
|
|
|
|
#define NUMBEROFSTAGES 6
|
|
|
|
bool g_bVoteFinished = true;
|
|
bool g_bIsRevote = false;
|
|
bool g_bStartVoteNextRound = false;
|
|
bool g_bPlayedZM = false;
|
|
bool g_bRaceEnabled;
|
|
bool g_bRaceAutoBhop;
|
|
bool g_bRaceBlockInfect;
|
|
bool g_bRaceBlockRespawn;
|
|
|
|
bool g_bOnCooldown[NUMBEROFSTAGES];
|
|
static char g_sStageName[NUMBEROFSTAGES][32] = {"Extreme 2", "Extreme 2 (Heal + Ultima)", "Extreme 3 (ZED)", "Extreme 3 (Hellz)", "Race Mode", "Zombie Mode"};
|
|
int g_Winnerstage;
|
|
|
|
Handle g_VoteMenu = INVALID_HANDLE;
|
|
Handle g_StageList = INVALID_HANDLE;
|
|
Handle g_CountdownTimer = INVALID_HANDLE;
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public Plugin myinfo =
|
|
{
|
|
name = "MakoV5 System CS:GO",
|
|
author = "Neon + xen",
|
|
description = "MakoV5 System CS:GO",
|
|
version = "1.0",
|
|
url = "https://steamcommunity.com/id/n3ontm"
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnPluginStart()
|
|
{
|
|
RegServerCmd("sm_makovote", Command_StartVote);
|
|
|
|
RegAdminCmd("sm_racebhop", Command_RaceBhop, ADMFLAG_GENERIC, "Toggle race-mode bhop");
|
|
|
|
RegConsoleCmd("sm_cancelrace", Command_CancelRace, "Cancel the race");
|
|
RegConsoleCmd("sm_startrace", Command_StartRace, "Start the race");
|
|
RegConsoleCmd("sm_endrace", Command_EndRace, "End the race");
|
|
|
|
HookEvent("round_start", OnRoundStart);
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnMapStart()
|
|
{
|
|
VerifyMap();
|
|
|
|
g_bStartVoteNextRound = false;
|
|
g_bPlayedZM = false;
|
|
|
|
for (int i = 0; i < NUMBEROFSTAGES; i++)
|
|
g_bOnCooldown[i] = false;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public Action VerifyMap()
|
|
{
|
|
char currentMap[64];
|
|
GetCurrentMap(currentMap, sizeof(currentMap));
|
|
|
|
if (!StrEqual(currentMap, "ze_ffvii_mako_reactor_v5_3_v5", false))
|
|
{
|
|
char sFilename[256];
|
|
GetPluginFilename(INVALID_HANDLE, sFilename, sizeof(sFilename));
|
|
|
|
ServerCommand("sm plugins unload %s", sFilename);
|
|
}
|
|
else
|
|
{
|
|
LoadContent();
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnEntitySpawned(int iEntity, const char[] sClassname)
|
|
{
|
|
if (!IsValidEntity(iEntity) || g_bVoteFinished)
|
|
return;
|
|
|
|
char sTargetname[128];
|
|
GetEntPropString(iEntity, Prop_Data, "m_iName", sTargetname, sizeof(sTargetname));
|
|
|
|
if ((strcmp(sTargetname, "espad") != 0) && (strcmp(sTargetname, "ss_slow") != 0) && (strcmp(sClassname, "ambient_generic") == 0))
|
|
{
|
|
AcceptEntityInput(iEntity, "Kill");
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
|
{
|
|
if (g_bStartVoteNextRound)
|
|
{
|
|
g_bVoteFinished = false;
|
|
if (!g_bPlayedZM)
|
|
{
|
|
CPrintToChatAll("{green}[Mako Vote] {default}ZM has not been played yet. Rolling the dice...");
|
|
if (GetRandomInt(1, 100) <= 35)
|
|
{
|
|
CPrintToChatAll("{green}[Mako Vote] {default}Result: ZM, restarting round.");
|
|
ServerCommand("sm_stage zm");
|
|
g_bVoteFinished = true;
|
|
g_bStartVoteNextRound = false;
|
|
g_bPlayedZM = true;
|
|
CS_TerminateRound(1.0, CSRoundEnd_GameStart, false);
|
|
return;
|
|
}
|
|
CPrintToChatAll("{green}[Mako Vote] {default}Result: Normal vote");
|
|
}
|
|
else
|
|
CPrintToChatAll("{green}[Mako Vote] {default}ZM already has been played. Starting normal vote.");
|
|
|
|
g_CountdownTimer = CreateTimer(1.0, StartVote, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
|
|
g_bStartVoteNextRound = false;
|
|
}
|
|
|
|
if (!(g_bVoteFinished))
|
|
{
|
|
int iStrip = FindEntityByTargetname(INVALID_ENT_REFERENCE, "RaceZone", "game_zone_player");
|
|
if (iStrip != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iStrip, "FireUser1");
|
|
|
|
int iButton1 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "boton", "func_button");
|
|
if (iButton1 != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iButton1, "Lock");
|
|
|
|
int iButton2 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "RaceMapButton1", "func_button");
|
|
if (iButton2 != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iButton2, "Lock");
|
|
|
|
int iButton3 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "RaceMapButton2", "func_button");
|
|
if (iButton3 != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iButton3, "Lock");
|
|
|
|
int iButton4 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "RaceMapButton3", "func_button");
|
|
if (iButton4 != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iButton4, "Lock");
|
|
|
|
int iButton5 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "RaceMapButton4", "func_button");
|
|
if (iButton5 != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iButton5, "Lock");
|
|
|
|
int iCounter = FindEntityByTargetname(INVALID_ENT_REFERENCE, "LevelCounter", "math_counter");
|
|
if (iCounter != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iCounter, "Kill");
|
|
|
|
int iFilter = FindEntityByTargetname(INVALID_ENT_REFERENCE, "humanos", "filter_activator_team");
|
|
if (iFilter != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iFilter, "Kill");
|
|
|
|
int iBarrerasfinal = FindEntityByTargetname(INVALID_ENT_REFERENCE, "barrerasfinal", "prop_dynamic");
|
|
if (iBarrerasfinal != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iBarrerasfinal, "Kill");
|
|
|
|
int iBarrerasfinal2 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "barrerasfinal2", "func_breakable");
|
|
if (iBarrerasfinal2 != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iBarrerasfinal2, "Break");
|
|
|
|
int iLevelText = FindEntityByTargetname(INVALID_ENT_REFERENCE, "LevelText", "game_text");
|
|
if (iLevelText != INVALID_ENT_REFERENCE)
|
|
{
|
|
SetVariantString("message > INTERMISSION ROUND <");
|
|
AcceptEntityInput(iLevelText, "AddOutput");
|
|
}
|
|
|
|
int iDestination = FindEntityByTargetname(INVALID_ENT_REFERENCE, "arriba2ex", "info_teleport_destination");
|
|
if (iDestination != INVALID_ENT_REFERENCE)
|
|
{
|
|
SetVariantString("origin -9350 4550 100");
|
|
AcceptEntityInput(iDestination, "AddOutput");
|
|
|
|
SetVariantString("angles 0 -90 0");
|
|
AcceptEntityInput(iDestination, "AddOutput");
|
|
}
|
|
|
|
int iTemplate1 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "EX2Laser1Temp", "point_template");
|
|
if (iTemplate1 != INVALID_ENT_REFERENCE)
|
|
{
|
|
DispatchKeyValue(iTemplate1, "OnEntitySpawned", "EX2Laser1Hurt,SetDamage,0,0,-1");
|
|
DispatchKeyValue(iTemplate1, "OnEntitySpawned", "EX2Laser1Hurt,AddOutput,OnStartTouch !activator:AddOutput:origin -7000 -1000 100:0:-1,0,-1");
|
|
}
|
|
|
|
int iTemplate2 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "EX2Laser2Temp", "point_template");
|
|
if (iTemplate2 != INVALID_ENT_REFERENCE)
|
|
{
|
|
DispatchKeyValue(iTemplate2, "OnEntitySpawned", "EX2Laser2Hurt,SetDamage,0,0,-1");
|
|
DispatchKeyValue(iTemplate2, "OnEntitySpawned", "EX2Laser2Hurt,AddOutput,OnStartTouch !activator:AddOutput:origin -7000 -1000 100:0:-1,0,-1");
|
|
}
|
|
|
|
int iTemplate3 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "EX2Laser3Temp", "point_template");
|
|
if (iTemplate3 != INVALID_ENT_REFERENCE)
|
|
{
|
|
DispatchKeyValue(iTemplate3, "OnEntitySpawned", "EX2Laser3Hurt,SetDamage,0,0,-1");
|
|
DispatchKeyValue(iTemplate3, "OnEntitySpawned", "EX2Laser3Hurt,AddOutput,OnStartTouch !activator:AddOutput:origin -7000 -1000 100:0:-1,0,-1");
|
|
}
|
|
|
|
int iTemplate4 = FindEntityByTargetname(INVALID_ENT_REFERENCE, "EX2Laser4Temp", "point_template");
|
|
if (iTemplate4 != INVALID_ENT_REFERENCE)
|
|
{
|
|
DispatchKeyValue(iTemplate4, "OnEntitySpawned", "EX2Laser4Hurt,SetDamage,0,0,-1");
|
|
DispatchKeyValue(iTemplate4, "OnEntitySpawned", "EX2Laser4Hurt,AddOutput,OnStartTouch !activator:AddOutput:origin -7000 -1000 100:0:-1,0,-1");
|
|
}
|
|
|
|
int iMusic = FindEntityByTargetname(INVALID_ENT_REFERENCE, "ss_slow", "ambient_generic");
|
|
if (iMusic != INVALID_ENT_REFERENCE)
|
|
{
|
|
SetVariantString("message #music/unloze/Pendulum_Witchcraft.mp3");
|
|
AcceptEntityInput(iMusic, "AddOutput");
|
|
|
|
AcceptEntityInput(iMusic, "PlaySound");
|
|
}
|
|
// CS:GO doesn't kill entities when they spawn I guess, so double down on that
|
|
iMusic = FindEntityByTargetname(INVALID_ENT_REFERENCE, "cancion_1", "ambient_generic");
|
|
if (iMusic != INVALID_ENT_REFERENCE)
|
|
{
|
|
AcceptEntityInput(iMusic, "Kill");
|
|
}
|
|
|
|
int iTeleport = FindEntityByTargetname(INVALID_ENT_REFERENCE, "teleporte_extreme", "trigger_teleport");
|
|
if (iTeleport != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iTeleport, "Enable");
|
|
|
|
int iTimer = FindEntityByTargetname(INVALID_ENT_REFERENCE, "cortes2", "logic_timer");
|
|
if (iTimer != INVALID_ENT_REFERENCE)
|
|
AcceptEntityInput(iTimer, "Enable");
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void GenerateArray()
|
|
{
|
|
int iBlockSize = ByteCountToCells(PLATFORM_MAX_PATH);
|
|
g_StageList = CreateArray(iBlockSize);
|
|
|
|
for (int i = 0; i < NUMBEROFSTAGES; i++)
|
|
PushArrayString(g_StageList, g_sStageName[i]);
|
|
|
|
int iArraySize = GetArraySize(g_StageList);
|
|
|
|
for (int i = 0; i < iArraySize; i++)
|
|
{
|
|
int iRandom = GetRandomInt(0, iArraySize - 1);
|
|
char sTemp1[128];
|
|
GetArrayString(g_StageList, iRandom, sTemp1, sizeof(sTemp1));
|
|
char sTemp2[128];
|
|
GetArrayString(g_StageList, i, sTemp2, sizeof(sTemp2));
|
|
SetArrayString(g_StageList, i, sTemp1);
|
|
SetArrayString(g_StageList, iRandom, sTemp2);
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public Action Command_StartVote(int args)
|
|
{
|
|
int iCurrentStage = GetCurrentStage();
|
|
|
|
if (iCurrentStage > 0)
|
|
g_bOnCooldown[iCurrentStage] = true;
|
|
|
|
if (iCurrentStage == 5)
|
|
g_bPlayedZM = true;
|
|
|
|
int iOnCD = 0;
|
|
for (int i = 0; i < NUMBEROFSTAGES; i++)
|
|
{
|
|
if (g_bOnCooldown[i])
|
|
iOnCD += 1;
|
|
}
|
|
|
|
if (iOnCD >= 4)
|
|
{
|
|
for (int i = 0; i < NUMBEROFSTAGES; i++)
|
|
g_bOnCooldown[i] = false;
|
|
}
|
|
|
|
GenerateArray();
|
|
g_bStartVoteNextRound = true;
|
|
|
|
return Plugin_Handled;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public Action StartVote(Handle timer)
|
|
{
|
|
static int iCountDown = 5;
|
|
PrintCenterTextAll("[MakoVote] Starting Vote in %ds", iCountDown);
|
|
|
|
if (iCountDown-- <= 0)
|
|
{
|
|
iCountDown = 5;
|
|
KillTimer(g_CountdownTimer);
|
|
g_CountdownTimer = INVALID_HANDLE;
|
|
InitiateVote();
|
|
}
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void InitiateVote()
|
|
{
|
|
if(IsVoteInProgress())
|
|
{
|
|
CPrintToChatAll("{green}[Mako Vote] {default}Another vote is currently in progress, retrying again in 5s.");
|
|
g_CountdownTimer = CreateTimer(1.0, StartVote, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
|
|
return;
|
|
}
|
|
|
|
Handle menuStyle = GetMenuStyleHandle(view_as<MenuStyle>(0));
|
|
g_VoteMenu = CreateMenuEx(menuStyle, Handler_MakoVoteMenu, MenuAction_End | MenuAction_Display | MenuAction_DisplayItem | MenuAction_VoteCancel);
|
|
|
|
int iArraySize = GetArraySize(g_StageList);
|
|
for (int i = 0; i < iArraySize; i++)
|
|
{
|
|
char sBuffer[128];
|
|
GetArrayString(g_StageList, i, sBuffer, sizeof(sBuffer));
|
|
|
|
for (int j = 0; j < NUMBEROFSTAGES; j++)
|
|
{
|
|
if (strcmp(sBuffer, g_sStageName[j]) == 0)
|
|
{
|
|
if (g_bOnCooldown[j])
|
|
AddMenuItem(g_VoteMenu, sBuffer, sBuffer, ITEMDRAW_DISABLED);
|
|
else
|
|
AddMenuItem(g_VoteMenu, sBuffer, sBuffer);
|
|
}
|
|
}
|
|
}
|
|
|
|
SetMenuOptionFlags(g_VoteMenu, MENUFLAG_BUTTON_NOVOTE);
|
|
SetMenuTitle(g_VoteMenu, "What stage to play next?");
|
|
SetVoteResultCallback(g_VoteMenu, Handler_SettingsVoteFinished);
|
|
VoteMenuToAll(g_VoteMenu, 20);
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public int Handler_MakoVoteMenu(Handle menu, MenuAction action, int param1, int param2)
|
|
{
|
|
switch(action)
|
|
{
|
|
case MenuAction_End:
|
|
{
|
|
delete menu;
|
|
|
|
if (param1 != -1)
|
|
{
|
|
g_bVoteFinished = true;
|
|
float fDelay = 3.0;
|
|
CS_TerminateRound(fDelay, CSRoundEnd_GameStart, false);
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public int MenuHandler_NotifyPanel(Menu hMenu, MenuAction iAction, int iParam1, int iParam2)
|
|
{
|
|
switch (iAction)
|
|
{
|
|
case MenuAction_Select, MenuAction_Cancel:
|
|
delete hMenu;
|
|
}
|
|
}
|
|
|
|
public void Handler_SettingsVoteFinished(Handle menu, int num_votes, int num_clients, const int[][] client_info, int num_items, const int[][] item_info)
|
|
{
|
|
int highest_votes = item_info[0][VOTEINFO_ITEM_VOTES];
|
|
int required_percent = 60;
|
|
int required_votes = RoundToCeil(float(num_votes) * float(required_percent) / 100);
|
|
|
|
if ((highest_votes < required_votes) && (!g_bIsRevote))
|
|
{
|
|
CPrintToChatAll("{green}[MakoVote] {default}A revote is needed!");
|
|
char sFirst[128];
|
|
char sSecond[128];
|
|
GetMenuItem(menu, item_info[0][VOTEINFO_ITEM_INDEX], sFirst, sizeof(sFirst));
|
|
GetMenuItem(menu, item_info[1][VOTEINFO_ITEM_INDEX], sSecond, sizeof(sSecond));
|
|
ClearArray(g_StageList);
|
|
PushArrayString(g_StageList, sFirst);
|
|
PushArrayString(g_StageList, sSecond);
|
|
g_bIsRevote = true;
|
|
g_CountdownTimer = CreateTimer(1.0, StartVote, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
|
|
|
|
return;
|
|
}
|
|
|
|
// No revote needed, continue as normal.
|
|
g_bIsRevote = false;
|
|
Handler_VoteFinishedGeneric(menu, num_votes, num_clients, client_info, num_items, item_info);
|
|
}
|
|
|
|
public void Handler_VoteFinishedGeneric(Handle menu, int num_votes, int num_clients, const int[][] client_info, int num_items, const int[][] item_info)
|
|
{
|
|
g_bVoteFinished = true;
|
|
char sWinner[128];
|
|
GetMenuItem(menu, item_info[0][VOTEINFO_ITEM_INDEX], sWinner, sizeof(sWinner));
|
|
float fPercentage = float(item_info[0][VOTEINFO_ITEM_VOTES] * 100) / float(num_votes);
|
|
|
|
CPrintToChatAll("{green}[MakoVote] {default}Vote Finished! Winner: {red}%s{default} with %d%% of %d votes!", sWinner, RoundToFloor(fPercentage), num_votes);
|
|
|
|
for (int i = 0; i < NUMBEROFSTAGES; i++)
|
|
{
|
|
if (strcmp(sWinner, g_sStageName[i]) == 0)
|
|
g_Winnerstage = i;
|
|
}
|
|
|
|
ServerCommand("sm_stage %d", (g_Winnerstage + 4));
|
|
|
|
float fDelay = 3.0;
|
|
CS_TerminateRound(fDelay, CSRoundEnd_GameStart, false);
|
|
}
|
|
|
|
public int GetCurrentStage()
|
|
{
|
|
int iLevelCounterEnt = FindEntityByTargetname(INVALID_ENT_REFERENCE, "LevelCounter", "math_counter");
|
|
|
|
int offset = FindDataMapInfo(iLevelCounterEnt, "m_OutValue");
|
|
int iCounterVal = RoundFloat(GetEntDataFloat(iLevelCounterEnt, offset));
|
|
|
|
int iCurrentStage;
|
|
if (iCounterVal == 5)
|
|
iCurrentStage = 0;
|
|
else if (iCounterVal == 6)
|
|
iCurrentStage = 5;
|
|
else if (iCounterVal == 7)
|
|
iCurrentStage = 1;
|
|
else if (iCounterVal == 9)
|
|
iCurrentStage = 3;
|
|
else if (iCounterVal == 10)
|
|
iCurrentStage = 2;
|
|
else if (iCounterVal == 11)
|
|
iCurrentStage = 4;
|
|
else
|
|
iCurrentStage = 0;
|
|
|
|
return iCurrentStage;
|
|
}
|
|
|
|
public int FindEntityByTargetname(int entity, const char[] sTargetname, const char[] sClassname)
|
|
{
|
|
if(sTargetname[0] == '#') // HammerID
|
|
{
|
|
int HammerID = StringToInt(sTargetname[1]);
|
|
|
|
while((entity = FindEntityByClassname(entity, sClassname)) != INVALID_ENT_REFERENCE)
|
|
{
|
|
if(GetEntProp(entity, Prop_Data, "m_iHammerID") == HammerID)
|
|
return entity;
|
|
}
|
|
}
|
|
else // Targetname
|
|
{
|
|
int Wildcard = FindCharInString(sTargetname, '*');
|
|
char sTargetnameBuf[64];
|
|
|
|
while((entity = FindEntityByClassname(entity, sClassname)) != INVALID_ENT_REFERENCE)
|
|
{
|
|
if(GetEntPropString(entity, Prop_Data, "m_iName", sTargetnameBuf, sizeof(sTargetnameBuf)) <= 0)
|
|
continue;
|
|
|
|
if(strncmp(sTargetnameBuf, sTargetname, Wildcard) == 0)
|
|
return entity;
|
|
}
|
|
}
|
|
return INVALID_ENT_REFERENCE;
|
|
}
|
|
|
|
public Action Command_RaceBhop(int client, int args)
|
|
{
|
|
g_bRaceAutoBhop = !g_bRaceAutoBhop;
|
|
|
|
if(g_bRaceAutoBhop)
|
|
{
|
|
ServerCommand("sm plugins unload togsjumpstats");
|
|
ServerCommand("sm plugins reload adminmenu");
|
|
ServerCommand("sv_autobunnyhopping 1");
|
|
ServerCommand("sv_airaccelerate 150");
|
|
}
|
|
else
|
|
{
|
|
ServerCommand("sm plugins load togsjumpstats");
|
|
ServerCommand("sm plugins reload adminmenu");
|
|
ServerCommand("sv_autobunnyhopping 0");
|
|
ServerCommand("sv_airaccelerate 12");
|
|
}
|
|
|
|
return Plugin_Handled;
|
|
}
|
|
|
|
public Action Command_CancelRace(int client, int args)
|
|
{
|
|
if (g_bRaceAutoBhop)
|
|
{
|
|
ServerCommand("sm plugins load togsjumpstats");
|
|
ServerCommand("sm plugins reload adminmenu");
|
|
ServerCommand("sv_autobunnyhopping 0");
|
|
ServerCommand("sv_airaccelerate 12");
|
|
}
|
|
g_bRaceEnabled = false;
|
|
g_bRaceAutoBhop = false;
|
|
g_bRaceBlockInfect = false;
|
|
g_bRaceBlockRespawn = false;
|
|
|
|
return Plugin_Handled;
|
|
}
|
|
|
|
public Action Command_StartRace(int client, int args)
|
|
{
|
|
g_bRaceEnabled = true;
|
|
g_bRaceBlockInfect = true;
|
|
g_bRaceBlockRespawn = true;
|
|
|
|
return Plugin_Handled;
|
|
}
|
|
|
|
public Action Command_EndRace(int client, int args)
|
|
{
|
|
g_bRaceBlockInfect = false;
|
|
|
|
char sTargetname[128];
|
|
|
|
for(int i = 1; i <= MaxClients; i++)
|
|
{
|
|
if(IsClientInGame(i) && IsPlayerAlive(i))
|
|
{
|
|
GetEntPropString(i, Prop_Data, "m_iName", sTargetname, sizeof(sTargetname));
|
|
|
|
if(!StrEqual(sTargetname, "player_racewinner", false))
|
|
{
|
|
ZR_InfectClient(i);
|
|
}
|
|
}
|
|
}
|
|
|
|
CreateTimer(5.0, SlayAll);
|
|
|
|
int entity;
|
|
|
|
while((entity = FindEntityByClassname(entity, "*")) != -1)
|
|
{
|
|
if(IsValidEntity(entity))
|
|
{
|
|
GetEntPropString(entity, Prop_Data, "m_iName", sTargetname, sizeof(sTargetname));
|
|
|
|
if(StrEqual(sTargetname, "RaceRelayEnd", false))
|
|
AcceptEntityInput(entity, "CancelPending");
|
|
}
|
|
}
|
|
|
|
return Plugin_Handled;
|
|
}
|
|
|
|
public Action:ZR_OnClientInfect(&client, &attacker, &bool:motherInfect, &bool:respawnOverride, &bool:respawn)
|
|
{
|
|
if(g_bRaceEnabled && g_bRaceBlockInfect)
|
|
return Plugin_Handled;
|
|
|
|
return Plugin_Continue;
|
|
}
|
|
|
|
public Action:ZR_OnClientRespawn(&client, &ZR_RespawnCondition:condition)
|
|
{
|
|
if(g_bRaceEnabled && g_bRaceBlockRespawn)
|
|
return Plugin_Handled;
|
|
|
|
return Plugin_Continue;
|
|
}
|
|
|
|
public Action SlayAll(Handle timer)
|
|
{
|
|
for(int i = 1; i <= MaxClients; i++)
|
|
if(IsClientInGame(i) && IsPlayerAlive(i))
|
|
ForcePlayerSuicide(i);
|
|
}
|
|
|
|
public void LoadContent()
|
|
{
|
|
AddFileToDownloadsTable("models/player/uuz/sephiroth/sephiroth.mdl");
|
|
AddFileToDownloadsTable("models/player/uuz/sephiroth/sephiroth.phy");
|
|
AddFileToDownloadsTable("models/player/uuz/sephiroth/sephiroth.vvd");
|
|
AddFileToDownloadsTable("models/player/uuz/sephiroth/sephiroth.dx90.vtx");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part1.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part1.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part2.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part2.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part3.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part3.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part4.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part4.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part5.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part5.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part6.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part6.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part7.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part7.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part8.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part8.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part9.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part9.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part10.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part10.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part11.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part11.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part12.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part12.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part13.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part13.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part14.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part14.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part15.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part15.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part16.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part16.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part17.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part17.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part18.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part18.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part19.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part19.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part20.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/uuz/sephiroth/part20.vtf");
|
|
AddFileToDownloadsTable("sound/hl1/fvox/beep.wav");
|
|
AddFileToDownloadsTable("sound/zombieden/custommusic/advent2.mp3");
|
|
AddFileToDownloadsTable("sound/zombieden/custommusic/m2fix.mp3");
|
|
AddFileToDownloadsTable("sound/zombieden/custommusic/m3fix.mp3");
|
|
AddFileToDownloadsTable("sound/zombieden/custommusic/m4fix.mp3");
|
|
AddFileToDownloadsTable("sound/zombieden/custommusic/m5fix.mp3");
|
|
AddFileToDownloadsTable("sound/zombieden/custommusic/m6.mp3");
|
|
AddFileToDownloadsTable("sound/music/unloze/Pendulum_Witchcraft.mp3");
|
|
PrecacheSound("#zombieden/custommusic/advent2.mp3", true);
|
|
PrecacheSound("#zombieden/custommusic/m2fix.mp3", true);
|
|
PrecacheSound("#zombieden/custommusic/m3fix.mp3", true);
|
|
PrecacheSound("#zombieden/custommusic/m4fix.mp3", true);
|
|
PrecacheSound("#zombieden/custommusic/m5fix.mp3", true);
|
|
PrecacheSound("#zombieden/custommusic/m6.mp3", true);
|
|
PrecacheSound("#music/unloze/Pendulum_Witchcraft.mp3", true);
|
|
} |