diff --git a/client/functions.lua b/client/functions.lua index ffa8992..c83c48c 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -320,12 +320,23 @@ HandleCamera = function(garage, toggle) Citizen.Wait(500) end +DrawScriptMarker = function(markerData) + -- Get the position and snap it to the ground + local pos = markerData["pos"] + local retval, groundZ = GetGroundZFor_3dCoord(pos.x, pos.y, pos.z, 0) + if retval then + pos = vector3(pos.x, pos.y, groundZ) + end + -- Prepare the markers + local size = { x = markerData["sizeX"], y = markerData["sizeX"], z = 1.0 } + local colour = Config.Colour + + -- Draw the markers and show the interact text + DrawMarker(1, pos.x, pos.y, pos.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, size.x, size.y, size.z, colour.r, colour.g, colour.b, 0.05, 0, 0, 0, 0, 0, 0, 0) + esx.ShowHelpNotification("Press ~g~E~s~ to interact with the garage at the coloured markers") -DrawScriptMarker = function(markerData) - DrawMarker(20, markerData["pos"], 0, 0, 0, 0, 0, 0, 0.701, 1.0001, 0.3001, 222, 50, 50, 0.05, 0, 0, 0, 0, 0, 0, 0) --esx.ShowHelpNotification("~g~E ~w~or ~g~ENTER ~w~Accepts ~g~Arrows ~w~Move ~g~Backspace ~w~Exit") - esx.ShowHelpNotification("Press ~g~E~s~ to interact with the garage at the ~r~red~s~ chevrons") end PlayAnimation = function(ped, dict, anim, settings) diff --git a/client/main.lua b/client/main.lua index 4bbcfc8..5eab122 100644 --- a/client/main.lua +++ b/client/main.lua @@ -104,8 +104,6 @@ Citizen.CreateThread(function() }) end elseif (dstCheck > 10.0 and dentro == garage) then - print(dentro) - print(garage) dentro = nil end end diff --git a/config.lua b/config.lua index dcf02be..db276d4 100644 --- a/config.lua +++ b/config.lua @@ -1,9 +1,11 @@ Config = {} Config.RangeCheck = 25.0 -Config.AllowRecovery = true -- Enables recovery from the garages. Disable this if you plan to use other recovery scripts -Config.RecoveryCost = 250 -- The cost of a car recovery. -Config.AllowTows = true -- Allows the car to be teleported to the garage (at a cost) if it has no people inside +Config.AllowRecovery = true -- Enables recovery from the garages. Disable this if you plan to use other recovery scripts +Config.RecoveryCost = 250 -- The cost of a car recovery. +Config.AllowTows = true -- Allows the car to be teleported to the garage (at a cost) if it has no people inside +Config.Colour = { r = 148, g = 0, b = 211 } -- The colour for the markers + Config.Garages = { ["B"] = { ["positions"] = {