Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <tf2>
  3. #include <tf2_stocks>
  4. #include <sdkhooks>
  5.  
  6. bool bOnTaunt[MAXPLAYERS];
  7. ConVar g_CvarSpeed;
  8.  
  9. public Plugin myinfo =
  10. {
  11. name = "",
  12. author = "",
  13. description = "",
  14. version = "",
  15. url = ""
  16. };
  17.  
  18. public void OnPluginStart()
  19. {
  20. g_CvarSpeed = CreateConVar("sm_taunt_forward_speed", "100.0", "Set the forward speed on taunts");
  21. }
  22.  
  23. public void TF2_OnConditionAdded(int client, TFCond cond)
  24. {
  25. if(!bOnTaunt[client] && cond == TFCond_Taunting)
  26. {
  27. PrintToChatAll("on taunt");
  28. bOnTaunt[client] = true;
  29. SetEntityMoveType(client, MOVETYPE_FLY);
  30. }
  31. }
  32.  
  33. public void TF2_OnConditionRemoved(int client, TFCond cond)
  34. {
  35. if(bOnTaunt[client] && cond == TFCond_Taunting)
  36. {
  37. PrintToChatAll("no taunt");
  38. bOnTaunt[client] = false;
  39. SetEntityMoveType(client, MOVETYPE_WALK);
  40. }
  41. }
  42.  
  43. public Action OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
  44. {
  45. if(bOnTaunt[client])
  46. {
  47. float vAngles[3], fForward[3], vVelocity[3];
  48. GetClientEyeAngles(client, vAngles);
  49. vAngles[0] = 0.0;
  50. GetAngleVectors(vAngles, fForward, NULL_VECTOR, NULL_VECTOR);
  51. for(int i = 0; i < 3; i++) vVelocity[i] = fForward[i] * g_CvarSpeed.FloatValue;
  52. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vVelocity);
  53. }
  54. return Plugin_Continue;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement