local sampev = require("samp.events")
require("addon")
math.randomseed(os.time()*os.clock()*math.random())
math.random(); math.random(); math.random()
function setRandomNick()
local data = {names = {}, surnames = {}}
local filenames = {"settings\\names.txt", "settings\\surnames.txt"}
for i = 1, #filenames do
local file = io.open(filenames[i], "r")
if not file then
return
end
for line in file:lines() do
line = line:gsub("%s", "")
table.insert(i == 1 and data.names or data.surnames, line)
end
file:close()
end
setBotNick(("%s_%s"):format(data.names[math.random(1, #data.names)], data.surnames[math.random(1, #data.surnames)]))
reconnect(1000)
end
function onLoad()
setRandomNick()
print('Поменял ник на - ' .. getBotNick())
end