Repository navigation
v3.1.0
v3.1.0
Added
-
Change the owner of a vehicle that already exists. Until now a vehicle could
only be made society owned at the moment it was handed out, through the
Job Vehicle tab. Everything that was already in the database was stuck the way
it had been created. The Vehicles tab now has a new row action (the building
icon) that opens an Ownership dialog: pick Player or Job / Society,
pick the job, and save. Society owned means theownercolumn holds the job name
instead of a player identifier, exactly like_givejobveh <...> 1writes it, so
ESX and msk_garage treat the row as a faction vehicle and every member of the job
can use it. Switching back to a player works through the online player picker, or
through a typed identifier when the owner is offline. (server/main.lua,
server/admin/api.lua, client/admin/nui.lua, web/src/admin/VehiclesTab.tsx,
web/src/admin/i18n.ts, web/src/admin/AdminApp.tsx, web/src/admin/devMock.ts,
html/**) -
Society vehicles are visible at a glance. The owner column in the vehicle
browser shows a green JOB / SOCIETY badge instead of a player name whenever
the row belongs to a job, and the ownership button of those rows is highlighted
in the accent colour. (web/src/admin/VehiclesTab.tsx) -
New permission
vehicle.owner("Change owner" / "Besitzer ändern"), listed in
the Permissions tab like every other right.group.admingets it automatically.
Your own groups do not — open the Permissions tab once, tick the new right for
the groups that should have it and save. Without the right the button simply is
not rendered, and the server refuses the call as well.
(shared/admin_perms.lua, web/src/admin/i18n.ts) -
New server console command
_setvehowner, so the console can do everything the
dashboard can do, same as with every other action:_setvehowner job police "ABC 123" _setvehowner player char1:abcd1234 "ABC 123"The command name is configurable through
Config.ConsoleCommands.setvehowner.
Older config files without that key keep working, the command then falls back to
_setvehowner. (config.lua, server/commands.lua)
Changed
- Vehicle keys follow the owner. When the ownership of a vehicle changes and
Config.VehicleKeys.enableis on, every key for that plate is removed and a fresh
key is handed to the new owner (player identifier or job name), through the same
auto-detected key adapter that give and spawn already use. (server/main.lua) - The Vehicles tab now also opens for admins who only hold
vehicle.ownerand
none of the other vehicle rights. (web/src/admin/AdminApp.tsx)
Notes
- Switching a player vehicle to society overwrites the
ownercolumn, so the
original player identifier is gone afterwards. That is why the dialog has the
identifier field, it is the way back for an owner who is not online. - Setting the owner type to Player with the job left on "no job" clears the
job
column to a realNULL, which turns a faction vehicle back into a plain private
vehicle.
Changed files
CHANGELOG.md
VERSION
fxmanifest.lua
config.lua
translation.lua
shared/admin_perms.lua
server/main.lua
server/commands.lua
server/admin/api.lua
client/admin/nui.lua
html/index.html
html/assets/*
web/package.json
web/src/admin/AdminApp.tsx
web/src/admin/VehiclesTab.tsx
web/src/admin/devMock.ts
web/src/admin/i18n.ts