View Single Post
teo30
Junior Member
Join Date: Sep 2016
Old 09-27-2016 , 23:36   Re: [CS GO] Spawn protection with fall damage
Reply With Quote #4

Quote:
Originally Posted by Nursik View Post
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[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid")
    if(
IsClientInGame(client) && IsPlayerAlive(client))
    {
        
CreateTimer(3.0Timer_StopTakingNoDamageclient);
        
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    }
}
 
public 
Action OnTakeDamage(victim, &attacker, &inflictor, &damagefloat 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:timerany:damage)
{
    
SDKUnhook(clientSDKHook_OnTakeDamageOnTakeDamage);

Thank you!
I'll try this later
really thank you!
teo30 is offline