Raised This Month: $ Target: $400
 0% 

[REQ] Execute ham x times


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-29-2017 , 18:54   Re: [REQ] Execute ham x times
Reply With Quote #2

Untested
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <engine>

#define MAX_PLAYERS 32

enum LimitTypes
{
    
Immunity,
    
Kick,
    
Reservation
}

new const 
TriggerLimitLimitTypes ] = 
{
    
999999,
    
2,
    
1
};

enum PlayerData
{
    
TriggerCount,
    
LimitTypes:LimitType
}

new 
g_TriggerDataMAX_PLAYERS ][ PlayerData ];

public 
plugin_init()
{
    
RegisterHamHam_TraceAttack "func_button" "Ham_UseButton" )
    
register_logevent"RoundStart" "1=Round_Start" )  
}

public 
client_authorizedid )
{
    new 
iFlags get_user_flagsid );
    
    if ( 
iFlags ADMIN_IMMUNITY )
    {
        
g_TriggerDataid ][ LimitType ] = Immunity;
    }
    else if ( 
iFlags ADMIN_KICK )
    {
        
g_TriggerDataid ][ LimitType ] = Kick;
    }
    else if ( 
iFlags ADMIN_RESERVATION )
    {
        
g_TriggerDataid ][ LimitType ] = Reservation;
    }
}
    
public 
Ham_UseButtoniEnt iAttacker Float:fDamage Float:vDirection] , TraceHandle iDamageBits 
{
    if( ( 
g_TriggerDataiAttacker ][ TriggerCount ] < TriggerLimitg_TriggerDataiAttacker ][ LimitType ] ] ) && is_valid_entiEnt ) && is_user_aliveiAttacker ) )
    {
        
ExecuteHamBHam_Touch iEnt iAttacker )
        
entity_set_floatiEnt EV_FL_frame 0.0 )
        
g_TriggerDataiAttacker ][ TriggerCount ]++;
    }
}

public 
RoundStart()
{
    for ( new 
sizeofg_TriggerData ) ; i++ )
        
g_TriggerData][ TriggerCount ] = 0;

__________________

Last edited by Bugsy; 01-29-2017 at 20:20.
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 20:58.


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