|
Junior Member
|
09-27-2016
, 23:36
Re: [CS GO] Spawn protection with fall damage
|
#4
|
Quote:
Originally Posted by Nursik
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:damage) { SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage); }
|
Thank you!
I'll try this later
really thank you!
|
|
|
|