Raised This Month: $ Target: $400
 0% 

[Tutorial] how to set player movement speed?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
javalia
Senior Member
Join Date: May 2009
Location: korea, republic of
Old 08-02-2010 , 22:59   [Tutorial] how to set player movement speed?
Reply With Quote #1

----battle report (report type c-84)----

on ep1 engine(at this time, only hl2mp)
u can just set m_fl_Maxspeed as just u want and it is all.
but on ep2 engine(css tf2...), that is not all

but it is not impossible to edit player movement speed.

so i am posting that simple way to edit movement speed of client

to edit player speed on ep2 engine, u need to use sdkhooks.

see this

Code:
public OnClientPutInServer(client){
    
    SDKHook(client, SDKHook_PreThinkPost, PreThinkPostHook);
    
}

public PreThinkPostHook(client){
    
    if(IsClientConnectedIngameAlive(client)){
        
        if(suitmode[client] == suitmode_speed){
        
            SetEntPropFloat(client, Prop_Data, "m_flMaxspeed", SUIT_SPEED_MAXSPEED);
            
        }
        
    }
    
}
suitmode[client] was global variable on that code.
so u can set client`s max speed as u want.

but, there is some limit on that.

first, to make players able to move faster than 320,
u need to set server convar "sv_maxspeed" to higher value of max speed that u want to set.
but u must not set it too high than u need.
if that value is too high, spectators will move too faster.

twice, if u want to players able to move faster than 400,
u must set ur server as "sv_cheats 1" server!!!!

cuz there is a client side cvar "cl_forwardspeed"
and it determinds how clients can be faster.
they cannot move faster than that value.
that convar dont exist on serverside.
and that convar has cheat flag.
so to set that convar, u must set sv_cheats 1

but at most of time, u will have no need to set client`s speed to higher value than 400. but if u need to do so, well...i was not able to find way to set that client side value without "sv_cheats 1"

-from a terran battlefield commander

----end of transmitsion----

Last edited by javalia; 08-02-2010 at 23:04.
javalia is offline
 


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 18:21.


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