local keys = {
[1] = 2103,
[2] = 2104,
[3] = 2102,
[4] = 2106,
[5] = 2107,
[6] = 2105,
[7] = 2109,
[8] = 2110,
[9] = 2108,
[0] = 2111,
["call"] = 2098,
["go"] = 2096
}
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand("call", scr)
wait(-1)
end
function scr(param)
local number = tonumber(param:match("(%d)"))
if number then
lua_thread.create(function()
nopHook("onShowTextDraw", true)
nopHook("onShowDialog", true)
sampSendChat("/phone")
wait(200)
sampSendDialogResponse(1000, 1, 0, 0)
wait(200)
sampSendClickTextdraw(keys["go"])
wait(200)
sampSendClickTextdraw(keys["call"])
parseNumber(number)
wait(200)
sampSendClickTextdraw(keys["go"])
wait(200)
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)
wait(200)
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