Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4. int g_roundStartedTime = -1;
  5. bool OnRound;
  6. int State = 0;
  7. float g_fMult = 1.0;
  8.  
  9. ConVar g_hCvarMaxCTHeight;
  10. ConVar g_hCvarMaxTHeight;
  11.  
  12. public Plugin myinfo =
  13. {
  14. name = "New Plugin",
  15. author = "Unknown",
  16. description = "<- Description ->",
  17. version = "1.0",
  18. url = "<- URL ->"
  19. }
  20.  
  21. public void OnPluginStart()
  22. {
  23. g_hCvarMaxCTHeight = CreateConVar("sm_maxCTheight_mult", "200.0", "Max height mult");
  24. g_hCvarMaxTHeight = CreateConVar("sm_maxTheight", "300.0", "Max height mult");
  25.  
  26. HookEvent("round_start", Round_Start);
  27. HookEvent("round_end", Round_End);
  28. RegConsoleCmd("sm_testtime", sm_testtime);
  29.  
  30. }
  31.  
  32. public Action OnPlayerRunCmd(int client, int& buttons, int& impulse, float vel[3], float angles[3], int& weapon, int& subtype, int& cmdnum, int& tickcount, int& seed, int mouse[2])
  33. {
  34. if(IsPlayerAlive(client))
  35. {
  36. if(GetClientTeam(client) == 3)
  37. {
  38. SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", g_fMult);
  39. if(GetEntityFlags(client) & FL_ONGROUND && buttons & IN_JUMP)
  40. {
  41. float velll[3];
  42. GetEntPropVector(client, Prop_Data, "m_vecVelocity", velll);
  43. velll[2] = g_hCvarMaxCTHeight.FloatValue * GetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue");
  44. TeleportEntity(client, NULL_VECTOR,NULL_VECTOR, velll);
  45. }
  46. }
  47. if(GetClientTeam(client) == 2)
  48. {
  49. if(GetEntityFlags(client) & FL_ONGROUND && buttons & IN_JUMP)
  50. {
  51. float velll[3];
  52. GetEntPropVector(client, Prop_Data, "m_vecVelocity", velll);
  53. velll[2] = g_hCvarMaxTHeight.FloatValue;
  54. TeleportEntity(client, NULL_VECTOR,NULL_VECTOR, velll);
  55. }
  56. }
  57. }
  58. }
  59.  
  60. public Action sm_testtime(client, args)
  61. {
  62. if(OnRound)
  63. {
  64. PrintToChatAll("time remaining %i", TimeLeft());
  65. }
  66. return Plugin_Handled;
  67. }
  68.  
  69. public Action Round_Start(Event event, const char[] name, bool dontBroadcast)
  70. {
  71. g_roundStartedTime = GetTime();
  72. OnRound = true;
  73. IniAll();
  74. }
  75.  
  76. public Action Round_End(Event event, const char[] name, bool dontBroadcast)
  77. {
  78. OnRound = false;
  79. IniAll();
  80. }
  81.  
  82. int TimeLeft()
  83. {
  84. return (GameRules_GetProp("m_iRoundTime") - (GetTime() - g_roundStartedTime))/60;
  85. }
  86.  
  87. public void OnGameFrame()
  88. {
  89. if(10 < TimeLeft() < 12 && State == 0) ChangeCTSpeed(1.1);
  90. if(8 < TimeLeft() < 10 && State == 1) ChangeCTSpeed(1.2);
  91. if(6 < TimeLeft() < 8 && State == 2) ChangeCTSpeed(1.3);
  92. if(5 < TimeLeft() < 6 && State == 3) ChangeCTSpeed(1.4);
  93. if(4 < TimeLeft() < 5 && State == 4) ChangeCTSpeed(1.5);
  94. if(3 < TimeLeft() < 4 && State == 5) ChangeCTSpeed(1.6);
  95. if(2 < TimeLeft() < 3 && State == 6) ChangeCTSpeed(1.7);
  96. if(1 < TimeLeft() < 2 && State == 7) ChangeCTSpeed(1.8);
  97. if(0 < TimeLeft() < 1 && State == 8) ChangeCTSpeed(1.9);
  98. }
  99.  
  100. void ChangeCTSpeed(float mult)
  101. {
  102. State++;
  103. PrintToChatAll("The speed of SEEKERS, it's now turn to %f", mult);
  104. g_fMult = mult;
  105. }
  106.  
  107. void IniAll()
  108. {
  109. State = 0;
  110. g_fMult = 1.0;
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement