скрипт который показывает стамину

Artemka!?

Участник
Автор темы
78
8
Ищу скрипт который показывает стамину возле худа.
 
  • Нравится
Реакции: arpix

rvng

молодой богатый дал менту на лапу
Модератор
10,770
5,987
/stbar
если отключить остальные функции то ни с чем конфликтовать не будет хотя сам по себе скрипт может заменить много чего
 
  • Нравится
Реакции: joklodf и Andrinall

Andrinall

Известный
680
532
Как ещё можно нарисовать бар стамины, но на луа.

1687798769881.png
1687798783153.png

Lua:
local memory = require 'memory'
local ffi = require 'ffi'

ffi.cdef[[
typedef struct RwRGBA { uint8_t red; uint8_t green; uint8_t blue; uint8_t alpha; } RwRGBA;
typedef struct CRGBA { RwRGBA rgba; } CRGBA;
]]

function main()
    repeat wait(100) until isSampAvailable()

    CSprite2D_DrawBarChart = ffi.cast("char(__cdecl*)(float, float, uint16_t, uint32_t, float, int, bool, bool, RwRGBA, RwRGBA)", 0x728640)
    CRGBA_constructor = ffi.cast("CRGBA*(__thiscall*)(void*, uint8_t, uint8_t, uint8_t, uint8_t)", 0x7170C0)

    addEventHandler("onD3DPresent", CHUD_RenderStaminaBar)

    wait(-1)
end

function getSprintLocalPlayer()
    return memory.getfloat(0xB7CDB4, 1) / 31.47000244
end

function CHUD_RenderStaminaBar()
    -- sampfuncs console causes visual bugs
    if not isPlayerPlaying(PLAYER_HANDLE) or isCharDead(PLAYER_PED) or sampIsScoreboardOpen() or isSampfuncsConsoleActive() then return 1 end

    local sw, sh = getScreenResolution()
    local width, height =
        sw * 0.0015625 * 62.0,
        sh * 0.002232143 * 8.5

    local function getYBasedOnHealth(pos, offset)
        return pos - sh * 0.002232143 * offset
    end

    local isPlayerInWater = isCharInWater(PLAYER_PED)
    local color = CRGBA_constructor(ffi.new("CRGBA"), 0xBF, 0x94, 0x30, 0xFF)
    local progressAddedColor = CRGBA_constructor(ffi.new("CRGBA"), 0, 0, 0, 0)
    return CSprite2D_DrawBarChart(
        sw - sw * 0.0015625 * 94.0,
        getYBasedOnHealth(getYBasedOnHealth(sh * 0.002232143 * 68.0, isPlayerInWater and 17 or 6), isPlayerInWater and 17 or 6),
        width, height,
        getSprintLocalPlayer(),
        0, 0, 1,
        color.rgba, progressAddedColor.rgba
    )
end
 
Последнее редактирование:

Artemka!?

Участник
Автор темы
78
8
Как ещё можно нарисовать бар стамины, но на луа.

Посмотреть вложение 205802Посмотреть вложение 205803
Lua:
local memory = require 'memory'
local ffi = require 'ffi'

ffi.cdef[[
typedef struct RwRGBA { uint8_t red; uint8_t green; uint8_t blue; uint8_t alpha; } RwRGBA;
typedef struct CRGBA { RwRGBA rgba; } CRGBA;
]]

function main()
    repeat wait(100) until isSampAvailable()

    CSprite2D_DrawBarChart = ffi.cast("char(__cdecl*)(float, float, uint16_t, uint32_t, float, int, bool, bool, RwRGBA, RwRGBA)", 0x728640)
    CRGBA_constructor = ffi.cast("CRGBA*(__thiscall*)(void*, uint8_t, uint8_t, uint8_t, uint8_t)", 0x7170C0)

    addEventHandler("onD3DPresent", CHUD_RenderStaminaBar)

    wait(-1)
end

function getSprintLocalPlayer()
    return memory.getfloat(0xB7CDB4, 1) / 31.47000244
end

function CHUD_RenderStaminaBar()
    -- sampfuncs console causes visual bugs
    if not isPlayerPlaying(PLAYER_HANDLE) or isCharDead(PLAYER_PED) or sampIsScoreboardOpen() or isSampfuncsConsoleActive() then return 1 end

    local sw, sh = getScreenResolution()
    local width, height =
        sw * 0.0015625 * 62.0,
        sh * 0.002232143 * 8.5

    local function getYBasedOnHealth(pos, offset)
        return pos - sh * 0.002232143 * offset
    end

    local isPlayerInWater = isCharInWater(PLAYER_PED)
    local color = CRGBA_constructor(ffi.new("CRGBA"), 0xBF, 0x94, 0x30, 0xFF)
    local progressAddedColor = CRGBA_constructor(ffi.new("CRGBA"), 0, 0, 0, 0)
    return CSprite2D_DrawBarChart(
        sw - sw * 0.0015625 * 94.0,
        getYBasedOnHealth(getYBasedOnHealth(sh * 0.002232143 * 68.0, isPlayerInWater and 17 or 6), isPlayerInWater and 17 or 6),
        width, height,
        getSprintLocalPlayer(),
        0, 0, 1,
        color.rgba, progressAddedColor.rgba
    )
end
я в коде не шарю, а бар стамины можна вертикально нарисовать справа от полоски хп.
 

Andrinall

Известный
680
532
я в коде не шарю, а бар стамины можна вертикально нарисовать справа от полоски хп.
Конкретно в этом шарить не обязательно, достаточно его скопировать в пустой текстовик в папке moonloader и сделать расширение .lua
 

Artemka!?

Участник
Автор темы
78
8
Конкретно в этом шарить не обязательно, достаточно его скопировать в пустой текстовик в папке moonloader и сделать расширение .lua
А, прям так. Спасибо за информацию!
 

joklodf

Участник
47
8