A few runtime fixes for basefuncommands
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401833
This commit is contained in:
parent
d0fac2def9
commit
9970ad59ac
@ -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,15 +71,28 @@ KillDrug(client)
|
||||
EndMessage();
|
||||
}
|
||||
|
||||
KillDrugTimer(client)
|
||||
{
|
||||
KillTimer(g_DrugTimers[client]);
|
||||
g_DrugTimers[client] = INVALID_HANDLE;
|
||||
}
|
||||
|
||||
KillAllDrugs()
|
||||
{
|
||||
new maxclients = GetMaxClients();
|
||||
for (new i = 1; i <= maxclients; i++)
|
||||
{
|
||||
if (g_DrugTimers[i] != INVALID_HANDLE)
|
||||
{
|
||||
if(IsClientInGame(i))
|
||||
{
|
||||
KillDrug(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
KillDrugTimer(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,7 +136,14 @@ PerformDrug(client, target, toggle)
|
||||
|
||||
public Action:Timer_Drug(Handle:timer, any:client)
|
||||
{
|
||||
if (!IsClientInGame(client) || !IsPlayerAlive(client))
|
||||
if (!IsClientInGame(client))
|
||||
{
|
||||
KillDrugTimer(client);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
if (!IsPlayerAlive(client))
|
||||
{
|
||||
KillDrug(client);
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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]);
|
||||
@ -97,9 +111,16 @@ KillAllFreezes()
|
||||
for (new i = 1; i <= maxclients; i++)
|
||||
{
|
||||
if (g_FreezeTimers[i] != INVALID_HANDLE)
|
||||
{
|
||||
if(IsClientInGame(i))
|
||||
{
|
||||
UnfreezeClient(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
KillFreezeTimer(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_FreezeBombTimers[i] != INVALID_HANDLE)
|
||||
{
|
||||
@ -154,9 +175,16 @@ 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;
|
||||
}
|
||||
@ -176,12 +204,6 @@ 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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user