v5.6.0
Runs on ESX, QBCore and Qbox. Until this release the resource was ESX only, and it said so in its manifest.
This release reads the vehicle table layout, the player object and the job events from the rewritten bridge. On msk_core 3.x none of them answers in this form. Update msk_core along with this script.
ox_lib is a dependency now, es_extended is not.
Changed
-
es_extendedis no longer a dependency. It was listed independenciesand imported through@es_extended/imports.lua, so the resource refused to start on any server without ESX.@ox_lib/init.luatakes its place. -
The vehicle table is resolved instead of hardcoded. The two layouts differ by more than their names:
ESX QBCore and Qbox Table owned_vehiclesplayer_vehiclesOwner ownercitizenidProperties vehiclemodsvehiclecolumnthe properties the spawn name Parked flag storedstateConfig.MySQLis filled fromMSK.VehicleStore.GetSchema()on start, and every query in the resource reads the names from there, so there is exactly one place that has to be right.infoIt is resolved outside of any thread. The first query can run before a thread would have gotten around to it, and it would then use the ESX fallback on a Qbox server. msk_core starts before this resource, so the export answers right away.
-
Vehicle properties are read and written in the format of the running framework. ESX has its own layout, QBCore and Qbox use the one from
ox_lib, and these properties go back into the framework's vehicle table where every other garage on the server reads them. Handing an ox_lib table to an ESX garage produces a car without mods, or none at all. ESX is fetched lazily when it is actually the running framework. -
The client no longer keeps its own copy of the player data. It mirrored
esx:playerLoadedandesx:setJobinto a local table. msk_core keeps that copy itself and raisesmsk_core:playerLoaded,msk_core:playerLogout,msk_core:setJobandmsk_core:onPlayerDeathon every framework.
Fixed
-
Park-in was broken. The
UPDATEfor park-in built its statement with two%splaceholders but passed only one value toformat, which raisesbad argument #2 to 'format' (no value)before the query is ever sent. -
Job vehicles were never purged on QBCore or Qbox. The handler for
Config.deleteJobVehiclesOnJobChangehung onesx:setJob, an event that only exists on ESX. It listens tomsk_core:setJobnow, which msk_core raises on every framework with the same arguments. -
The framework group was only ever resolved on ESX. It went through
xPlayer.getGroup(), a method QBCore and Qbox do not have, so a dashboard admin without the matchingadd_principalline was refused there. -
A vehicle row with unreadable property JSON no longer takes the caller down. Park-out and the impound release decoded it unchecked.
Changed files
fxmanifest.lua
config/static.lua
config/settings.lua
shared/utils.lua
client/main.lua
client/state.lua
client/blips.lua
client/nui.lua
client/points.lua
client/vehicles.lua
client/admin/sync.lua
server/main.lua
server/api.lua
server/garages.lua
server/impound.lua
server/private.lua
server/private_command.lua
server/validation.lua
server/vehicles.lua
server/admin/api.lua
server/admin/permissions.lua