Raised This Month: $ Target: $400
 0% 

need help understanding this.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 11-13-2007 , 21:28   Re: need help understanding this.
Reply With Quote #1

You need to hook the actual DeathMsg. Put this in your plugin_init()

PHP Code:
register_event"DeathMsg""onDeath""a" 
__________________
M249-M4A1 is offline
FiVeTeNMontrail
Junior Member
Join Date: Aug 2006
Old 11-13-2007 , 21:59   Re: need help understanding this.
Reply With Quote #2

I already have that, i was just posting part of the code.

Code:
 #include <amxmodx>
    
    #define MAX_CLIENTS 32
    #define MAX_SUICIDE 4
    
    new g_iSuicideCnt[ MAX_CLIENTS + 1 ] = { MAX_SUICIDE, ... };
    
    public plugin_init()
    {
        register_plugin( "Anti-Death Kicker", "1.0", "FiVeTeN" );
        
        register_event( "DeathMsg", "onDeath", "a" );                                // Suicide
        register_event( "TextMsg" , "eResetCount", "a", "2=#Game_will_restart_in" ); // Restart attempt
        register_event( "HLTV"    , "eResetCount", "a", "1=0", "2=0" );              // New round
    }
    
    public onDeath()
    {
 client_print( 0, print_chat, "Testing yo");
        new iKiller = read_data( 1 );
        new iVictim = read_data( 2 );
        static sWeapon[6]; 
        read_data( 4, sWeapon, sizeof sWeapon - 1 );
        
        if( iKiller == iVictim && equal( sWeapon, "world", 5 ))
        {
            --g_iSuicideCnt[ iVictim ];
            
            if( !g_iSuicideCnt[ iVictim ] )
                server_cmd( "kick #%d Your message here", get_user_userid( iVictim ) );
            
            client_print( iVictim, print_chat, "[AMXX] Careful! You have %d suicide%s left.", g_iSuicideCnt[ iVictim ], g_iSuicideCnt[ iVictim ] < 2 ? "" : "s" );
        }
    }
    
    public eResetCount()
        arrayset( g_iSuicideCnt, MAX_SUICIDE, sizeof g_iSuicideCnt );
    
    public client_disconnect( id )  
        g_iSuicideCnt[id] = MAX_SUICIDE;
FiVeTeNMontrail is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 11-13-2007 , 22:29   Re: need help understanding this.
Reply With Quote #3

It's working for me, mate ...
Make sure you have latest .amxx file in your plugins directory and server restarted.
__________________
alien is offline
Send a message via ICQ to alien
FiVeTeNMontrail
Junior Member
Join Date: Aug 2006
Old 11-13-2007 , 22:42   Re: need help understanding this.
Reply With Quote #4

Do you think it could be because im using this plugin for a mod called zombie panic?
FiVeTeNMontrail 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 01:20.


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