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: extract financing to it's own table & fix: Finance vehicle menu #64

Merged
merged 18 commits into from
Mar 15, 2024
Merged
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
Prev Previous commit
Next Next commit
refactor: use the finance function
TonybynMp4 authored Feb 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 3bb2ed3c27a8d9add4f1a8be9bdf8365e5127527
4 changes: 2 additions & 2 deletions server/main.lua
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@ RegisterNetEvent('qbx_vehicleshop:server:removePlayer', function(citizenid)
if not financeTimer[citizenid] then return end

local playTime = financeTimer[citizenid]
local financetime = FetchVehicleEntitiesByCitizenId(citizenid)
for _, v in pairs(financetime) do
local vehicles = FetchFinancedVehicleEntitiesByCitizenId(citizenid)
for _, v in pairs(vehicles) do
if v.balance >= 1 then
local newTime = math.floor(v.financetime - (((os.time() - playTime) / 1000) / 60))
if newTime < 0 then newTime = 0 end