|
Senior Member
Join Date: Mar 2020
Location: Portugal
|
08-24-2022
, 07:05
Re: Mortal Headshot v0.1.1
|
#36
|
Quote:
Originally Posted by bibu
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 = 1 << CSW_SMOKEGRENADE | 1 << CSW_HEGRENADE | 1 << CSW_FLASHBANG | 1 << CSW_C4
new g_iMaxPlayers
new bool:g_weaponMortalHeadshot[ MAX_WEAPONS + 1 ]
public plugin_init() { register_plugin( "Mortal Headshot", "0.1.1", "eXtrem" ) register_concmd( "mh_weapon", "ConsoleCommand_MortalHeadshot", ADMIN_KICK ) RegisterHam( Ham_TraceAttack, "player", "HamTraceAttack" ) g_iMaxPlayers = get_maxplayers() }
public HamTraceAttack( victim, attacker, Float:damage, Float:tr[3], traceresult, dmgbits ) { if( !IsPlayer( attacker ) || victim == attacker ) return HAM_IGNORED if( g_weaponMortalHeadshot[ get_user_weapon( attacker ) ] && get_tr2( traceresult , TR_iHitgroup ) == HIT_HEAD ) { SetHamParamFloat( 3 , damage * 10.0 ) } return HAM_IGNORED }
public ConsoleCommand_MortalHeadshot( id, level, cid ) { if( !cmd_access( id, level, cid, 1 ) ) { return PLUGIN_HANDLED } new szWeapon[ 32 ] = "weapon_" read_argv( 1, szWeapon[ 7 ], charsmax( szWeapon ) -7 ) new weaponid = get_weaponid( szWeapon ) if( weaponid && ~( 1 << weaponid ) & bitsNotAllowedWeapons ) { new szValue[ 2 ] read_argv( 2, szValue, charsmax( szValue ) ) g_weaponMortalHeadshot[ weaponid ] = szValue[ 0 ] == '0' ? false : true console_print( id, "%s mortal headshot : %s", szWeapon, szValue[ 0 ] == '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.
|
|
|
|