Raised This Month: $ Target: $400
 0% 

Solved Take Player +attack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wilian159
Member
Join Date: Dec 2013
Old 07-24-2022 , 22:16   Re: Take Player +attack
Reply With Quote #1

this ?:

PHP Code:
register_forward(FM_CmdStart"xCmdStart"false)

public 
xCmdStart(iduc_handlerandseed)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED
    
    
static xBtnxOldBtn
    xBtn 
get_uc(uc_handleUC_Buttons)
    
xOldBtn pev(idpev_oldbuttons)

    if((
xBtn IN_ATTACK) && !(xOldBtn IN_ATTACK))
    {
        const 
m_flNextAttack 83
        
const Float:nextTime 9999.0

        set_pdata_float
(idm_flNextAttacknextTime)

        
client_print(id3"-> attack block")
    }

    return 
FMRES_IGNORED

__________________
wilian159 is offline
damage220
Senior Member
Join Date: Jul 2022
Location: Ukraine
Old 07-25-2022 , 03:51   Re: Take Player +attack
Reply With Quote #2

Quote:
Originally Posted by wilian159 View Post
this ?:

PHP Code:
register_forward(FM_CmdStart"xCmdStart"false)

public 
xCmdStart(iduc_handlerandseed)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED
    
    
static xBtnxOldBtn
    xBtn 
get_uc(uc_handleUC_Buttons)
    
xOldBtn pev(idpev_oldbuttons)

    if((
xBtn IN_ATTACK) && !(xOldBtn IN_ATTACK))
    {
        const 
m_flNextAttack 83
        
const Float:nextTime 9999.0

        set_pdata_float
(idm_flNextAttacknextTime)

        
client_print(id3"-> 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.
damage220 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode