local sampev = require('lib.samp.events')
local obyava = '' -- твоё объявление
local adnick = ''
local active = false
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('cmd', function ()
active = true
sampAddChatMessage('отправляем...', -1)
sampProcessChatInput('/ad ' .. obyava)
end)
wait(-1)
end
function sampev.onServerMessage(color, text)
if active then
if text:match('На обработку объявлений пришло сообщение от: (%w+)') then
adnick = text:match('На обработку объявлений пришло сообщение от: (%w+)')
if sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))):find(adnick) then...
local sampev = require('lib.samp.events')
local obyava = '' -- твоё объявление
local active = false
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('cmd', function ()
active = true
sampAddChatMessage('отправляем...', -1)
sampProcessChatInput('/ad ' .. obyava)
end)
wait(-1)
end
function sampev.onServerMessage(color, text)
if active then
if text:match('На обработку объявлений пришло сообщение от: (%w+_%w+)') then
local adnick = text:match('На обработку объявлений пришло сообщение от: (%w+_%w+)')
if adnick == sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))) then
lua_thread.create(sendalt)
end
end
end
end
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if active then
if dialogId == 25477 then
local count = -1
for n in text:gmatch('[^\r\n]+') do
if n:find('San Fierro') then -- city без тире и на английском
sampSendDialogResponse(dialogId, 1, count, '')
end
count = count + 1
end
elseif dialogId == 15346 then
local count = -1
for n in text:gmatch('[^\r\n]+') do
if n:find('Обычное') then
sampSendDialogResponse(dialogId, 1, count, '')
end
count = count + 1
end
elseif dialogId == 15347 then
sampSendDialogResponse(dialogId, 1, 0, '')
elseif dialogId == 25896 then
sampSendDialogResponse(dialogId, 1, 0, '')
elseif dialogId == 556 then
local count = -1
for n in text:gmatch('[^\r\n]+') do
if n:find(sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)))) then
sampSendDialogResponse(556, 1, count, '')
end
count = count + 1
end
elseif dialogId == 557 then
sampSendDialogResponse(557, 1, 0, 'ну там че те надо типа') -- поменяй
active = false
end
end
end
function sendalt()
setGameKeyState(21, -256)
wait(200)
setGameKeyState(21, 0)
end
а ты для вайс-сити, тогда там скорее всего диалоги другие. скинешь id всех - пофикшуПосмотреть вложение 249445
Чет на этом моменте тормозит
local sampev = require('lib.samp.events')
local obyava = '' -- твоё объявление
local active = false
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('cmd', function ()
active = true
sampAddChatMessage('отправляем...', -1)
sampProcessChatInput('/ad ' .. obyava)
end)
wait(-1)
end
function sampev.onServerMessage(color, text)
if active then
if text:match('На обработку объявлений пришло сообщение от: (%w+_%w+)') then
local adnick = text:match('На обработку объявлений пришло сообщение от: (%w+_%w+)')
if adnick == sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))) then
lua_thread.create(sendalt)
end
end
end
end
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if active then
if dialogId == 25612 then
sampSendDialogResponse(dialogId, 1, 0, '')
elseif dialogId == 25613 then
local count = -1
for n in text:gmatch('[^\r\n]+') do
if n:find(sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)))) then
sampSendDialogResponse(25613, 1, count, '')
end
count = count + 1
end
elseif dialogId == 25614 then
sampSendDialogResponse(25614, 1, 0, 'ну там че те надо типа') -- поменяй
active = false
end
end
end
function sendalt()
setGameKeyState(21, -256)
wait(200)
setGameKeyState(21, 0)
end
там точно сообщение пишется 'На обработку объявлений пришло сообщение от: n_n'?Чет все равно на этом окне тормозит, но в чат пишется что я отправил объявление
local sampev = require('lib.samp.events')
local obyava = '' -- твоё объявление
local active = false
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('cmd', function ()
active = true
sampAddChatMessage('отправляем...', -1)
sampProcessChatInput('/ad ' .. obyava)
end)
wait(-1)
end
function sampev.onServerMessage(color, text)
if active then
if text:match('На обработку объявлений пришло сообщение от: (%w+_%w+)') then
local adnick = text:match('На обработку объявлений пришло сообщение от: (%w+_%w+)')
if adnick == sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))) then
sampProcessChatInput('/newsredak')
end
end
end
end
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if active then
if dialogId == 25612 then
sampSendDialogResponse(dialogId, 1, 0, '')
elseif dialogId == 25613 then
local count = -1
for n in text:gmatch('[^\r\n]+') do
if n:find(sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)))) then
sampSendDialogResponse(25613, 1, count, '')
end
count = count + 1
end
elseif dialogId == 25614 then
sampSendDialogResponse(25614, 1, 0, 'ну там че те надо типа') -- поменяй
active = false
end
end
end
а само сообщение отправляется?Все равно тормозит на окне 25612, можно туда добавить что бы энтер тыкнул ?
на этом моменте![]()
local sampev = require('lib.samp.events')
local obyava = '' -- твоё объявление
local active = false
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('cmd', function ()
active = true
sampAddChatMessage('отправляем...', -1)
sampProcessChatInput('/ad ' .. obyava)
end)
wait(-1)
end
function sampev.onServerMessage(color, text)
if active then
if text:match('На обработку объявлений пришло сообщение от: (%w+_%w+)') then
local adnick = text:match('На обработку объявлений пришло сообщение от: (%w+_%w+)')
if adnick == sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))) then
sampProcessChatInput('/newsredak')
end
end
end
end
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if active then
if dialogId == 25612 then
sampSendDialogResponse(dialogId, 1, 0, '')
return false
elseif dialogId == 25613 then
local count = -1
for n in text:gmatch('[^\r\n]+') do
if n:find(sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)))) then
sampSendDialogResponse(25613, 1, count, '')
end
count = count + 1
end
return false
elseif dialogId == 25614 then
sampSendDialogResponse(25614, 1, 0, 'ну там че те надо типа') -- поменяй
active = false
return false
end
end
end