Ulysses

Ulysses Stuff => Releases => Ulysses Release Archives => Topic started by: Chironex on October 04, 2007, 02:22:40 AM

Title: Cvar Addon Module 0.2
Post by: Chironex on October 04, 2007, 02:22:40 AM
THIS IS FOR ULX 3.2x

This small module (smallest ever :)) allow you to add buttons and sliders into the Admin menu, from your configuration files (server/gamemodes/maps configs).

Here is some examples:

ulx addCvarSlider <slider label> <console variable> <slider max value> <optional: deny overflow>
ulx addCvarSlider "Max Wire Thrusters:" "sbox_maxwire_thrusters" 20
ulx addCvarSlider "Max Wire Values:" "sbox_maxwire_values" 100 1

ulx addCvarButton <label when disabled> <label when enabled> <console variable>
ulx addCvarButton "Enable CDS" "Disable CDS" "CDS_Enabled"


Changelog:
v0.2: the only problem found has been fixed


Report bugs/suggestions/anything, thanks.

Place this file into "addons/ulx/lua/ulx/modules" :
Title: Re: Cvar Addon Module
Post by: MrPresident on October 04, 2007, 09:30:11 AM
this is pure win.. thank you. ;D ;D ;D
Title: Re: Cvar Addon Module
Post by: Chironex on October 04, 2007, 10:03:02 AM
;)
Title: Re: Cvar Addon Module
Post by: Megiddo on October 04, 2007, 10:42:14 AM
Good job! :D
Title: Re: Cvar Addon Module
Post by: Chironex on October 04, 2007, 12:17:54 PM
Thanks lol,

I made a small update, now it sets the cvar to the limit you specify, if the cvar current value is greater than your limit...i don't know if you understand what i've just said, so here is an example:

Say you have this cvar: "sbox_maxwire_shits" with a default value: 50

In the old version of this script, if you do:  ulx addCvarSlider "Wire Shits:" "sbox_maxwire_shits" 10 , this will create a slider with max value 10, but the current value of this cvar is still 50 until you click Apply.

Well, now this problem is fixed, redownload from first post :)