Help

G W

Участник
Автор темы
141
5
Версия MoonLoader
.026-beta
Почему она не работает ? Помогите пожалуйста.
Lua:
 function samp.onServerMessage(color, text)
testid, msg = text:match('.+%[(%d+)]: (.+)')

if testid and msg and msg:find('Тест') then
sampAddChatMessage('Чтобы выдать мут нажмите клавишу CTRL', -1)
end

if isKeyJustPressed(key.VK_CTRL) and testid ~= nil then
sampAddChatMessage('/mute '..testid..' 15')
end
end
 
Последнее редактирование:
Решение
Lua:
require "moonloader"
local samp = require 'lib.samp.events'

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(2000) end
    
    while true do

        if isKeyJustPressed(VK_LCONTROL) and active then
            active = false
            sampAddChatMessage('/mute '..testid..' 15')
        end

    wait(0)
    end
end

function samp.onServerMessage(color, text)
    testid, msg = text:match('.+%[(%d+)]: (.+)')

    if testid and msg:find('Тест') then
        sampAddChatMessage('Чтобы выдать мут нажмите клавишу CTRL', -1)
        active = true
    end
end

Cosmo

Известный
Друг
646
2,602
Lua:
require "moonloader"
local samp = require 'lib.samp.events'

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(2000) end
    
    while true do

        if isKeyJustPressed(VK_LCONTROL) and active then
            active = false
            sampAddChatMessage('/mute '..testid..' 15')
        end

    wait(0)
    end
end

function samp.onServerMessage(color, text)
    testid, msg = text:match('.+%[(%d+)]: (.+)')

    if testid and msg:find('Тест') then
        sampAddChatMessage('Чтобы выдать мут нажмите клавишу CTRL', -1)
        active = true
    end
end