Raised This Month: $ Target: $400
 0% 

[REQ] Execute ham x times


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 01-29-2017 , 19:07   Re: [REQ] Execute ham x times
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Untested
PHP Code:

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

#define MAX_PLAYERS 32

const TriggerLimit 5;

new 
g_TriggerCountMAX_PLAYERS ];

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

public 
Ham_UseButtoniEnt iAttacker Float:fDamage Float:vDirection] , TraceHandle iDamageBits 
{
    if( ( 
g_TriggerCountiAttacker ] < TriggerLimit ) && is_valid_entiEnt ) && is_user_aliveiAttacker ) && !( get_user_flagsiAttacker ) & ADMIN_RESERVATION ) )
    {
        
ExecuteHamBHam_Touch iEnt iAttacker )
        
entity_set_floatiEnt EV_FL_frame 0.0 )
        
g_TriggerCountiAttacker ]++;
    }
}

public 
RoundStart()
{
    
arraysetg_TriggerCount sizeofg_TriggerCount ) );

Works!

I need another edit if u could:
Different TriggerCount for specific flag
ADMIN_RESERVATION 1
ADMIN_KICK 2
ADMIN_IMMUNITY unlimited
Thanks!
__________________
Airkish 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