- 92
- 31
- Версия MoonLoader
- .026-beta
Всем привет. Я не могу понгять почемуто не выводит значение в парсер и просто выводит ид. Помогите пожалуйста уже 4-й день пытаюсь сделать.
code:
local sampev = require "lib.samp.events"
local keys = {
[1] = 2108,
[2] = 2106,
[3] = 2107,
[4] = 2111,
[5] = 2109,
[6] = 2110,
[7] = 2114,
[8] = 2112,
[9] = 2113,
[0] = 2115,
["call"] = 2101,
["go"] = 2100
}
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand("call", scr)
sampRegisterChatCommand("callid", callid)
while true do
wait(0)
end
end
function sampev.onServerMessage(color, text)
if open == true then
param = tonumber(text:match("{FFFFFF}%a+_%a+%[%d+]: {33CCFF}(%d+)"))
sampAddChatMessage(number, 0xFFFFFF)
open = false
end
end
function scr(param)
param = tonumber(param)
if param ~= nil and param < 1000
then
sampSendChat("/number " .. param)
open = true
local number = param
if tonumber(number) ~= "" then
lua_thread.create(function()
--nopHook("onShowTextDraw", true)
--nopHook("onShowDialog", true)
wait{1000}
sampSendChat("/phone")
sampSendDialogResponse(1000, 1, 0, 0)
sampSendClickTextdraw(keys["go"])
sampSendClickTextdraw(keys["call"])
parseNumber(number)
sampSendClickTextdraw(keys["go"])
sampSendDialogResponse(966, 1, 10, 0)
wait(1600)
--nopHook("onShowTextDraw", false)
--nopHook("onShowDialog", false)
end)
end
end
function parseNumber(n)
local n = tostring(n)
for i = 1, #n do
number = n:sub(i, i)
sampSendClickTextdraw(keys[tonumber(number)])
end
end
function nopHook(name, bool)
local samp = require 'samp.events'
samp[name] = function()
if bool then return false end
end
end
function callid(id)
id = tonumber(id)
if id ~= nil and id < 1000
then
sampSendChat("/number " .. id)
end
end
end