Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Commit

Permalink
Some optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nord1cWarr1or committed Jan 16, 2021
1 parent aefb94b commit 0f428ba
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions addons/amxmodx/scripting/AFK-Protection.sma
Expand Up @@ -252,9 +252,18 @@ public AFKCheck(id)

ToggleAFKProtection(const id)
{
set_entvar(id, var_takedamage, g_bIsPlayerAFK[id] ? DAMAGE_NO : DAMAGE_AIM);
set_entvar(id, var_solid, g_bIsPlayerAFK[id] ? SOLID_NOT : SOLID_SLIDEBOX);
set_member(id, m_bIsDefusing, g_bIsPlayerAFK[id] ? true : false);
if(g_bIsPlayerAFK[id])
{
set_entvar(id, var_takedamage, DAMAGE_NO);
set_entvar(id, var_solid, SOLID_NOT);
set_member(id, m_bIsDefusing, true);
}
else
{
set_entvar(id, var_takedamage, DAMAGE_AIM);
set_entvar(id, var_solid, SOLID_SLIDEBOX);
set_member(id, m_bIsDefusing, false);
}

ToggleEffects(id);
}
Expand Down

0 comments on commit 0f428ba

Please sign in to comment.