- 251
- 48
- Версия MoonLoader
- .026-beta
Lua:
function hook.onShowDialog(dialogId, style, title, button1, button2, text)
if parsim and dialogId == 228 and title:find("Статистика администратора") then
-- другой диалог
end
if parsim and dialogId == 1932 and title:find("{dfb519}Оффлайн статистика") then
for line in text:gmatch("[^\r\n]+") do
if line:find("Послед. вход: %[%.+%/%.+%/%.+ %.+%:%.+%]") then
lc_d, lc_m, lc_y, lc_h, lc_min = line:match("Послед. вход: %[(%.+)%/(%.+)%/(%.+) (%.+):(%.+)%]")
end
end
parsim = false
return false
end
end
Код:
function command_stats(args_astats)
lua_thread.create(function()
astats_menu.v = true
timerStart = os.time()
timerEndTime = 3
wait(1000)
sampSendChat("/getoffstats "..args_astats)
parsim = true
wait(1000)
sampSendChat("/astats "..args_astats)
parsim = true
end)
end
Выводит ошибку:
Код:
[ML] (error) name: C:\Games\GTA San Andreas\moonloader\name.lua:1889: attempt to concatenate global 'lc_min' (a nil value)
stack traceback:
C:\Games\GTA San Andreas\moonloader\name.lua:1889: in function 'OnDrawFrame'
C:\Games\GTA San Andreas\moonloader\lib\imgui.lua:1378: in function <C:\Games\GTA San Andreas\moonloader\lib\imgui.lua:1367>
[ML] (error) name: Script died due to an error. (01E9BEC4)
Нужный текст из диалога: Послед. вход: [31/10/2022 17:56]