помощь со скриптом нужна

maksimkabr

Новичок
Автор темы
1
0
Версия MoonLoader
.026-beta
можете сделать мини-скрипт, биндер с активацией текста на alt+Q "/a У вас есть доказательства на нарушение ?"
 

qdIbp

Автор темы
Проверенный
1,387
1,141
Lua:
require "lib.moonloader"
require 'lib.vkeys'
local on = require "lib.samp.events"
local imgui = require 'imgui'

local timer, nick, id, cmd, nan, tim = 0, '', '', '', '', 0
local sms = sampAddChatMessage

local font_flag = require('moonloader').font_flag
local my_font = renderCreateFont('Verdana', 12)

function main()
    while true do wait(0)
        if tim >= os.time() then renderFontDrawText(my_font, os.time() - tim, 10, 400, 0xFFFFFFFF) end
        if isKeyDown(18) and isKeyDown(81) and timer <= os.time() then
            if tim >= os.time() then
                sampSendChat('/a '..nick..' у тебя есть пруфы на нарушение?')
                timer = os.time() + 1.2
            end
        end
    end
end

function on.onServerMessage(color, text)
    if text:find('[A%] %(%w+_%w+)%[%d+]: (+)') and tim >= os.time() then
        nan = text:match('(%w+_%w+)')
        if nan == nick then
            sampSendChat('/'..cmd..' //'..nick)
            nick, id, cmd, nan = '', '', '', ''
        end
    elseif text:find('[A%] %(%w+_%w+)%[%d+]: /(%S+) (.+)',1) and tim <= os.time() then
        nick, id, cmd = text:match('(%w+_%w+)%[%d+]: /((%S+ .+))')
        tim = os.time() + 13
    end
end
 

SomaGnoma

Известный
442
152
Lua:
require "lib.moonloader"
require 'lib.vkeys'
local on = require "lib.samp.events"
local imgui = require 'imgui'

local timer, nick, id, cmd, nan, tim = 0, '', '', '', '', 0
local sms = sampAddChatMessage

local font_flag = require('moonloader').font_flag
local my_font = renderCreateFont('Verdana', 12)

function main()
    while true do wait(0)
        if tim >= os.time() then renderFontDrawText(my_font, os.time() - tim, 10, 400, 0xFFFFFFFF) end
        if isKeyDown(18) and isKeyDown(81) and timer <= os.time() then
            if tim >= os.time() then
                sampSendChat('/a '..nick..' у тебя есть пруфы на нарушение?')
                timer = os.time() + 1.2
            end
        end
    end
end

function on.onServerMessage(color, text)
    if text:find('[A%] %(%w+_%w+)%[%d+]: (+)') and tim >= os.time() then
        nan = text:match('(%w+_%w+)')
        if nan == nick then
            sampSendChat('/'..cmd..' //'..nick)
            nick, id, cmd, nan = '', '', '', ''
        end
    elseif text:find('[A%] %(%w+_%w+)%[%d+]: /(%S+) (.+)',1) and tim <= os.time() then
        nick, id, cmd = text:match('(%w+_%w+)%[%d+]: /((%S+ .+))')
        tim = os.time() + 13
    end
end
Зачем ты приплел imgui и vkeys и events??
Держи любимый:
Lua:
require "lib.moonloader" -- подрубаем либу

function main()
    while not isSampAvailable() or not isSampfuncsLoaded() do wait(50) end -- проверяем самп че он там загрузился
    while true do wait(0) 
        if isKeyDown(18) and isKeyJustPressed(81) then -- если нажаты две кнопочки то
           sampSendChat('/a У вас есть доказательства на нарушение?') -- сам поменяешь если че
        end
    end
end
 

qdIbp

Автор темы
Проверенный
1,387
1,141
Зачем ты приплел imgui и vkeys и events??
Держи любимый:
Lua:
require "lib.moonloader" -- подрубаем либу

function main()
    while not isSampAvailable() or not isSampfuncsLoaded() do wait(50) end -- проверяем самп че он там загрузился
    while true do wait(0)
        if isKeyDown(18) and isKeyJustPressed(81) then -- если нажаты две кнопочки то
           sampSendChat('/a У вас есть доказательства на нарушение?') -- сам поменяешь если че
        end
    end
end
Я как всегда записался в коде и довел до полу автоматического автоответчика 😅

согл, лоханулся