Lua HUD Lua | Простой Hud

NERV_=.

Новичок
Автор темы
24
13
Версия SA-MP
  1. 0.3.7 (R1)
Недавно мне было скучно, что я решил написать этот худ
По функционалу скудновато, но я думаю что в будущем он будет развит
Команды: /hmenu - меню, /hpos - изменить позицию

Библиотеки:

Moonloader
Imgui
Memory
IniCfg
Encoding

Естественно говно код!


1.png
 

Вложения

  • HUDAIKA.rar
    3.9 KB · Просмотры: 68

ARMOR

kjor32 is legend
Модератор
4,846
6,095
Напоминает меню собейта модифицированого FYP'ом
 

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,773
11,220
1. вместо того что бы каждый раз писать дохера строк проще создать одну функцию, которая будет это делать
Lua:
                                renderDrawBoxWithBorder(PosX+45, PosY + 15, 150, 8, 0x00FFFFFF, 1, 0xFF000000)
                                renderDrawBoxWithBorder(PosX+45, PosY + 15, 126, 8, 0x00FFFFFF, 1, 0xFF000000)
                                renderDrawBoxWithBorder(PosX+45, PosY + 15, 105, 8, 0x00FFFFFF, 1, 0xFF000000)
                                renderDrawBoxWithBorder(PosX+45, PosY + 15, 84, 8, 0x00FFFFFF, 1, 0xFF000000)
                                renderDrawBoxWithBorder(PosX+45, PosY + 15, 63, 8, 0x00FFFFFF, 1, 0xFF000000)
                                renderDrawBoxWithBorder(PosX+45, PosY + 15, 42, 8, 0x00FFFFFF, 1, 0xFF000000)
                                renderDrawBoxWithBorder(PosX+45, PosY + 15, 21, 8, 0x00FFFFFF, 1, 0xFF000000)
                                renderDrawBoxWithBorder(PosX+45, PosY + 15, 0, 8, 0x00FFFFFF, 1, 0xFF000000)

2. вместо
Lua:
if idw == 0 then
                            weapon = "Кулак"
                        end
                        if idw == 1 then
                            weapon = "Кастет"
                        end
                        if idw == 2 then
                            weapon = "Гольф Палка"
                        end
                        if idw == 3 then
                            weapon = "Палка"
                        end
                        if idw == 4 then
                            weapon = "Нож"
                        end
                        if idw == 5 then
                            weapon = "Бита"
                        end
                        if idw == 6 then
                            weapon = "Лопата"
                        end
                        if idw == 7 then
                            weapon = "Гольф Клюшка"
                        end
                        if idw == 8 then
                            weapon = "Катана"
                        end
                        if idw == 9 then
                            weapon = "Бензомпила"
                        end
                        if idw == 10 then
                            weapon = "Фиолетовое Дилдо"
                        end
                        if idw == 11 then
                            weapon = "Дилдо"
                        end
                        if idw == 12 then
                            weapon = "Вибратор"
                        end
                        if idw == 13 then
                            weapon = "Серебрянное дилдо"
                        end
                        if idw == 14 then
                            weapon = "Цветы"
                        end
                        if idw == 15 then
                            weapon = "Спрей"
                        end
                        if idw == 16 then
                            weapon = "Граната"
                        end
                        if idw == 17 then
                            weapon = "Газ"
                        end
                        if idw == 18 then
                            weapon = "Коктель молотова"
                        end
                        if idw == 19 then
                            weapon = "Кастет"
                        end
                        if idw == 22 then
                            weapon = "Пистолет"
                        end
                        if idw == 23 then
                            weapon = "Пистолет с глушителем"
                        end
                        if idw == 24 then
                            weapon = "Дигл"
                        end
                        if idw == 25 then
                            weapon = "Дробовик"
                        end
                        if idw == 26 then
                            weapon = "Обрез"
                        end
                        if idw == 27 then
                            weapon = "Быстрый дробовик"
                        end
                        if idw == 28 then
                            weapon = "Узи"
                        end
                        if idw == 29 then
                            weapon = "МР-5"
                        end
                        if idw == 30 then
                            weapon = "АК-47"
                        end
                        if idw == 31 then
                            weapon = "М4"
                        end
                        if idw == 32 then
                            weapon = "Тес-9"
                        end
                        if idw == 33 then
                            weapon = "Винтовка"
                        end
                        if idw == 34 then
                            weapon = "Снайперская винтовка"
                        end
                        if idw == 35 then
                            weapon = "РПГ"
                        end
                        if idw == 36 then
                            weapon = "НРПГ"
                        end
                        if idw == 37 then
                            weapon = "Огнемёт"
                        end
                        if idw == 38 then
                            weapon = "Миниган"
                        end
                        if idw == 39 then
                            weapon = "Заряд"
                        end
                        if idw == 40 then
                            weapon = "Детонатор"
                        end
                        if idw == 41 then
                            weapon = "Балончик"
                        end
                        if idw == 42 then
                            weapon = "Огнетушитель"
                        end
                        if idw == 43 then
                            weapon = "Камера"
                        end
                        if idw == 44 then
                            weapon = "Ночное зрение"
                        end
                        if idw == 45 then
                            weapon = "Тепловизор"
                        end
                        if idw == 46 then
                            weapon = "Парашют"
                        end
--
можно использовать
Lua:
local weapList = require 'game.weapons'
local name = weapList.get_name(ID ОРУЖИЯ)

3. я лучше буду бегать с оффнутым худом, чем с таким
4. вместо
Lua:
if wanted == 0 then
                        renderDrawBoxWithBorder(PosX, PosY+120, 238, 20,0xB3000000, 1, 0xFFFF0000)
                        renderFontDrawText(font1, '{7FFF00}WANTED: Вы не в розыске', PosX+15,PosY+120,0xFFFFFFFF)
                        end
                        if wanted == 1 then
                        renderDrawBoxWithBorder(PosX, PosY+120, 238, 20,0xB3000000, 1, 0xFFFF0000)
                        renderFontDrawText(font1, '{F4A460}WANTED: Уровень розыска 1', PosX+15,PosY+120,0xFFFFFFFF)
                        end
                        if wanted == 2 then
                        renderDrawBoxWithBorder(PosX, PosY+120, 238, 20,0xB3000000, 1, 0xFFFF0000)
                        renderFontDrawText(font1, '{F4A460}WANTED: Уровень розыска 2', PosX+15,PosY+120,0xFFFFFFFF)
                        end
                        if wanted == 3 then
                        renderDrawBoxWithBorder(PosX, PosY+120, 238, 20,0xB3000000, 1, 0xFFFF0000)
                        renderFontDrawText(font1, '{F4A460}WANTED: Уровень розыска 3', PosX+15,PosY+120,0xFFFFFFFF)
                        end
                        if wanted == 4 then
                        renderDrawBoxWithBorder(PosX, PosY+120, 238, 20,0xB3000000, 1, 0xFFFF0000)
                        renderFontDrawText(font1, '{F4A460}WANTED: Уровень розыска 4', PosX+15,PosY+120,0xFFFFFFFF)
                        end
                        if wanted == 5 then
                        renderDrawBoxWithBorder(PosX, PosY+120, 238, 20,0xB3000000, 1, 0xFFFF0000)
                        renderFontDrawText(font1, '{F4A460}WANTED: Уровень розыска 5', PosX+15,PosY+120,0xFFFFFFFF)
                        end
                        if wanted == 6 then
                        renderDrawBoxWithBorder(PosX, PosY+120, 238, 20,0xB3000000, 1, 0xFFFF0000)
                        renderFontDrawText(font1, '{F4A460}WANTED: Уровень розыска 6', PosX+15,PosY+120,0xFFFFFFFF)
                        end
можно было сделать так:
Lua:
renderDrawBoxWithBorder(PosX, PosY+120, 238, 20,0xB3000000, 1, 0xFFFF0000)
if wanted == 0 then 
    renderFontDrawText(font1, '{F4A460}WANTED: ты не в розыске', PosX+15,PosY+120,0xFFFFFFFF)
else
    renderFontDrawText(font1, '{F4A460}WANTED: Уровень розыска '..tostring(wanted), PosX+15,PosY+120,0xFFFFFFFF)
end
 

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,773
11,220

MAHEKEH

Известный
1,996
497
Ну если забыть про надпись оружия вместо иконки то вполне себе нормальный худ.