ищу скрипт на кд аптеки и брони и стантину

Koralewski

Новичок
Автор темы
5
0
1778065010698.png

ищу такой или похожий скрипт на стантину
 

Порожденный

Активный
359
57

Koralewski

Новичок
Автор темы
5
0
По визуалу подходит это
https://www.blast.hk/threads/242381/
Но там нету стамины,
Есть еще вот такая тема
Если это не то, отпиши что хочешь увидеть, попробую реализовать
ну впринципе то что на скрине хотелось бы и видеть
 

d3sync

Участник
87
55
1778234361128.png


Изменить положение - /staminapos

stamina:
-- STAMINA HUD.lua
local wm = require 'lib.windows.message'
local inicfg = require 'inicfg'
local memory = require 'memory'

local directIni = 'staminahud.ini'

local ini = inicfg.load({
    main = {
        x = 50,
        y = 400,
    }
}, directIni)

inicfg.save(ini, directIni)

local changePos = false

local sX, sY = getScreenResolution()
local font_size = sY / 128
local font = renderCreateFont('Courier New', font_size, 5)

addEventHandler("onWindowMessage", function(msg, wp, lp)
    if changePos then
        if msg == wm.WM_LBUTTONDOWN then
            consumeWindowMessage(true, false)
        end

        if msg == wm.WM_LBUTTONUP then
            changePos = false
            showCursor(false)
            inicfg.save(ini, directIni)
        end
    end
end)

function main()
    while not isSampAvailable() do
        wait(0)
    end

    sampRegisterChatCommand('staminapos', function()
        changePos = true
        showCursor(true)
    end)

    while true do
        wait(0)
        renderStamina()
    end
end

function renderStamina()
    if changePos then
        local posX, posY = getCursorPos()
        ini.main.x = posX
        ini.main.y = posY
    end

    local stamina = getPlayerStamina()
    local text = string.format("Стамина: %d%%", stamina)

    local height = renderGetFontDrawHeight(font)
    local width = renderGetFontDrawTextLength(font, text) + 14

    renderDrawBox(
        ini.main.x,
        ini.main.y,
        width,
        height + 6,
        0x70000000
    )

    renderDrawBox(
        ini.main.x - 3,
        ini.main.y,
        3,
        height + 6,
        0xFF00AA55
    )

    renderFontDrawText(
        font,
        text,
        ini.main.x + 8 + 1,
        ini.main.y + 3 + 1,
        0xAA000000
    )

    renderFontDrawText(
        font,
        text,
        ini.main.x + 8,
        ini.main.y + 3,
        0xFF00CC66
    )
end

function getPlayerStamina()
    local value = memory.getfloat(0xB7CDB4, 1)

    local stamina = math.floor(value / 31.47000244)

    if stamina < 0 then stamina = 0 end
    if stamina > 100 then stamina = 100 end

    return stamina
end
 

d3sync

Участник
87
55
Попробуй

стамина:
-- Rodina RP STAMINA HUD

local wm = require 'lib.windows.message'
local inicfg = require 'inicfg'
local memory = require 'memory'

local directIni = 'rodina_stamina.ini'

local ini = inicfg.load({
    main = {
        x = 35,
        y = 420,
    }
}, directIni)

inicfg.save(ini, directIni)

local changePos = false

local sX, sY = getScreenResolution()

local font_size = sY / 128
local font = renderCreateFont('Tahoma', font_size, 5)

addEventHandler("onWindowMessage", function(msg, wp, lp)
    if changePos then
        if msg == wm.WM_LBUTTONDOWN then
            consumeWindowMessage(true, false)
        end

        if msg == wm.WM_LBUTTONUP then
            changePos = false
            showCursor(false)
            inicfg.save(ini, directIni)
        end
    end
end)

function main()
    while not isSampAvailable() do
        wait(0)
    end

    sampAddChatMessage("{00CC66}[STAMINA]{FFFFFF} Загружен. /staminapos", -1)

    sampRegisterChatCommand('staminapos', function()
        changePos = true
        showCursor(true)

        sampAddChatMessage("{00CC66}[STAMINA]{FFFFFF} Перетащи HUD мышкой.", -1)
    end)

    while true do
        wait(0)

        if not isCharOnFoot(PLAYER_PED) then
            goto continue
        end

        renderStamina()

        ::continue::
    end
end

function renderStamina()
    if changePos then
        local posX, posY = getCursorPos()

        ini.main.x = posX
        ini.main.y = posY
    end

    local stamina = getPlayerStamina()

    local text = string.format("Стамина: %d%%", stamina)

    local height = renderGetFontDrawHeight(font)
    local width = renderGetFontDrawTextLength(font, text) + 16

    -- фон
    renderDrawBox(
        ini.main.x,
        ini.main.y,
        width,
        height + 6,
        0x70000000
    )


    renderDrawBox(
        ini.main.x - 3,
        ini.main.y,
        3,
        height + 6,
        0xFF00AA55
    )


    renderFontDrawText(
        font,
        text,
        ini.main.x + 8 + 1,
        ini.main.y + 3 + 1,
        0xAA000000
    )


    renderFontDrawText(
        font,
        text,
        ini.main.x + 8,
        ini.main.y + 3,
        0xFF00CC66
    )
end

function getPlayerStamina()
    -- Rodina/CRMP address
    local value = memory.getfloat(0xBAA410, 1)

    local stamina = math.floor(value / 31.47000244)

    if stamina < 0 then stamina = 0 end
    if stamina > 100 then stamina = 100 end

    return stamina
end