Zum Hauptinhalt springen

v5.6.0

Runs on ESX, QBCore and Qbox. Until this release the resource was ESX only, and it said so in its manifest.

Requires msk_core 4.0.0 or newer

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_extended is no longer a dependency. It was listed in dependencies and imported through @es_extended/imports.lua, so the resource refused to start on any server without ESX. @ox_lib/init.lua takes its place.

  • The vehicle table is resolved instead of hardcoded. The two layouts differ by more than their names:

    ESXQBCore and Qbox
    Tableowned_vehiclesplayer_vehicles
    Ownerownercitizenid
    Propertiesvehiclemods
    vehicle columnthe propertiesthe spawn name
    Parked flagstoredstate

    Config.MySQL is filled from MSK.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.

    info

    It 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:playerLoaded and esx:setJob into a local table. msk_core keeps that copy itself and raises msk_core:playerLoaded, msk_core:playerLogout, msk_core:setJob and msk_core:onPlayerDeath on every framework.

Fixed

  • Park-in was broken. The UPDATE for park-in built its statement with two %s placeholders but passed only one value to format, which raises bad 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.deleteJobVehiclesOnJobChange hung on esx:setJob, an event that only exists on ESX. It listens to msk_core:setJob now, 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 matching add_principal line 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