Skip to content

Commit

Permalink
fix(server): vehicle mods and version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
mafewtm authored Nov 10, 2024
1 parent e7b4939 commit 60b0b2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ lib.addCommand('callsign', {
}, function(source, args)
local player = exports.qbx_core:GetPlayer(source)

if not player or player.PlayerData.job.type ~= 'leo' or player.PlayerData.job.type ~= 'ems' then return end
if not player or player.PlayerData.job.type ~= 'leo' and player.PlayerData.job.type ~= 'ems' then return end

player.Functions.SetMetaData('callsign', args.callsign)
end)
Expand Down
5 changes: 5 additions & 0 deletions server/main.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
assert(lib.checkDependency('qbx_vehicles', '1.4.1', true))
assert(lib.checkDependency('qbx_garages', '1.1.3', true))
lib.versionCheck('Qbox-project/qbx_police')

local config = require 'config.server'
local sharedConfig = require 'config.shared'

Expand Down Expand Up @@ -38,6 +42,7 @@ end
lib.callback.register('qbx_police:server:spawnVehicle', function(source, vehicle, spawn)
local ped = GetPlayerPed(source)

vehicle.mods = vehicle.mods or {}
vehicle.mods.plate = vehicle.mods.plate or ('LSPD%s'):format(math.random(1000, 9999))

local netId, veh = qbx.spawnVehicle({
Expand Down

0 comments on commit 60b0b2e

Please sign in to comment.