Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarrrk authored Dec 10, 2018
1 parent 2e73330 commit 1fe56fd
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
5 changes: 5 additions & 0 deletions __resource.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
files {
'visualsettings.dat'
}

client_script 'client.lua'
38 changes: 38 additions & 0 deletions client.lua
Original file line number Diff line number Diff line change
@@ -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)
33 changes: 33 additions & 0 deletions visualsettings.dat
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1fe56fd

Please sign in to comment.