View Single Post
iFusion
Junior Member
Join Date: Oct 2018
Old 03-21-2021 , 11:29   Re: AWP -X hp on every shot
Reply With Quote #5

Fixed and tested.

Its working.

PHP Code:
#include <sourcemod>
#include <sdkhooks>
#include <cstrike>

#pragma semicolon 1
#pragma newdecls required

#define DamagePlayer 10.0

public void OnPluginStart()
{
    
HookEvent("weapon_fire"weapon_fire);
}

public 
Action weapon_fire(Handle event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
char weapon[32];
    
GetEventString(event"weapon"weaponsizeof(weapon));
    
    if(
StrEqual(weapon"weapon_awp"))
    {
        
SDKHooks_TakeDamage(clientclientclientDamagePlayer);
    }

iFusion is offline