Quote:
Originally Posted by ImACow
How would one hook into client commands, without the runcmd/gameframe?
I'm interested in detecting if a player presses "+reload" on their knife / gun
|
PHP Code:
public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float vel[3], const float angles[3], int weapon, int subtype, int cmdnum, int tickcount, int seed, const int mouse[2])
{
if (view_as<bool>(buttons & IN_RELOAD))
{
int wp = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
if (wp == -1)
{
return Plugin_Continue;
}
// we have the weapon, check here if is knife etc
}
return Plugin_Continue;
}
__________________