function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand("coords", coords)
wait(-1)
end
function coords()
local mx, my, mz = getCharCoordinates(playerPed)
local str = string.format("X = %.4f; Y = %.4f; Z = %.4f;", mx, my, mz)
sampAddChatMessage(str, -1)
end