View Single Post
MAJESTIC_SZ
Senior Member
Join Date: Mar 2020
Location: Portugal
Old 08-24-2022 , 07:05   Re: Mortal Headshot v0.1.1
Reply With Quote #36

Quote:
Originally Posted by bibu View Post
Try this:

PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >
#include < fakemeta >

#define IsPlayer(%1) (1<= %1 <= g_iMaxPlayers)
#define MAX_WEAPONS CSW_P90

const bitsNotAllowedWeapons << CSW_SMOKEGRENADE << CSW_HEGRENADE << CSW_FLASHBANG << CSW_C4

new g_iMaxPlayers

new bool:g_weaponMortalHeadshotMAX_WEAPONS ]

public 
plugin_init() 
{
    
register_plugin"Mortal Headshot""0.1.1""eXtrem" )
    
    
register_concmd"mh_weapon""ConsoleCommand_MortalHeadshot"ADMIN_KICK )
    
    
RegisterHamHam_TraceAttack"player""HamTraceAttack" )
    
    
g_iMaxPlayers get_maxplayers()
}

public 
HamTraceAttackvictimattackerFloat:damageFloat:tr[3], traceresultdmgbits )
{
    if( !
IsPlayerattacker ) || victim == attacker )
        return 
HAM_IGNORED
    
    
if( g_weaponMortalHeadshotget_user_weaponattacker ) ] && get_tr2traceresult TR_iHitgroup ) == HIT_HEAD )
    {
        
SetHamParamFloatdamage 10.0 )
    }
    
    return 
HAM_IGNORED
}

public 
ConsoleCommand_MortalHeadshotidlevelcid )
{
    if( !
cmd_accessidlevelcid)  ) 
    { 
        return 
PLUGIN_HANDLED
    

    
    new 
szWeapon32 ] = "weapon_"
        
    
read_argv1szWeapon], charsmaxszWeapon ) -)
    
    new 
weaponid get_weaponidszWeapon )
        
    if( 
weaponid && ~( << weaponid ) & bitsNotAllowedWeapons )
    {
        new 
szValue]
        
read_argv2szValuecharsmaxszValue ) )
        
        
g_weaponMortalHeadshotweaponid ] = szValue] == '0' false true            
                
        console_print
id"%s mortal headshot : %s"szWeaponszValue] == '0' "disabled" "enabled" )
    }
    
    return 
PLUGIN_HANDLED


Thank you very much. I have been testing it and so far so good

Last edited by MAJESTIC_SZ; 08-24-2022 at 07:05.
MAJESTIC_SZ is offline