-
Notifications
You must be signed in to change notification settings - Fork 3
/
client.lua
38 lines (31 loc) · 1.12 KB
/
client.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
POS_actual = 1
PED_hasBeenTeleported = false
function teleport(pos)
local ped = GetPlayerPed(-1)
Citizen.CreateThread(function()
PED_hasBeenTeleported = true
NetworkFadeOutEntity(ped, true, false)
Citizen.Wait(500)
SetEntityCoords(ped, pos.x, pos.y, pos.z, 1, 0, 0, 1)
SetEntityHeading(ped, pos.h)
NetworkFadeInEntity(ped, 0)
Citizen.Wait(500)
PED_hasBeenTeleported = false
end)
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local ped = GetPlayerPed(-1)
local playerPos = GetEntityCoords(ped, true)
for i,pos in pairs(INTERIORS) do
DrawMarker(1, pos.x, pos.y, pos.z-1, 0, 0, 0, 0, 0, 0, 1.0,1.0,0.5, 255,255,255, 200, 0, 0, 2, 0, 0, 0, 0)
if (Vdist(playerPos.x, playerPos.y, playerPos.z, pos.x, pos.y, pos.z) < 1.0) and (not PED_hasBeenTeleported) then
POS_actual = pos.id
if not gui_interiors.opened then
gui_interiors_OpenMenu()
end
end
end
end
end)