Raised This Month: $12 Target: $400
 3% 

CS_TerminateRound not firing?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 01-11-2017 , 01:55   CS_TerminateRound not firing?
Reply With Quote #1

Hey guys, I'm attempting to modify Mapchooser Extended lightly.

When an RTV is successful, instead of ForceChangeLevel being called and the map changing abruptly, I wish for the map change to be a bit more "graceful", meaning timelimit is lowered to expire the map, everyone gets slayed, round is ended, scoreboard pops up and map changes.

Currently this is what I have:

Code:
public Action:Timer_ChangeMap(Handle:hTimer, Handle:dp) {     g_ChangeMapInProgress = false;         new String:map[PLATFORM_MAX_PATH];         if (dp == INVALID_HANDLE)     {         if (!GetNextMap(map, PLATFORM_MAX_PATH))         {             //No passed map and no set nextmap. fail!             return Plugin_Stop;          }     }     else     {         ResetPack(dp);         ReadPackString(dp, map, PLATFORM_MAX_PATH);     }     //ForceChangeLevel(map, "Map Vote");     SetNextMap(map);     PrintToChatAll("Slaying all - end of map");     ServerCommand("mp_timelimit 1");     ServerCommand("mp_maxrounds 1");     ServerCommand("sm_slay @all");     CS_TerminateRound(1.0, CSRoundEnd_Draw);     ServerCommand("sm_slay @all");         return Plugin_Stop; }

It's a bit sloppy of a way of doing it, but should do the trick, right? Everything else works, except the round isn't ending. Any thoughts on why?

I tested making it even sloppier, changing the part in question to:

Code:
    SetNextMap(map);     PrintToChatAll("Slaying all - end of map");     ServerCommand("mp_timelimit 1");     ServerCommand("mp_maxrounds 1");     ServerCommand("sm_slay @all");     ServerCommand("sv_cheats 1");     ServerCommand("endround");     ServerCommand("sv_cheats 0");

and that works, but obviously I don't want cheats on at any point in time.
__________________

Last edited by sneaK; 01-11-2017 at 01:56.
sneaK is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-11-2017 , 02:25   Re: CS_TerminateRound not firing?
Reply With Quote #2

If terminate round isn't actually ending the round then that makes me think that the gamedata is bad.
Also terminate round will need a higher value for the map end time or it will wait only 1 second and then cut to the map change.
mp_match_restart_delay may be the value to set the CS_TerminateRound value to.
Edit: you are right about setting the timelimit and max rounds to a low value, as it will trigger the end-of-map checks.

Last edited by Mitchell; 01-11-2017 at 02:26.
Mitchell is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-11-2017 , 03:11   Re: CS_TerminateRound not firing?
Reply With Quote #3

I dont think settings cheats on and off like that is an issue because nothing can can be processed inbetween the squential calls as SRCDS isnt threaded.

Slaying everyone is a bit harsh and would effect stats plugins like rankme. Calling endround wouldn't require you to slay the clients.
__________________
Neuro Toxin is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 01-11-2017 , 03:18   Re: CS_TerminateRound not firing?
Reply With Quote #4

Quote:
Originally Posted by Mitchell View Post
If terminate round isn't actually ending the round then that makes me think that the gamedata is bad.
Also terminate round will need a higher value for the map end time or it will wait only 1 second and then cut to the map change.
mp_match_restart_delay may be the value to set the CS_TerminateRound value to.
Edit: you are right about setting the timelimit and max rounds to a low value, as it will trigger the end-of-map checks.
I'll try using a higher value, hopefully that will solve it! I was almost thinking I wasn't calling CS_TerminateRound correctly...

Quote:
Originally Posted by Neuro Toxin View Post
I dont think settings cheats on and off like that is an issue because nothing can can be processed inbetween the squential calls as SRCDS isnt threaded.

Slaying everyone is a bit harsh and would effect stats plugins like rankme. Calling endround wouldn't require you to slay the clients.
I'm running SMAC, so sv_cheats is automatically set back to 0 before endround is called, so that's that doesn't work unfortunately, hence why I'm attempting to use CS_TerminateRound.

I'm not worried about stats since this is for movement servers (surf, bhop, etc), the slaying is just an added protection to ensure the round ends and the server changes to the next map. If I got the round to end properly then I could probably take out the slaying after testing, but that's what I'm stuck on.
__________________

Last edited by sneaK; 01-11-2017 at 03:28.
sneaK is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-11-2017 , 04:34   Re: CS_TerminateRound not firing?
Reply With Quote #5

Maybe another plugin is blocking the terminate round call?
__________________
Neuro Toxin is offline
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 01-11-2017 , 18:01   Re: CS_TerminateRound not firing?
Reply With Quote #6

Perhaps try using the third argument in the function:
PHP Code:
CS_TerminateRound(1.0CSRoundEnd_Drawtrue); 
I've always set that to true. Might stop other plugins from interfering, as Neuro noted could be happening. Also, consider changing the 1.0 to something higher for a slightly longer, more graceful delay/change.
__________________
ThatOneGuy is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 01-11-2017 , 22:05   Re: CS_TerminateRound not firing?
Reply With Quote #7

You can also try, creating a game_round_end entity and firing one of the inputs. Note, using the entity to end rounds will follow more steps than just calling the function (Like adding to the score iirc).
Dr!fter 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 20:37.


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