ULX

Author Topic: Load functions only when server.cfg has been read?  (Read 3212 times)

0 Members and 1 Guest are viewing this topic.

Offline Luk | twitch.tv/doctorluk

  • Newbie
  • *
  • Posts: 40
  • Karma: 12
Load functions only when server.cfg has been read?
« on: December 17, 2016, 01:19:50 PM »
Hey guys, just a quick question:

I'm going to make my Karmabet Plugin available on the Steam Workshop. For this I'd like to use ConVars, so people can use their server.cfg to configure the plugin (currently the values can be set inside a .lua).
The problem with that is that GetConVar() upon plugin load returns the default ConVar, not the one in the server.cfg. If I wait a couple seconds, GetConVar actually returns the value set in the server.cfg. This makes it difficulty for me to decide whether the owner wants to use MySQL/SQLite and the appropriate DB-Name/Username/PW etc.

I just can't get my head around loading the MySQL/SQLite part only when the config has been executed. Any ideas? The plugin in question is available here: https://github.com/doctorluk/ulx-karma-betting
« Last Edit: December 17, 2016, 03:01:26 PM by Luk | twitch.tv/doctorluk »
Host of Spielwiese der Erwachsenen, a German TTT Server for adults only.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given