Raised This Month: $51 Target: $400
 12% 

Detecting player is standing.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hellkong
Member
Join Date: Nov 2021
Old 03-27-2024 , 16:52   Detecting player is standing.
Reply With Quote #1

As the title, for ex when someone was ducking then turned standing.

How to detect that?

We do know flag IN_DUCK for ducking, what about something like IN_STAND...
Hellkong is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-27-2024 , 20:52   Re: Detecting player is standing.
Reply With Quote #3

This may help, depending on what your goal is. As you found, there is no IN_STAND, so you have only IN_DUCK to work with.

PHP Code:

#include <amxmodx>
#include <fakemeta>

public plugin_init() 
{
    
register_forwardFM_CmdStart "CmdStart" );
}

public 
CmdStartid uc_handle seed 
{
    static 
Buttons OldButtons;
    
    
Buttons get_ucuc_handle UC_Buttons );
    
OldButtons pevid pev_oldbuttons );
    
    if ( !( 
OldButtons IN_DUCK ) && ( Buttons IN_DUCK ) )
    {
        
//Began ducking  (first pressed duck)
        
    
}
    else if ( ( 
OldButtons IN_DUCK ) && ( Buttons IN_DUCK ) )
    {
        
//Is ducking  (holding duck)
        
    
}
    else if ( ( 
OldButtons IN_DUCK ) && !( Buttons IN_DUCK ) )
    {
        
//Stopped ducking  (just released duck)
        
    
}
    else if ( !( 
OldButtons IN_DUCK ) && !( Buttons IN_DUCK ) )
    {
        
//Player is standing  (did not recently press or release duck)

    
}

__________________
Bugsy is offline
Hellkong
Member
Join Date: Nov 2021
Old 03-27-2024 , 22:48   Re: Detecting player is standing.
Reply With Quote #4

Thx.

The goal is, changing view offset, in ducking it will return the old one, I managed to change when ducking, but the glitch is visible in mil second.

Using Orpheu, it may be a better way, but I don't know how.
Hellkong 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 17:51.


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