Jump to content

Mod to disable regenerate world vote

Recommended Posts

I'm trying to set up a mod for a dedicated server, that will allow players to vote for rollbacks and kicking, but not for regenerating or banning. Unless I missed something, you can't specify it that way in the cluster.ini of the dedicated server (it's either all voting enabled or no voting at all). I didn't get anywhere, this is what a friend and I could come up with:

function SetUserCommandPermission()
GLOBAL.require("usercommands").GetCommandFromName("kick").vote = true
GLOBAL.require("usercommands").GetCommandFromName("kick").permission = "USER"
GLOBAL.require("usercommands").GetCommandFromName("ban").permission = "ADMIN"
GLOBAL.require("usercommands").GetCommandFromName("rollback").vote = true
GLOBAL.require("usercommands").GetCommandFromName("rollback").permission = "USER"
GLOBAL.require("usercommands").GetCommandFromName("regenerate").permission = "ADMIN"
AddPrefabPostInit("world", SetUserCommandPermission)

I tried this code last night but it makes players able to rollback without voting... and I don't remember what happened with the regen command but I believe it also didn't work...
Also let me know if there is any way to lower the amount of players needed for a vote, it'd be good to not need 3 folks to test this lol.

Edited by Juanasdf
  • Like 1
Link to comment
Share on other sites

I got it to work with 

function SetUserCommandPermission()

GLOBAL.require("usercommands").GetCommandFromName("regenerate").vote = false
AddPrefabPostInit("world", SetUserCommandPermission)

Turns out "vote" determines if players can start a vote and NOT if the command will go through one

The permissions just change who can run the command WITHOUT voting.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...