feat(es_extended/server/functions): add exposed vehicle class functions

This commit is contained in:
Kenshin13
2024-12-20 22:02:45 +01:00
parent 8ea8b4a69f
commit 3d16c4fecd
+20
View File
@@ -615,3 +615,23 @@ function Core.IsPlayerAdmin(playerId)
local xPlayer = ESX.Players[playerId]
return (xPlayer and Config.AdminGroups[xPlayer.group] and true) or false
end
---@param owner string
---@param plate string
---@param coords vector4
---@return VehicleClass?
function ESX.CreateExtendedVehicle(owner, plate, coords)
return Core.vehicleClass.new(owner, plate, coords)
end
---@param plate string
---@return VehicleClass?
function ESX.GetExtendedVehicleFromPlate(plate)
assert(type(plate) == "string", "Expected 'plate' to be a string")
if Core.vehicles[plate] then
local obj = table.clone(Core.vehicleClass)
obj.plate = plate
return obj
end
end