Guest User

Untitled

a guest
Apr 26th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <tf2_stocks>
  3.  
  4. public OnPluginStart()
  5. {
  6. RegConsoleCmd("rpg_runspeed", Command_Runspeed);
  7. }
  8.  
  9. public Action:Command_Runspeed(client, args)
  10. {
  11. new Float:multiplier = 1.0;
  12.  
  13. if (args == 1)
  14. {
  15. decl String:buffer[4];
  16. GetCmdArg(1, buffer, sizeof(buffer);
  17.  
  18. multiplier = StringToFloat(buffer);
  19. }
  20. else if (args > 1)
  21. {
  22. PrintToChat(client, "[SourceRPG] Usage: /rpg_runspeed [multiplier]
  23. return;
  24. }
  25.  
  26. SpeedMultiplier(client, multiplier);
  27. }
  28.  
  29. public SpeedMultiplier(client, Float:multiplier)
  30. {
  31. new TFClassType:class = TF2_GetPlayerClass(client);
  32. new Float:classSpeed = TF2_GetClassSpeed(class);
  33. new Float:runspeed = classSpeed * multiplier;
  34. if (runspeed > 400.0) runspeed = 400.0;
  35.  
  36. SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", runspeed);
  37. }
Add Comment
Please, Sign In to add comment