Активация на G

Matteo Mandarin

Новичок
Автор темы
23
0
Написал AutoForm и она работала со временем перестала. Тип если мне например в админский чат пишут /plveh 52 522 1 то должен вывести на экран оповещение и при нажимании на G форма выдавала человеку кар. Сейчас вообще ничего не происходит сам скрипт запускает и прогружает но не работает активация.

lua autoform:
local event = require('lib.samp.events')

stop = 0
started = 0
prinato = 0
active_report = 0
active_report2 = 0

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(1000) end
    sampAddChatMessage("{FF0000}[AutoForm] {ffffff} {00FFFF} Script uspeshno actived!", -1)
    sampAddChatMessage("{FF0000}[AutoForm] {ffffff} {00FFFF} Avtor: Matteo !", -1)
    sampAddChatMessage("{FF0000}[AutoForm] {ffffff} {00FFFF} Activatishn: G !", -1)
    repeat wait(0) until isSampAvailable()
    while true do
        wait(0)
                        if isKeyDown(71) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
                        while isKeyDown(71) do wait(0) end   
                if active_report == 2 then                   
                          sampSendChat(string.format("/%s %s", cmd, paramssss))
                                    status("true", 1)
                          sampSendChat("/a [Form] +")           
                                active_report2 = 1
                end
                    end   
    end
end
 

qdIbp

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

sms=sampAddChatMessage
local acrive = false 
local da = 0 
local cmd = '' 
local cid = '' 
local ca = '' 
local co = '' 
local nn = ''

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end  
        
    while true do wait(0)
        if isKeyDown(VK_B) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
            sampSendChat('/ot') wait(750) end  
            
        if isKeyDown(71) and acrive and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
            ewe() sampSendChat('/a [Form] +') wait(1500)
        end  
    end
end

function on.onServerMessage(color, text)
    if not acrive and da == 0 then
        if text:find('[(%w+)%] (%w+_%w+)[(%d+)]: /(%a+) (%P+)') then 
            cmd, cid = text:match('(%a+) (%P+)') acrive = true da = 3 printStyledString(cmd, 4000, 5)   
            
        elseif text:find('[(%w+)%] (%w+_%w+)[(%d+)]: /(%a+) (%P+) //(%w+)') then 
            cmd, cid, nn = text:match('(%a+) (%P+) //(%w+)') 
            acrive = true da = 2 printStyledString(cmd, 4000, 5) end
               
               
               
               
        if text:find('[(%w+)%] (%w+_%w+)[(%d+)]: /(%a+) (%P+) (%P+)') then 
            cmd, cid, ca = text:match('(%a+) (%P+) (%P+)') acrive = true da = 3 printStyledString(cmd, 4000, 5)   
        elseif text:find('[(%w+)%] (%w+_%w+)[(%d+)]: /(%a+) (%P+) (%P+) //(%w+)') then 
            cmd, cid, ca = text:match('(%a+) (%P+) (%P+) //(%w+)') acrive = true da = 3 printStyledString(cmd, 4000, 5) end  
              

              
        if text:find('[(%w+)%] (%w+_%w+)[(%d+)]: /(%a+) (%P+) (%P+) (%P+)') then
            cmd, cid, ca, co, nn = text:match('(%a+) (%P+) (%P+) (%P+)') acrive = true da = 4 printStyledString(cmd, 4000, 5)
        elseif text:find('[(%w+)%] (%w+_%w+)[(%d+)]: /(%a+) (%P+) (%P+) (%P+) //(%w+)') then -- /cmd [arg1] [arg2] [arg3]
            cmd, cid, ca, co, nn = text:match('(%a+) (%P+) (%P+) (%P+) //(%w+)') acrive = true da = 4 printStyledString(cmd, 4000, 5)
            
            
            
            
        end 
    end        
end


function ewe()
    lua_thread.create(function()
        if acrive then

            if da == 2 then 
                wait(1200) 
                sampSendChat('/'..cmd..' '..cid..' //'..nn)    
                cmd ='' cid='' ca='' co='' nn = '' da = 0 

            elseif da == 3 then 
                wait(1200) 
                sampSendChat('/'..cmd..' '..cid..' '..ca..' //'..nn) 
                cmd ='' cid='' ca='' co='' nn = '' da = 0 

            elseif da == 4 then 
                wait(1200) 
                sampSendChat('/'..cmd..' '..cid..' '..ca..' '..co..' //'..nn)
                cmd ='' cid='' ca='' co='' nn = '' da = 0 
            
            
            
            
            
            
            
            
            end
            acrive = false
        end
    end)
end
Дальше сам решай как пользоваться
 
Последнее редактирование:
  • Нравится
Реакции: IlyaHL2

Matteo Mandarin

Новичок
Автор темы
23
0
Lua:
require "lib.moonloader"
require 'lib.vkeys'
local on = require "lib.samp.events"
acrive = false
da = 0
cmd = ''
cid = ''
ca = ''
co = ''

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end 
    while true do wait(0)
        if isKeyDown(71) and acrive and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
            sampSendChat('/a [Form] +') ewe()
        end 
    end
end

function on.onServerMessage(color, text)
    lua_thread.create(function() 
        if not acrive and da == 0 then
            if text:find('[A] (%w+_%w+)%[(%d+)%]:(%s+)(/%a+) (%d+)') then -- /cmd [arg1]
            --if text:find('(%w+_%w+)%[(%d+)%]:(%s+)/(%a+) (%d+)') then
                cmd, cid = text:match('(%a+) (%d+)') acrive = true  da = 2 printStyledString('/'..cmd, 4000, 5) end
              
            if text:find('[A] (%w+_%w+)%[(%d+)%]:(%s+)(/%a+) (%d+) (%d+)') then -- /cmd [arg1] [arg2]
            --if text:find('(%w+_%w+)%[(%d+)%]:(%s+)/(%a+) (%d+) (%d+)') then
                cmd, cid, ca = text:match('(%a+) (%d+) (%d+)') acrive = true da = 3 printStyledString('/'..cmd, 4000, 5) end 
              
            if text:find('[A] (%w+_%w+)%[(%d+)%]:(%s+)(/%a+) (%d+) (%d+) (%d+)') then -- /cmd [arg1] [arg2] [arg3]
            --if text:find('(%w+_%w+)%[(%d+)%]:(%s+)/(%a+) (%d+) (%d+) (%d+)') then
                cmd, cid, ca, co = text:match('(%a+) (%d+) (%d+) (%d+)') acrive = true da = 4  printStyledString('/'..cmd, 4000, 5)
            end     
        end 
    end) 
end

function ewe()
    lua_thread.create(function()
        if acrive then
            if da == 2 then wait(1200) sampSendChat(' /'..cmd..' '..cid) cmd ='' cid='' ca='' co='' da = 0 print(cmd..' '..cid..' '..ca..' '..co..' '..da)
            elseif da == 3 then wait(1200) sampSendChat(' /'..cmd..' '..cid..' '..ca) cmd ='' cid='' ca='' co='' da = 0 print(cmd..' '..cid..' '..ca..' '..co..' '..da)
            elseif da == 4 then wait(1200) sampSendChat(' /'..cmd..' '..cid..' '..ca..' '..co) cmd ='' cid='' ca='' co='' da = 0 print(cmd..' '..cid..' '..ca..' '..co..' '..da)
            end
            acrive = false
        end
    end)
end
Дальше сам решай как пользоваться
Не помогло
 

qdIbp

Автор темы
Проверенный
1,387
1,142
Ты конкретней описываешь что тебе надо, а точнее где эта команда должна быть написана, в админ чат, в рации какое-нибудь, в обычном чате, я сделал специально для админ чата

Или что конкретно не работает
 

Matteo Mandarin

Новичок
Автор темы
23
0
Ты конкретней описываешь что тебе надо, а точнее где эта команда должна быть написана, в админ чат, в рации какое-нибудь, в обычном чате, я сделал специально для админ чата

Или что конкретно не работает
Я имею ввиду что тип когда кидают например /slap 41 1 то на экране появляется админ форм и нажимаешь на G она принимается. А твой код засунул вообще перестало работать)