diff --git a/scripting/include/hideandseek/hscmds.inc b/scripting/include/hideandseek/hscmds.inc index 6e7fe8d..9f0d957 100644 --- a/scripting/include/hideandseek/hscmds.inc +++ b/scripting/include/hideandseek/hscmds.inc @@ -312,6 +312,7 @@ public Action OnClientSayCommand(int client, const char[] command, const char[] public Action Command_Join(int client, int args) { + if(!isEnabled) return Plugin_Continue; static float tpLoc[3]; GetSpawnPosition(tpLoc); if(args == 1) { diff --git a/scripting/include/hideandseek/hscore.inc b/scripting/include/hideandseek/hscore.inc index 72c1d22..86ca47f 100644 --- a/scripting/include/hideandseek/hscore.inc +++ b/scripting/include/hideandseek/hscore.inc @@ -1,10 +1,12 @@ #include -#include #include +#include static KeyValues kv; StringMap mapConfigs; +static float DEFAULT_SCALE[3] = { 5.0, 5.0, 5.0 }; + bool ReloadMapDB() { if(kv != null) { delete kv; diff --git a/scripting/include/hideandseek/hsgame.inc b/scripting/include/hideandseek/hsgame.inc index 21b7405..eeae405 100644 --- a/scripting/include/hideandseek/hsgame.inc +++ b/scripting/include/hideandseek/hsgame.inc @@ -308,4 +308,5 @@ stock void GetViewVector(float fVecAngle[3], float fOutPut[3]) bool Filter_IgnoreAll(int entity, int mask) { return false; -} \ No newline at end of file +} + diff --git a/scripting/l4d2_hideandseek.sp b/scripting/l4d2_hideandseek.sp index 536801d..7ab105a 100644 --- a/scripting/l4d2_hideandseek.sp +++ b/scripting/l4d2_hideandseek.sp @@ -12,10 +12,10 @@ #include #include #include +#include #include #if defined DEBUG_BLOCKERS #include -int g_iLaserIndex; #endif public Plugin myinfo = @@ -60,53 +60,17 @@ enum GameState { State_Hunting } -char gamemode[32], currentMap[64]; -bool isEnabled, lateLoaded; - -bool isPendingPlay[MAXPLAYERS+1]; -bool isNavBlockersEnabled = true, isPropsEnabled = true, isPortalsEnabled = true; bool isNearbyPlaying[MAXPLAYERS+1]; bool wasThirdPersonVomitted[MAXPLAYERS+1]; bool gameOver; int currentSeeker; int currentPlayers = 0; -float DEFAULT_SCALE[3] = { 5.0, 5.0, 5.0 }; - -char currentSet[16] = "default"; - Handle suspenseTimer, thirdPersonTimer; -char nextRoundMap[64]; -int seekerCam = INVALID_ENT_REFERENCE; -bool isViewingCam[MAXPLAYERS+1]; - int g_BeamSprite; int g_HaloSprite; -enum struct EntityConfig { - float origin[3]; - float rotation[3]; - char type[32]; - char model[64]; - float scale[3]; - float offset[3]; -} - -enum struct MapConfig { - ArrayList entities; - ArrayList inputs; - float spawnpoint[3]; - bool hasSpawnpoint; - int mapTime; - bool canClimb; - bool pressButtons; -} - -MapConfig mapConfig; -ArrayList validMaps; -ArrayList validSets; - bool hasBeenSeeker[MAXPLAYERS+1]; bool ignoreSeekerBalance; @@ -244,6 +208,14 @@ public Action L4D2_OnChangeFinaleStage(int &finaleType, const char[] arg) { return Plugin_Continue; } +public void OnSceneStageChanged(int scene, SceneStages stage) { + if(isEnabled && stage == SceneStage_Spawned) { + int activator = GetSceneInitiator(scene); + if(activator != GetActorFromScene(scene)) { + CancelScene(scene); + } + } +} public void Event_GamemodeChange(ConVar cvar, const char[] oldValue, const char[] newValue) { cvar.GetString(gamemode, sizeof(gamemode)); @@ -278,7 +250,7 @@ public void Event_GamemodeChange(ConVar cvar, const char[] oldValue, const char[ } } } - } else if(!lateLoaded && suspenseTimer != null) { + } else if(!lateLoaded) { UnhookEvent("round_end", Event_RoundEnd); UnhookEvent("round_start", Event_RoundStart); UnhookEvent("item_pickup", Event_ItemPickup);