Speed in duck
Hi everybody, well I want to give more speed when the player is in duck, someone could give me an example of how I can do? ... thx in advance
|
Re: Speed in duck
I'd like to know too. How can we change player's speed to a certain value while he's moving in duck mode, without affecting the normal speed values of walking, running, etc.. ?
|
Re: Speed in duck
1 Attachment(s)
Not tested, but should work
|
Re: Speed in duck
not quite, it seems like when you duck your maxspeed gets changed to the selected value, but your actual speed is lowered, probably the same thing that lowers your speed when you normally duck. I tested with the value 800.0, it sets maxspeed to 800, but when i try to duck the actual speed is lowered down to 160/170.
The way you made it changes the global value of the players speed(maxspeed, which is used for everything, running, walking, ducking). My knowledge about game values is very thin, but I think the walking and ducking values are values taken from the maxspeed value which are divided by a certain factor. I'm guessing that the +duck and +speed(command for walking) act as a dividing factor to the actual speed... What i'm saying is it does change the speed when ducking, but not up to the desired value. Any ideas? |
Re: Speed in duck
register_forward(FM_CmdStart,"fwd_CmdStart")
public fwd_CmdStart(id, uc_handle, seed) { if(!is_user_alive(id)) return FMRES_IGNORED; new buttons = get_uc(uc_handle,UC_Buttons) new oldbuttons = get_user_oldbutton(id); if((buttons & IN_DUCK) && !(oldbuttons & IN_DUCK)) set_user_maxspeed(id,your_value) } |
Re: Speed in duck
Quote:
set_user_maxspeed is not a good way to do this. Any other ideas? |
Re: Speed in duck
Quote:
PHP Code:
|
Re: Speed in duck
1 Attachment(s)
Give this a try. I'm not sure if it is working perfectly, but it appears to from a client perspective. Hopefully someone with more orpheu experience will chime in.
Place the files in the attached archive in: amxmodx\configs\orpheu\functions PHP Code:
|
Re: Speed in duck
Works like a charm, only we should note that the speed is still limited by the player's max speed.
It's a good idea to change the player's max speed when he goes into duck mode and then restore it back to normal after he stops ducking. I like siriusmd99's idea about using fwd_CmdStart, so i combined the codes and ended up with something like this. PHP Code:
|
Re: Speed in duck
You are constantly setting the maxspeed value, it is not the best idea...
PHP Code:
|
| All times are GMT -4. The time now is 09:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.