From 1fe56fd4584921af23762d071a282a244e145d99 Mon Sep 17 00:00:00 2001 From: Jack Carlin Date: Mon, 10 Dec 2018 16:14:54 +0000 Subject: [PATCH] Initial commit --- __resource.lua | 5 +++++ client.lua | 38 ++++++++++++++++++++++++++++++++++++++ visualsettings.dat | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 __resource.lua create mode 100644 client.lua create mode 100644 visualsettings.dat diff --git a/__resource.lua b/__resource.lua new file mode 100644 index 0000000..8cda869 --- /dev/null +++ b/__resource.lua @@ -0,0 +1,5 @@ +files { + 'visualsettings.dat' +} + +client_script 'client.lua' \ No newline at end of file diff --git a/client.lua b/client.lua new file mode 100644 index 0000000..cf9037c --- /dev/null +++ b/client.lua @@ -0,0 +1,38 @@ +function stringsplit(inputstr, sep) + if sep == nil then + sep = "%s" + end + + local t={} ; i=1 + + for str in string.gmatch(inputstr, "([^"..sep.."]+)") do + t[i] = str + i = i + 1 + end + + return t +end + +local function starts_with(str, start) + return str:sub(1, #start) == start +end + +Citizen.CreateThread(function() + local settingsFile = LoadResourceFile(GetCurrentResourceName(), "visualsettings.dat") + + local lines = stringsplit(settingsFile, "\n") + + for k,v in ipairs(lines) do + if not starts_with(v, '#') and not starts_with(v, '//') and (v ~= "" or v ~= " ") and #v > 1 then + v = v:gsub("%s+", " ") + + local setting = stringsplit(v, " ") + + if setting[1] ~= nil and setting[2] ~= nil and tonumber(setting[2]) ~= nil then + if setting[1] ~= 'weather.CycleDuration' then + Citizen.InvokeNative(GetHashKey('SET_VISUAL_SETTING_FLOAT') & 0xFFFFFFFF, setting[1], tonumber(setting[2])) + end + end + end + end +end) \ No newline at end of file diff --git a/visualsettings.dat b/visualsettings.dat new file mode 100644 index 0000000..a47a7ea --- /dev/null +++ b/visualsettings.dat @@ -0,0 +1,33 @@ +car.headlight.day.emissive.on 180.00 +car.headlight.night.emissive.on 105.00 +car.headlight.day.emissive.off 0.000 +car.headlight.night.emissive.off 0.000 +car.taillight.day.emissive.on 200.0 +car.taillight.night.emissive.on 150.0 +car.taillight.day.emissive.off 0.00 +car.taillight.night.emissive.off 0.000 +car.indicator.day.emissive.on 250.00 +car.indicator.night.emissive.on 220.00 +car.indicator.day.emissive.off 0.00 +car.indicator.night.emissive.off 0.000 +car.reversinglight.day.emissive.on 35.00 +car.reversinglight.night.emissive.on 15.00 +car.reversinglight.day.emissive.off 0.000 +car.reversinglight.night.emissive.off 0.000 +car.defaultlight.day.emissive.on 2300.00 +car.defaultlight.night.emissive.on 1500.00 +car.defaultlight.day.emissive.off 0.00 +car.defaultlight.night.emissive.off 0.000 +car.brakelight.day.emissive.on 240.00 +car.brakelight.night.emissive.on 180.00 +car.brakelight.day.emissive.off 0.00 +car.brakelight.night.emissive.off 0.000 +car.middlebrakelight.day.emissive.on 210.00 +car.middlebrakelight.night.emissive.on 160.00 +car.middlebrakelight.day.emissive.off 0.00 +car.middlebrakelight.night.emissive.off 0.000 +car.extralight.day.emissive.on 350.00 +car.extralight.night.emissive.on 160.00 +car.extralight.day.emissive.off 0.000 +car.extralight.night.emissive.off 0.00 +car.emissiveMultiplier 2.00 \ No newline at end of file