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
[ERROR] addons/ulx/lua/ulx/modules/sh/reports.lua:46: attempt to call field 'convar' (a nil value)
i think its because im creating the convars incorrectly
-- 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 )
Any help/suggestions would be great as ive never used a convar before.