Add ESX.Game.Teleport

This commit is contained in:
Jérémie N'gadi
2017-08-03 15:44:01 +02:00
parent afebc0e23e
commit 700355cf55
@@ -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