- 10
- 1
- Версия SA-MP
-
- 0.3.7-R3
Мне нужно, чтобы координаты сохранялись в файл построчно, но этого почему-то не происходит, он просто обновляет строку на новую координаты, но не переносит их на новую. В чем может быть проблема?
Вот так это выглядит:
Вот так это выглядит:
Код:
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand("coord", function() coord = not coord sampAddChatMessage('cooord write' ..(coord and 'On' or 'Off'), -1) end)
while true do
wait(0)
if coord then
local x, y, z = getCharCoordinates(PLAYER_PED)
sampAddChatMessage(x .. str .. y .. str .. z, -1)
local file = io.open(getGameDirectory().."//moonloader//info//coord.txt", "r+")
file:write(x .. str .. y .. str .. z, "\n")
file:close()
end
end
end
Последнее редактирование: