Lua

Jendosik

Участник
Автор темы
211
12
Версия MoonLoader
.026-beta
в чём ошибка
Lua:
script_name('123') -- название скрипта
script_author('FORMYS') -- автор скрипта
script_description('Otschet') -- описание скрипта

require "lib.moonloader" -- подключение библиотеки
require "lib.moonloader"
local imgui = require 'imgui'
local encoding = require 'encoding'
local inicfg = require 'inicfg'
local samp = require 'samp.events'
local key = require('vkeys')
encoding.default = 'CP1251'
u8 = encoding.UTF8
local color_dialog = 0xDEB887
local font_flag = require('moonloader').font_flag
local my_font = renderCreateFont('Verdana', 12, font_flag.BOLD + font_flag.SHADOW)

-- Для диалога с ID 12
local i = 0
local ii = 0
local timer1=false
local timer2=false

function samp.onServerMessage(color, text)
    if text:find("for.") then
            if i>10 then
                return true
            end
            i=11
            timer()
        end
    end

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

    sampRegisterChatCommand("col", cmd_col)

    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)

    while true do
        wait(0)
        if i>0 then
            if ii>0 then
        -- if i ~= 0 then
        renderFontDrawText(my_font, i, 10, 400, 0xFFFFFFFF)
            end


    end
end



function timer()
        lua_thread.create(
        function()
            if not timer1 then
                timer1=true
                while i>0 do
                    wait(1000)
                    i=i-1
                end
                timer1=false
            end
        end
        )
    end
end
 

sᴀxᴏɴ

#Mary
Всефорумный модератор
791
846
Lua:
script_name('123') -- название скрипта
script_author('FORMYS') -- автор скрипта
script_description('Otschet') -- описание скрипта

require "lib.moonloader" -- подключение библиотеки
require "lib.moonloader"
local imgui = require 'imgui'
local encoding = require 'encoding'
local inicfg = require 'inicfg'
local samp = require 'samp.events'
local key = require('vkeys')
encoding.default = 'CP1251'
u8 = encoding.UTF8
local color_dialog = 0xDEB887
local font_flag = require('moonloader').font_flag
local my_font = renderCreateFont('Verdana', 12, font_flag.BOLD + font_flag.SHADOW)

-- Для диалога с ID 12
local i = 0
local ii = 0
local timer1=false
local timer2=false


function samp.onServerMessage(color, text)
    if text:find("for.") then
            if i>10 then
                return true
            end
            i=11
            timer()
        end
    end

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

    sampRegisterChatCommand("col", cmd_col)

    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)

    while true do
        wait(0)
        if i>0 then
            if ii>0 then
        -- if i ~= 0 then
        renderFontDrawText(my_font, i, 10, 400, 0xFFFFFFFF)
            end


    end
end
end

function timer()
        lua_thread.create(
        function()
            if not timer1 then
                timer1=true
                while i>0 do
                    wait(1000)
                    i=i-1
                end
                timer1=false
            end
        end
        )
end
 

Jendosik

Участник
Автор темы
211
12
Lua:
script_name('123') -- название скрипта
script_author('FORMYS') -- автор скрипта
script_description('Otschet') -- описание скрипта

require "lib.moonloader" -- подключение библиотеки
require "lib.moonloader"
local imgui = require 'imgui'
local encoding = require 'encoding'
local inicfg = require 'inicfg'
local samp = require 'samp.events'
local key = require('vkeys')
encoding.default = 'CP1251'
u8 = encoding.UTF8
local color_dialog = 0xDEB887
local font_flag = require('moonloader').font_flag
local my_font = renderCreateFont('Verdana', 12, font_flag.BOLD + font_flag.SHADOW)

-- Для диалога с ID 12
local i = 0
local ii = 0
local timer1=false
local timer2=false


function samp.onServerMessage(color, text)
    if text:find("for.") then
            if i>10 then
                return true
            end
            i=11
            timer()
        end
    end

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

    sampRegisterChatCommand("col", cmd_col)

    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)

    while true do
        wait(0)
        if i>0 then
            if ii>0 then
        -- if i ~= 0 then
        renderFontDrawText(my_font, i, 10, 400, 0xFFFFFFFF)
            end


    end
end
end

function timer()
        lua_thread.create(
        function()
            if not timer1 then
                timer1=true
                while i>0 do
                    wait(1000)
                    i=i-1
                end
                timer1=false
            end
        end
        )
end
Неа