Raised This Month: $51 Target: $400
 12% 

[CS:GO] Changing players velocity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 12-17-2017 , 03:18   [CS:GO] Changing players velocity
Reply With Quote #1

Im using:
PHP Code:
public void SetSpeed(int clientfloat speed)
{
    
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"speed);

But that tricky think here, or at least for me, is that if I give the player some gravity to its basically pointless, because as I see it m_flLaggedMovementValue also counts for the speed the player model itself, so it will drop the player very fast even with high gravity, which makes the gravity useless. Im trying to achieve a decent roll the dice plugin and I'm almost done, but that really bothers me. Is there another way to set the player velocity, but just the running velocity.
__________________
PinHeaDi is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-17-2017 , 03:26   Re: [CS:GO] Changing players velocity
Reply With Quote #2

You can just set the speed of the player only when he's on the ground.
Mitchell is offline
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 12-17-2017 , 04:19   Re: [CS:GO] Changing players velocity
Reply With Quote #3

If found that in smlib:

PHP Code:
/**
 * Gets the client's view offset.
 * This is the position relative to the client itself.
 *
 * @param client        Client Index.
 * @param vec            Vector Buffer.
 * @noreturn
 */
stock Client_GetViewOffset(clientFloat:vec[3])
{
    
GetEntPropVector(clientProp_Data"m_vecViewOffset"vec);
}

/**
 * Sets the client's view offset.
 * This is the position relative to the client itself.
 *
 * @param client        Client Index.
 * @param vec            Vector buffer.
 * @noreturn
 */
stock Client_SetViewOffset(clientFloat:vec[3])
{
    
SetEntPropVector(clientProp_Data"m_vecViewOffset"vec);

But im not sure if that counts for the speed and actually I can manage to add it to me code, I always get argument mismatch.,
__________________
PinHeaDi is offline
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 12-17-2017 , 05:45   Re: [CS:GO] Changing players velocity
Reply With Quote #4

Can't this be done by rescaling player's velocity?

Getting player's vector and rescale it and update his velocity by using TeleportEntity()
__________________
Starbish is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 12-17-2017 , 07:20   Re: [CS:GO] Changing players velocity
Reply With Quote #5

I'm not exactly sure what you're asking. You want the horizontal velocity of the player to be slowed down, but not the vertical?
hmmmmm is offline
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 12-17-2017 , 07:45   Re: [CS:GO] Changing players velocity
Reply With Quote #6

Quote:
Originally Posted by hmmmmm View Post
I'm not exactly sure what you're asking. You want the horizontal velocity of the player to be slowed down, but not the vertical?
I want to increase/decrees(depending on the dice roll) the running speed, but in way that when I give gravity too the player doesn't fall with the same speed when he jumps, which makes the gravity useless.
__________________
PinHeaDi is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 12-17-2017 , 10:15   Re: [CS:GO] Changing players velocity
Reply With Quote #7

When applying the gravity, try dividing the number that youre applying by their current laggedmovementvalue
e.g. SetEntityGravity( client, gravity / GetEntPropFloat( client, Prop_Data, "m_flLaggedMovementValue" ) )
hmmmmm 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 02:51.


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