Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2012
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. #pragma semicolon 1
  2.  
  3. #include <sourcemod>
  4. #include <sdktools>
  5. #include <cstrike>
  6.  
  7. new Handle:g_Timer = INVALID_HANDLE;
  8. new Handle:g_RoundEnd = INVALID_HANDLE;
  9. new bool:g_bRoundEnd = false;
  10. new bool:g_bMapchange = false;
  11.  
  12. public Plugin:myinfo =
  13. {
  14. name = "Forced Round-End",
  15. author = "Zephyrus",
  16. description = "Privately coded plugin.",
  17. version = "1.0",
  18. url = ""
  19. }
  20.  
  21. public OnPluginStart()
  22. {
  23. HookEvent("round_start", Event_RoundStart);
  24. HookEvent("round_end", Event_RoundEnd);
  25. }
  26.  
  27. public OnMapStart()
  28. {
  29. g_bMapchange=false;
  30. }
  31.  
  32. public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
  33. {
  34. new roundtime = GetConVarInt(FindConVar("mp_roundtime"))*60+GetConVarInt(FindConVar("mp_freezetime"));
  35. if(roundtime > 0 && g_Timer == INVALID_HANDLE)
  36. {
  37. g_Timer = CreateTimer(float(roundtime), EndRound, _, TIMER_FLAG_NO_MAPCHANGE);
  38. }
  39.  
  40. g_bRoundEnd=false;
  41.  
  42. return Plugin_Continue;
  43. }
  44.  
  45. public Action:Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
  46. {
  47. g_Timer = INVALID_HANDLE;
  48.  
  49. return Plugin_Continue;
  50. }
  51.  
  52. public Action:EndRound(Handle:timer, any:data)
  53. {
  54. g_bRoundEnd=true;
  55. return Plugin_Stop;
  56. }
  57.  
  58. public OnGameFrame()
  59. {
  60. if(RoundToFloor(GetGameTime())%66==0)
  61. {
  62. new timeleft;
  63. GetMapTimeLeft(timeleft);
  64. if((timeleft <= 0 && g_bRoundEnd && !g_bMapchange) || (timeleft <= 0 && GetConVarInt(FindConVar("mp_ignore_round_win_conditions"))==1))
  65. {
  66. if(!g_bMapchange)
  67. CS_TerminateRound(5.0, CSRoundEnd_Draw);
  68. g_bMapchange=true;
  69. }
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement