local hook = require 'lib.samp.events'
function main()
repeat wait(0) until isSampAvailable()
sampAddChatMessage("Klans StageRp Tapper загрузился успешно введите /clicktxd", 0xc0c24e)
sampRegisterChatCommand("clicktxd",
function()
grogger = not grogger
if grogger then sampAddChatMessage("Klans StageRp Tapper активирован", 0xc0c24e)
else sampAddChatMessage("Klans StageRp Tapper деактивирован", 0xc0c24e) end
end)
wait(-1)
end
function hook.onShowTextDraw(textdrawId, data)
if grogger then
if data.text:find("Y") then
sendKey(64)
elseif data.text:find("N") then
sendKey(128)
elseif data.text:find("H") then
sendKey(192)
end
end
end
function sendKey(key)
local _, myId = sampGetPlayerIdByCharHandle(PLAYER_PED)
local data = allocateMemory(68)
sampStorePlayerOnfootData(myId, data)
setStructElement(data, 36, 1, key, false)
sampSendOnfootData(data)
freeMemory(data)
end