AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CSGO] Hook map end vote result (https://forums.alliedmods.net/showthread.php?t=308769)

eyal282 07-03-2018 06:38

[CSGO] Hook map end vote result
 
How to get the result of this vote end? User message does not work for this specific vote.

The reason I need it is in order to fix a bug that restarts the server to the same map when it passes ( a workaround on a bug I fail to fix )

https://imgur.com/a/ZbG7cDz

Ermert1992 07-04-2018 15:18

Re: [CSGO] Hook map end vote result
 
Yes, I'm looking for this, too.

mug1wara 07-04-2018 15:20

Re: [CSGO] Hook map end vote result
 
You could hook game_end, create a timer from when the game ends till the mapvoting being started.

kratoss1812 07-04-2018 15:21

Re: [CSGO] Hook map end vote result
 
You don't need to code anything ^.^

Add The following in csgo/cfg/gamemode_casual_server.cfg or in your server.cfg!
Code:

mp_match_restart_delay 20

//mp_endmatch_votenextmap_keepcurrent 0
mp_endmatch_votenextmap 0 // keep this to 0
mp_endmatch_votenextleveltime 20


EDIT: I did't read your problem well.. but you can keep these convars in your server.cfg and use Map chooser and for chat messages you can use my plugin ( not released.. too simply)

PHP Code:

#define PLUGIN_AUTHOR "kRatoss"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <colors>

public Plugin myinfo 
{
    
name "Map Commands",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url ""
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_nextmap"Cmd_Next);
    
RegAdminCmd("sm_setnextmap"Cmd_SetADMFLAG_CHANGEMAP);
}

public 
Action Cmd_Next(int clientint args)
{
    
char sMap[64];
    
GetNextMap(sMapsizeof(sMap));
    
    
PrintToChat(client"\x04 Next map: \x03 %s"sMap);
}

public 
Action Cmd_Set(int clientint args)
{
    if(
args != 1)
    {
        
PrintToChat(client"Usage: sm_setnextmap <map>");
        return 
Plugin_Handled;
    }
    
    
char sArgs[64];
    
GetCmdArg(1sArgssizeof(sArgs));
    
    
char sMap[62];
    
GetCmdArgString(sMapsizeof(sMap));
    
    
SetNextMap(sMap);
    
    
char sName[MAX_NAME_LENGTH];
    
GetClientName(clientsNameMAX_NAME_LENGTH);
    
    
PrintToChatAll("\x04 Admin %s set the next map to: %s"sNamesMap);
    
    return 
Plugin_Handled;



Powerlord 07-05-2018 00:16

Re: [CSGO] Hook map end vote result
 
Actually, I tried looking for how the server communicates the choices to clients and how the clients communicate their votes back to the server. I never did find it.

As you've said, it doesn't use the vote UserMessages, events, and commands that existed prior to the introduction of the match end map vote.

Ilusion9 07-05-2018 10:04

Re: [CSGO] Hook map end vote result
 
PHP Code:


events_ids_translate
[EVENT_GAME_NEWMAP]<-["game_newmap",["mapname"]];

events_ids_translate[EVENT_NEXTLEVEL_CHANGED]<-["nextlevel_changed",["nextlevel"]];

events_ids_translate[EVENT_ENDMATCH_MAPVOTE_SELECTING_MAP]<-["endmatch_mapvote_selecting_map",["count","slot1","slot2","slot3","slot4","slot5","slot6","slot7","slot8","slot9","slot10"]];
events_ids_translate[EVENT_ENDMATCH_CMM_START_REVEAL_ITEMS]<-["endmatch_cmm_start_reveal_items",[]]; 

Try `nextlevel_changed` event (parametes: "nextlevel") (string ???)

If it doesn't work try `endmatch_mapvote_selecting_map` event (parameters: "count","slot1","slot2","slot3","slot4","slot 5","slot6","slot7","slot8","slot9","slot10 ").
I don't know when it's called and i don't know if the parameters are strings or ints. If it's called at every vote, you can start sending your own maps in the vote and then you count the votes.
https://forums.alliedmods.net/showthread.php?t=288728

`endmatch_cmm_start_reveal_items` has no parameters.


All times are GMT -4. The time now is 00:43.

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