made sure plugin does not need to be unloaded

This commit is contained in:
jenz 2024-08-01 21:10:54 +02:00
parent be9d9dca43
commit 0e5cc3175c

View File

@ -13,17 +13,16 @@ public Plugin myinfo =
float g_fOrigin_Button5[3]; float g_fOrigin_Button5[3];
Handle g_hSparkTimer; Handle g_hSparkTimer;
bool g_bIsBoatEscape = false;
public void VerifyMap() public void VerifyMap()
{ {
g_bIsBoatEscape = false;
char currentMap[64]; char currentMap[64];
GetCurrentMap(currentMap, sizeof(currentMap)); GetCurrentMap(currentMap, sizeof(currentMap));
if (!StrEqual(currentMap, "ze_boatescape6_remix_fix2"))
{ g_bIsBoatEscape = StrEqual(currentMap, "ze_boatescape6_remix_fix2", false);
char sFilename[256]; if (g_bIsBoatEscape)
GetPluginFilename(null, sFilename, sizeof(sFilename));
ServerCommand("sm plugins unload %s", sFilename);
}
else
{ {
AddFileToDownloadsTable("models/zombieden/xmode/youmu/laser.dx80.vtx"); AddFileToDownloadsTable("models/zombieden/xmode/youmu/laser.dx80.vtx");
AddFileToDownloadsTable("models/zombieden/xmode/youmu/laser.dx90.vtx"); AddFileToDownloadsTable("models/zombieden/xmode/youmu/laser.dx90.vtx");
@ -68,7 +67,6 @@ public void VerifyMap()
PrecacheModel("models/props/cs_italy/orange.mdl"); PrecacheModel("models/props/cs_italy/orange.mdl");
PrecacheModel("models/props_junk/watermelon01.mdl"); PrecacheModel("models/props_junk/watermelon01.mdl");
} }
} }
public void OnPluginStart() public void OnPluginStart()
@ -84,13 +82,17 @@ public void OnMapStart()
} }
public void OnRoundEnd(Event hEvent, const char[] sEvent, bool bDontBroadcast) public void OnRoundEnd(Event hEvent, const char[] sEvent, bool bDontBroadcast)
{
if (g_bIsBoatEscape)
{ {
delete g_hSparkTimer; delete g_hSparkTimer;
} }
}
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast) public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
{ {
if (g_bIsBoatEscape)
{
delete g_hSparkTimer; delete g_hSparkTimer;
SpawnSparkTimer(); SpawnSparkTimer();
SpawnSeagullRelay(); SpawnSeagullRelay();
@ -255,6 +257,7 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
SetVariantString("!activator"); SetVariantString("!activator");
AcceptEntityInput(iMelonBeam, "SetParent", iRotating); AcceptEntityInput(iMelonBeam, "SetParent", iRotating);
} }
}