- 573
- 61
- Версия SA-MP
-
- 0.3.7 (R1)
Что не так в коде, почему не пашет?
Код:
script_name('AutoReplace')
script_author("JackBanana")
script_dependencies("SAMPFUNCS, SAMP")
require "lib.moonloader"
local inicfg = require 'inicfg'
local mem = require "memory"
local dir = os.getenv('USERPROFILE') .. '\\Documents\\GTA San Andreas User Files\\SAMP\\AutoReplace.ini'
if not doesFileExist(dir) then
local text = "[Text]\n"
local replace = "[Replace]\n"
for i = 1, 100 do
text = text..i.."=Text\n"
replace = replace..i.."=Replace\n"
end
local file = io.open(dir, "a")
file:write(text..replace)
file:flush()