Zum Hauptinhalt springen

v5.7.0

Stops vehicles from losing their tuning on slow PCs, adds a client spawn mode and loads vehicle images from JG Vehicle Studio or a CDN.

The NUI changed

Replace the html/ folder together with the rest of the resource files, then restart the resource. No database change.

Fixed​

  • Vehicles lost their tuning when a slow PC parked them in again. After a park-out the client writes the saved tuning onto the car. On a slow PC, or when another player holds the entity, that write could fail for good after about one second. The player then drove a stock car, and the next park-in stored the stock state over the real tuning. Two changes close this:
    • The client keeps re-applying the tuning for up to 30 seconds and tells the server once it really sits on the car.
    • As long as that confirmation is missing, park-in keeps the tuning from the database and only takes the condition (damage, dirt, plate) from the car. The tuning is read from the row at park-in time, so a mechanic script that wrote new tuning in between is not undone.
  • A failed park-out from the impound moved the car into the garage. The rollback set stored = 1 for impound vehicles too, so the car left the impound with the fee refunded. Anyone could trigger this by calling msk_garage:rollbackSpawn directly. The car stays in the impound now, only the fee is refunded.
  • A saved mod the model does not offer kept the tuning check failing, for example after an addon car was updated. Such a slot is skipped now.

Added​

  • Config.spawnMode = 'server' | 'client'. 'server' (default) spawns with CreateVehicleServerSetter as before. 'client' lets the player's client create the car, so it owns it from the first frame and the tuning lands at once. The server reserves the spawn and checks the reported car before the park-out counts: it must be a vehicle owned by that player, the model must match the database and it must stand within 10 m of the reserved spot. A car that fails is deleted and the park-out rolled back. The DB plate is forced onto the car and the entity stays in the world when the player disconnects. Selectable in the dashboard.
vorsicht

'client' needs entity creation by clients and does not work with sv_entityLockdown strict.

  • Vehicle images from JG Vehicle Studio or a CDN. Config.GetVehicleImage(model, hash) in config/static.lua returns the image URLs for a model. By default it uses jg-vehiclestudio automatically while it runs, then Config.VehicleImageCdn, which defaults to https://cdn.msk-scripts.de/vehicles/{model}.png. The UI tries these URLs first, then the local vehicle_images/ folder, then the class icon. See Dashboard → Vehicle images.

Update notes​

If you keep your own config files, add Config.spawnMode to config/settings.lua and the new image block (Config.VehicleImageCdn, Config.GetVehicleImage) to config/static.lua. Without them the server spawn stays active and no CDN images are loaded. On an existing install spawnMode is not in the database yet, so the value from config/settings.lua applies until you save it in the dashboard.

Changed files​

fxmanifest.lua
client/nui.lua
client/vehicles.lua
config/settings.lua
config/static.lua
server/admin/api.lua
server/api.lua
server/vehicles.lua
shared/admin_perms.lua
vehicle_images/A_README.md
web/src/admin/SettingsTab.tsx
web/src/admin/i18n.ts
web/src/admin/types.ts
web/src/components/VehicleCard.tsx
web/src/devMock.ts
web/src/i18n/types.ts
web/package.json (5.5.0 -> 5.7.0)
web/package-lock.json
html/** (rebuilt)