It's easy. But i don't like this because real protection should work against bullet/grenade/knife damage only until a player pressed ATTACK/ATTACK2 button or protection interval has expired. That one is much harder to implement.
Here is the .sma with protection that BAIL has mentioned.
Just added/changed this:
Code:
new const g_iProtectionOffFlags = IN_ATTACK | IN_ATTACK2 | IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT
...
public On_ClientPreThink(id)
{
...
if ( buttons & g_iProtectionOffFlags )
{
RemoveProtection(id)
}
}