Skip to content

Allows developers to dynamically override default max speed for specific players or classes

License

Notifications You must be signed in to change notification settings

justin-chellah/player-class-max-speed-override

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[TF2] Player Class Default Max Speed Override

This is a SourceMod Plugin that lets developers dynamically override specific player or class base max speeds. This is a way more efficient approach because it hooks onto the CTFPlayer::TeamFortress_CalculateMaxSpeed method and allows to apply the speed change before the game does its own class and state-specific calculations so that speed attributes won't become useless.

API

  • Global Forward
    • Action TF2_OnCalculatePlayerMaxSpeed( int iClient, TFClassType eClass, float& flDefaultMaxSpeed )

Example code:

public Action TF2_OnCalculatePlayerMaxSpeed( int iClient, TFClassType eClass, float& flDefaultMaxSpeed )
{
	if ( eClass == TFClass_Scout )
	{
		const float flMaxSpeed = 200.0;
		
		flDefaultMaxSpeed = flMaxSpeed;
		
		return Plugin_Changed;
	}
	
	return Plugin_Continue;
}

Requirements

Supported Platforms

  • Windows
  • Linux

About

Allows developers to dynamically override default max speed for specific players or classes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published