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];
Handle g_hSparkTimer;
bool g_bIsBoatEscape = false;
public void VerifyMap()
{
g_bIsBoatEscape = false;
char currentMap[64];
GetCurrentMap(currentMap, sizeof(currentMap));
if (!StrEqual(currentMap, "ze_boatescape6_remix_fix2"))
{
char sFilename[256];
GetPluginFilename(null, sFilename, sizeof(sFilename));
ServerCommand("sm plugins unload %s", sFilename);
}
else
g_bIsBoatEscape = StrEqual(currentMap, "ze_boatescape6_remix_fix2", false);
if (g_bIsBoatEscape)
{
AddFileToDownloadsTable("models/zombieden/xmode/youmu/laser.dx80.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_junk/watermelon01.mdl");
}
}
public void OnPluginStart()
@ -85,12 +83,16 @@ public void OnMapStart()
public void OnRoundEnd(Event hEvent, const char[] sEvent, bool bDontBroadcast)
{
if (g_bIsBoatEscape)
{
delete g_hSparkTimer;
}
}
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
{
if (g_bIsBoatEscape)
{
delete g_hSparkTimer;
SpawnSparkTimer();
SpawnSeagullRelay();
@ -254,6 +256,7 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
AcceptEntityInput(iMelon, "SetParent", iRotating);
SetVariantString("!activator");
AcceptEntityInput(iMelonBeam, "SetParent", iRotating);
}
}