View Single Post
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-21-2013 , 11:02   Re: Help me create a plugin
Reply With Quote #8

Here you go. Requires Orpheu Module aswell as the CGrenade signatures that I've attached below the .sma :
Code:
#include <amxmodx> #include <engine> #include <orpheu> #define RADIUS      200.0 #define TIMELIMIT   10.0 new Float:g_flRoundStart; public plugin_init() {     register_plugin( "No Nading Player Spawn!", "0.0.1", "hornet" );         new szMap[ 32 ];     get_mapname( szMap, charsmax( szMap ) );         if( equal( szMap, "surf_ski_2" ) )     {         OrpheuRegisterHook( OrpheuGetFunction( "Detonate3", "CGrenade" ), "CGrenade_Detonate" );         OrpheuRegisterHook( OrpheuGetFunction( "Detonate", "CGrenade" ), "CGrenade_Detonate" );         OrpheuRegisterHook( OrpheuGetFunction( "SG_Detonate", "CGrenade" ), "CGrenade_Detonate" );                 register_logevent( "LogEvent_RoundStart", 2, "1=Round_Start" );     } } public OrpheuHookReturn:CGrenade_Detonate( iEnt ) {     if( get_roundtime( g_flRoundStart ) > TIMELIMIT )         return OrpheuIgnored;         new iOwner = entity_get_edict( iEnt, EV_ENT_owner );         if( !is_user_alive( iOwner ) )         return OrpheuIgnored;         new Float:flOrigin[ 3 ];     entity_get_vector( iEnt, EV_VEC_origin, flOrigin );         new szSpawnEnt[ 32 ], Ents[ 1 ];         switch( get_user_team( iOwner ) )     {         case 1: szSpawnEnt = "info_player_start";         case 2: szSpawnEnt = "info_player_deathmatch";     }         if( find_sphere_class( iEnt, szSpawnEnt, RADIUS, Ents, 1, flOrigin ) )     {         user_kill( iOwner, 1 );                 new szName[ 32 ];         get_user_name( iOwner, szName, charsmax( szName ) );                 client_print( 0, print_chat, "[ AMXX ] Player %s was killed for throwing grenades into player spawn!", szName );     }         return OrpheuIgnored; } public LogEvent_RoundStart() {     g_flRoundStart = get_gametime(); } Float:get_roundtime( Float:flStart ) {     return get_gametime() - flStart; }
Attached Files
File Type: zip CGrenade.zip (1.1 KB, 54 views)
File Type: sma Get Plugin or Get Source (test5.sma - 114 views - 1.7 KB)
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 05-21-2013 at 11:46.
hornet is offline