View Single Post
Author Message
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 04-15-2016 , 01:55   Force round end (CSGO)
Reply With Quote #1

Hey Guys,

So I will basically do anything to have a foolproof system to force the round to end once the roundtime reaches 0:00 I currently have a deathmatch server and well since the round doesn't end the time will still be 0:00 on the ingame clock at this time tomorrow!!

Heres the code I used if its any help
PHP Code:
public Action:CheckRemainingTime(Handle:timer)
{
    new 
Handle:hTmp;    
    
hTmp FindConVar("mp_timelimit");
    new 
iTimeLimit GetConVarInt(hTmp);            
    if (
hTmp != INVALID_HANDLE)
        
CloseHandle(hTmp);    
    if (
iTimeLimit 0)
    {
        new 
timeleft;
        
GetMapTimeLeft(timeleft);
        
        switch(
timeleft)
        {
            case 
60CPrintToChatAll("Time Remaining: \x0460 seconds\x01");
            case 
30CPrintToChatAll("Time Remaining: \x0430 seconds\x01");
            case 
15CPrintToChatAll("Time Remaining: \x0415 seconds\x01");
            case -
1CPrintToChatAll("\x023..");
            case -
2CPrintToChatAll("\x022..");
            case -
3CPrintToChatAll("\x021..");
        }
        
        if(
timeleft < -&& !g_bAllowRoundEnd)
        {
            
g_bAllowRoundEnd true;
            
CS_TerminateRound(0.5CSRoundEnd_TerroristWintrue);
        }
    }

__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman is offline