AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   change player movements (https://forums.alliedmods.net/showthread.php?t=272597)

pillowCloud 10-03-2015 11:42

change player movements
 
I want to change player movements, for example:

If player is pressing W (move forward), then he will move backward,
and also for both right and left.

Thanks in advance :wink:

pillowCloud 10-15-2015 19:05

Re: change player movements
 
Is this possible?

fysiks 10-15-2015 22:31

Re: change player movements
 
Most likely yes but why would anyone want to do that?

OciXCrom 10-16-2015 09:03

Re: change player movements
 
Reverse-Motion grenade for example. :\

pillowCloud 10-17-2015 08:36

Re: change player movements
 
Well, this should be a part of a deathrun event,
just to make things more funnier.

I will be grateful for any help.

vitorrossi 10-17-2015 15:17

Re: change player movements
 
You could hook pre-think and pev_buttons within this function. Then do a bit check (&) for IN_FORWARD, IN_BACK, IN_MOVERIGHT, IN_MOVELEFT and set_pev pev_buttons to the opposite of what player is pressing. Untested

fysiks 10-17-2015 23:08

Re: change player movements
 
Quote:

Originally Posted by vitorrossi (Post 2354039)
You could hook pre-think and pev_buttons within this function. Then do a bit check (&) for IN_FORWARD, IN_BACK, IN_MOVERIGHT, IN_MOVELEFT and set_pev pev_buttons to the opposite of what player is pressing. Untested

I believe it's more efficient (or more proper) to use FM_CmdStart and not Prethink.

pillowCloud 10-22-2015 09:02

Re: change player movements
 
Quote:

Originally Posted by fysiks (Post 2354182)
I believe it's more efficient (or more proper) to use FM_CmdStart and not Prethink.

Quote:

Originally Posted by vitorrossi (Post 2354039)
You could hook pre-think and pev_buttons within this function. Then do a bit check (&) for IN_FORWARD, IN_BACK, IN_MOVERIGHT, IN_MOVELEFT and set_pev pev_buttons to the opposite of what player is pressing. Untested

not sure how to do this,
could i get a little example of this?

fysiks 10-22-2015 20:39

Re: change player movements
 
You can search for FM_CmdStart and the particular IN_* command constants (see hlsdk_const.inc for all the specific values). Other good keywords are pev_buttons and pev_oldbuttons (which you'll see these two stated in hlsdk_const.inc).

pillowCloud 11-05-2015 17:29

Re: change player movements
 
Quote:

Originally Posted by fysiks (Post 2355753)
You can search for FM_CmdStart and the particular IN_* command constants (see hlsdk_const.inc for all the specific values). Other good keywords are pev_buttons and pev_oldbuttons (which you'll see these two stated in hlsdk_const.inc).

Thanks alot.


All times are GMT -4. The time now is 22:04.

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