кто может помочь адаптировать скрипт под раксамп

k3shte

Новичок
Автор темы
8
1
Версия SA-MP
  1. 0.3.7 (R1)
  2. 0.3.7-R3
  3. Любая
  4. Другая
скрипт для того чтобы принимать трейды, и как-то бы вырезать команду активации, чтобы после запуска сразу воркало
Lua:
require("lib.moonloader")
local samp = require("lib.samp.events")
local state = false

local authorization = {
    nick = "",
    password = "123123123",
}

function samp.onServerMessage(clr, text)
    if text:gsub("%{......%}", ""):find("%[Предложение%] .*%[%d+%] предлагает Вам торговлю%.") and state then
        lua_thread.create(function()
            setVirtualKeyDown(VK_Y, true)
            wait(30)
            setVirtualKeyDown(VK_Y, false)
        end)
    end
end

function main()
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("tauto", function()
        state = not state
        sampAddChatMessage("[TA] {FDFDFD}Скрипт был "..(state and "активирован" or "отключен")..".", 0xFFFF0000)
    end)
    while true do wait(0)
        if state then
            for i = 0, 2304 do
                if sampTextdrawIsExists(i) and i == 2094 then
                    sampSendClickTextdraw(i)
                    wait(1500)
                end
            end
        end
    end
end

function sendAuthorization(nick, pass)
    local string1 = string.format("authorization|%s|%s|0", nick, pass)
    local bs = bitStream.new()
    bs:writeInt8(220)
    bs:writeInt8(18)
    bs:writeInt16(string.len(string1))
    bs:writeString(string1)
    bs:writeInt32(1)
    bs:sendPacketEx(2, 9, 6)
    bs:reset()
end