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

CS_TerminateRound not firing?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 02:09.


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