Raised This Month: $10 Target: $400
 2% 

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 , 05: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 10: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 , 09: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 , 10: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 , 12: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 , 19: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 , 19: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 19:42.
chickez is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 02-05-2021 , 20:48   Re: +strafe (strafe modifier)
Reply With Quote #7

Maybe try to combine player's angles with his movement (keys) and get more precise info
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...)
JocAnis is offline
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 02-06-2021 , 11:56   Re: +strafe (strafe modifier)
Reply With Quote #8

Good idea. I will try it.
chickez is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 02-07-2021 , 09:13   Re: +strafe (strafe modifier)
Reply With Quote #9

This could be your reference/help: https://dev-cs.ru/resources/144/

Unfortunately Mistrick stopped supporting it..but maybe you can develop something better than his work
PS: when u finish dont make it public, for obviously reasons, good luck !!!
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...)
JocAnis is offline
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 02-08-2021 , 10:52   Re: +strafe (strafe modifier)
Reply With Quote #10

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 04:45.


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