ULX

Author Topic: Cvar Addon Module 0.2  (Read 8488 times)

0 Members and 1 Guest are viewing this topic.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Cvar Addon Module 0.2
« 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" :
« Last Edit: October 04, 2007, 12:19:44 PM by Kyzer »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Cvar Addon Module
« Reply #1 on: October 04, 2007, 09:30:11 AM »
this is pure win.. thank you. ;D ;D ;D

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Cvar Addon Module
« Reply #2 on: October 04, 2007, 10:03:02 AM »
;)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Cvar Addon Module
« Reply #3 on: October 04, 2007, 10:42:14 AM »
Good job! :D
Experiencing God's grace one day at a time.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Cvar Addon Module
« Reply #4 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 :)