Raised This Month: $ Target: $400
 0% 

need help understanding this.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-12-2007 , 23:03   Re: need help understanding this.
Reply With Quote #1

I would do something like :

Code:
    #include <amxmodx>         #define MAX_CLIENTS 32     #define MAX_SUICIDE 10         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()     {         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;
__________________
Arkshine 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