Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #include <sourcemod>
- #include <sdktools>
- #include <cstrike>
- new Handle:g_Timer = INVALID_HANDLE;
- new Handle:g_RoundEnd = INVALID_HANDLE;
- new bool:g_bRoundEnd = false;
- new bool:g_bMapchange = false;
- public Plugin:myinfo =
- {
- name = "Forced Round-End",
- author = "Zephyrus",
- description = "Privately coded plugin.",
- version = "1.0",
- url = ""
- }
- public OnPluginStart()
- {
- HookEvent("round_start", Event_RoundStart);
- HookEvent("round_end", Event_RoundEnd);
- }
- public OnMapStart()
- {
- g_bMapchange=false;
- }
- public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new roundtime = GetConVarInt(FindConVar("mp_roundtime"))*60+GetConVarInt(FindConVar("mp_freezetime"));
- if(roundtime > 0 && g_Timer == INVALID_HANDLE)
- {
- g_Timer = CreateTimer(float(roundtime), EndRound, _, TIMER_FLAG_NO_MAPCHANGE);
- }
- g_bRoundEnd=false;
- return Plugin_Continue;
- }
- public Action:Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
- {
- g_Timer = INVALID_HANDLE;
- return Plugin_Continue;
- }
- public Action:EndRound(Handle:timer, any:data)
- {
- g_bRoundEnd=true;
- return Plugin_Stop;
- }
- public OnGameFrame()
- {
- if(RoundToFloor(GetGameTime())%66==0)
- {
- new timeleft;
- GetMapTimeLeft(timeleft);
- if((timeleft <= 0 && g_bRoundEnd && !g_bMapchange) || (timeleft <= 0 && GetConVarInt(FindConVar("mp_ignore_round_win_conditions"))==1))
- {
- if(!g_bMapchange)
- CS_TerminateRound(5.0, CSRoundEnd_Draw);
- g_bMapchange=true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement