mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 17:28:53 +00:00
Add ESX.Game.Teleport
This commit is contained in:
@@ -247,6 +247,23 @@ ESX.GetWeaponLabel = function(name)
|
||||
|
||||
end
|
||||
|
||||
ESX.Game.Teleport = function(entity, coords, cb)
|
||||
|
||||
RequestCollisionAtCoord(coords.x, coords.y, coords.z)
|
||||
|
||||
while not HasCollisionLoadedAroundEntity(entity) do
|
||||
RequestCollisionAtCoord(coords.x, coords.x, coords.x)
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
|
||||
SetEntityCoords(entity, coords.x, coords.y, coords.z)
|
||||
|
||||
if cb ~= nil then
|
||||
cb()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
ESX.Game.GetPlayers = function()
|
||||
|
||||
local maxPlayers = Config.MaxPlayers
|
||||
|
||||
Reference in New Issue
Block a user