Raised This Month: $32 Target: $400
 8% 

how to set player speed?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raydan
Senior Member
Join Date: Aug 2006
Old 11-01-2007 , 09:23   how to set player speed?
Reply With Quote #1

how to set player speed?
i am using

SpeedOffset=FindSendPropOffs("CCSPlayer","m_f lLaggedMovementValue");
SetEntDataFloat(client,SpeedOffset,speed/300.0,true);

i set speed to 220,when player jump, they are like "flying"
and what is the normal speed?
raydan is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 11-01-2007 , 13:40   Re: how to set player speed?
Reply With Quote #2

Normal speed is 1. "m_f lLaggedMovementValue" is a speed multiplier, and 220 means 220 times faster than normal speed.
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
raydan
Senior Member
Join Date: Aug 2006
Old 11-01-2007 , 22:48   Re: how to set player speed?
Reply With Quote #3

any other ways to change player speed?
because i set m_f lLaggedMovementValue less than 1, there gravity look like lower. it will can player gravity. i don't want it
raydan is offline
kirewv
Senior Member
Join Date: Oct 2007
Old 03-24-2008 , 16:36   Re: how to set player speed?
Reply With Quote #4

This is all that is needed:

SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0);
kirewv is offline
sfPlayer
Senior Member
Join Date: Dec 2007
Location: Germany
Old 03-24-2008 , 19:41   Re: how to set player speed?
Reply With Quote #5

Since the acceleration is the first derivation of the velocity it's physically absolutely correct that the acceleration caused by gravity which is constant will exert more influence if you change the velocity.
sfPlayer is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 03-25-2008 , 10:33   Re: how to set player speed?
Reply With Quote #6

There is another way to change player speed, but you can't currently use it with SM. That way is to hook the GetMaxSpeed function on the weapons and return a new value. It won't have the effect on gravity that the lagged movement value does. I think SM has plans to allow hooking such functions at some point though.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 03-25-2008 , 13:47   Re: how to set player speed?
Reply With Quote #7

I'm working on a hacks extension right now. One of the features will be the ability to see when an entity is created (such as weapon) and a GetMaxSpeed hook will also be included.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 03-26-2008 , 11:00   Re: how to set player speed?
Reply With Quote #8

Code:
//Speed:
public Max_Speed(Client, Float:RP_Max)
{
 //Set Max Speed:
 new Speed_Offset;
 Speed_Offset = FindSendPropOffs("CHL2MP_Player", "m_flMaxspeed");
 //Set Speed:
 if(Speed_Offset > 0)
  SetEntData(Client, Speed_Offset, RP_Max, 4, true);
}
as found in http://forums.alliedmods.net/showthread.php?t=68386
__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 03-26-2008 , 13:10   Re: how to set player speed?
Reply With Quote #9

Quote:
Originally Posted by L. Duke View Post
I'm working on a hacks extension right now. One of the features will be the ability to see when an entity is created (such as weapon) and a GetMaxSpeed hook will also be included.
Awesome
Greyscale is offline
raydan
Senior Member
Join Date: Aug 2006
Old 04-21-2008 , 06:11   Re: how to set player speed?
Reply With Quote #10

Quote:
Originally Posted by Pinkfairie View Post
Code:
//Speed:
public Max_Speed(Client, Float:RP_Max)
{
 //Set Max Speed:
 new Speed_Offset;
 Speed_Offset = FindSendPropOffs("CHL2MP_Player", "m_flMaxspeed");
 //Set Speed:
 if(Speed_Offset > 0)
  SetEntData(Client, Speed_Offset, RP_Max, 4, true);
}
as found in http://forums.alliedmods.net/showthread.php?t=68386

Code:
public Max_Speed(Client, Float:RP_Max)
{
 new Speed_Offset;
 Speed_Offset = FindSendPropOffs("CBasePlayer", "m_flMaxspeed");
 if(Speed_Offset > 0)
 {
  PrintToServer("Set speed");
  SetEntData(Client, Speed_Offset, RP_Max, 4, true);
 }
}
doesn' work
raydan is offline
Reply


Thread Tools
Display Modes

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 00:57.


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