Tell me if it works.
PHP Code:
#pragma semicolon 1
#include sourcemod
#include sdkhooks
public void OnPluginStart()
{
HookEvent("player_spawn", OnPlayerSpawn);
}
public Action OnPlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid")
if(IsClientInGame(client) && IsPlayerAlive(client))
{
CreateTimer(3.0, Timer_StopTakingNoDamage, client);
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
}
public Action OnTakeDamage(victim, &attacker, &inflictor, &damage, float damageForce[3], float damagePosition[3])
{
If (IsClientInGame(victim) && IsPlayerAlive(victim))
If (damagetype & DMG_FALL)
{
damage *= 0.0;
return Plugin_Changed;
}
}
public Action:Timer_StopTakingNoDamage(Handle:timer, any:client)
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}