че не работает с нажатиями по текстдраву?

  • Автор темы deleted-user-532248
  • Дата начала
D

deleted-user-532248

Гость
Автор темы
Удаление темы с решением
Версия MoonLoader
.027.0-preview
памагите, не работает скрипт
ыыыы:
local sampev = require("samp.events")

local textdraw = {
    [1] = {_, 2302, 1000},
    [2] = {_, 2302, 1000},
    [3] = {_, 2302, 1000},
    [4] = {_, 2302, 1000},
    [5] = {_, 2302, 1000},
}


local time1 = 1
local timer = 200


function chest()
    newTask(function()
        sendClickTextdraw(65535)
        wait(500)
        runCommand("/mm")
        wait(3000)
        runCommand('/invent')
        wait(1000)
        for i = 1, 5 do
            if(tonumber(textdraw[i][1])) then
                sendClickTextdraw(textdraw[i][1])
                wait(textdraw[i][3])
                sendClickTextdraw(textdraw[i][2])
                wait(textdraw[i][3])
            end
            wait(500)
        end
        wait(500)
        sendClickTextdraw(65535)
    end)
end

function sampev.onShowTextDraw(id, data)
    if data.modelId == 19918 then
        textdraw[1][1] = id
    end
    if data.modelId == 1353 then
        textdraw[2][1] = id
    end
    if data.modelId == 1733 then
        textdraw[3][1] = id 
    end
    if data.modelId == 19613 then
        textdraw[4][1] = id 
    end
    if data.modelId == 2887 then
        textdraw[5][1] = id 
    end
end

function sampev.onShowDialog(id, style, title, btn1, btn2, text)
    if id == 722 then
        sendDialogResponse(id, 0, -1, "")
        return false
    end
end

function onUpdate()
    wait(64000)
            chest()
        end
 
  • Эм
Реакции: YarikVL

Vintik

Мечтатель
Проверенный
1,485
943
ну это ж разбираться надо долго...
пойми в каком месте перестаёт работать
1) крашит?
2) срабатывает ли sampev.onShowTextDraw (и записывает ли в твою таблицу)?
3) что выводит tonumber(textdraw[1]) в твоём цикле for
вот так вот и отлаживать дебажить, меня побьют за такие слова...
 
D

deleted-user-532248

Гость
Автор темы
ну это ж разбираться надо долго...
пойми в каком месте перестаёт работать
1) крашит?
2) срабатывает ли sampev.onShowTextDraw (и записывает ли в твою таблицу)?
3) что выводит tonumber(textdraw[1]) в твоём цикле for
вот так вот и отлаживать дебажить, меня побьют за такие слова...
нихуя не происходит и не выводит, скрипт не крашится
 

хромиус)

спокойно, это всего лишь слива
Друг
4,954
3,228
Что за смесь рак-луа и мун-луа в коде выше?
раксамп
памагите, не работает скрипт
ыыыы:
local sampev = require("samp.events")

local textdraw = {
    [1] = {_, 2302, 1000},
    [2] = {_, 2302, 1000},
    [3] = {_, 2302, 1000},
    [4] = {_, 2302, 1000},
    [5] = {_, 2302, 1000},
}


local time1 = 1
local timer = 200


function chest()
    newTask(function()
        sendClickTextdraw(65535)
        wait(500)
        runCommand("/mm")
        wait(3000)
        runCommand('/invent')
        wait(1000)
        for i = 1, 5 do
            if(tonumber(textdraw[i][1])) then
                sendClickTextdraw(textdraw[i][1])
                wait(textdraw[i][3])
                sendClickTextdraw(textdraw[i][2])
                wait(textdraw[i][3])
            end
            wait(500)
        end
        wait(500)
        sendClickTextdraw(65535)
    end)
end

function sampev.onShowTextDraw(id, data)
    if data.modelId == 19918 then
        textdraw[1][1] = id
    end
    if data.modelId == 1353 then
        textdraw[2][1] = id
    end
    if data.modelId == 1733 then
        textdraw[3][1] = id
    end
    if data.modelId == 19613 then
        textdraw[4][1] = id
    end
    if data.modelId == 2887 then
        textdraw[5][1] = id
    end
end

function sampev.onShowDialog(id, style, title, btn1, btn2, text)
    if id == 722 then
        sendDialogResponse(id, 0, -1, "")
        return false
    end
end

function onUpdate()
    wait(64000)
            chest()
        end
во первых,ранкоманд обрабатывает команды раксампа,используй sendInput
 

cloused2

Активный
310
91
памагите, не работает скрипт
ыыыы:
local sampev = require("samp.events")

local textdraw = {
    [1] = {_, 2302, 1000},
    [2] = {_, 2302, 1000},
    [3] = {_, 2302, 1000},
    [4] = {_, 2302, 1000},
    [5] = {_, 2302, 1000},
}


local time1 = 1
local timer = 200


function chest()
    newTask(function()
        sendClickTextdraw(65535)
        wait(500)
        runCommand("/mm")
        wait(3000)
        runCommand('/invent')
        wait(1000)
        for i = 1, 5 do
            if(tonumber(textdraw[i][1])) then
                sendClickTextdraw(textdraw[i][1])
                wait(textdraw[i][3])
                sendClickTextdraw(textdraw[i][2])
                wait(textdraw[i][3])
            end
            wait(500)
        end
        wait(500)
        sendClickTextdraw(65535)
    end)
end

function sampev.onShowTextDraw(id, data)
    if data.modelId == 19918 then
        textdraw[1][1] = id
    end
    if data.modelId == 1353 then
        textdraw[2][1] = id
    end
    if data.modelId == 1733 then
        textdraw[3][1] = id
    end
    if data.modelId == 19613 then
        textdraw[4][1] = id
    end
    if data.modelId == 2887 then
        textdraw[5][1] = id
    end
end

function sampev.onShowDialog(id, style, title, btn1, btn2, text)
    if id == 722 then
        sendDialogResponse(id, 0, -1, "")
        return false
    end
end

function onUpdate()
    wait(64000)
            chest()
        end
Чувак как минимум в сампе команду отправляют через sampSendChat()
 
  • Нравится
Реакции: Vintik