View Single Post
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