diff --git a/plugins/funcommands.sp b/plugins/funcommands.sp index d98b996b..1d199e31 100644 --- a/plugins/funcommands.sp +++ b/plugins/funcommands.sp @@ -58,11 +58,11 @@ new Handle:hTopMenu = INVALID_HANDLE; #define SOUND_FREEZE "physics/glass/glass_impact_bullet4.wav" // Following are model indexes for temp entities -new g_BeamSprite; -new g_BeamSprite2; -new g_HaloSprite; -new g_GlowSprite; -new g_ExplosionSprite; +new g_BeamSprite = -1; +new g_BeamSprite2 = -1; +new g_HaloSprite = -1; +new g_GlowSprite = -1; +new g_ExplosionSprite = -1; // Basic color arrays for temp entities new redColor[4] = {255, 75, 75, 255}; @@ -169,11 +169,20 @@ public OnMapStart() PrecacheSound(SOUND_BOOM, true); PrecacheSound(SOUND_FREEZE, true); - g_BeamSprite = PrecacheModel("materials/sprites/laser.vmt"); - g_BeamSprite2 = PrecacheModel("sprites/bluelight1.vmt"); - g_HaloSprite = PrecacheModel("materials/sprites/halo01.vmt"); - g_GlowSprite = PrecacheModel("sprites/blueglow2.vmt"); - g_ExplosionSprite = PrecacheModel("sprites/sprite_fire01.vmt"); + if (GuessSDKVersion() == SOURCE_SDK_LEFT4DEAD2) + { + g_BeamSprite = PrecacheModel("materials/sprites/laserbeam.vmt"); + g_HaloSprite = PrecacheModel("materials/sprites/glow01.vmt"); + } + else + { + g_BeamSprite = PrecacheModel("materials/sprites/laser.vmt"); + g_HaloSprite = PrecacheModel("materials/sprites/halo01.vmt"); + g_BeamSprite2 = PrecacheModel("sprites/bluelight1.vmt"); + g_GlowSprite = PrecacheModel("sprites/blueglow2.vmt"); + g_ExplosionSprite = PrecacheModel("sprites/sprite_fire01.vmt"); + } + } public OnMapEnd() diff --git a/plugins/funcommands/fire.sp b/plugins/funcommands/fire.sp index f6667b44..662139db 100644 --- a/plugins/funcommands/fire.sp +++ b/plugins/funcommands/fire.sp @@ -134,8 +134,11 @@ public Action:Timer_FireBomb(Handle:timer, any:value) } else { - TE_SetupExplosion(vec, g_ExplosionSprite, 0.1, 1, 0, GetConVarInt(g_Cvar_FireBombRadius), 5000); - TE_SendToAll(); + if (g_ExplosionSprite > -1) + { + TE_SetupExplosion(vec, g_ExplosionSprite, 0.1, 1, 0, GetConVarInt(g_Cvar_FireBombRadius), 5000); + TE_SendToAll(); + } GetClientAbsOrigin(client, vec); vec[2] += 10; diff --git a/plugins/funcommands/ice.sp b/plugins/funcommands/ice.sp index ba349b01..fbe5db3a 100644 --- a/plugins/funcommands/ice.sp +++ b/plugins/funcommands/ice.sp @@ -186,7 +186,15 @@ public Action:Timer_Freeze(Handle:timer, any:value) GetClientAbsOrigin(client, vec); vec[2] += 10; - TE_SetupGlowSprite(vec, g_GlowSprite, 0.95, 1.5, 50); + if (g_GlowSprite > -1) + { + TE_SetupGlowSprite(vec, g_GlowSprite, 0.95, 1.5, 50); + } + else + { + TE_SetupGlowSprite(vec, g_HaloSprite, 0.95, 1.5, 50); + } + TE_SendToAll(); return Plugin_Continue; @@ -241,8 +249,11 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value) } else { - TE_SetupExplosion(vec, g_ExplosionSprite, 5.0, 1, 0, GetConVarInt(g_Cvar_FreezeBombRadius), 5000); - TE_SendToAll(); + if (g_ExplosionSprite > -1) + { + TE_SetupExplosion(vec, g_ExplosionSprite, 5.0, 1, 0, GetConVarInt(g_Cvar_FreezeBombRadius), 5000); + TE_SendToAll(); + } EmitAmbientSound(SOUND_BOOM, vec, client, SNDLEVEL_RAIDSIREN); @@ -275,7 +286,14 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value) continue; } - TE_SetupBeamPoints(vec, pos, g_BeamSprite2, g_HaloSprite, 0, 1, 0.7, 20.0, 50.0, 1, 1.5, blueColor, 10); + if (g_BeamSprite2 > -1) + { + TE_SetupBeamPoints(vec, pos, g_BeamSprite2, g_HaloSprite, 0, 1, 0.7, 20.0, 50.0, 1, 1.5, blueColor, 10); + } + else + { + TE_SetupBeamPoints(vec, pos, g_BeamSprite, g_HaloSprite, 0, 1, 0.7, 20.0, 50.0, 1, 1.5, blueColor, 10); + } TE_SendToAll(); FreezeClient(i, GetConVarInt(g_Cvar_FreezeDuration)); diff --git a/plugins/funcommands/timebomb.sp b/plugins/funcommands/timebomb.sp index 09ee125f..41a4cb50 100644 --- a/plugins/funcommands/timebomb.sp +++ b/plugins/funcommands/timebomb.sp @@ -127,8 +127,11 @@ public Action:Timer_TimeBomb(Handle:timer, any:value) } else { - TE_SetupExplosion(vec, g_ExplosionSprite, 5.0, 1, 0, GetConVarInt(g_Cvar_TimeBombRadius), 5000); - TE_SendToAll(); + if (g_ExplosionSprite > -1) + { + TE_SetupExplosion(vec, g_ExplosionSprite, 5.0, 1, 0, GetConVarInt(g_Cvar_TimeBombRadius), 5000); + TE_SendToAll(); + } EmitAmbientSound(SOUND_BOOM, vec, client, SNDLEVEL_RAIDSIREN); @@ -166,8 +169,12 @@ public Action:Timer_TimeBomb(Handle:timer, any:value) damage = RoundToFloor(damage * ((GetConVarFloat(g_Cvar_TimeBombRadius) - distance) / GetConVarFloat(g_Cvar_TimeBombRadius))); SlapPlayer(i, damage, false); - TE_SetupExplosion(pos, g_ExplosionSprite, 0.05, 1, 0, 1, 1); - TE_SendToAll(); + + if (g_ExplosionSprite > -1) + { + TE_SetupExplosion(pos, g_ExplosionSprite, 0.05, 1, 0, 1, 1); + TE_SendToAll(); + } /* ToDo new Float:dir[3];