help imgui

lifeisabitch

Участник
Автор темы
59
2
Версия MoonLoader
Другое
why does the animation not work the id placed
почему не работает анимация?

Lua:
local sampev = require ("samp.events")
require "lib.moonloader"
local imgui = require 'imgui'

local config = {
    status = imgui.ImBool(false),
    id = imgui.ImInt(-1),
}

local randf = false
local rand = imgui.ImBool(false)

function sampev.onPlayerSync(playerId, data)
    if config.status.v then
        if playerId == config.id.v then
            if rand then
                data.quaternion[0] = math.random(0,1)
                data.quaternion[1] = math.random(0,1)
                data.quaternion[2] = math.random(0,1)
                data.quaternion[3] = math.random(0,1)
            end
        end
    end
end

function imgui.OnDrawFrame()

    imgui.Checkbox('##0',config.status)
    imgui.InputInt('##1', config.id, 0, 5)
   
    if imgui.Checkbox(u8'Anim', rand) then
        randf = not randf
        if randf then
            sampAddChatMessage("{00FFFF}[Anim] >> {d5dedd}(Anim) Activated", -1)
        else
            sampAddChatMessage("{00FFFF}[Anim] >> {d5dedd}(Anim) Disabled", -1)
        end
    end
end