 |
|
Senior Member
Join Date: Jul 2022
Location: Ukraine
|

07-25-2022
, 03:51
Re: Take Player +attack
|
#10
|
Quote:
Originally Posted by wilian159
this ?:
PHP Code:
register_forward(FM_CmdStart, "xCmdStart", false)
public xCmdStart(id, uc_handle, randseed)
{
if(!is_user_alive(id))
return FMRES_IGNORED
static xBtn, xOldBtn
xBtn = get_uc(uc_handle, UC_Buttons)
xOldBtn = pev(id, pev_oldbuttons)
if((xBtn & IN_ATTACK) && !(xOldBtn & IN_ATTACK))
{
const m_flNextAttack = 83
const Float:nextTime = 9999.0
set_pdata_float(id, m_flNextAttack, nextTime)
client_print(id, 3, "-> attack block")
}
return FMRES_IGNORED
}
|
No. It is called every frame even when player idle (i.e. do nothing). I was expecting that the handler will be called when I jump or shoot, or whatever but not when I am moving or idle.
|
|
|
|