Raised This Month: $ Target: $400
 0% 

Event Hooking


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-20-2009 , 03:58   Re: Event Hooking
Reply With Quote #8

Code:
#include < amxmodx > #include < fakemeta > new const g_iNadeConstants[ 3 ] = {     CSW_HEGRENADE,     CSW_FLASHBANG,     CSW_SMOKEGRENADE }; new const g_szNadeModels[ 3 ][ ] = {     "models/w_hegrenade.mdl",     "models/w_flashbang.mdl",     "models/w_smokegrenade.mdl"; }; new Trie:g_tNadeModels; public plugin_init( ) {     g_tNadeModels = TrieCreate( );         for( new i = 0; i < 3; i++ )     {         TrieSetCell( g_tNadeModels, g_szNadeModels[ i ], i );     }         register_forward( FM_SetModel, "FwdSetModel", 1 ); } public plugin_end( ) {     TrieDestroy( g_tNadeModels ); } public FwdSetModel( iEntity, const szModel[ ] ) {     if( pev_vaild( iEntity ) )     {         new iOwner = pev( iEntity, pev_owner );                 if( is_user_connected( iOwner ) )         {             static Float:fExplodeTime;             pev( iEntity, pev_dmgtime, fExplodeTime );                         if( fExplodeTime > 0.0 )             {                 static iIndex;                 if( TrieGetCell( g_tNadeModels, szModel, iIndex ) )                 {                     new CSW_nadetype = g_iNadeConstants[ iIndex ];                                         // iEntity = the grenade entity                     // CSW_nadetype = the CSW_* constant for the nade type                     // iOwner = the thrower                 }             }         }     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 15:14.


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