mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
Fix duplicate functions and typos
This commit is contained in:
@@ -87,42 +87,6 @@ function removeDistVehicleZone(zoneId)
|
||||
end
|
||||
end
|
||||
|
||||
--- Attempts to gain network control of a vehicle and set it as a mission entity.
|
||||
---
|
||||
--- This function forces synchronization of a vehicle with other players by requesting network control and setting the vehicle as a mission entity.
|
||||
---
|
||||
---@param entity number The handle of the vehicle entity to push.
|
||||
---
|
||||
---@usage
|
||||
--- ```lua
|
||||
--- pushVehicle(vehicle)
|
||||
--- ```
|
||||
function pushVehicle(entity)
|
||||
SetVehicleModKit(entity, 0)
|
||||
if entity ~= 0 and DoesEntityExist(entity) then
|
||||
if not NetworkHasControlOfEntity(entity) then
|
||||
debugPrint("^6Bridge^7: ^3pushVehicle^7: ^2Requesting network control of vehicle^7.")
|
||||
NetworkRequestControlOfEntity(entity)
|
||||
local timeout = 2000
|
||||
while timeout > 0 and not NetworkHasControlOfEntity(entity) do
|
||||
Wait(100)
|
||||
timeout -= 100
|
||||
end
|
||||
if NetworkHasControlOfEntity(entity) then debugPrint("^6Bridge^7: ^3pushVehicle^7: ^2Network has control of entity^7.") end
|
||||
end
|
||||
if not IsEntityAMissionEntity(entity) then
|
||||
debugPrint("^6Bridge^7: ^3pushVehicle^7: ^2Setting vehicle as a ^7'^2mission^7' ^2entity^7.")
|
||||
SetEntityAsMissionEntity(entity, true, true)
|
||||
local timeout = 2000
|
||||
while timeout > 0 and not IsEntityAMissionEntity(entity) do
|
||||
Wait(100)
|
||||
timeout -= 100
|
||||
end
|
||||
if IsEntityAMissionEntity(entity) then debugPrint("^6Bridge^7: ^3pushVehicle^7: ^2Vehicle is a ^7'^2mission^7'^2 entity^7.") end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Deletes a spawned vehicle.
|
||||
---
|
||||
---@param vehicle number The handle of the vehicle entity to delete.
|
||||
|
||||
Reference in New Issue
Block a user