View Single Post
nguyenbaodanh
AlliedModders Donor
Join Date: Jun 2007
Location: HCMC, Vietnam
Old 03-21-2021 , 02:40   Re: AWP -X hp on every shot
Reply With Quote #3

Quote:
Originally Posted by iFusion View Post
not tested, but it should work.

you can set the damage on line 8
PHP Code:
#define DamagePlayer 10.0 
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"awp"))
    {
        
SDKHooks_TakeDamage(clientclientclientDamagePlayer);
    }

thank you alot! will try this soon when I'm online
__________________
nguyenbaodanh is offline