mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 16:23:22 +00:00
FIX - complete LB custom app compatibility (#11)
* FIX - preserve LB custom app lifecycle * FIX - reset LB export aliases before startup * FIX - report competing custom app providers * FIX - identify LB app frames as live NUI * FIX - complete LB custom app compatibility * FIX - provide LB PicChat runtime exports * FIX - route LB PicChat through Sky Phone * FIX - return cached LB equipped phone number * FIX - harden PicChat compatibility migration * ENH - complete modular phone provider and Creator APIs * DOC - document the Sky Phone Creator API --------- Co-authored-by: DerEchteAlec <bycraky@gmail.com> Co-authored-by: DerEchteAlec <alec.schitzkat@luwan.io>
This commit is contained in:
co-authored by
DerEchteAlec
DerEchteAlec
parent
9aec3eefef
commit
30559048fd
@@ -0,0 +1,34 @@
|
||||
local function player_coordinates()
|
||||
local coords = GetEntityCoords(PlayerPedId())
|
||||
return {
|
||||
x = coords.x,
|
||||
y = coords.y,
|
||||
z = coords.z,
|
||||
}
|
||||
end
|
||||
|
||||
RegisterNUICallback("map:getPlayerCoords", function(data, cb)
|
||||
if type(data) ~= "table" then
|
||||
cb({ success = false, error = "invalid_request" })
|
||||
return
|
||||
end
|
||||
|
||||
cb({ success = true, data = { coords = player_coordinates() } })
|
||||
end)
|
||||
|
||||
RegisterNUICallback("map:setWaypoint", function(data, cb)
|
||||
local coords = type(data) == "table" and data.coords or nil
|
||||
local x = type(coords) == "table" and tonumber(coords.x) or nil
|
||||
local y = type(coords) == "table" and tonumber(coords.y) or nil
|
||||
if not x or not y or x ~= x or y ~= y or math.abs(x) > 10000.0 or math.abs(y) > 10000.0 then
|
||||
cb({ success = false, error = "invalid_marker" })
|
||||
return
|
||||
end
|
||||
|
||||
SetNewWaypoint(x, y)
|
||||
cb({ success = true })
|
||||
end)
|
||||
|
||||
RegisterNUICallback("skyride:get-player-coords", function(_, cb)
|
||||
cb({ success = true, data = { coords = player_coordinates() } })
|
||||
end)
|
||||
Reference in New Issue
Block a user