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

How do you change the movement speed of a player?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 07-28-2013 , 04:13   How do you change the movement speed of a player?
Reply With Quote #1

Hey guys!

This is CSS I'm talking about.

The default sm_speed command changes its velocity value which screws up with the gravity.
I've been trying to change the movement speed of players to something way higher than the normal speed and I've had no luck yet.

How would I be able to do this without messing up their gravity?
dilalmon is offline
Eden.Campo
Member
Join Date: Mar 2013
Old 07-28-2013 , 04:30   Re: How do you change the movement speed of a player?
Reply With Quote #2

Code:
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", speedvalue(float));
Eden.Campo is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 07-28-2013 , 04:45   Re: How do you change the movement speed of a player?
Reply With Quote #3

Quote:
Originally Posted by Eden.Campo View Post
Code:
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", speedvalue(float));
Incorrect.

Teleport the client and use the velocity argument to set his new velocity.

Reset the client velocity:
Code:
new Float:origin[3];
    GetClientAbsOrigin(client, origin);
    
    TeleportEntity(client, origin, NULL_VECTOR, Float:{0.0, 0.0, 0.0});
Set his velocity to 1,000:
Code:
new Float:origin[3];
    GetClientAbsOrigin(client, origin);
    
    TeleportEntity(client, origin, NULL_VECTOR, Float:{1000.0, 0.0, 0.0});
__________________
retired
shavit is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 07-28-2013 , 04:52   Re: How do you change the movement speed of a player?
Reply With Quote #4

This changes the gravity felt by the player.
Sorry, this is what I meant. I only need movement speed changed.
dilalmon is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 07-28-2013 , 04:59   Re: How do you change the movement speed of a player?
Reply With Quote #5

Quote:
Originally Posted by shavit View Post
Incorrect.

Teleport the client and use the velocity argument to set his new velocity.

Reset the client velocity:
Code:
new Float:origin[3];
    GetClientAbsOrigin(client, origin);
    
    TeleportEntity(client, origin, NULL_VECTOR, Float:{0.0, 0.0, 0.0});
Set his velocity to 1,000:
Code:
new Float:origin[3];
    GetClientAbsOrigin(client, origin);
    
    TeleportEntity(client, origin, NULL_VECTOR, Float:{1000.0, 0.0, 0.0});
Could you give me an example of how I can use this?
I'm not quite sure of how. Thanks!
dilalmon is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 07-28-2013 , 09:20   Re: How do you change the movement speed of a player?
Reply With Quote #6

try this i don't know if it still works, you may need updated gamedata

Last edited by blodia; 07-28-2013 at 09:21.
blodia is offline
dilalmon
AlliedModders Donor
Join Date: Apr 2013
Old 07-28-2013 , 12:52   Re: How do you change the movement speed of a player?
Reply With Quote #7

Sadly, it doesn't work after the gamedata has been updated.
I have a Windows server.
dilalmon is offline
necavi
Veteran Member
Join Date: Sep 2010
Old 07-28-2013 , 17:19   Re: How do you change the movement speed of a player?
Reply With Quote #8

Set m_flLaggedMovementValue - that's what War3Source does and it works fine.
necavi is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 07-28-2013 , 17:49   Re: How do you change the movement speed of a player?
Reply With Quote #9

Quote:
Originally Posted by necavi View Post
it works fine.
it doesn't work fine and the op already mentioned it, that changes the speed of the whole client movement not just runspeed which is what the op wants. if you double the speed using m_flLaggedMovementValue you also jump twice as fast, if you half it you jump in slow motion. the name of the prop even explains what its use for...
blodia is offline
necavi
Veteran Member
Join Date: Sep 2010
Old 07-28-2013 , 19:13   Re: How do you change the movement speed of a player?
Reply With Quote #10

And I already gave the solution to that. https://github.com/War3Source/War3So...eedGravGlow.sp That particular file is ugly as hell, but basically what it does is modify the value of m_flLaggedMovementValue if it has been changed since it was last set by the script (as in, if the engine set it due to jumping, switching weapons or a hundred other little events) and then multiplies that by the amount we want it to be set to. No issues with gravity or anything else.
necavi 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 15:45.


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