Raised This Month: $ Target: $400
 0% 

Question about engine


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
3d0tz
Junior Member
Join Date: Feb 2022
Old 03-04-2022 , 13:27   Question about engine
Reply With Quote #1

Is it possible to hook +USE using engine?
3d0tz is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 03-04-2022 , 13:32   Re: Question about engine
Reply With Quote #2

No.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-04-2022 , 14:20   Re: Question about engine
Reply With Quote #3

The better question is why do you need to do it exactly with engine?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-04-2022 , 20:34   Re: Question about engine
Reply With Quote #4

Quote:
Originally Posted by Shadows Adi View Post
No.
Yes.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 03-05-2022 , 02:12   Re: Question about engine
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
Yes.
If you can hook "+use" which is client side ...

You can catch only if the button is pressed.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 03-05-2022 at 02:13.
Shadows Adi is offline
3d0tz
Junior Member
Join Date: Feb 2022
Old 03-05-2022 , 05:41   Re: Question about engine
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
The better question is why do you need to do it exactly with engine?
Im just trying to learn more
3d0tz is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-05-2022 , 10:12   Re: Question about engine
Reply With Quote #7

Well lesson #1, don't worry too much about the module that does the work, be more concerned about which module does it better/more efficiently.

Why not use this? It can be used to detect when hold is first pressed, use held, use released. If you do need to capture more than 1 of these actions, cache the value in a variable instead of re-calling the natives.
PHP Code:
#include <amxmodx>
#include <fakemeta>

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

public 
FwdCmdStartid uc_handle seed )
{
    if ( ( 
get_ucuc_handle UC_Buttons ) & IN_USE ) && !( pevid pev_oldbuttons ) & IN_USE ) )
    {
        
//Use first pressed
    
}
 
    if ( ( 
get_ucuc_handle UC_Buttons ) & IN_USE ) && ( pevid pev_oldbuttons ) & IN_USE ) )
    {
        
//Use held
    
}
   
    if ( !( 
get_ucuc_handle UC_Buttons ) & IN_USE ) && ( pevid pev_oldbuttons ) & IN_USE ) )
    {
        
//Use released
    
}

    return 
FMRES_IGNORED;

__________________
Bugsy 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 01:11.


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