script_name("Universal Taper")
script_authors("Unknown")
script_moonloader(0.25)
require "lib.moonloader"
local hook = require 'lib.samp.events'
grogger = false
function main()
repeat wait(0) until isSampAvailable()
sampAddChatMessage("Universal Taper загрузился успешно. Введите /click", 0xc0c24e)
sampRegisterChatCommand("click",
function()
grogger = not grogger
if grogger then sampAddChatMessage("Universal Taper активирован", 0xc0c24e)
else sampAddChatMessage("Universal Taper деактивирован", 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