Looking for a function thatll set the players current velocity.. NOT MAXSPEED
Allow me to explain.. this is for TFC..
In TFC each class has their own maxspeed, and are allowed to bunnyhop up to 170% of their maxspeed. If they try to bhop over that 170%, itll reset their velocity to their maxspeed. For example, a Scout has a maxspeed of 400.. and can go as high as 680 and if he tries to bhop while being over 680, his velocity will be reset to 400. Now there is another thing called a "chop hop"... where a player can actually maintain a high rate of speed past 680 by +duck'ing instead. I want to apply that same mechanic to +duck where if they try it while over 680, itll set them back to 400. Is there a function thatll set their current velocity given these conditions? |
Re: Looking for a function thatll set the players current velocity.. NOT MAXSPEED
pev_velocity?
|
Re: Looking for a function thatll set the players current velocity.. NOT MAXSPEED
Hey thank you for your reply! Ya i have been trying to use that. I am a rather novice programmer so I am not sure if there is something I need to do differently, but I am getting an effect of sorts but not the intended affect. Ill psuedo code it and explain what its doing for me..
register(hamduck, chop) public chop(id) speed stuff convert speed to percentage stuff new float:speedvec[3] speedvec[0] = maxspeed speedvec[1] = maxspeed speedvec[2] = 0.0 if(conditions to cause my player to slowdown){ set_pev(id, pev_velocity, speedvec) } I am not getting the intended behavior, which is for it to slow the player down to the maxspeed... it is instead throwing my player backward sometimes or stopping on a dime. I understand its like because of how I am doing that speedvec and assigning it values, but idk what wizardry i gotta do to ensure its always projecting the player in the proper direction. I have also tried entity_set_float(id, EV_VEC_velocity, speedvec) with the same result. |
Re: Looking for a function thatll set the players current velocity.. NOT MAXSPEED
|
Re: Looking for a function thatll set the players current velocity.. NOT MAXSPEED
try this
Code:
|
Re: Looking for a function thatll set the players current velocity.. NOT MAXSPEED
Quote:
For tfc simply setting the user maxspeed wont cut it because users of chophop are not effected by it. I will need to actually alter their velocity as their maxspeed by default is the maxspeed I want to use anyway. I am trying to reset their velocity BACK to their maxspeed. Was actually the first thing i searched up and tried. I really do appreciate the reply though and hope this doesnt come off foul. |
Re: Looking for a function thatll set the players current velocity.. NOT MAXSPEED
Thank you!
|
Re: Looking for a function thatll set the players current velocity.. NOT MAXSPEED
Thank you!
|
All times are GMT -4. The time now is 02:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.