require("lib.moonloader")
function main()
repeat wait(100) until isSampAvailable()
sampRegisterChatCommand("mycoord", coord)
wait(-1)
end
function coord()
local x, y, z = getCharCoordinates(PLAYER_PED)
local f = io.open("mycoord.txt", "w")
f:write(string.format(".2f, 0.2f, 0.2f", x, y, z))
f:flush()
f:close()
end