diff --git a/plugins/basefuncommands/drug.sp b/plugins/basefuncommands/drug.sp index 59da6664..f6572dc9 100644 --- a/plugins/basefuncommands/drug.sp +++ b/plugins/basefuncommands/drug.sp @@ -46,8 +46,7 @@ CreateDrug(client) KillDrug(client) { - KillTimer(g_DrugTimers[client]); - g_DrugTimers[client] = INVALID_HANDLE; + KillDrugTimer(client); new Float:pos[3]; GetClientAbsOrigin(client, pos); @@ -72,6 +71,12 @@ KillDrug(client) EndMessage(); } +KillDrugTimer(client) +{ + KillTimer(g_DrugTimers[client]); + g_DrugTimers[client] = INVALID_HANDLE; +} + KillAllDrugs() { new maxclients = GetMaxClients(); @@ -79,7 +84,14 @@ KillAllDrugs() { if (g_DrugTimers[i] != INVALID_HANDLE) { - KillDrug(i); + if(IsClientInGame(i)) + { + KillDrug(i); + } + else + { + KillDrugTimer(i); + } } } } @@ -124,13 +136,20 @@ PerformDrug(client, target, toggle) public Action:Timer_Drug(Handle:timer, any:client) { - if (!IsClientInGame(client) || !IsPlayerAlive(client)) + if (!IsClientInGame(client)) { - KillDrug(client); + KillDrugTimer(client); return Plugin_Handled; } + if (!IsPlayerAlive(client)) + { + KillDrug(client); + + return Plugin_Handled; + } + new Float:pos[3]; GetClientAbsOrigin(client, pos); diff --git a/plugins/basefuncommands/fire.sp b/plugins/basefuncommands/fire.sp index b05c0220..90e96c3c 100644 --- a/plugins/basefuncommands/fire.sp +++ b/plugins/basefuncommands/fire.sp @@ -60,8 +60,6 @@ KillFireBomb(client) { KillTimer(g_FireBombTimers[client]); g_FireBombTimers[client] = INVALID_HANDLE; - - SetEntityRenderColor(client, 255, 255, 255, 255); } KillAllFireBombs() @@ -96,6 +94,7 @@ PerformFireBomb(client, target, toggle) else { KillFireBomb(target); + SetEntityRenderColor(client, 255, 255, 255, 255); LogAction(client, target, "\"%L\" removed a FireBomb on \"%L\"", client, target); } } @@ -114,6 +113,7 @@ PerformFireBomb(client, target, toggle) if (g_FireBombTimers[target] != INVALID_HANDLE) { KillFireBomb(target); + SetEntityRenderColor(client, 255, 255, 255, 255); LogAction(client, target, "\"%L\" removed a FireBomb on \"%L\"", client, target); } } @@ -186,6 +186,7 @@ public Action:Timer_FireBomb(Handle:timer, any:client) IgniteEntity(client, GetConVarFloat(g_BurnDuration)); KillFireBomb(client); + SetEntityRenderColor(client, 255, 255, 255, 255); if (GetConVarInt(g_FireBombMode) > 0) { diff --git a/plugins/basefuncommands/ice.sp b/plugins/basefuncommands/ice.sp index 976742af..11afbcbb 100644 --- a/plugins/basefuncommands/ice.sp +++ b/plugins/basefuncommands/ice.sp @@ -71,6 +71,21 @@ FreezeClient(client, time) } UnfreezeClient(client) +{ + KillFreezeTimer(client); + + new Float:vec[3]; + GetClientAbsOrigin(client, vec); + vec[2] += 10; + + GetClientEyePosition(client, vec); + EmitAmbientSound(SOUND_FREEZE, vec, client, SNDLEVEL_RAIDSIREN); + + SetEntityMovetype(client, MOVETYPE_WALK); + SetEntityRenderColor(client, 255, 255, 255, 255); +} + +KillFreezeTimer(client) { KillTimer(g_FreezeTimers[client]); g_FreezeTimers[client] = INVALID_HANDLE; @@ -82,7 +97,6 @@ CreateFreezeBomb(client) g_FreezeBombTracker[client] = GetConVarInt(g_FreezeBombTicks); } - KillFreezeBomb(client) { KillTimer(g_FreezeBombTimers[client]); @@ -98,7 +112,14 @@ KillAllFreezes() { if (g_FreezeTimers[i] != INVALID_HANDLE) { - UnfreezeClient(i); + if(IsClientInGame(i)) + { + UnfreezeClient(i); + } + else + { + KillFreezeTimer(i); + } } if (g_FreezeBombTimers[i] != INVALID_HANDLE) @@ -154,13 +175,20 @@ PerformFreezeBomb(client, target, toggle) public Action:Timer_Freeze(Handle:timer, any:client) { - if (!IsClientInGame(client) || !IsPlayerAlive(client)) + if (!IsClientInGame(client)) { - KillFreezeBomb(client); + KillFreezeTimer(client); return Plugin_Handled; } + if (!IsPlayerAlive(client)) + { + UnfreezeClient(client); + + return Plugin_Handled; + } + g_FreezeTracker[client]--; SetEntityMovetype(client, MOVETYPE_NONE); @@ -176,14 +204,8 @@ public Action:Timer_Freeze(Handle:timer, any:client) if (g_FreezeTracker[client] == 0) { UnfreezeClient(client); - - GetClientEyePosition(client, vec); - EmitAmbientSound(SOUND_FREEZE, vec, client, SNDLEVEL_RAIDSIREN); - - SetEntityMovetype(client, MOVETYPE_WALK); - SetEntityRenderColor(client, 255, 255, 255, 255); } - + return Plugin_Handled; } diff --git a/plugins/basefuncommands/timebomb.sp b/plugins/basefuncommands/timebomb.sp index b808b4f5..be6731e0 100644 --- a/plugins/basefuncommands/timebomb.sp +++ b/plugins/basefuncommands/timebomb.sp @@ -57,8 +57,6 @@ KillTimeBomb(client) { KillTimer(g_TimeBombTimers[client]); g_TimeBombTimers[client] = INVALID_HANDLE; - - SetEntityRenderColor(client, 255, 255, 255, 255); } KillAllTimeBombs() @@ -87,6 +85,7 @@ PerformTimeBomb(client, target, toggle) else { KillTimeBomb(target); + SetEntityRenderColor(client, 255, 255, 255, 255); LogAction(client, target, "\"%L\" removed a TimeBomb on \"%L\"", client, target); } } @@ -105,6 +104,7 @@ PerformTimeBomb(client, target, toggle) if (g_TimeBombTimers[target] != INVALID_HANDLE) { KillTimeBomb(target); + SetEntityRenderColor(client, 255, 255, 255, 255); LogAction(client, target, "\"%L\" removed a TimeBomb on \"%L\"", client, target); } } @@ -163,6 +163,7 @@ public Action:Timer_TimeBomb(Handle:timer, any:client) ForcePlayerSuicide(client); KillTimeBomb(client); + SetEntityRenderColor(client, 255, 255, 255, 255); if (GetConVarInt(g_TimeBombMode) > 0) {