So as far as button detection goes, the only two ways I've really found of doing it is through OnPlayerRunCmd and GetEntProp, I'm using GetEntProp in this instance and I want it to do an action when the button is pressed however while testing this it always seems to trigger multiple times or not at all and I'd like to know if there's a different way to accomplish this or if anyone would know the cause.
Here's the bit I'm using
Code:
public void OnGameFrame() {
for (int i = 1; i <= MaxClients; i++) {
if (!IsClientInGame(i) || !IsPlayerAlive(i)) {
continue;
}
if(GetEntProp(i, Prop_Data, "m_afButtonReleased") & IN_RELOAD){
PrintToChat(i, "You pressed the reload key!");
}
}
}