Hi there again,
I’m playing with this but noticing that my heading always returns as H:0.00 . If I remove the string format, it shows correctly(but long). Do I need to change something in the code to perhaps get it to handle heading correctly?
RegisterNetEvent("SaveCommand")
AddEventHandler("SaveCommand", function()
x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
heading = GetEntityHeading(GetPlayerPed(-1))
local PlayerName = GetPlayerName()
TriggerServerEvent("SaveCoords", PlayerName , string.format('%.2f', x) , string.format('%.2f', y) , string.format('%.2f', z), string.format('%.2f', heading))
TriggerEvent('chat:addMessage', { args = { ('Coordinates: X: %.2f, Y: %.2f, Z: %.2f, H: %.2f'):format(x, y, z, heading) } })
end)