restart, nextmap, swamp teams votes disabled after 5 minutes


(BlackEight) #1

Hello
I run ET server with nq 1.2.5 mod. I know that after some 5 minutes votes like nextmap, maprestart, swapteams should be disabled after the 5 minutes after the beginning of map. Is there some cvar that enables this? It doesnt work at my server at all and at the end of map guys are able to do maprestart :confused:

Regards,
Eight


(phisherman) #2

There is no CVAR or command for that, but since you’re running NQ125, you could do such a thing via lua. I don’t know if somebody already made such a thing, there already were some threads referring to that problem.
You can look around a bit, and if you don’t find anything, I’ll try and create such a script.


(BlackEight) #3

Unfortunatelly I couldnt find any LUA for that feature. I will be very thankful if you could make that script for us.

Regards,
Eith


(YourFather_CZ) #4

There are options represented by cvars which enables possibility to vote.

Using Lua scripting, this cvars are handled by Lua script at desired time (e.g. 5 minutes before end of round).

Name of these cvars begin with: vote_allow_
Here is an example of cvarlist (pay attention, it’s old ETPro cvarlist).


(phisherman) #5

Alright, give it a try:

–VoteBlock LUA v1 by Phishermans Phriend
–Block specified votes after X minutes have passed on a map
–Clients can show the blocked votes and time via /voteblock

–IF YOU WANT TO RUN THIS SCRIPT ON YOUR SERVER, YOU NEED TO PLACE THE ALLOWED VOTE-CVARS INTO THE DEFAULT.CFG OF YOUR g_mapconfigs-DIRECTORY!!!

–Configuration------------------
time = 5*60 – specify the time (in seconds) that needs to pass before the votes are disabled
announce = true – show a text-announcement in chat area when the time has passed

–define the votes that shall be disabled (false=allowed,true=blocked)
–if some votes are generally disabled on your server, they are not influenced if they are set to false below
block_restart = false
block_reset = false
block_shuffle_re = false – shuffle with maprestart
block_shuffle_nore = false – shuffle without maprestart
block_nextmap = false
block_swap = false
block_surrender = false
block_map = false – voting for single maps/cmpgns
block_timelimit = false
block_poll = false
block_nextcmpgn = false – only for campaign mode!
block_restartcmpgn = false – only for campaign mode!
–End of Configuartion-----------
The default.cfg-thing is very important, because if you do not set the allowed vote-cvars to 1 in this config (gets loaded on every mapstart), the votes will only be allowed on the first map until the time has passed, and not on the following.
The script has been developed for NQ >= 1.2.5, I don’t know if it will work with other mods.
Feel free to use, share and modify this script, altered versions for other mods are welcome. (Upload here)
I tested it, no warranty though. Please report all bugs or suggestions here.
Download:


(BlackEight) #6

Oh thanks. I will check that and make reply as soon as it’s done.
What do you mean by that:

IF YOU WANT TO RUN THIS SCRIPT ON YOUR SERVER, YOU NEED TO PLACE THE ALLOWED VOTE-CVARS INTO THE DEFAULT.CFG OF YOUR g_mapconfigs-DIRECTORY

I have mapconfigs folder with cfgs for every map but why you want to add these votecvars lines into it? Hym, how do the votecvars look like by the way? Something like this:

vote_allow_shuffleteamsxp_norestart

(phisherman) #7

Yeah, that’s one of them. You can list all vote-cvars by doing “/cvarlist vote_allow” to your console.

About the default.cfg: I guess you are using a server.cfg that is read when you start your server. And in that cfg you normally put all the vote cvars and define whether they’re allowed or not. But my script changes those cvars after the time is up, so from the second map on, the votes will be disallowed permanently. Therefore you need a hook that allows the cvars at every mapstart. And that is the default.cfg inside of your g_mapconfigs-directory. It gets parsed on every mapstart. So if you dont have it already, simply create it and put all the map-cvars in there (Only the ones that are set to 1, the ones set to 0 dont matter).

I hope that explanation is understandable. If you will run this script on your server, it would be nice if you posted the IP so I can check the functionality. :slight_smile:


(BlackEight) #8

I checked that and it works like a dream :slight_smile: Thanks for help and your time.

Regards,
Eight