#pragma semicolon 1
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#pragma newdecls required
#define DMG_FALL (1 << 5)
bool
g_bIsEnd;
public Plugin myinfo =
{
name = "[CS:GO] No Fall Damage",
author = "alexip121093 & Neoxx",
description = "No Falling Damage & No Fall Damage Sound",
version = "1.0.1",
url = "https://forums.alliedmods.net/showthread.php?p=2316188"
}
public void OnPluginStart()
{
AddNormalSoundHook(SoundHook);
HookEvent("round_end", Event_Round);
HookEvent("round_start", Event_Round);
}
void Event_Round(Event hEvent, const char[] szName, bool bDontBroadcast)
{
g_bIsEnd = (szName[6] == 'e');
}
public void OnClientPostAdminCheck(int client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action SoundHook(int clients[64], int &numClients, char sound[PLATFORM_MAX_PATH], int &entity, int &channel, float &volume, int &level, int &pitch, int &flags)
{
if(g_bIsEnd && StrContains(sound, "player/damage", false) >= 0)
return Plugin_Handled;
return Plugin_Continue;
}
public Action OnTakeDamage(int client, int &attacker, int &inflictor, float &damage, int &damagetype)
{
if(g_bIsEnd && (damagetype & DMG_FALL))
return Plugin_Handled;
return Plugin_Continue;
}