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

[CSGO] Hook map end vote result


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-03-2018 , 06:38   [CSGO] Hook map end vote result
Reply With Quote #1

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
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Ermert1992
Member
Join Date: Jan 2012
Location: Germany
Old 07-04-2018 , 15:18   Re: [CSGO] Hook map end vote result
Reply With Quote #2

Yes, I'm looking for this, too.
Ermert1992 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-04-2018 , 15:20   Re: [CSGO] Hook map end vote result
Reply With Quote #3

You could hook game_end, create a timer from when the game ends till the mapvoting being started.
mug1wara is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 07-04-2018 , 15:21   Re: [CSGO] Hook map end vote result
Reply With Quote #4

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;


Last edited by kratoss1812; 07-04-2018 at 15:24.
kratoss1812 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-05-2018 , 00:16   Re: [CSGO] Hook map end vote result
Reply With Quote #5

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.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-05-2018 at 00:17.
Powerlord is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 07-05-2018 , 10:04   Re: [CSGO] Hook map end vote result
Reply With Quote #6

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.

Last edited by Ilusion9; 07-05-2018 at 10:18.
Ilusion9 is offline
Reply



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:25.


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