Raised This Month: $ Target: $400
 0% 

Function to check wall kill?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-31-2015 , 07:28   Re: [HELP] Function to check wall kill?
Reply With Quote #1

Definitely doable. Try this and see if it works:
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new const Version[] = "0.1";

#define MAX_PLAYERS 32

new bool:g_bLastAttackWasWallMAX_PLAYERS ][ MAX_PLAYERS ];

#define IsPlayer(%1)    ( 1 <= %1 <= MAX_PLAYERS )

public plugin_init()
{
    
register_plugin"Check Wall Kill" Version "bugsy" );
    
    
RegisterHamHam_TraceAttack "player" "Player_TraceAttack" );
    
register_event"DeathMsg" "Ev_DeathMsg" "a" "1>0" );
}

public 
Player_TraceAttackiEnt iAttacker Float:flDamage Float:fDir] , ptr iDamageType )
{
    if( 
IsPlayeriAttacker ) )
    {
        if ( 
iDamageType DMG_BULLET )
        {
            new 
Float:fEnd];
            
get_tr2ptr TR_vecEndPos fEnd );
            
            
g_bLastAttackWasWalliEnt ][ iAttacker ] = bool:!ExecuteHamHam_FVecVisible iAttacker fEnd );
        }
        else
        {
            
g_bLastAttackWasWalliEnt ][ iAttacker ] = false;
        }
    }
}  

public 
Ev_DeathMsg()
{
    new 
iKiller read_data);
    new 
iVictim read_data);
    new 
iIsHeadshot read_data);
    
    if ( 
iIsHeadshot && ( g_bLastAttackWasWalliVictim ][ iKiller ] == true ) )
    {
        
client_printprint_chat "Headshot wall kill" );
    }

__________________

Last edited by Bugsy; 10-31-2015 at 07:41.
Bugsy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode