Should work with buttons, doors, ...
Can't work with vehicles.
PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
#pragma semicolon 1
#define PLUGIN "No Use @ Round End"
#define VERSION "0.0.1"
#define cm(%0) ( sizeof(%0) - 1 )
const m_afButtonPressed = 246;
new HamHook:g_iHhCBasePlayerObjectCaps;
public plugin_init()
{
register_plugin( PLUGIN, VERSION, "ConnorMcLeod" );
DisableHamForward( g_iHhCBasePlayerObjectCaps = RegisterHam(Ham_ObjectCaps, "player", "OnCBasePlayer_ObjectCaps", false) );
register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0");
register_logevent("Event_Round_End", 2, "1=Round_End");
}
public Event_HLTV_New_Round()
{
DisableHamForward(g_iHhCBasePlayerObjectCaps);
}
public Event_Round_End()
{
EnableHamForward(g_iHhCBasePlayerObjectCaps);
}
public OnCBasePlayer_ObjectCaps( id )
{
new buttons = pev(id, pev_button);
if( buttons & IN_USE )
{
set_pev(id, pev_button, buttons & ~IN_USE);
}
buttons = get_pdata_int(id, m_afButtonPressed);
if( buttons & IN_USE )
{
set_pdata_int(id, m_afButtonPressed, buttons & ~IN_USE);
}
return HAM_HANDLED;
}
__________________