mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
fix(es_extended/client/functions): add optional return type
This commit is contained in:
@@ -532,7 +532,7 @@ end
|
||||
---@param heading number The heading of the vehicle
|
||||
---@param cb? function The callback function
|
||||
---@param networked? boolean Whether the vehicle should be networked
|
||||
---@return nil
|
||||
---@return number? vehicle
|
||||
function ESX.Game.SpawnVehicle(vehicleModel, coords, heading, cb, networked)
|
||||
local model = type(vehicleModel) == "number" and vehicleModel or joaat(vehicleModel)
|
||||
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
|
||||
|
||||
@@ -83,7 +83,7 @@ end
|
||||
---@param heading number
|
||||
---@param properties table
|
||||
---@param cb? fun(netId: number)
|
||||
---@return number|nil netId
|
||||
---@return number? netId
|
||||
function ESX.OneSync.SpawnVehicle(model, coords, heading, properties, cb)
|
||||
if cb and not ESX.IsFunctionReference(cb) then
|
||||
error("Invalid callback function")
|
||||
|
||||
Reference in New Issue
Block a user