 |
|
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
|

01-29-2017
, 19:07
Re: [REQ] Execute ham x times
|
#3
|
Quote:
Originally Posted by Bugsy
Untested
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#define MAX_PLAYERS 32
const TriggerLimit = 5;
new g_TriggerCount[ MAX_PLAYERS + 1 ];
public plugin_init()
{
RegisterHam( Ham_TraceAttack , "func_button" , "Ham_UseButton" )
register_logevent( "RoundStart" , 2 , "1=Round_Start" )
}
public Ham_UseButton( iEnt , iAttacker , Float:fDamage , Float:vDirection[ 3 ] , TraceHandle , iDamageBits )
{
if( ( g_TriggerCount[ iAttacker ] < TriggerLimit ) && is_valid_ent( iEnt ) && is_user_alive( iAttacker ) && !( get_user_flags( iAttacker ) & ADMIN_RESERVATION ) )
{
ExecuteHamB( Ham_Touch , iEnt , iAttacker )
entity_set_float( iEnt , EV_FL_frame , 0.0 )
g_TriggerCount[ iAttacker ]++;
}
}
public RoundStart()
{
arrayset( g_TriggerCount , 0 , sizeof( g_TriggerCount ) );
}
|
Works!
I need another edit if u could:
Different TriggerCount for specific flag
ADMIN_RESERVATION 1
ADMIN_KICK 2
ADMIN_IMMUNITY unlimited
Thanks!
__________________
|
|
|
|