Hey guys,
so im trying to block the +attack etc on flashbang, basically i want the flash just to be hold.
when switching back to usp or other guns you can normally shoot.
atm i got this code which works perfectly
Code:
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2])
{
char sWeaponName[32];
if (IsPlayerAlive(client))
{
GetEntityClassname(GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"), sWeaponName, sizeof(sWeaponName));
if (StrEqual(sWeaponName, "weapon_flashbang"))
{
if (buttons & IN_ATTACK)
SetEntPropFloat(weapon, Prop_Send, "m_flNextPrimaryAttack", 999999.0)
SetEntPropFloat(client, Prop_Send, "m_flNextAttack", 9999.0)
return Plugin_Changed;
}
}
return Plugin_Continue;
}
The only problem is it spams my server with error
Code:
L 06/01/2020 - 11:14:47: [SM] [0] SetEntPropFloat
L 06/01/2020 - 11:14:47: [SM] [1] Line 55, plugin.sp::OnPlayerRunCmd
L 06/01/2020 - 11:14:47: [SM] Exception reported: Property "m_flNextPrimaryAttack" not found (entity 1/player)
L 06/01/2020 - 11:14:47: [SM] Blaming: Flashfix.smx
Anyone got a clue how i could fix that?