- 6
- 2
- Версия MoonLoader
- .026-beta
Lua:
require "lib.moonloader"
local hook = require 'lib.samp.events'
grogger = false
function main()
repeat wait(0) until isSampAvailable()
sampAddChatMessage("Work", 0xc0c24e)
sampRegisterChatCommand("click",
function()
grogger = not grogger
if grogger then sampAddChatMessage("1", 0xc0c24e)
else sampAddChatMessage("0", 0xc0c24e) end
end)
wait(-1)
end
function hook.onShowTextDraw(textdrawId, data)
if grogger then
if sampTextdrawGetString(2077):find("N") then
wait(1000)
sendKey(128)
elseif sampTextdrawGetString(2077):find("Y") then
wait(1000)
sendKey(64)
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