Raised This Month: $32 Target: $400
 8% 

Force round end (CSGO)


Post New Thread Reply   
 
Thread Tools Display Modes
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
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 04-15-2016 , 02:46   Re: Force round end (CSGO)
Reply With Quote #2

Your snippet looks fine...

What's the problem?

Does it not work or do you get errors or...?
__________________
Neuro Toxin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-15-2016 , 10:18   Re: Force round end (CSGO)
Reply With Quote #3

Deathmatch like game_type 1 game_mode 2 ?
Maybe you have wrong game settings...

Try add these in override config. Make sure any other plugin not change cvars or execute extra config files.

...cfg/gamemode_deathmatch_server.cfg
Code:
mp_default_team_winner_no_objective -1
mp_respawn_on_death_t 1
mp_respawn_on_death_ct 1

mp_roundtime_defuse 0
mp_roundtime_hostage 0
mp_roundtime 15 // use both roundtime and timelimit
mp_timelimit 15
mp_maxrounds 0
mp_ignore_round_win_conditions 0

mp_match_end_restart 0
mp_match_end_changelevel 1
__________________
Do not Private Message @me

Last edited by Bacardi; 04-15-2016 at 10:22.
Bacardi is offline
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 04-15-2016 , 10:54   Re: Force round end (CSGO)
Reply With Quote #4

Quote:
Originally Posted by Neuro Toxin View Post
Your snippet looks fine...

What's the problem?

Does it not work or do you get errors or...?
It does work if you connect right after the restart, the whole round plays out and it counts down 3, 2, 1 and ends the round at 0:00 perfectly. However if people join then disconnect the server hibernates however i believe the timer continues to run as later lastnight my roundtime and timeleft is set to 20mins yet the timer killed the round at 11:00 minutes left.

The issue is there is no error logs as it thinks its running flawlessly. I'm going to try the configs below and hopefully that works. Do you think hooking round_time instead of timeleft is a better option?
__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman is offline
Triniayo
Senior Member
Join Date: Apr 2011
Location: #include <germany>
Old 04-15-2016 , 10:56   Re: Force round end (CSGO)
Reply With Quote #5

Quote:
Originally Posted by Mr.Freeman View Post
It does work if you connect right after the restart, the whole round plays out and it counts down 3, 2, 1 and ends the round at 0:00 perfectly. However if people join then disconnect the server hibernates however i believe the timer continues to run as later lastnight my roundtime and timeleft is set to 20mins yet the timer killed the round at 11:00 minutes left.

The issue is there is no error logs as it thinks its running flawlessly. I'm going to try the configs below and hopefully that works. Do you think hooking round_time instead of timeleft is a better option?
That's not a problem of your script, if the server hibernates.

Add this to your sourcemod.cfg:

sm_cvar sv_hibernate_when_empty 0
__________________
If you need any help, feel free to add me on Steam.


Triniayo is offline
Send a message via Skype™ to Triniayo
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 04-15-2016 , 11:20   Re: Force round end (CSGO)
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
Deathmatch like game_type 1 game_mode 2 ?
Maybe you have wrong game settings...

Try add these in override config. Make sure any other plugin not change cvars or execute extra config files.

...cfg/gamemode_deathmatch_server.cfg
Code:
mp_default_team_winner_no_objective -1
mp_respawn_on_death_t 1
mp_respawn_on_death_ct 1

mp_roundtime_defuse 0
mp_roundtime_hostage 0
mp_roundtime 15 // use both roundtime and timelimit
mp_timelimit 15
mp_maxrounds 0
mp_ignore_round_win_conditions 0

mp_match_end_restart 0
mp_match_end_changelevel 1
Hey Man,

Thanks for the help so far, I used everything you put in the CFG yet still the round does not end. Any other sugguestions?
__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-15-2016 , 11:31   Re: Force round end (CSGO)
Reply With Quote #7

hmm..
try give a list plugins and some cvar settings.

rcon con_logfile myfile.txt
rcon sv_game_mode_convars
rcon sm plugins list
rcon differences
rcon con_logfile ""


But pefore you post file, remove RCON password!
__________________
Do not Private Message @me
Bacardi is offline
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 04-15-2016 , 11:37   Re: Force round end (CSGO)
Reply With Quote #8

Added above to my server.cfg and restarted the server, where would I fetch the myfile.txt from?
__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-15-2016 , 14:54   Re: Force round end (CSGO)
Reply With Quote #9

in csgo folder
__________________
Do not Private Message @me
Bacardi is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode