local encoding = require 'encoding'
encoding.default = 'CP1251' -- Use 'UTF-8' if your file is saved in UTF-8
local u8 = encoding.UTF8
local sampev = require 'lib.samp.events'
function sampev.onServerMessage(color, text)
local _, playerId = sampGetPlayerIdByCharHandle(PLAYER_PED)
local nick = sampGetPlayerNickname(playerId)
local pattern = u8(string.format("%s подал заявление на страхование имущества.", nick))
if text:find(pattern) then
setVirtualKeyDown(0xA4, true) -- ALT key
wait(50)
setVirtualKeyDown(0xA4, false)
end
end
function sampev.onShowDialog(id, style, title, button1, button2, text)
if id == 15095 then
sampSendDialogResponse(15095, 1, 0, "")
elseif id == 15096 then
sampSendDialogResponse(15096, 1, 0, "")
end
end