- 18
- 0
Lua:
script_name("Clicker YHN")
script_authors("Vitaliy_King")
local hook = require 'lib.samp.events'
function main()
repeat wait(0) until isSampAvailable()
sampAddChatMessage("Clicker YHN Загружен. Введите: /yhn", 0xc0c24e)
sampRegisterChatCommand("yhn",
function()
grogger = not grogger
if grogger then sampAddChatMessage("Clicker YHN Активирован", 0xc0c24e)
else sampAddChatMessage("Clicker YHN Деактивирован", 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