Ulysses Stuff > Ulysses Release Archives

Report Module 1.3

<< < (7/9) > >>

Jussy:
Ahh for some reason it messes up my servers jobs, i cant click on them :P ill just have to wait till hopefully an update comes out for this reporter :) but thnx man :)

JamminR:
Not only is this release older than the Gmod 13 update, it's older than our Ulib re-write of (2011?)

* JamminR hijacks thread with post related nothing to original topic.
--- Quote from: MrPresident on May 21, 2013, 11:42:43 AM ---I don't know how to code, I'm sorry.  ::)

--- End quote ---
* JamminR thinks "ah HA! There WERE negative effects."

* JamminR continues laughing aloud at the joke MrP made.

bender180:
so i want to try and attempt to update this as i think it might be useful to me, do you think it would be better for me to rewrite it from scratch or update the existing code. I started updating existing code ive been getting this error


--- Code: ---[ERROR] addons/ulx/lua/ulx/modules/sh/reports.lua:46: attempt to call field 'convar' (a nil value)
--- End code ---

i think its because im creating the convars incorrectly


--- Code: ----- Easy Config:
local ReportsEnabled = "1" -- Set this to 0 if you want to disable this script
local ReportsInLogs = "1" -- Set this to 0 if you don't want to log reports in daily logs
local ReportsInterval = "120" -- The player can only report once then he need to wait this interval (seconds) before reporting again. 0 = no delay (not recommended)
local ReportsFolder = "ulx_logs" -- By default, in the same folder as others log files
-- End of config


local ReportsEnabled = ulx.convar( "ReportsEnabled", "1", "<0-1> - Set this to 0 if you want to disable the report command.", ULib.ACCESS_ADMIN)
local reportsInLogs = ulx.convar( "reportsInLogs", "1", "<0-1> - Set this to 0 if you don't want to log reports in daily logs.", ULib.ACCESS_ADMIN )
local ReportsInterval = ulx.convar( "ReportsInterval", "120", "<time> - Time between 2 reports from the same player. Set this to 0 to disable.", ULib.ACCESS_SUPERADMIN )
local ReportsFolder = ulx.convar( "ReportsFolder", "ulx_logs", "<folder> - The folder where to save the reports file.", ULib.ACCESS_SUPERADMIN )
--- End code ---


Any help/suggestions would be great as ive never used a convar before.

Vilusia:

--- Code: ---[ERROR] addons/ulx/lua/ulx/modules/sh/reports.lua:46: attempt to call field 'convar' (a nil value)
  1. unknown - addons/ulx/lua/ulx/modules/sh/reports.lua:46
   2. include - [C]:-1
    3. unknown - addons/ulx/lua/ulx/cl_init.lua:17
     4. include - [C]:-1
      5. unknown - addons/ulx/lua/ulib/modules/ulx_init.lua:4
       6. include - [C]:-1
        7. unknown - addons/ulib/lua/ulib/cl_init.lua:23
         8. include - [C]:-1
          9. unknown - addons/ulib/lua/autorun/ulib_init.lua:5


--- End code ---
Getting this.

JamminR:
Vilusia, read the second page of this thread....it's not compatible with Ulib 2.5 or Gmod 13. and the post above yours only indicates he's thinking about making it work (whether by scratch or by rewrite)

Bender, Best of both worlds.
To rewrite the ULX commands themselves, you almost have to rewrite the functions anyway.
As for convar structure, I'd have to remind myself how we do it.

EDIT- If ULX had a documents site like Ulib does at ulyssesmod.net/docs, here's what it would say about ulx.convar

--- Code: -----[[
Function: convar

This is what will set up ULX's convars, it makes them under the command "ulx"

Parameters:

command - The console command. IE, "sv_kickminge".
value - The value to start off at.
help - *(Optional)* A help string for using the command.
access - *(Optional, defaults to ACCESS_ALL)* Restricted access.
]]

--- End code ---

My guess, you're defining the same variables twice. Once as a string or number, then as a convar.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version