Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

Creating custom votes


  • Please log in to reply
6 replies to this topic

#1
OFFLINE   Dookie

Dookie

    Advanced Member

  • Members
  • PipPipPipPip
  • 420 posts
55
Getting Better
  • LocationCroatia

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



#2
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better
[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.



#3
OFFLINE   Dookie

Dookie

    Advanced Member

  • Members
  • PipPipPipPip
  • 420 posts
55
Getting Better
  • LocationCroatia

[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.



#4
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better

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.



#5
OFFLINE   Dookie

Dookie

    Advanced Member

  • Members
  • PipPipPipPip
  • 420 posts
55
Getting Better
  • LocationCroatia

Ok, thx for the effort zelly!



#6
OFFLINE   mo_no

mo_no

    Newbie

  • Members
  • Pip
  • 8 posts
1
A step in the right direction
You can try this one
http://mygamingtalk....-custom-voting/

#7
OFFLINE   Dookie

Dookie

    Advanced Member

  • Members
  • PipPipPipPip
  • 420 posts
55
Getting Better
  • LocationCroatia

Yea I know about it, but I thought it could be done now without adding additional pk3s on server.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users