Raised This Month: $ Target: $400
 0% 

Shift Button pressed ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alexxxxxxxxx
Member
Join Date: Aug 2017
Old 12-13-2017 , 13:12   Shift Button pressed ?
Reply With Quote #1

How can i know if a player is pressing L SHIFT button ?
Alexxxxxxxxx is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 12-13-2017 , 15:05   Re: Shift Button pressed ?
Reply With Quote #2

Quote:
Originally Posted by Alexxxxxxxxx View Post
How can i know if a player is pressing L SHIFT button ?
Unsure but try this:

if(get_user_button(index) & IN_RUN)
eyal282 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-13-2017 , 15:36   Re: Shift Button pressed ?
Reply With Quote #3

Quote:
Originally Posted by eyal282 View Post
Unsure but try this:

if(get_user_button(index) & IN_RUN)
no.

There was a thread about this a month ago, or so. Search
__________________
retired chump

Last edited by DjSoftero; 12-13-2017 at 15:37.
DjSoftero is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-13-2017 , 20:59   Re: Shift Button pressed ?
Reply With Quote #4

The most important thing to understand is that you cannot know what keyboard keys are being pressed. You can only see what commands are being sent to the server. Not every body uses the same keyboard layout.
__________________
fysiks is offline
Alexxxxxxxxx
Member
Join Date: Aug 2017
Old 12-14-2017 , 12:08   Re: Shift Button pressed ?
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
The most important thing to understand is that you cannot know what keyboard keys are being pressed. You can only see what commands are being sent to the server. Not every body uses the same keyboard layout.
i am talking about default keyborad binds
Alexxxxxxxxx is offline
alexbomjovem
New Member
Join Date: Jul 2018
Location: brasil
Old 02-03-2022 , 14:16   Re: Shift Button pressed ?
Reply With Quote #6

PHP Code:
if(fm_get_ent_speed(id) < 150)
{
            return 
FMRES_IGNORED;

detect shift velocity

Last edited by alexbomjovem; 02-03-2022 at 14:17.
alexbomjovem is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-03-2022 , 15:18   Re: Shift Button pressed ?
Reply With Quote #7

Quote:
Originally Posted by alexbomjovem View Post
PHP Code:
if(fm_get_ent_speed(id) < 150)
{
            return 
FMRES_IGNORED;

detect shift velocity
And what is fm_get_ent_speed?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 02-03-2022 , 19:04   Re: Shift Button pressed ?
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
And what is fm_get_ent_speed?
I believe it is this stock.

PHP Code:
stock Float:fm_get_ent_speed(id)
{
 if(!
pev_valid(id))
  return 
0.0;
 
 static 
Float:vVelocity[3];
 
pev(idpev_velocityvVelocity);
 
 
vVelocity[2] = 0.0;
 
 return 
vector_length(vVelocity);

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 02-13-2022 , 11:27   Re: Shift Button pressed ?
Reply With Quote #9

Quote:
Originally Posted by alexbomjovem View Post
PHP Code:
if(fm_get_ent_speed(id) < 150)
{
            return 
FMRES_IGNORED;

detect shift velocity
the code will also be executed at the start of the movement isn't it?
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 02-13-2022 at 11:30.
kww is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 02-14-2022 , 00:08   Re: Shift Button pressed ?
Reply With Quote #10

Quote:
Originally Posted by kww View Post
the code will also be executed at the start of the movement isn't it?
this is such a bad way of doing it...
first of all, controllers are a thing (not sure who does that on 1.6 ,but I tried to and you can "shift" even without using +speed because of the analog input), also when you land/jump it's gonna trigger it, or hit an object/wall while running your speed is gonna shift to lower amounts or 0.
there's also +moveup that does influence move speed even if you do not hold shift (+speed)
fps too high or too low is gonna trigger that (jumping/landing with 150+ fps, falling off ledges with less than 40 fps etc for example if u had less than 20 and u land somewhere you will most likely never even trigger this cuz you don't lose that much speed lol)

Getting non-fatal hits on you(especially with awp) will also trigger that most likely.

I guess you could "hack" around it, and code a command that lets players bind it on their shift button, let's say +ability and set their ent speed. But you can also probably just register clcmd +speed (I GUESS? not sure, don't know the amxx sdk that well).

Refer to : https://forums.alliedmods.net/showpo...05&postcount=5
__________________

Last edited by deprale; 02-14-2022 at 00:12.
deprale 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 13:26.


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