diff --git a/server/main.lua b/server/main.lua index b5d267190..283383b4a 100644 --- a/server/main.lua +++ b/server/main.lua @@ -98,15 +98,19 @@ end exports('GetVehicleClass', GetVehicleClass) ---@return table -function GetVehiclesByName() - return QBX.Shared.Vehicles +---@overload fun(key: string): Vehicle +function GetVehiclesByName(key) + local vehicles = QBX.Shared.Vehicles + return vehicles[key] or vehicles end exports('GetVehiclesByName', GetVehiclesByName) ---@return table -function GetVehiclesByHash() - return QBX.Shared.VehicleHashes +---@overload fun(key: number): Vehicle +function GetVehiclesByHash(key) + local vehicles = QBX.Shared.VehicleHashes + return vehicles[key] or vehicles end exports('GetVehiclesByHash', GetVehiclesByHash) @@ -119,8 +123,10 @@ end exports('GetVehiclesByCategory', GetVehiclesByCategory) ---@return table -function GetWeapons() - return QBX.Shared.Weapons +---@overload fun(key: number): Weapon +function GetWeapons(key) + local weapons = QBX.Shared.Weapons + return weapons[key] or weapons end exports('GetWeapons', GetWeapons)