Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. #pragma semicolon 1
  2.  
  3. #include <sourcemod>
  4. #include <sdktools>
  5. #include <tf2_stocks>
  6.  
  7. #define REPLAY_PAUSE "replay/enterperformancemode.wav"
  8. #define REPLAY_RESUME "replay/exitperformancemode.wav"
  9.  
  10. #define PLUGIN_NAME "[TF2] Focus Harder"
  11. #define PLUGIN_AUTHOR "FlaminSarge"
  12. #define PLUGIN_VERSION "1.0"
  13. #define PLUGIN_CONTACT "http://forums.alliedmods.net/"
  14.  
  15. public Plugin:myinfo =
  16. {
  17. name = PLUGIN_NAME,
  18. author = PLUGIN_AUTHOR,
  19. description = PLUGIN_NAME,
  20. version = PLUGIN_VERSION,
  21. url = PLUGIN_CONTACT
  22. };
  23. public OnMapStart()
  24. {
  25. PrecacheSound(REPLAY_PAUSE, true);
  26. PrecacheSound(REPLAY_RESUME, true);
  27. }
  28. public OnPluginStart()
  29. {
  30. CreateConVar("focusharder_version", PLUGIN_VERSION, PLUGIN_NAME, FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_PLUGIN);
  31. }
  32. public TF2_OnConditionAdded(client, TFCond:cond)
  33. {
  34. if (IsFakeClient(client)) return;
  35. if (_:cond == 1 && TF2_IsPlayerInCondition(client, TFCond_Zoomed))
  36. {
  37. EmitSoundToClient(client, REPLAY_PAUSE);
  38. EmitSoundToClient(client, REPLAY_PAUSE);
  39. FadeClientVolume(client, 80.0, 2.2, 200.0, 2.2);
  40. }
  41. else if (cond == TFCond_Zoomed && TF2_IsPlayerInCondition(client, TFCond:1))
  42. {
  43. FadeClientVolume(client, 80.0, 0.2, 200.0, 0.2);
  44. }
  45. }
  46. public TF2_OnConditionRemoved(client, TFCond:cond)
  47. {
  48. if (IsFakeClient(client)) return;
  49. if (_:cond == 1)
  50. {
  51. FadeClientVolume(client, 0.0, 0.8, 200.0, 0.8);
  52. if (IsPlayerAlive(client))
  53. {
  54. EmitSoundToClient(client, REPLAY_RESUME);
  55. EmitSoundToClient(client, REPLAY_RESUME);
  56. }
  57. }
  58. else if (cond == TFCond_Zoomed && TF2_IsPlayerInCondition(client, TFCond:1))
  59. {
  60. FadeClientVolume(client, 0.0, 0.2, 0.0, 0.2);
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement