I have a little plugin which triggers button by simply shooting at him, however I need to limit trigger count.
After x shots, player won't be able to trigger button anymore. Count to restart on new round
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
public plugin_init()
{
RegisterHam(Ham_TraceAttack, "func_button", "Ham_UseButton")
}
public Ham_UseButton( iEnt, iAttacker, Float:fDamage, Float:vDirection[3], TraceHandle, iDamageBits )
{
if(!is_valid_ent(iEnt) || !is_user_alive(iAttacker) || get_user_flags(iAttacker) & ADMIN_RESERVATION)
return;
ExecuteHamB(Ham_Touch, iEnt, iAttacker)
entity_set_float(iEnt, EV_FL_frame, 0.0)
}
__________________