Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added qbx_garages support #43

Merged
merged 7 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions client/realtor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ end

local car = 0
local shell = 0

local playerCoords = vec3(0, 0, 0)
local garageCoords = nil
local garageHeading = 0.0

local isPreviewing = false
local isAddingGarage = false

local function showText()
lib.showTextUI('BACKSPACE - Exit \n ARROW LEFT - Turn left \n ARROW RIGHT - Turn right \n ENTER - Confirm Placement')
Expand All @@ -22,6 +19,7 @@ local function spawnCar()
local model = lib.requestModel('sultanrs', 2500)
car = CreateVehicle(model, 0.0, 0.0, 0.0, 0.0, false, false)
SetEntityCompletelyDisableCollision(car, false, false)
Frowmza marked this conversation as resolved.
Show resolved Hide resolved
SetModelAsNoLongerNeeded(model)
end

local function previewProperty(propertyIndex)
Expand Down Expand Up @@ -52,7 +50,7 @@ local function stopPreview()
end

local function addGaragePoint()
isAddingGarage = not isAddingGarage
local isAddingGarage = true
garageCoords = nil

showText()
Expand Down Expand Up @@ -127,7 +125,7 @@ lib.registerMenu({
{type = 'input', label = locale('alert.property_name'), description = locale('alert.property_name_description'), required = true, min = 4, max = 32, icon = 'home'},
{type = 'number', label = locale('alert.price'), description = locale('alert.price_description'), icon = 'dollar-sign', required = true, min = 1},
{type = 'number', label = locale('alert.rent_interval'), description = locale('alert.rent_interval_description'), icon = 'clock', min = 1, max = 24, step = 1},
{type = 'checkbox', label = locale('alert.add_garage'), required = true},
{type = 'checkbox', label = locale('alert.add_garage')},
})
if not input then return end

Expand Down
2 changes: 1 addition & 1 deletion server/realtor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RegisterNetEvent('qbx_properties:server:createProperty', function(interiorIndex,

if player.PlayerData.job.name ~= 'realestate' then return end
if not garageCoords and #(playerCoords - propertyCoords) > 5.0 then return end
if garageCoords and #(playerCoords - vec3(garageCoords.x, garageCoords.y, garageCoords.z)) > 5.0 then return end
if garageCoords and #(playerCoords - vec3(garageCoords.xyz)) > 5.0 then return end
Frowmza marked this conversation as resolved.
Show resolved Hide resolved

local interactData = {
{
Expand Down
Loading