Jump to content

Creating custom votes


Dookie

Recommended Posts

Hi, ive heard some rumours that its possible to create a custom votes in silent mod without adding lua scripts or additional pk3 files, ive been searching a bit in wiki but coudnt find much info about it, anyone, I would need someone to assist me with making a +5 mins vote, thats the only 1 i need :D, anyone help? :D thanks

Link to comment
Share on other sites

[customvote]
name = The of the vote shown with the /callvote command. Maximum length 15 characters.
exec = Command string to execute if the vote passes. Maximum length 1023 characters.
description = Description of the vote shown with the /callvote command. Maximum length 1023 characters.
votetext = The text that is show for voters. Maximum length 255 characters.
passtext = Optionally, a text that is shown to players if the vote passes.
levels = Optionally, admins can define the vote to be available to only specific levels. Same format that is used with the custom commands. 

Goes in shrubbot.cfg just like you would do a  command.

*Disclaimer I havent used yet so idk for sure.

Link to comment
Share on other sites

[customvote]
name = +5mins
exec = ??
description = Add additional 5 minutes to current timelimit
votetext = Add 5 more minutes?
passtext = Vote passed
levels = 

 

What should go in exec? And btw, is that vote then shown in when you click esc and go to votes, or you must call it in a diffrent way? thanks.

Link to comment
Share on other sites

I havent really expieremented with this at all so I may have to be corrected.
But I dont think you could add just 5 minutes. You would need to set the timelimit to a specific number. (which obviously wouldnt be too handy)
I think if you want +5 mins on the clock you might want to make a lua console command to do so.

And to call this vote you would need to do /callvote addtime in the console or make a new menu pk3 with addtime in it.

 

The Vote in shrubbot:

[customvote]
name = addtime
exec  = addtime
description = Adds 5 minutes to the clock
votetext = Add 5 minutes to the clock?
passtext = 5 Minutes have been added to the clock
levels =

You would need a lua file for this still (Which originally isnt what you wanted, But I dont think there is another way)

function et_ConsoleCommand( command )
  if ( string.lower(command) == "addtime" ) then
    et.trap_Cvar_Set("timelimit",( et.trap_Cvar_Get("timelimit") + 5 ) )
  end
end

Not 100% that is correct lol. That is just how I interpreted it to be done.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...