Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <tf2_stocks>
- public OnPluginStart()
- {
- RegConsoleCmd("rpg_runspeed", Command_Runspeed);
- }
- public Action:Command_Runspeed(client, args)
- {
- new Float:multiplier = 1.0;
- if (args == 1)
- {
- decl String:buffer[4];
- GetCmdArg(1, buffer, sizeof(buffer);
- multiplier = StringToFloat(buffer);
- }
- else if (args > 1)
- {
- PrintToChat(client, "[SourceRPG] Usage: /rpg_runspeed [multiplier]
- return;
- }
- SpeedMultiplier(client, multiplier);
- }
- public SpeedMultiplier(client, Float:multiplier)
- {
- new TFClassType:class = TF2_GetPlayerClass(client);
- new Float:classSpeed = TF2_GetClassSpeed(class);
- new Float:runspeed = classSpeed * multiplier;
- if (runspeed > 400.0) runspeed = 400.0;
- SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", runspeed);
- }
Add Comment
Please, Sign In to add comment