local sampev = require 'samp.events'
function sampev.onDisplayGameText(style, time, text)
if text:find('You are hungry') or text:find('You are very hungry') then
sendInput('/jmeat') -- жареное мясо оленины
end
end
function sendInput(text)
assert(type(text) == "string", "string expected, got "..type(text))
local bs = bitStream.new()
if text:sub(1, 1) == "/" then
bs:writeUInt32(text:len())
bs:writeString(text)
bs:sendRPC(50)
else
bs:writeUInt8(text:len())
bs:writeString(text)
bs:sendRPC(101)
end
end