Помощь чайнику.. (Диалог)

maximred

Новичок
Автор темы
5
0
Версия MoonLoader
.026-beta
Lua:
script_name("Pops")
script_version_number(1)
script_version("1.0")
script_authors("no")

function onReceiveRpc(id,bitStream)
    if id == 2 then
        dialogId = raknetBitStreamReadInt16(bitStream)
        style = raknetBitStreamReadInt8(bitStream)
        str = raknetBitStreamReadInt8(bitStream)
        title = raknetBitStreamReadString(bitStream, str)
        if title:find("Авторизация") then sampSendDialogResponse(dialogId,1,0,"*******") end
    end
    end
Крч.. Взял готовый скрипт из темы (Не поленился) Просто с нулевыми знаниями .. впендорил его таким способом(Ввод текста в диалоговое окно..) Проверял нечего не работает...
"Всем интересно знать, с чего начинается скрипт"

Буду благодарен...
 
Последнее редактирование модератором:
Решение
Lua:
script_name("Pops")
script_version_number(1)
script_version("1.0")
script_authors("no")

local sampev = require 'samp.events'

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    wait(-1)
end

function sampev.onShowDialog(dialogId, dialogStyle, dialogTitle, okButtonText, cancelButtonText, dialogText)
    if dialogId == 2 and dialogTitle:find('Авторизация') then
        sampSendDialogResponse(dialogId,1,0,'*******')
    end
end

Bredd Lane

Известный
423
348
Lua:
script_name("Pops")
script_version_number(1)
script_version("1.0")
script_authors("no")

local sampev = require 'samp.events'

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    wait(-1)
end

function sampev.onShowDialog(dialogId, dialogStyle, dialogTitle, okButtonText, cancelButtonText, dialogText)
    if dialogId == 2 and dialogTitle:find('Авторизация') then
        sampSendDialogResponse(dialogId,1,0,'*******')
    end
end