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

Solved +strafe (strafe modifier)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 02-05-2021 , 04:16   +strafe (strafe modifier)
Reply With Quote #1

Hi, I want to check, if user is using strafe modifier.

I tried to hook +strafe / -strafe command, to detect if the player is using strafe modifier.
PHP Code:
#include <amxmodx>
#include <amxmisc>

new bool:g_bStrafe [33];

public 
plugin_init () {
    
register_clcmd "+strafe" "cmdCheckStrafeON" );
    
register_clcmd "-strafe" "cmdCheckStrafeOFF" );
}

public 
cmdCheckStrafeON id ) {
    
g_bStrafe [id] = true;
}

public 
cmdCheckStrafeOFF id ) {
    
g_bStrafe [id] = false;

This doesn't work. Too, default +strafe bind is ALT. So i tried check, if IN_ALT1
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

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

public 
fwCmdStart iduc_handle) {
    new 
iButton get_uc uc_handleUC_Buttons );

    if ( 
iButton IN_ALT1 )
        
client_print id print_chat "You are using ALT bind!" );

    return 
FMRES_IGNORED;

Still, doesn't work.

Any help?

Last edited by chickez; 02-08-2021 at 09:52. Reason: explanation what i'm trying to do..
chickez is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-05-2021 , 08:26   Re: +strafe (strafe modifier)
Reply With Quote #2

I believe it's completely handled client-side and just alters the movements that the client sends to the server.
__________________
klippy is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-05-2021 , 09:12   Re: +strafe (strafe modifier)
Reply With Quote #3

IN_ALT1 has nothing to do with the ALT button on your keyboard. It stands for ALTernate attack.
You cannot hook keyboard buttons nor client-sided commands.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 02-05-2021 , 11:29   Re: +strafe (strafe modifier)
Reply With Quote #4

Yes, it change forwardmove and sidemove. It's if i'm holding A ( IN_MOVELEFT ), sidemove is value of maxspeed. In example, maxspeed is 250.0 , so IN_MOVELEFT is 250.0 ( but first frame is 200.0 , i'm checking > 2 Frames of movement, it's always 250.0 ).

But when I use +strafe and IN_MOVELEFT ( or something else like IN_FORWARD ), sidemove & forwardmove is random.
Code:
Sidemove: -223.99 & Maxspeed: -249.99
Sidemove: 201.99 & Maxspeed: 249.99
ForwardMove: 125.99 & Maxspeed: 249.99
ForwardMove: 121.99 & Maxspeed: 249.99
I thought, the IN_ALT1 is ALT button. Thank's for explanation.

Do you know if is possible hook +strafe / -strafe? Or check, if player is using it?
chickez is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-05-2021 , 18:05   Re: +strafe (strafe modifier)
Reply With Quote #5

It would be easier if you explain why you need to detect/block it. There may be an alternate solution.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 02-05-2021 , 18:41   Re: +strafe (strafe modifier)
Reply With Quote #6

It's what I wrote.

If sidemove or forwardmove != maxspeed - should be obvious strafehelper. Lot of strafehelpers have more sidemove / forwardmove than maxspeed. But strafe modifier change the sidemove while IN_MOVELEFT / RIGHT / FORWARD / BACK.

I know easier way - sidemove or forwardmove > maxspeed. But I want to check more obvious.

Last edited by chickez; 02-05-2021 at 18:42.
chickez is offline
Old 02-05-2021, 19:48
JocAnis
This message has been deleted by JocAnis.
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 02-06-2021 , 10:56   Re: +strafe (strafe modifier)
Reply With Quote #7

Good idea. I will try it.
chickez is offline
Old 02-07-2021, 08:13
JocAnis
This message has been deleted by JocAnis.
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 02-08-2021 , 09:52   Re: +strafe (strafe modifier)
Reply With Quote #8

Thank you. Yes, i know the reason ;).
I think, all what i wanted to know is here written.

Thanks for support. Solved.
chickez is offline
Reply


Thread Tools
Display Modes

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 12:48.


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