Raised This Month: $ Target: $400
 0% 

Forward >"<....


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-27-2009 , 23:36   Re: Forward >"<....
Reply With Quote #5

PHP Code:
#include <amxmodx>

public plugin_init() 
{
    
register_plugin"Weapon and Kill" "1.0" "bugsy" );
    
register_event"CurWeapon" "fw_EvCurWeapon" "be" "1=1" );
    
register_event"DeathMsg" "fw_EvDeathMsg" "a" );
}

public 
fw_EvCurWeaponid )
{
    static 
iWeapon iPrevWeapon;
    static 
szWeapon20 ];
    
    
iWeapon read_data);
    
    if ( 
iWeapon != iPrevWeapon )
    {
        
get_weaponnameiWeapon szWeapon 19 );
        
client_printid print_chat "* You are now using %s" szWeapon] );
        
iPrevWeapon iWeapon;
    }
}

public 
fw_EvDeathMsg( )
{
    static 
iKilleriKiller read_data);
    static 
iVictimiVictim read_data);
    static 
iWasHeadshotiWasHeadshot read_data);
    static 
szWeaponUsed20 ]; read_dataszWeaponUsed 19 );
    static 
szKiller33 ] , szVictim33 ];
    
    
//You could also perform this if-statement via adding condition in the register_event function
    //which will make it only be called if a player kills another player [not called on suicide\slay etc]
    //register_event( "DeathMsg" , "fw_EvDeathMsg" , "a" , "1>0" , "2>0" );
    
if ( iKiller && iVictim )
    {
        
get_user_nameiKiller szKiller 32 );
        
get_user_nameiVictim szVictim 32 );
    
        
client_printprint_chat "* %s killed %s with %s%s" szKiller szVictimszWeaponUsed iWasHeadshot " [HEADSHOT]" "" );
    }

__________________
Bugsy is offline
 



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:31.


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