script_name = "BMS GameFixer" script_author = "BMS STUDIO" script_translator = "BMS Development" script_version = "11" --------------------------------------------------- local imgui = require 'imgui' local encoding = require 'encoding' local lfs = require 'lfs' encoding.default = 'UTF-8' u8 = encoding.UTF8 local memory = require 'memory' local ev = require "lib.samp.events" local rkeys = require 'rkeys' local ffi = require('ffi') imgui.HotKey = require('imgui_addons').HotKey local fa = require 'fAwesome5' local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range }) local weaponSoundDelay = {[9] = 200, [37] = 900} local soundsDir = 'moonloader/gamefixer/genrl/' local uiSoundsDir = 'moonloader/gamefixer/sounds/' ----------------- [ ini ] ----------------- local inicfg = require "inicfg" local directIni = "gamefixer.ini" local ini = inicfg.load(inicfg.load({ settings = { theme = "1", shownicks = false, showhp = false, noradio = true, showchat = true, showhud = true, bighpbar = false, weather = "1", hours = "17", min = "0", drawdist = "300", drawdistair = "1000", fog = "90", lod = "280", blockweather = true, blocktime = true, givemedist = true, targetblip = true, antiblockedplayer = true, chatt = true, unlimitfps = true, postfx = false, nobirds = false, nocloudbig = false, nocloudsmall = false, sensfix = true, nosounds = true, intmusic = false, audiostream = false, fixblackroads = false, nodust = true, effects = false, longarmfix = true, noshadows = true, waterfixquadro = true, intrun = true, shadowedit = true, mapzoom = true, mapzoomvalue = "260.0", shadowcp = "0", shadowlight = "0", vehlods = false, animmoney = "3", fixcrosshair = true, crosshairX = "64", crosshairY = "64", blockkeys = false, noplaneline = true, sunfix = false, vsync = false, radarfix = false, radarWidth = "94", radarHeight = "76", radarPosX = "40", radarPosY = "104", fixtaxilight = true, forceaniso = false, mapzoomfixer = false, dual_monitor_fix = false, radar_color_fix = false, adkfix = false, lang = "id", custom_enabled = false, custom_window_bg = "0.08,0.08,0.10,0.82", custom_text = "1.00,1.00,1.00,0.96", custom_button = "1.00,1.00,1.00,0.12", custom_child_bg = "1.00,1.00,1.00,0.06", custom_frame_bg = "1.00,1.00,1.00,0.10", custom_window_rounding = "18.0", custom_frame_rounding = "10.0", custom_alpha = "1.00", }, hphud = { active = true, hpt = false, text = 3, style = 1, pos = 2, mode = 1, }, cleaner = { autoclean = true, cleaninfo = true, limit = "1000", }, ugenrl_main = { enable = false, weapon = true, enemyWeapon = true, enemyWeaponDist = 70, hit = true, pain = true, informers = true, autonosounds = true, fastactive = "[18,85]", }, ugenrl_volume = { weapon = 1.00, hit = 1.00, pain = 1.00, }, ugenrl_sounds = { [22] = '9mm.mp3', [23] = 'Silecent-Pistol.mp3', [24] = 'Deagle1.wav', [25] = 'Shotgun.1.wav', [26] = 'Sawnoff-Shotgun.mp3', [27] = 'Combat-Shotgun.mp3', [28] = 'Uzi.mp3', [29] = 'MP5.mp3', [30] = 'AK-47.mp3', [31] = 'M4.1.wav', [32] = 'TEC-9.mp3', [33] = 'Rifle.mp3', [34] = 'Sniper.mp3', hit = 'Bell1.mp3', pain = 'Painmale1.mp3', }, fixtimecyc = { active = false, allambient = "0.800", objambient = "0.800", worldambientR = "0.800", worldambientG = "0.800", worldambientB = "0.800", }, discord = { url = "", nick = "BMS", cmd = "@", all = false, }, keyboard = { active = false, mouse = false, move = true, mode = 0, bongo_skin = 2, kx = 10, ky = 500, mx = 10, my = 200, }, music = { volume = "50", mode = 1, }, ssao = { enable = false, thick = 55, intens = 80, }, ssao_reshade = { enable = false, amount = "4.00", radius = "2.00", quality = 2, render = "0.50", fade_s = "1.00", fade_e = "1.00", }, killstate = { enable = true, show_feed = true, show_stats = true, maxfeed = 5, ksx = 300, ksy = 120, }, panelkey = { keys = "[118]", }, hudchanger = { fist = "", sitem16 = "", radardisc = "", weapon_icon = "", font_hud = "", }, commands = { openmenu = "/bmenu", givemedist = "/givemedist", drawdistance = "/dd", drawdistanceair = "/ddair", fogdistance = "/fd", loddistance = "/ld", shownicks = "/sname", showhp = "/shp", offradio = "/gameradio", clearchat = "/cc", showchat = "/showchat", showhud = "/showhud", bighpbar = "/160hp", fpslock = "/fpslock", postfx = "/postfx", antiblockedplayer = "/abplayer", animmoney = "/animmoney", chatopenfix = "/chatfix", hphud = "/hphud", hpstyle = "/hpstyle", hppos = "/hppos", hptext = "/hpt", autocleaner = "/accl", cleanmemory = "/ccl", cleaninfo = "/cclinfo", setmbforautocleaner = "/setccl", nobirds = "/nobirds", nodust = "/nodust", fixtimecyc = "/fixtimecyc", editcrosshair = "/ech", effects = "/effects", shadowedit = "/shadowedit", nocloudbig = "/nocloudbig", nocloudsmall = "/nocloudsmall", noshadows = "/noshadows", vehlods = "/vehlods", fixcrosshair = "/fixcrosshair", intrun = "/interiorrun", waterfixquadro = "/waterquadrofix", longarmfix = "/longarmfix", fixblackroads = "/fixblackroads", sensfix = "/sensfix", audiostream = "/audiostream", intmusic = "/intmusic", nosounds = "/nosounds", noplaneline = "/noplaneline", blockkeys = "/blockkeys", sunfix = "/sunfix", targetblip = "/targetblip", vsync = "/vsync", radarfix = "/radarfix", fixtaxilight = "/fixtaxilight", radarWidth = "/radarw", radarHeight = "/radarh", radarx = "/radarx", radary = "/radary", ugenrl = "/ugenrl", autonosounds = "/autonosounds", uds = "/uds", uss = "/uss", ums = "/ums", urs = "/urs", ursp = "/ursp", uuzi = "/uuzi", ump5 = "/ump5", ubs = "/ubs", ups = "/ups", ugd = "/ugd", ugvw = "/ugvw", ugvh = "/ugvh", ugvp = "/ugvp", forceaniso = "/forceaniso", mapzoomfixer = "/mapzoomfixer", shadowcp = "/shadowcp", shadowlight = "/shadowlight", dual_monitor_fix = "/dualfix", radar_color_fix = "/radarcolorfix", adkfix = "/adkfix", deletegun = "/deletegun", dhook = "/dhook", keyboard = "/keyboard", mp3pl = "/mp3pl", ssao = "/ssao", hudchanger = "/hudchanger", }, }, directIni)) -- migrasi: bersihkan section/field lama yg sudah tidak dipakai (tab Fist dihapus, hudchanger dirapikan) pcall(function() if ini.fist then ini.fist = nil end if ini.hudchanger then if ini.hudchanger.enable ~= nil then ini.hudchanger.enable = nil end if ini.hudchanger.fist_x ~= nil then ini.hudchanger.fist_x = nil end if ini.hudchanger.fist_y ~= nil then ini.hudchanger.fist_y = nil end if ini.hudchanger.radar_set ~= nil then ini.hudchanger.radar_set = nil end if ini.hudchanger.radar_apply ~= nil then ini.hudchanger.radar_apply = nil end if ini.hudchanger.copy_from_mod ~= nil then ini.hudchanger.copy_from_mod = nil end end end) inicfg.save(ini, directIni) function save() inicfg.save(ini, directIni) end ------------- [ i18n ] ------------- local LANG = { id = { ["GameFixer"] = "BMS GameFixer", ["Main"] = "Utama", ["Fixes"] = "Perbaikan", ["Boost FPS"] = "Tingkat FPS", ["UGenrl"] = "UGenrl", ["Commands"] = "Perintah", ["Settings"] = "Pengaturan", ["Automatic map scaling"] = "Skala peta otomatis", ["Map zoom out:"] = "Perbesar peta:", ["Money Animation:"] = "Animasi uang:", ["Fast"] = "Cepat", ["No Animation"] = "Tanpa Animasi", ["Default"] = "Standar", ["Sight size X:"] = "Ukuran bidik X:", ["Sight size in Y:"] = "Ukuran bidik Y:", ["Weather and time editor"] = "Pengatur cuaca & waktu", ["Weather:"] = "Cuaca:", ["Time:"] = "Jam:", ["Minutes:"] = "Menit:", ["Freeze Weather"] = "Kunci cuaca", ["Freeze Time"] = "Kunci waktu", ["HP HUD"] = "HP HUD", ["Health Indicator Font:"] = "Font indikator HP:", ["Health Indicator Position:"] = "Posisi indikator HP:", ["Show 'HP' Behind Numbers"] = "Tampilkan 'HP' di belakang angka", ["160 HP Bar"] = "Bar HP 160", ["Radio"] = "Radio", ["Sound"] = "Suara", ["InteriorMusic"] = "Musik interior", ["Audiostream"] = "Audio stream", ["Clear Chat"] = "Bersihkan chat", ["TargetBlip"] = "Penanda target", ["SA-MP Keys Lock"] = "Kunci tombol SA-MP", ["Vsync"] = "Vsync", ["Getting Stuck in other players Fix"] = "Perbaikan tersangkut pemain lain", ["Chat Opening Fix"] = "Perbaikan buka chat", ["Sensitivity Fix"] = "Perbaikan sensitivitas", ["BlackRoads Fix"] = "Perbaikan jalan hitam", ["Ninja Hijack Fix"] = "Perbaikan ninja hijack", ["LongArm Fix"] = "Perbaikan lengan panjang", ["Square Water Fix"] = "Perbaikan air kotak", ["InteriorRun Fix"] = "Perbaikan lari interior", ["Crosshair White Dot Fix"] = "Perbaikan titik putih bidik", ["Bring Back Sun"] = "Kembalikan matahari", ["Taxi Light fix"] = "Perbaikan lampu taksi", ["DualMonitorFix"] = "Perbaikan dua monitor", ["Texture Correction/Anisotropic"] = "Koreksi tekstur/Anisotropik", ["Map Zom Low Sensitivity Fix"] = "Perbaikan zoom peta", ["Radar Outline Fix"] = "Perbaikan garis radar", ["Radar Fix"] = "Perbaikan radar", ["Radar Width"] = "Lebar radar", ["Radar Height"] = "Tinggi radar", ["Radar Position X"] = "Posisi radar X", ["Radar Position Y"] = "Posisi radar Y", ["NickNames"] = "Nama pemain", ["PlayerHP"] = "HP pemain", ["Chat"] = "Chat", ["HUD"] = "HUD", ["FPS unlock"] = "Buka batas FPS", ["Postfx"] = "Efek pasca", ["Low Clouds"] = "Awan rendah", ["High Clouds"] = "Awan tinggi", ["Birds"] = "Burung", ["Effects"] = "Efek", ["VehLods"] = "LOD kendaraan", ["Shadows"] = "Bayangan", ["Dust"] = "Debu", ["Plane Lines"] = "Jejak pesawat", ["Ability to Change Distance"] = "Kemampuan ubah jarak", ["Draw Distance:"] = "Jarak render:", ["In Air Draw Distance:"] = "Jarak render udara:", ["Fog Distance:"] = "Jarak kabut:", ["Lod Distance:"] = "Jarak LOD:", ["Shadow Editor"] = "Pengatur bayangan", ["Ability to Edit Shadows"] = "Kemampuan edit bayangan", ["Main Shadow:"] = "Bayangan utama:", ["Shadow Light:"] = "Cahaya bayangan:", ["Timecycle Fix"] = "Perbaikan timecycle", ["All Ambient:"] = "Ambient total:", ["Object Ambient:"] = "Ambient objek:", ["World Ambient_R:"] = "Ambient dunia R:", ["World Ambient_G:"] = "Ambient dunia G:", ["World Ambient_B:"] = "Ambient dunia B:", ["CCL"] = "Bersihkan RAM", ["Show message about CCL"] = "Tampilkan pesan CCL", ["Clean Memory"] = "Bersihkan memori", ["Limit For CCL:"] = "Batas CCL:", ["Enable Ultimate Genrl"] = "Aktifkan Ultimate Genrl", ["Automatically Disable game sound when Ultimate Genrl is Enabled"] = "Matikan suara game otomatis saat UG aktif", ["Shots Sound"] = "Suara tembakan", ["Shot Sounds"] = "Suara tembakan musuh", ["Hitsound"] = "Suara kena", ["PainSound"] = "Suara kesakitan", ["Quick Activation / Deactivation Ultimate Genrl:"] = "Aktifasi cepat Ultimate Genrl:", ["Deagle Sounds:"] = "Suara Deagle:", ["Shotgun Sounds:"] = "Suara Shotgun:", ["M4 Sounds:"] = "Suara M4:", ["Rifle Sounds:"] = "Suara Rifle:", ["Sniper Sounds:"] = "Suara Sniper:", ["Mp5 Sounds:"] = "Suara MP5:", ["Uzi Sounds:"] = "Suara Uzi:", ["HitSounds:"] = "Suara kena:", ["PainSounds:"] = "Suara kesakitan:", ["Sound volume:"] = "Volume suara:", ["Shot Sound Range:"] = "Jarak dengar tembakan:", ["Command to open menu"] = "Perintah membuka menu", ["Enable / Disable Ability to change Distance"] = "Aktif/Nonaktif kemampuan ubah jarak", ["Change Draw Distance"] = "Ubah jarak render", ["Change In Air Draw Distance"] = "Ubah jarak render udara", ["Change Fog Distance"] = "Ubah jarak kabut", ["Change Lod Distance"] = "Ubah jarak LOD", ["Show / Hide NickNames"] = "Tampil/Sembunyi nama pemain", ["Show / Hide Player Health Indicator"] = "Tampil/Sembunyi indikator HP pemain", ["Enable / Disable Radio"] = "Aktif/Nonaktif radio", ["Hide / Show Chat"] = "Sembunyi/Tampil chat", ["Hide / Show HUD"] = "Sembunyi/Tampil HUD", ["Change The Speed of Increasing / Decreasing Money"] = "Ubah kecepatan animasi uang", ["Enable / Disable 160HP Bar"] = "Aktif/Nonaktif bar HP 160", ["Enable / Disable FPS Unlock"] = "Aktif/Nonaktif buka batas FPS", ["Enable / Disable PostFX"] = "Aktif/Nonaktif efek pasca", ["Enable / Disable AntiStuck"] = "Aktif/Nonaktif anti-tersangkut", ["Enable / Disable Chat Opening on E Fix"] = "Aktif/Nonaktif perbaikan buka chat", ["Enable / Disable Digital Health Indicator"] = "Aktif/Nonaktif indikator HP digital", ["Change Style of Digital Health Indicator"] = "Ubah gaya indikator HP", ["Change Position of Digital Health Indicator"] = "Ubah posisi indikator HP", ["Enable / Disable 'HP' behind Numbers"] = "Aktif/Nonaktif 'HP' di belakang angka", ["Enable / Disable Auto CCL"] = "Aktif/Nonaktif CCL otomatis", ["Enable / Disable CCl Message"] = "Aktif/Nonaktif pesan CCL", ["Limit for CCL"] = "Batas untuk CCL", ["Enable / Disable Birds"] = "Aktif/Nonaktif burung", ["Enable / Disable Dust"] = "Aktif/Nonaktif debu", ["Enable / Disable Timecycle Fix"] = "Aktif/Nonaktif perbaikan timecycle", ["Enable / Disable Effects"] = "Aktif/Nonaktif efek", ["Resize Crosshair"] = "Ubah ukuran bidik", ["Enable / Disable Ability to Edit Shadows"] = "Aktif/Nonaktif edit bayangan", ["Enable / Disable High Clouds"] = "Aktif/Nonaktif awan tinggi", ["Enable / Disable Low Clouds"] = "Aktif/Nonaktif awan rendah", ["Enable / Disable Shadows"] = "Aktif/Nonaktif bayangan", ["Enable / Disable VehLods"] = "Aktif/Nonaktif LOD kendaraan", ["Enable / Disable Crosshair White Dot Fix"] = "Aktif/Nonaktif titik putih bidik", ["Enable / Disable Interior Running Fix"] = "Aktif/Nonaktif lari interior", ["Enable / Disable Ninja Hijack Fix"] = "Aktif/Nonaktif ninja hijack", ["Enable / Disable Square Water Fix"] = "Aktif/Nonaktif air kotak", ["Enable / Disable Long Arm Fix"] = "Aktif/Nonaktif lengan panjang", ["Enable / Disable BlackRoads Fix"] = "Aktif/Nonaktif jalan hitam", ["Enable / Disable Sensitivity Fix"] = "Aktif/Nonaktif sensitivitas", ["Enable / Disable Audiostream"] = "Aktif/Nonaktif audio stream", ["Enable / Disable InteriorMusic"] = "Aktif/Nonaktif musik interior", ["Enable / Disable Sounds"] = "Aktif/Nonaktif suara", ["Enable / Disable SA-MP Key Lock"] = "Aktif/Nonaktif kunci tombol SA-MP", ["Enable / Disable Plane Lines"] = "Aktif/Nonaktif jejak pesawat", ["Enable / Disable SunFix / Bring Back Sun"] = "Aktif/Nonaktif matahari", ["Enable / Disable TargetBlip"] = "Aktif/Nonaktif penanda target", ["Enable / Disable Vsync"] = "Aktif/Nonaktif vsync", ["Enable / Disable Radar Outline Fix"] = "Aktif/Nonaktif garis radar", ["Enable / Disable Radar Fix"] = "Aktif/Nonaktif perbaikan radar", ["Enable / Disable DualMonitorFix"] = "Aktif/Nonaktif dua monitor", ["Enable / Disable TaxiLightFix"] = "Aktif/Nonaktif lampu taksi", ["Edit Radar Width"] = "Ubah lebar radar", ["Edit Radar Height"] = "Ubah tinggi radar", ["Edit Radar Position X"] = "Ubah posisi radar X", ["Edit Radar Position Y"] = "Ubah posisi radar Y", ["Enable / Disable Ultimate Genrl"] = "Aktif/Nonaktif Ultimate Genrl", ["Enable / Disable Automatically Disable game Sound When Ultimate Genrl Is Enabled "] = "Aktif/Nonaktif suara otomatis saat UG aktif", ["Change Deagle Sound"] = "Ubah suara Deagle", ["Change Shotgun Sound"] = "Ubah suara Shotgun", ["Change M4 Sound"] = "Ubah suara M4", ["Change Rifle Sound"] = "Ubah suara Rifle", ["Change Uzi Sound"] = "Ubah suara Uzi", ["Change Mp5 Sound"] = "Ubah suara MP5", ["Change HitSound"] = "Ubah suara kena", ["Change PainSound"] = "Ubah suara kesakitan", ["Change Shot Sound Range"] = "Ubah jarak dengar tembakan", ["Change Volume of Shots"] = "Ubah volume tembakan", ["Change HitSound Volume"] = "Ubah volume suara kena", ["Change PainSound Volume"] = "Ubah volume suara kesakitan", ["Enable / Disable Anisotropic"] = "Aktif/Nonaktif anisotropik", ["Enable / Disable MapZoomFix"] = "Aktif/Nonaktif perbaikan zoom peta", ["Edit Main Shadow"] = "Ubah bayangan utama", ["Edit Shadow Light"] = "Ubah cahaya bayangan", ["Change Theme:"] = "Ganti Tema:", ["Language:"] = "Bahasa:", ["Indonesia"] = "Indonesia", ["English"] = "Inggris", ["Enable"] = "Aktifkan", ["Disable"] = "Nonaktifkan", ["Show"] = "Tampilkan", ["Hide"] = "Sembunyikan", ["Digital Health Indicator"] = "Indikator HP digital", ["Loaded. Open menu:"] = "Dimuat. Buka menu:", ["Loading"] = "Memuat...", ["BMS GameFixer v11"] = "BMS GameFixer v11", ["By BMS STUDIO"] = "oleh BMS STUDIO", ["Dark Mode"] = "Mode Gelap", ["Light Mode"] = "Mode Terang", ["Custom Colors"] = "Warna Kustom", ["Enable Custom Colors"] = "Aktifkan Warna Kustom", ["Window Background"] = "Latar Jendela", ["Text Color"] = "Warna Teks", ["Button Color"] = "Warna Tombol", ["Child Bg"] = "Latar Anak", ["Frame Bg"] = "Latar Bingkai", ["Window Rounding"] = "Kelengkungan Jendela", ["Frame Rounding"] = "Kelengkungan Bingkai", ["Alpha"] = "Alpha", ["Distance Editor"] = "Editor Jarak", ["Shadow Editor"] = "Editor Bayangan", ["Timecycle Fix"] = "Perbaikan Timecycle", ["CCL"] = "Bersihkan RAM", ["Enable / Disable Distance Editor"] = "Aktif/Nonaktif Editor Jarak", ["Enable / Disable Shadow Editor"] = "Aktif/Nonaktif Editor Bayangan", ["Enable / Disable Timecycle Fix"] = "Aktif/Nonaktif Perbaikan Timecycle", ["Enable / Disable CCL"] = "Aktif/Nonaktif CCL", ["Sound Effects"] = "Efek Suara", ["Tools"] = "Alat", ["Discord Webhook"] = "Discord Webhook", ["Discord Active"] = "Aktif (kirim chat ke Discord)", ["Discord Name"] = "Nama pengirim", ["Discord URL"] = "URL Webhook", ["Discord Command"] = "Perintah chat (cth @)", ["Save"] = "Simpan", ["Send Test"] = "Kirim Tes", ["No URL set"] = "URL belum diisi — simpan URL webhook dulu", ["Keyboard Overlay"] = "Overlay Keyboard", ["Show Keyboard"] = "Tampilkan keyboard", ["Show Mouse"] = "Tampilkan mouse", ["Allow Window Move"] = "Overlay bisa digeser", ["Keyboard Mode"] = "Model keyboard", ["KB Full"] = "Penuh", ["KB NumPad"] = "NumPad", ["KB Small"] = "Kecil", ["KB Mini"] = "Mini", ["KB Compact"] = "Kompak", ["Toggle Discord Webhook"] = "Aktif/Nonaktif Discord webhook", ["Toggle Keyboard Overlay"] = "Aktif/Nonaktif overlay keyboard", ["MP3 Player"] = "MP3 Player", ["Music Offline"] = "Musik Offline", ["Music Online"] = "Musik Online", ["Play This Song"] = "Putar lagu ini", ["Pause"] = "Jeda", ["Continue"] = "Lanjut", ["Stop"] = "Berhenti", ["Volume"] = "Volume", ["Online Link Hint"] = "Di bawah, masukkan link langsung lagu/radio online.", ["Run Via Link"] = "Putar via link", ["No Tracks"] = "Belum ada mp3 di folder moonloader/MP3 Player", ["Open MP3 Player"] = "Buka MP3 Player", ["Fist"] = "Fist", ["Fist Name"] = "Nama fist", ["Position X"] = "Posisi X", ["Position Y"] = "Posisi Y", ["Apply Fist"] = "Pasang Fist", ["Fist Presets"] = "Preset cepat (1-5)", ["Fist Hint"] = "Butuh fist_by_rvng.luac + folder resource (sudah dipasang) dan fist transparan di hud.txd. Nama salah = kotak putih. Matikan = sprite diparkir di luar layar.", ["Enable Fist"] = "Aktifkan Fist", ["Fist Sent"] = "Terkirim: ", ["Fist Chat Busy"] = "Chat sedang dipakai — tutup dulu lalu ulangi.", ["SSAO"] = "SSAO", ["Enable SSAO"] = "Aktifkan SSAO", ["Thickness"] = "Ketebalan", ["Intensity"] = "Intensitas", ["Thin"] = "Tipis", ["Medium"] = "Sedang", ["Thick"] = "Tebal", ["SSAO Preset"] = "Preset cepat", ["SSAO Hint"] = "Fake AO ringan (bukan SSAO depth-buffer). Memakai Timecycle & Shadow yang sama — perubahan di sini ikut mengubah tab Fixes, dan sebaliknya. Butuh ENB/ReShade untuk hasil 100%.", ["Fake AO"] = "Fake AO", ["SSAO Active"] = "Aktif", ["SSAO Inactive"] = "Mati", ["Toggle SSAO"] = "Aktif/Nonaktif SSAO (Fake AO)", ["Open HUDChanger"] = "Buka tab HUDChanger", ["Open"] = "Buka", ["SSAO Real"] = "SSAO Real (ReShade MXAO)", ["Install SSAO"] = "Install SSAO", ["SSAO Installed"] = "Terpasang", ["SSAO Not Installed"] = "Belum terpasang — klik Install", ["Reload ReShade"] = "Reload ReShade", ["MXAO Amount"] = "Kekuatan MXAO", ["MXAO Radius"] = "Radius MXAO", ["MXAO Quality"] = "Kualitas MXAO", ["SSAO Real Hint"] = "SSAO asli dari ReShade (qUINT MXAO, paket RESHADE FREEZIN Step 3). Install menyalin shader ke folder GTA + mengatur preset. Toggle butuh reload ReShade. Jangan nyalakan Fake AO bersamaan.", ["Fake AO Fallback"] = "Fake AO (cadangan bila ReShade belum install)", ["Open GTA Folder"] = "Buka Folder SSAO", ["Uninstall SSAO"] = "Sterilkan Root", ["Need Restart"] = "Butuh restart game (injector/log belum segar)", ["Open Log"] = "Buka Log", ["Debug View"] = "Lihat Debug", ["Render Scale"] = "Skala Render", ["Fade Start"] = "Awal Jarak", ["Fade End"] = "Akhir Jarak", ["Light Preset"] = "Mode Ringan", ["Injector Missing"] = "Injector tidak ada (root steril)", ["SSAO Thickness"] = "Tebal-tipis SSAO", ["KillState"] = "KillState", ["KillState Info"] = "Status kill & overlay", ["Enable KillState"] = "Aktifkan KillState", ["KillState Installed"] = "Terpasang", ["KillState Not Installed"] = "Belum terpasang", ["KillState Enabled"] = "Aktif", ["KillState Disabled"] = "Mati", ["KillState File"] = "File: moonloader/killstate.lua", ["KillState Version"] = "Versi: 2.4 (luacrypted)", ["KillState Hint"] = "KillState native di dalam GameFixer (tanpa file killstate.lua eksternal): kill feed + K/D + akurasi. Toggle langsung tampil/hilang — tanpa reload, tanpa restart.", ["KS Show Feed"] = "Tampilkan feed", ["KS Show Stats"] = "Tampilkan statistik", ["KS Max"] = "Maks feed", ["KS Clear"] = "Bersihkan feed", ["KS Reset"] = "Reset statistik", ["Reload Scripts"] = "Reload Scripts", ["Open Folder"] = "Buka Folder", ["Copy From Mod"] = "Copy dari mod gta", -- BMS SENSFIX NATIVE 2026-09-05 (pengganti sensfix.asi) ["SensFix"] = "SensFix", ["SensFix Sub"] = "Sensitivitas mouse (native, tanpa ASI)", ["Enable SensFix"] = "Aktifkan SensFix", ["SensFix Installed"] = "Terpasang", ["SensFix Not Installed"] = "Belum aktif", ["SensFix Enabled"] = "Aktif", ["SensFix Disabled"] = "Mati", ["Sens Global"] = "Global", ["Sens Aiming"] = "Membidik", ["Sens Sniper"] = "Sniper", ["Sens Preset"] = "Preset cepat", ["Sens Default"] = "Bawaan", ["Sens Steady"] = "Stabil", ["Sens Fast"] = "Cepat", ["Sens Lock Sniper"] = "Kunci Sniper", ["SensFix Hint"] = "Pengganti sensfix.asi di dalam panel: 4 titik sensitivitas game di-patch langsung di memori (lihat biasa + membidik). Berlaku LANGSUNG tanpa restart. Nilai tersimpan di moonloader/config/sensfix.ini.", ["Sens Live Note"] = "Aktif langsung — tanpa restart game. sensfix.asi sudah tidak dibutuhkan (boleh dihapus).", ["Sens Classic Note"] = "Mode Sniper otomatis saat senjata sniper di tangan; atau centang Kunci Sniper.", -- BMS HUDCHANGER 2026-09-06 (tab "HUDChanger" - manajemen texture HUD) ["HUDChanger"] = "HUDChanger", ["HUDChanger Sub"] = "Ganti texture HUD (fist, crosshair, radardisc, weapon icon, font, radar map)", ["HUDChanger Folder"] = "Folder sumber", ["HUDChanger Source"] = "Sumber: C:\\Users\\Admin\\Documents\\mod gta\\HUD CHANGER\\monetloader\\loader\\", ["HUDChanger Dest"] = "Tujuan: moonloader/gamefixer/hudchanger/ (otomatis tercopy)", ["HUDChanger Files"] = "File di folder", ["HUDChanger Apply"] = "Pakai", ["HUDChanger Reset"] = "Reset ke default", ["HUDChanger None"] = "(kosong)", ["HUDChanger Installed"] = "Terpasang", ["HUDChanger Not Installed"] = "Belum terpasang", ["HUDChanger Copied"] = "disalin ke moonloader/gamefixer/hudchanger/", ["HUDChanger No Source"] = "Folder sumber mod tidak ditemukan — taruh file langsung ke folder tujuan lalu Refresh.", ["HC Apply Game"] = "Pasang ke Game", ["HC Restore"] = "Kembalikan TXD", ["HC Game Hint"] = "Menulis PNG langsung ke models/hud.txd & fonts.txd (backup otomatis *.bms-bak). Berlaku setelah restart game.", ["HUDChanger Empty"] = "Folder kosong. Taruh file .png ke folder sumber.", ["HUDChanger ApplyHint"] = "Pilih file dari daftar lalu klik Pakai. Restart radar map butuh reload.", ["HC Fist"] = "Fist (Tangan)", ["HC Fist Sub"] = "Mengganti sprite fist (tangan) di HUD. Nama file = nama texture (lihat nama asli fist di hud.txd).", ["HC Fist ApplyHint"] = "Nama salah = sprite putih. Matikan = sprite diparkir di luar layar (koordinat 9999 9999).", ["HC Crosshair"] = "Crosshair (SiteM16)", ["HC Crosshair Sub"] = "Mengganti sprite crosshair site M16.", ["HC Radardisc"] = "Radar Disc", ["HC Radardisc Sub"] = "Mengganti titik-titik radar di minimap.", ["HC Weapon Icon"] = "Weapon Icon", ["HC Weapon Icon Sub"] = "Mengganti icon senjata di HUD. Nama file WAJIB sama dengan nama texture weapon icon GTA SA (mis. desert_eagleicon.png, ak47icon.png).", ["HC Weapon Icon Warn"] = "Nama tidak cocok dengan GTA SA = icon tidak berubah.", ["HC Font"] = "Font HUD", ["HC Font Sub"] = "Mengganti font HUD. Nama file WAJIB font1.png dan font2.png (hanya 2 slot ini yang dipakai).", ["HC Font Warn"] = "Hanya font1 dan font2 yang dibaca sistem.", ["HC Radar Map"] = "Radar Map (radar0.txd .. radar143.txd)", ["HC Radar Map Sub"] = "Tile radar untuk peta. Salin TXD ke folder GTA/models/ lalu request untuk load.", ["HC Radar Map Action"] = "Pasang ke GTA/models/", ["HC Radar Map Reload"] = "Reload Models (radarXXX)", ["HC Radar Map Reset"] = "Hapus dari GTA/models/", ["HC Radar Map Installed"] = "Terpasang di GTA/models/ (TXD HUD Map aktif).", ["HC Radar Map ResetDone"] = "File telah dihapus dari GTA/models/.", ["HUDChanger Manager"] = "Manajer HUDChanger", ["HUDChanger Open Folder"] = "Buka Folder", ["HUDChanger Copy All"] = "Salin Semua dari mod gta", ["HC Restart Needed"] = "Butuh restart agar texture dimuat game (TXD di-mount saat startup).", ["KB Bongo"] = "Bongo Cat", ["KB Bongo Skin"] = "Skin kucing (1-4)", ["Panel Key"] = "Tombol panel", }, en = { ["GameFixer"] = "BMS GameFixer", ["Main"] = "Main", ["Fixes"] = "Fixes", ["Boost FPS"] = "Boost FPS", ["UGenrl"] = "UGenrl", ["Commands"] = "Commands", ["Settings"] = "Settings", ["Change Theme:"] = "Change Theme:", ["Language:"] = "Language:", ["Indonesia"] = "Indonesia", ["English"] = "English", ["Dark Mode"] = "Dark Mode", ["Light Mode"] = "Light Mode", ["Loading"] = "Loading...", ["Enable Custom Colors"] = "Enable Custom Colors", ["Window Background"] = "Window Background", ["Text Color"] = "Text Color", ["Button Color"] = "Button Color", ["Child Bg"] = "Child Bg", ["Frame Bg"] = "Frame Bg", ["Automatic map scaling"] = "Automatic map scaling", ["Radar Fix"] = "Radar Fix", ["Window Rounding"] = "Window Rounding", ["Frame Rounding"] = "Frame Rounding", ["Alpha"] = "Alpha", ["Distance Editor"] = "Distance Editor", ["Shadow Editor"] = "Shadow Editor", ["Timecycle Fix"] = "Timecycle Fix", ["CCL"] = "Clean RAM", ["Enable / Disable Distance Editor"] = "Enable / Disable Distance Editor", ["Enable / Disable Shadow Editor"] = "Enable / Disable Shadow Editor", ["Enable / Disable Timecycle Fix"] = "Enable / Disable Timecycle Fix", ["Enable / Disable CCL"] = "Enable / Disable CCL", ["Sound Effects"] = "Sound Effects", -- tambahkan semua kunci dari id yang hilang ["Radar Width"] = "Radar Width", ["Radar Height"] = "Radar Height", ["Radar Position X"] = "Radar Position X", ["Radar Position Y"] = "Radar Position Y", ["Sight size X:"] = "Sight size X:", ["Sight size in Y:"] = "Sight size in Y:", ["Weather and time editor"] = "Weather and time editor", ["Weather:"] = "Weather:", ["Time:"] = "Time:", ["Minutes:"] = "Minutes:", ["Freeze Weather"] = "Freeze Weather", ["Freeze Time"] = "Freeze Time", ["HP HUD"] = "HP HUD", ["Health Indicator Font:"] = "Health Indicator Font:", ["Health Indicator Position:"] = "Health Indicator Position:", ["Show 'HP' Behind Numbers"] = "Show 'HP' Behind Numbers", ["160 HP Bar"] = "160 HP Bar", ["Radio"] = "Radio", ["Sound"] = "Sound", ["InteriorMusic"] = "Interior Music", ["Audiostream"] = "Audio Stream", ["Clear Chat"] = "Clear Chat", ["TargetBlip"] = "Target Blip", ["SA-MP Keys Lock"] = "SA-MP Keys Lock", ["Vsync"] = "Vsync", ["Getting Stuck in other players Fix"] = "Getting Stuck in other players Fix", ["Chat Opening Fix"] = "Chat Opening Fix", ["Sensitivity Fix"] = "Sensitivity Fix", ["BlackRoads Fix"] = "BlackRoads Fix", ["Ninja Hijack Fix"] = "Ninja Hijack Fix", ["LongArm Fix"] = "LongArm Fix", ["Square Water Fix"] = "Square Water Fix", ["InteriorRun Fix"] = "InteriorRun Fix", ["Crosshair White Dot Fix"] = "Crosshair White Dot Fix", ["Bring Back Sun"] = "Bring Back Sun", ["Taxi Light fix"] = "Taxi Light fix", ["DualMonitorFix"] = "Dual Monitor Fix", ["Texture Correction/Anisotropic"] = "Texture Correction/Anisotropic", ["Map Zom Low Sensitivity Fix"] = "Map Zoom Low Sensitivity Fix", ["Radar Outline Fix"] = "Radar Outline Fix", ["Radar Fix"] = "Radar Fix", ["NickNames"] = "NickNames", ["PlayerHP"] = "Player HP", ["Chat"] = "Chat", ["HUD"] = "HUD", ["FPS unlock"] = "FPS unlock", ["Postfx"] = "Postfx", ["Low Clouds"] = "Low Clouds", ["High Clouds"] = "High Clouds", ["Birds"] = "Birds", ["Effects"] = "Effects", ["VehLods"] = "VehLods", ["Shadows"] = "Shadows", ["Dust"] = "Dust", ["Plane Lines"] = "Plane Lines", ["Ability to Change Distance"] = "Ability to Change Distance", ["Draw Distance:"] = "Draw Distance:", ["In Air Draw Distance:"] = "In Air Draw Distance:", ["Fog Distance:"] = "Fog Distance:", ["Lod Distance:"] = "Lod Distance:", ["Ability to Edit Shadows"] = "Ability to Edit Shadows", ["Main Shadow:"] = "Main Shadow:", ["Shadow Light:"] = "Shadow Light:", ["All Ambient:"] = "All Ambient:", ["Object Ambient:"] = "Object Ambient:", ["World Ambient_R:"] = "World Ambient_R:", ["World Ambient_G:"] = "World Ambient_G:", ["World Ambient_B:"] = "World Ambient_B:", ["Show message about CCL"] = "Show message about CCL", ["Clean Memory"] = "Clean Memory", ["Limit For CCL:"] = "Limit For CCL:", ["Enable Ultimate Genrl"] = "Enable Ultimate Genrl", ["Automatically Disable game sound when Ultimate Genrl is Enabled"] = "Automatically Disable game sound when Ultimate Genrl is Enabled", ["Shots Sound"] = "Shots Sound", ["Shot Sounds"] = "Shot Sounds", ["Hitsound"] = "Hitsound", ["PainSound"] = "PainSound", ["Quick Activation / Deactivation Ultimate Genrl:"] = "Quick Activation / Deactivation Ultimate Genrl:", ["Deagle Sounds:"] = "Deagle Sounds:", ["Shotgun Sounds:"] = "Shotgun Sounds:", ["M4 Sounds:"] = "M4 Sounds:", ["Rifle Sounds:"] = "Rifle Sounds:", ["Sniper Sounds:"] = "Sniper Sounds:", ["Mp5 Sounds:"] = "Mp5 Sounds:", ["Uzi Sounds:"] = "Uzi Sounds:", ["HitSounds:"] = "HitSounds:", ["PainSounds:"] = "PainSounds:", ["Sound volume:"] = "Sound volume:", ["Shot Sound Range:"] = "Shot Sound Range:", ["Command to open menu"] = "Command to open menu", ["Enable / Disable Ability to change Distance"] = "Enable / Disable Ability to change Distance", ["Change Draw Distance"] = "Change Draw Distance", ["Change In Air Draw Distance"] = "Change In Air Draw Distance", ["Change Fog Distance"] = "Change Fog Distance", ["Change Lod Distance"] = "Change Lod Distance", ["Show / Hide NickNames"] = "Show / Hide NickNames", ["Show / Hide Player Health Indicator"] = "Show / Hide Player Health Indicator", ["Enable / Disable Radio"] = "Enable / Disable Radio", ["Hide / Show Chat"] = "Hide / Show Chat", ["Hide / Show HUD"] = "Hide / Show HUD", ["Change The Speed of Increasing / Decreasing Money"] = "Change The Speed of Increasing / Decreasing Money", ["Enable / Disable 160HP Bar"] = "Enable / Disable 160HP Bar", ["Enable / Disable FPS Unlock"] = "Enable / Disable FPS Unlock", ["Enable / Disable PostFX"] = "Enable / Disable PostFX", ["Enable / Disable AntiStuck"] = "Enable / Disable AntiStuck", ["Enable / Disable Chat Opening on E Fix"] = "Enable / Disable Chat Opening on E Fix", ["Enable / Disable Digital Health Indicator"] = "Enable / Disable Digital Health Indicator", ["Change Style of Digital Health Indicator"] = "Change Style of Digital Health Indicator", ["Change Position of Digital Health Indicator"] = "Change Position of Digital Health Indicator", ["Enable / Disable 'HP' behind Numbers"] = "Enable / Disable 'HP' behind Numbers", ["Enable / Disable Auto CCL"] = "Enable / Disable Auto CCL", ["Enable / Disable CCl Message"] = "Enable / Disable CCl Message", ["Limit for CCL"] = "Limit for CCL", ["Enable / Disable Birds"] = "Enable / Disable Birds", ["Enable / Disable Dust"] = "Enable / Disable Dust", ["Enable / Disable Timecycle Fix"] = "Enable / Disable Timecycle Fix", ["Enable / Disable Effects"] = "Enable / Disable Effects", ["Resize Crosshair"] = "Resize Crosshair", ["Enable / Disable Ability to Edit Shadows"] = "Enable / Disable Ability to Edit Shadows", ["Enable / Disable High Clouds"] = "Enable / Disable High Clouds", ["Enable / Disable Low Clouds"] = "Enable / Disable Low Clouds", ["Enable / Disable Shadows"] = "Enable / Disable Shadows", ["Enable / Disable VehLods"] = "Enable / Disable VehLods", ["Enable / Disable Crosshair White Dot Fix"] = "Enable / Disable Crosshair White Dot Fix", ["Enable / Disable Interior Running Fix"] = "Enable / Disable Interior Running Fix", ["Enable / Disable Ninja Hijack Fix"] = "Enable / Disable Ninja Hijack Fix", ["Enable / Disable Square Water Fix"] = "Enable / Disable Square Water Fix", ["Enable / Disable Long Arm Fix"] = "Enable / Disable Long Arm Fix", ["Enable / Disable BlackRoads Fix"] = "Enable / Disable BlackRoads Fix", ["Enable / Disable Sensitivity Fix"] = "Enable / Disable Sensitivity Fix", ["Enable / Disable Audiostream"] = "Enable / Disable Audiostream", ["Enable / Disable InteriorMusic"] = "Enable / Disable InteriorMusic", ["Enable / Disable Sounds"] = "Enable / Disable Sounds", ["Enable / Disable SA-MP Key Lock"] = "Enable / Disable SA-MP Key Lock", ["Enable / Disable Plane Lines"] = "Enable / Disable Plane Lines", ["Enable / Disable SunFix / Bring Back Sun"] = "Enable / Disable SunFix / Bring Back Sun", ["Enable / Disable TargetBlip"] = "Enable / Disable TargetBlip", ["Enable / Disable Vsync"] = "Enable / Disable Vsync", ["Enable / Disable Radar Outline Fix"] = "Enable / Disable Radar Outline Fix", ["Enable / Disable Radar Fix"] = "Enable / Disable Radar Fix", ["Enable / Disable DualMonitorFix"] = "Enable / Disable DualMonitorFix", ["Enable / Disable TaxiLightFix"] = "Enable / Disable TaxiLightFix", ["Edit Radar Width"] = "Edit Radar Width", ["Edit Radar Height"] = "Edit Radar Height", ["Edit Radar Position X"] = "Edit Radar Position X", ["Edit Radar Position Y"] = "Edit Radar Position Y", ["Enable / Disable Ultimate Genrl"] = "Enable / Disable Ultimate Genrl", ["Enable / Disable Automatically Disable game Sound When Ultimate Genrl Is Enabled "] = "Enable / Disable Automatically Disable game Sound When Ultimate Genrl Is Enabled ", ["Change Deagle Sound"] = "Change Deagle Sound", ["Change Shotgun Sound"] = "Change Shotgun Sound", ["Change M4 Sound"] = "Change M4 Sound", ["Change Rifle Sound"] = "Change Rifle Sound", ["Change Uzi Sound"] = "Change Uzi Sound", ["Change Mp5 Sound"] = "Change Mp5 Sound", ["Change HitSound"] = "Change HitSound", ["Change PainSound"] = "Change PainSound", ["Change Shot Sound Range"] = "Change Shot Sound Range", ["Change Volume of Shots"] = "Change Volume of Shots", ["Change HitSound Volume"] = "Change HitSound Volume", ["Change PainSound Volume"] = "Change PainSound Volume", ["Enable / Disable Anisotropic"] = "Enable / Disable Anisotropic", ["Enable / Disable MapZoomFix"] = "Enable / Disable MapZoomFix", ["Edit Main Shadow"] = "Edit Main Shadow", ["Edit Shadow Light"] = "Edit Shadow Light", ["Enable"] = "Enable", ["Disable"] = "Disable", ["Show"] = "Show", ["Hide"] = "Hide", ["Digital Health Indicator"] = "Digital Health Indicator", ["Loaded. Open menu:"] = "Loaded. Open menu:", ["BMS GameFixer v11"] = "BMS GameFixer v11", ["By BMS STUDIO"] = "By BMS STUDIO", ["Custom Colors"] = "Custom Colors", ["Sound Effects"] = "Sound Effects", ["Tools"] = "Tools", ["Discord Webhook"] = "Discord Webhook", ["Discord Active"] = "Active (forward chat to Discord)", ["Discord Name"] = "Sender name", ["Discord URL"] = "Webhook URL", ["Discord Command"] = "Chat command (e.g. @)", ["Save"] = "Save", ["Send Test"] = "Send Test", ["No URL set"] = "No URL set — save your webhook URL first", ["Keyboard Overlay"] = "Keyboard Overlay", ["Show Keyboard"] = "Show keyboard", ["Show Mouse"] = "Show mouse", ["Allow Window Move"] = "Overlay draggable", ["Keyboard Mode"] = "Keyboard model", ["KB Full"] = "Full", ["KB NumPad"] = "NumPad", ["KB Small"] = "Small", ["KB Mini"] = "Mini", ["KB Compact"] = "Compact", ["Toggle Discord Webhook"] = "Toggle Discord webhook", ["Toggle Keyboard Overlay"] = "Toggle keyboard overlay", ["MP3 Player"] = "MP3 Player", ["Music Offline"] = "Music Offline", ["Music Online"] = "Music Online", ["Play This Song"] = "Play this song", ["Pause"] = "Pause", ["Continue"] = "Continue", ["Stop"] = "Stop", ["Volume"] = "Volume", ["Online Link Hint"] = "Below, enter a direct link to an online song/radio.", ["Run Via Link"] = "Play via link", ["No Tracks"] = "No mp3 yet in moonloader/MP3 Player folder", ["Open MP3 Player"] = "Open MP3 Player", ["Fist"] = "Fist", ["Fist Name"] = "Fist name", ["Position X"] = "Position X", ["Position Y"] = "Position Y", ["Apply Fist"] = "Apply Fist", ["Fist Presets"] = "Quick presets (1-5)", ["Fist Hint"] = "Needs fist_by_rvng.luac + resource folder (installed) and transparent fist in hud.txd. Wrong name = white square. Disabling parks the sprite off-screen.", ["Enable Fist"] = "Enable Fist", ["Fist Sent"] = "Sent: ", ["Fist Chat Busy"] = "Chat is busy — close it first, then retry.", ["SSAO"] = "SSAO", ["Enable SSAO"] = "Enable SSAO", ["Thickness"] = "Thickness", ["Intensity"] = "Intensity", ["Thin"] = "Thin", ["Medium"] = "Medium", ["Thick"] = "Thick", ["SSAO Preset"] = "Quick presets", ["SSAO Hint"] = "Lightweight Fake AO (not depth-buffer SSAO). Shares Timecycle & Shadow with Fixes tab — changes here affect Fixes and vice versa. Needs ENB/ReShade for 100%.", ["Fake AO"] = "Fake AO", ["SSAO Active"] = "Active", ["SSAO Inactive"] = "Off", ["Toggle SSAO"] = "Toggle SSAO (Fake AO)", ["Open HUDChanger"] = "Open HUDChanger tab", ["Open"] = "Open", ["SSAO Real"] = "Real SSAO (ReShade MXAO)", ["Install SSAO"] = "Install SSAO", ["SSAO Installed"] = "Installed", ["SSAO Not Installed"] = "Not installed — click Install", ["Reload ReShade"] = "Reload ReShade", ["MXAO Amount"] = "MXAO Amount", ["MXAO Radius"] = "MXAO Radius", ["MXAO Quality"] = "MXAO Quality", ["SSAO Real Hint"] = "Real SSAO from ReShade (qUINT MXAO, RESHADE FREEZIN Step 3 pack). Install copies shaders to GTA folder + sets preset. Toggle needs ReShade reload. Do not enable Fake AO at the same time.", ["Fake AO Fallback"] = "Fake AO (fallback if ReShade not installed)", ["Open GTA Folder"] = "Open SSAO Folder", ["Uninstall SSAO"] = "Sterilize Root", ["Need Restart"] = "Game restart needed (injector/log stale)", ["Open Log"] = "Open Log", ["Debug View"] = "Debug View", ["Render Scale"] = "Render Scale", ["Fade Start"] = "Fade Start", ["Fade End"] = "Fade End", ["Light Preset"] = "Light Preset", ["Injector Missing"] = "Injector missing (sterile root)", ["SSAO Thickness"] = "SSAO thickness", ["KillState"] = "KillState", ["KillState Info"] = "Kill status & overlay", ["Enable KillState"] = "Enable KillState", ["KillState Installed"] = "Installed", ["KillState Not Installed"] = "Not installed", ["KillState Enabled"] = "Enabled", ["KillState Disabled"] = "Disabled", ["KillState File"] = "File: moonloader/killstate.lua", ["KillState Version"] = "Version: 2.4 (luacrypted)", ["KillState Hint"] = "Native KillState inside GameFixer (no external killstate.lua): kill feed + K/D + accuracy. Toggling shows/hides instantly — no reload, no restart.", ["KS Show Feed"] = "Show feed", ["KS Show Stats"] = "Show stats", ["KS Max"] = "Max feed", ["KS Clear"] = "Clear feed", ["KS Reset"] = "Reset stats", ["Reload Scripts"] = "Reload Scripts", ["Open Folder"] = "Open Folder", ["Copy From Mod"] = "Copy from mod gta", -- BMS SENSFIX NATIVE 2026-09-05 (sensfix.asi replacement) ["SensFix"] = "SensFix", ["SensFix Sub"] = "Mouse sensitivity (native, no ASI)", ["Enable SensFix"] = "Enable SensFix", ["SensFix Installed"] = "Installed", ["SensFix Not Installed"] = "Not active", ["SensFix Enabled"] = "Enabled", ["SensFix Disabled"] = "Disabled", ["Sens Global"] = "Global", ["Sens Aiming"] = "Aiming", ["Sens Sniper"] = "Sniper", ["Sens Preset"] = "Quick presets", ["Sens Default"] = "Default", ["Sens Steady"] = "Steady", ["Sens Fast"] = "Fast", ["Sens Lock Sniper"] = "Lock Sniper", ["SensFix Hint"] = "In-panel sensfix.asi replacement: patches 4 game sensitivity spots directly in memory (normal look + aiming). Applies INSTANTLY, no restart. Values stored in moonloader/config/sensfix.ini.", ["Sens Live Note"] = "Active instantly — no game restart. sensfix.asi is no longer needed (safe to delete).", ["Sens Classic Note"] = "Sniper mode auto-engages with sniper rifle equipped; or tick Lock Sniper.", -- BMS HUDCHANGER 2026-09-06 ["HUDChanger"] = "HUDChanger", ["HUDChanger Sub"] = "Swap HUD textures (fist, crosshair, radardisc, weapon icon, font, radar map)", ["HUDChanger Folder"] = "Source folder", ["HUDChanger Source"] = "Source: C:\\Users\\Admin\\Documents\\mod gta\\HUD CHANGER\\monetloader\\loader\\", ["HUDChanger Dest"] = "Dest: moonloader/gamefixer/hudchanger/ (auto-copied)", ["HUDChanger Files"] = "Files in folder", ["HUDChanger Apply"] = "Apply", ["HUDChanger Reset"] = "Reset to default", ["HUDChanger None"] = "(none)", ["HUDChanger Installed"] = "Installed", ["HUDChanger Not Installed"] = "Not installed", ["HUDChanger Copied"] = "copied to moonloader/gamefixer/hudchanger/", ["HUDChanger No Source"] = "Mod source folder not found — drop files into the dest folder directly, then Refresh.", ["HC Apply Game"] = "Apply to Game", ["HC Restore"] = "Restore TXD", ["HC Game Hint"] = "Writes PNGs directly into models/hud.txd & fonts.txd (auto *.bms-bak backup). Takes effect after game restart.", ["HUDChanger Empty"] = "Folder empty. Put .png files into the source folder.", ["HUDChanger ApplyHint"] = "Pick a file from the list then click Apply. Radar map needs reload.", ["HC Fist"] = "Fist (Hand)", ["HC Fist Sub"] = "Replace the fist (hand) sprite on the HUD. File name = texture name in hud.txd.", ["HC Fist ApplyHint"] = "Wrong name = white sprite. Disable parks the sprite off-screen (9999 9999).", ["HC Crosshair"] = "Crosshair (SiteM16)", ["HC Crosshair Sub"] = "Replace site-M16 crosshair sprite.", ["HC Radardisc"] = "Radar Disc", ["HC Radardisc Sub"] = "Replace radar dots on the minimap.", ["HC Weapon Icon"] = "Weapon Icon", ["HC Weapon Icon Sub"] = "Replace weapon HUD icons. File name MUST match GTA SA weapon icon name (e.g. desert_eagleicon.png, ak47icon.png).", ["HC Weapon Icon Warn"] = "Wrong name = icon won't change.", ["HC Font"] = "HUD Font", ["HC Font Sub"] = "Replace HUD font. File name MUST be font1.png and font2.png (only these two slots are read).", ["HC Font Warn"] = "Only font1 and font2 are read by the system.", ["HC Radar Map"] = "Radar Map (radar0.txd .. radar143.txd)", ["HC Radar Map Sub"] = "Radar tiles for the map. Copy TXDs to GTA/models/ then request to load.", ["HC Radar Map Action"] = "Install to GTA/models/", ["HC Radar Map Reload"] = "Reload Models (radarXXX)", ["HC Radar Map Reset"] = "Remove from GTA/models/", ["HC Radar Map Installed"] = "Installed to GTA/models/ (TXD HUD Map active).", ["HC Radar Map ResetDone"] = "Files removed from GTA/models/.", ["HUDChanger Manager"] = "HUDChanger Manager", ["HUDChanger Open Folder"] = "Open Folder", ["HUDChanger Copy All"] = "Copy All from mod gta", ["HC Restart Needed"] = "Restart required so the game loads the texture (TXD is mounted at startup).", ["KB Bongo"] = "Bongo Cat", ["KB Bongo Skin"] = "Cat skin (1-4)", ["Panel Key"] = "Panel key", }, } if ini and ini.settings and ini.settings.lang ~= "id" and ini.settings.lang ~= "en" then ini.settings.lang = "id" end local curLang = (ini and ini.settings and ini.settings.lang) or "id" if curLang ~= "id" and curLang ~= "en" then curLang = "id" end function T(k) local t = LANG[curLang] or LANG.id; local v = t[k]; if v ~= nil then return v end; local e = LANG.en[k]; if e ~= nil then return e end; return k end function setLang(l) if l ~= "id" and l ~= "en" then l = "id" end; curLang = l; ini.settings.lang = curLang; save() end -- BMS UI: warna teks ikut tema (putih di dark, hitam di light). Teks hardcode putih tak terbaca di tema terang. function DIM(a) if ini.settings.theme == 2 then return imgui.ImVec4(0,0,0,a) else return imgui.ImVec4(1,1,1,a) end end -- Bungkus teks panjang agar tak kepotong (fallback aman bila TextWrapped tak ada di binding). local HAS_TEXTWRAP = imgui.TextWrapped ~= nil function bmsTextU8(s) if HAS_TEXTWRAP then imgui.TextWrapped(s) else imgui.Text(s) end end function bmsTextColU8(col, s) if HAS_TEXTWRAP then imgui.PushStyleColor(imgui.Col.Text, col) imgui.TextWrapped(s) imgui.PopStyleColor() else imgui.TextColored(col, s) end end -- highlight per-list UGenrl (dulu 1 global 'selected' utk 9 list -> highlight bocor antar-list) local bmsUgenrlSel = {} ------------- [ window ] ------------- local main_menu = imgui.ImBool(false) local sw, sh = getScreenResolution() -------------[ sliders ] ------------- local sliders = { fontshp = imgui.ImInt(ini.hphud.text), poshp = imgui.ImInt(ini.hphud.pos), weather = imgui.ImInt(ini.settings.weather), hours = imgui.ImInt(ini.settings.hours), min = imgui.ImInt(ini.settings.min), drawdist = imgui.ImInt(ini.settings.drawdist), drawdistair = imgui.ImInt(ini.settings.drawdistair), fog = imgui.ImInt(ini.settings.fog), lod = imgui.ImInt(ini.settings.lod), shadowcp = imgui.ImInt(ini.settings.shadowcp), shadowlight = imgui.ImInt(ini.settings.shadowlight), limitmem = imgui.ImInt(ini.cleaner.limit), mapzoomvalue = imgui.ImFloat(ini.settings.mapzoomvalue), allambient = imgui.ImFloat(ini.fixtimecyc.allambient), objambient = imgui.ImFloat(ini.fixtimecyc.objambient), worldambientR = imgui.ImFloat(ini.fixtimecyc.worldambientR), worldambientG = imgui.ImFloat(ini.fixtimecyc.worldambientG), worldambientB = imgui.ImFloat(ini.fixtimecyc.worldambientB), radarw = imgui.ImInt(ini.settings.radarWidth), radarh = imgui.ImInt(ini.settings.radarHeight), radarposx = imgui.ImInt(ini.settings.radarPosX), radarposy = imgui.ImInt(ini.settings.radarPosY), ------------- [ugenrl] -------------- weapon_volume_slider = imgui.ImFloat(ini.ugenrl_volume.weapon), hit_volume_slider = imgui.ImFloat(ini.ugenrl_volume.hit), pain_volume_slider = imgui.ImFloat(ini.ugenrl_volume.pain), enemyweapon_dist = imgui.ImInt(ini.ugenrl_main.enemyWeaponDist), --------------------------------------- } ------------- [checkboxes] ------------- local checkboxes = { hpt = imgui.ImBool(ini.hphud.hpt), blockweather = imgui.ImBool(ini.settings.blockweather), blocktime = imgui.ImBool(ini.settings.blocktime), antiblockedplayer = imgui.ImBool(ini.settings.antiblockedplayer), chatt = imgui.ImBool(ini.settings.chatt), sensfix = imgui.ImBool(ini.settings.sensfix), fixblackroads = imgui.ImBool(ini.settings.fixblackroads), longarmfix = imgui.ImBool(ini.settings.longarmfix), waterfixquadro = imgui.ImBool(ini.settings.waterfixquadro), intrun = imgui.ImBool(ini.settings.intrun), cleaninfo = imgui.ImBool(ini.cleaner.cleaninfo), fixcrosshair = imgui.ImBool(ini.settings.fixcrosshair), mapzoom = imgui.ImBool(ini.settings.mapzoom), sunfix = imgui.ImBool(ini.settings.sunfix), radarfix = imgui.ImBool(ini.settings.radarfix), fixtaxilight = imgui.ImBool(ini.settings.fixtaxilight), forceaniso = imgui.ImBool(ini.settings.forceaniso), mapzoomfixer = imgui.ImBool(ini.settings.mapzoomfixer), dual_monitor_fix = imgui.ImBool(ini.settings.dual_monitor_fix), radar_color_fix = imgui.ImBool(ini.settings.radar_color_fix), adkfix = imgui.ImBool(ini.settings.adkfix), ------------- [ugenrl] ------------- ugenrl_enable = imgui.ImBool(ini.ugenrl_main.enable), weapon_checkbox = imgui.ImBool(ini.ugenrl_main.weapon), enemyweapon_checkbox = imgui.ImBool(ini.ugenrl_main.enemyWeapon), hit_checkbox = imgui.ImBool(ini.ugenrl_main.hit), pain_checkbox = imgui.ImBool(ini.ugenrl_main.pain), autonosounds = imgui.ImBool(ini.ugenrl_main.autonosounds), --------------------------------------- } ------------- [BUFFER] ------------- local buffers = { cmd_openmenu = imgui.ImBuffer(''..ini.commands.openmenu, 32), cmd_givemedist = imgui.ImBuffer(''..ini.commands.givemedist, 32), cmd_drawdistance = imgui.ImBuffer(''..ini.commands.drawdistance, 32), cmd_drawdistanceair = imgui.ImBuffer(''..ini.commands.drawdistanceair, 32), cmd_fogdistance = imgui.ImBuffer(''..ini.commands.fogdistance, 32), cmd_loddistance = imgui.ImBuffer(''..ini.commands.loddistance, 32), cmd_shownicks = imgui.ImBuffer(''..ini.commands.shownicks, 32), cmd_showhp = imgui.ImBuffer(''..ini.commands.showhp, 32), cmd_offradio = imgui.ImBuffer(''..ini.commands.offradio, 32), cmd_deletegun = imgui.ImBuffer(''..ini.commands.deletegun, 32), cmd_clearchat = imgui.ImBuffer(''..ini.commands.clearchat, 32), cmd_showchat = imgui.ImBuffer(''..ini.commands.showchat, 32), cmd_showhud = imgui.ImBuffer(''..ini.commands.showhud, 32), cmd_bighpbar = imgui.ImBuffer(''..ini.commands.bighpbar, 32), cmd_fpslock= imgui.ImBuffer(''..ini.commands.fpslock, 32), cmd_postfx = imgui.ImBuffer(''..ini.commands.postfx, 32), cmd_antiblockedplayer = imgui.ImBuffer(''..ini.commands.antiblockedplayer, 32), cmd_animmoney = imgui.ImBuffer(''..ini.commands.animmoney, 32), cmd_chatopenfix = imgui.ImBuffer(''..ini.commands.chatopenfix, 32), cmd_hphud = imgui.ImBuffer(''..ini.commands.hphud, 32), cmd_hpstyle = imgui.ImBuffer(''..ini.commands.hpstyle, 32), cmd_hppos = imgui.ImBuffer(''..ini.commands.hppos, 32), cmd_hptext = imgui.ImBuffer(''..ini.commands.hptext, 32), cmd_autocleaner = imgui.ImBuffer(''..ini.commands.autocleaner, 32), cmd_cleanmemory = imgui.ImBuffer(''..ini.commands.cleanmemory, 32), cmd_cleaninfo = imgui.ImBuffer(''..ini.commands.cleaninfo, 32), cmd_setmbforautocleaner = imgui.ImBuffer(''..ini.commands.setmbforautocleaner, 32), cmd_nobirds = imgui.ImBuffer(''..ini.commands.nobirds, 32), cmd_nodust = imgui.ImBuffer(''..ini.commands.nodust, 32), cmd_fixtimecyc = imgui.ImBuffer(''..ini.commands.fixtimecyc, 32), cmd_effects = imgui.ImBuffer(''..ini.commands.effects, 32), cmd_editcrosshair = imgui.ImBuffer(''..ini.commands.editcrosshair, 32), cmd_shadowedit = imgui.ImBuffer(''..ini.commands.shadowedit, 32), cmd_nocloudbig = imgui.ImBuffer(''..ini.commands.nocloudbig, 32), cmd_nocloudsmall = imgui.ImBuffer(''..ini.commands.nocloudsmall, 32), cmd_noshadows = imgui.ImBuffer(''..ini.commands.noshadows, 32), cmd_vehlods = imgui.ImBuffer(''..ini.commands.vehlods, 32), cmd_fixcrosshair = imgui.ImBuffer(''..ini.commands.fixcrosshair, 32), cmd_intrun = imgui.ImBuffer(''..ini.commands.intrun, 32), cmd_waterfixquadro = imgui.ImBuffer(''..ini.commands.waterfixquadro, 32), cmd_longarmfix = imgui.ImBuffer(''..ini.commands.longarmfix, 32), cmd_fixblackroads = imgui.ImBuffer(''..ini.commands.fixblackroads, 32), cmd_fixsens = imgui.ImBuffer(''..ini.commands.sensfix, 32), cmd_audiostream = imgui.ImBuffer(''..ini.commands.audiostream, 32), cmd_intmusic = imgui.ImBuffer(''..ini.commands.intmusic, 32), cmd_nosounds = imgui.ImBuffer(''..ini.commands.nosounds, 32), cmd_noplaneline = imgui.ImBuffer(''..ini.commands.noplaneline, 32), cmd_blocksampkeys = imgui.ImBuffer(''..ini.commands.blockkeys, 32), cmd_sunfix = imgui.ImBuffer(''..ini.commands.sunfix, 32), cmd_targetblip = imgui.ImBuffer(''..ini.commands.targetblip, 32), vmenu_crx = imgui.ImInt(ini.settings.crosshairX), vmenu_cry = imgui.ImInt(ini.settings.crosshairY), cmd_vsync = imgui.ImBuffer(''..ini.commands.vsync, 32), cmd_radarfix = imgui.ImBuffer(''..ini.commands.radarfix, 32), cmd_fixtaxilight = imgui.ImBuffer(''..ini.commands.fixtaxilight, 32), cmd_radarwidth = imgui.ImBuffer(''..ini.commands.radarWidth, 32), cmd_radarheight = imgui.ImBuffer(''..ini.commands.radarHeight, 32), cmd_radarx = imgui.ImBuffer(''..ini.commands.radarx, 32), cmd_radary = imgui.ImBuffer(''..ini.commands.radary, 32), cmd_ugenrl = imgui.ImBuffer(''..ini.commands.ugenrl, 32), cmd_autonosounds = imgui.ImBuffer(''..ini.commands.autonosounds, 32), cmd_uds = imgui.ImBuffer(''..ini.commands.uds, 32), cmd_uss = imgui.ImBuffer(''..ini.commands.uss, 32), cmd_ums = imgui.ImBuffer(''..ini.commands.ums, 32), cmd_urs = imgui.ImBuffer(''..ini.commands.urs, 32), cmd_ursp = imgui.ImBuffer(''..ini.commands.ursp, 32), cmd_ubs = imgui.ImBuffer(''..ini.commands.ubs, 32), cmd_uuzi = imgui.ImBuffer(''..ini.commands.uuzi, 32), cmd_ump5 = imgui.ImBuffer(''..ini.commands.ump5, 32), cmd_ups = imgui.ImBuffer(''..ini.commands.ups, 32), cmd_ugd = imgui.ImBuffer(''..ini.commands.ugd, 32), cmd_ugvw = imgui.ImBuffer(''..ini.commands.ugvw, 32), cmd_ugvh = imgui.ImBuffer(''..ini.commands.ugvh, 32), cmd_ugvp = imgui.ImBuffer(''..ini.commands.ugvp, 32), cmd_forceaniso = imgui.ImBuffer(''..ini.commands.forceaniso, 32), cmd_mapzoomfixer = imgui.ImBuffer(''..ini.commands.mapzoomfixer, 32), cmd_shadowcp = imgui.ImBuffer(''..ini.commands.shadowcp, 32), cmd_shadowlight = imgui.ImBuffer(''..ini.commands.shadowlight, 32), cmd_dual_monitor_fix = imgui.ImBuffer(''..ini.commands.dual_monitor_fix, 32), cmd_radar_color_fix = imgui.ImBuffer(''..ini.commands.radar_color_fix, 32), cmd_adkfix = imgui.ImBuffer(''..ini.commands.adkfix, 32), cmd_dhook = imgui.ImBuffer(''..ini.commands.dhook, 32), cmd_keyboard = imgui.ImBuffer(''..ini.commands.keyboard, 32), cmd_mp3pl = imgui.ImBuffer(''..ini.commands.mp3pl, 32), cmd_ssao = imgui.ImBuffer(''..ini.commands.ssao, 32), cmd_hudchanger = imgui.ImBuffer(''..ini.commands.hudchanger, 32), music_link = imgui.ImBuffer('', 256), discord_url = imgui.ImBuffer(''..ini.discord.url, 256), discord_nick = imgui.ImBuffer(''..ini.discord.nick, 50), discord_cmd = imgui.ImBuffer(''..ini.discord.cmd, 16), } local discord_all = imgui.ImBool(ini.discord.all) local kbShow = imgui.ImBool(ini.keyboard.active) local kbMouse = imgui.ImBool(ini.keyboard.mouse) local kbMove = imgui.ImBool(ini.keyboard.move) local kbMode = imgui.ImInt(ini.keyboard.mode) local kbPos = imgui.ImVec2(ini.keyboard.kx, ini.keyboard.ky) local kbMousePos = imgui.ImVec2(ini.keyboard.mx, ini.keyboard.my) local kbWheel = {} -- {delta, expire} untuk highlight scroll mouse local tKbMode = { T("KB Full"), T("KB NumPad"), T("KB Small"), T("KB Mini"), T("KB Compact"), T("KB Bongo") } ------------------------------ [ BMS REMOTE ASSETS ] ------------------------------ -- Sistem loading semua gambar bawaan script (icon, bongo cat, dsb) lewat URL, -- BUKAN dari file lokal — supaya paketan akhirnya cuma 1 file .lua ini saja. -- -- Cara pakai: -- 1) Isi link gambar langsung (direct link ke file .png/.jpg, BUKAN link halaman -- preview) di tabel `bmsRemoteAssetUrls` di bawah ini. -- 2) Panggil bmsGetRemoteTexture("nama") di kode render tiap frame. Fungsi ini -- balikin texture kalau sudah siap, atau nil kalau masih proses download — -- jadi cukup skip gambar itu untuk frame tsb (jangan dipaksa render). -- 3) Sekali berhasil didownload, hasilnya disimpan di cache lokal -- (resource/gamefixer_cache/) supaya tidak download ulang tiap buka game. local bmsRemoteAssetCacheDir = getWorkingDirectory() .. "/resource/gamefixer_cache" local bmsRemoteAssetUrls = { loading = "https://i.8upload.com/image/9bac94749efd85d9/image.jpg", -- TODO: BMS — isi link direct-image di sini (contoh host: i.8upload.com, GitHub raw, dsb) one = "", two = "", three = "", four = "", five = "", six = "", bongo_w = "", bongo_a = "", bongo_s = "", bongo_d = "", bongo_f = "", bongo_spa = "", bongo_leftup = "", bongo_1 = "", bongo_2 = "", bongo_3 = "", bongo_4 = "", } local bmsRemoteAssetState = {} -- [name] = {requested, ready, texture, path} local function bmsRemoteAssetPath(name, url) local ext = url:match("%.([%a]+)%f[%A]$") or "png" return bmsRemoteAssetCacheDir .. "/" .. name .. "." .. ext end local function bmsEnsureRemoteAssetDir() if doesDirectoryExist and not doesDirectoryExist(bmsRemoteAssetCacheDir) then pcall(createDirectory, bmsRemoteAssetCacheDir) end end -- Aman dipanggil tiap frame: kerja beneran (cek folder/download) cuma jalan sekali -- per asset berkat flag requested/ready di dalam state-nya. local function bmsPumpRemoteAsset(name) local url = bmsRemoteAssetUrls[name] if not url or url == "" then return end -- belum diisi link-nya, skip diam-diam local st = bmsRemoteAssetState[name] if not st then st = { requested = false, ready = false, texture = nil, path = bmsRemoteAssetPath(name, url) } bmsRemoteAssetState[name] = st end if st.texture or st.ready then return end local ok = pcall(function() bmsEnsureRemoteAssetDir() if doesFileExist and doesFileExist(st.path) then st.ready = true return end if not st.requested and downloadUrlToFile then st.requested = true downloadUrlToFile(url, st.path, function(_, status) if status == 6 then st.ready = true else st.requested = false -- gagal, coba lagi frame berikutnya end end) end end) if not ok then st.requested = false end end -- Balikin texture kalau sudah siap, atau nil kalau masih proses/link belum diisi. function bmsGetRemoteTexture(name) bmsPumpRemoteAsset(name) local st = bmsRemoteAssetState[name] if not st then return nil end if not st.texture and st.ready then local ok, tex = pcall(imgui.CreateTextureFromFile, st.path) if ok and tex then st.texture = tex elseif ok then st.ready = false -- file rusak/kepotong, hapus flag biar didownload ulang st.requested = false end end return st.texture end ------------------------------------------------------------------------------------ -- BMS BONGO CAT 2026-09-06: 11 VK -> 11 PNG (resource/Vkeys/*.png). Saat tombol ditekan, -- sprite PNG muncul di posisi tersusun horizontal. Tidak dipakai saat keyboard utama aktif. local bmsBongoVKs = { {0x57, 'w.png'}, -- W {0x41, 'a.png'}, -- A {0x53, 's.png'}, -- S {0x44, 'd.png'}, -- D {0x46, 'f.png'}, -- F {0x20, 'spa.png'}, -- Space {0x26, 'leftup.png'}, -- Up Arrow {0x31, '1.png'}, -- 1 {0x32, '2.png'}, -- 2 {0x33, '3.png'}, -- 3 {0x34, '4.png'}, -- 4 } -- Nama file lokal (mis. 'w.png') -> nama asset remote (mis. 'bongo_w', lihat -- bmsRemoteAssetUrls di atas). Texture-nya didownload dari link, bukan file lokal lagi. local bmsBongoAssetKey = { ['w.png'] = 'bongo_w', ['a.png'] = 'bongo_a', ['s.png'] = 'bongo_s', ['d.png'] = 'bongo_d', ['f.png'] = 'bongo_f', ['spa.png'] = 'bongo_spa', ['leftup.png'] = 'bongo_leftup', ['1.png'] = 'bongo_1', ['2.png'] = 'bongo_2', ['3.png'] = 'bongo_3', ['4.png'] = 'bongo_4', } local bmsBongoTex = {} function bmsBongoLoad() -- Dipanggil tiap frame dari drawBongoCatOverlay(); bmsGetRemoteTexture() sendiri -- sudah murah kalau sudah siap/sedang proses, jadi aman tanpa guard "sekali saja". for _, e in ipairs(bmsBongoVKs) do local key = bmsBongoAssetKey[e[2]] local tex = key and bmsGetRemoteTexture(key) if tex then bmsBongoTex[e[2]] = tex end end end function bmsBongoAvailable() bmsBongoLoad() return next(bmsBongoTex) ~= nil end -- 0-based seperti combo lain (skin 1-4 -> v 0-3) local bmsBongoSkin = imgui.ImInt(math.max(1, math.min(4, tonumber(ini.keyboard.bongo_skin) or 2)) - 1) local tBongoSkin = { "1", "2", "3", "4" } local bmsMusicVol = imgui.ImFloat(tonumber(ini.music.volume) or 50) local bmsMusicMode = tonumber(ini.music.mode) or 1 local bmsMusicSel = 1 local bmsMusicCache = {} local bmsPlaysound = nil local bmsOnlineSong = nil local bmsKillStateOn = imgui.ImBool(ini.killstate.enable) local bmsSsaoOn = imgui.ImBool(ini.ssao.enable) local bmsSsaoThick = imgui.ImInt(tonumber(ini.ssao.thick) or 55) local bmsSsaoIntens = imgui.ImInt(tonumber(ini.ssao.intens) or 80) local bmsSsaoPrev = nil local bmsRsOn = imgui.ImBool(ini.ssao_reshade.enable) local bmsRsAmount = imgui.ImFloat(math.max(0, math.min(4.0, tonumber(ini.ssao_reshade.amount) or 4.0))) local bmsRsRadius = imgui.ImFloat(math.max(0.5, math.min(6.0, tonumber(ini.ssao_reshade.radius) or 2.0))) local bmsRsQuality = imgui.ImInt(math.max(0, math.min(7, math.floor(tonumber(ini.ssao_reshade.quality) or 2)))) local bmsRsRender = imgui.ImFloat(math.max(0.25, math.min(1.0, tonumber(ini.ssao_reshade.render) or 0.5))) local bmsRsFadeS = imgui.ImFloat(math.max(0, math.min(1.0, tonumber(ini.ssao_reshade.fade_s) or 1.0))) local bmsRsFadeE = imgui.ImFloat(math.max(0, math.min(1.0, tonumber(ini.ssao_reshade.fade_e) or 1.0))) local bmsRsDebug = imgui.ImInt(0) local bmsRsDebugUntil = 0 -- pengaman: debug view menutupi SELURUH layar incl. menu local bmsRsChecked = false local bmsRsInstalled = false local bmsRsInjector = false local bmsRsSetOn -- forward: diisi backend Real di bawah (eksklusi Fake->Real) local bmsSsaoSetOn -- forward: dipanggil /ssao di onSendCommand (di atas definisi) local bmsRsNeedRestart = false -- BMS SENSFIX 2026-09-04: state dibaca LANGSUNG dari sensfix.ini saat load (sumber kebenaran = file ASI) local tab = imgui.ImInt(1) local tabs = { u8 '| t | Main', u8 '| t | Fixes', u8 '| t | Boost FPS', u8 '| t | UGenrl', u8 '| t | Commands', u8 '| t | Settings', } local arr_animmoney = { T("Fast"), T("No Animation"), T("Default"), } local radio_animmoney = imgui.ImInt(ini.settings.animmoney) -- Dulu 6 file lokal di moonloader/gamefixer/images/*.png. Sekarang lewat metatable: -- setiap kali kode lain akses images.one / images["one"] dst, itu otomatis manggil -- bmsGetRemoteTexture("one") — lazy, di-cache, dan sumbernya link di bmsRemoteAssetUrls. local images = setmetatable({}, { __index = function(_, key) return bmsGetRemoteTexture(key) end }) ------------- [Dual Monitor fix] ------------- ffi.cdef [[ typedef unsigned long HANDLE; typedef HANDLE HWND; typedef struct _RECT { long left; long top; long right; long bottom; } RECT, *PRECT; HWND GetActiveWindow(void); bool GetWindowRect( HWND hWnd, PRECT lpRect ); bool ClipCursor(const RECT *lpRect); bool GetClipCursor(PRECT lpRect); ]] local rcClip, rcOldClip = ffi.new('RECT'), ffi.new('RECT') --------------------------------------- local tLastKeys = {} local FastUgenrlKey = { v = decodeJson(ini.ugenrl_main.fastactive) } -- BMS PANEL KEY: hotkey buka/tutup panel (default F7 = VK 118). Disimpan JSON spt fastactive. local tLastPanelKeys = {} local PanelHotKey = { v = {118} } pcall(function() local t = decodeJson(ini.panelkey.keys) if type(t) == "table" and #t > 0 then PanelHotKey.v = t end end) local bindPanelHotKey = nil function bmsTogglePanel() local okA, active = pcall(function() return sampIsChatInputActive() end) if okA and active then return end local okD, dlg = pcall(function() return sampIsDialogActive() end) if okD and dlg then return end main_menu.v = not main_menu.v if main_menu.v then imgui.Process = true end end local tStyle = { T("Dark Mode"), T("Light Mode"), } local iStyle = imgui.ImInt(ini.settings.theme-1) local tLang = {"Indonesia", "English"} local langCodes = {"id","en"} function curLangIdx() for i,c in ipairs(langCodes) do if c==curLang then return i-1 end end return 0 end local iLang = imgui.ImInt(curLangIdx()) -- Loading image: lazy-init only after ImGui is alive. -- Sekarang lewat sistem BMS REMOTE ASSETS di atas (key "loading", link-nya ada di -- bmsRemoteAssetUrls). loadingTexture & kedua fungsi ini dipertahankan apa adanya -- supaya kode render di bawah (drawPanelLoading, menu, dst) tidak perlu diubah. local loadingTexture = nil local function bmsEnsureLoadingImage() bmsPumpRemoteAsset("loading") end local function bmsCreateLoadingTexture() if loadingTexture then return end loadingTexture = bmsGetRemoteTexture("loading") end local customEnabled = imgui.ImBool(ini.settings.custom_enabled) function parseVec4(str, def) local r,g,b,a = str:match("([^,]+),([^,]+),([^,]+),([^,]+)") if r and g and b and a then return imgui.ImVec4(tonumber(r),tonumber(g),tonumber(b),tonumber(a)) end return def end local customWindowBg = parseVec4(ini.settings.custom_window_bg, imgui.ImVec4(0.08,0.08,0.10,0.82)) local customText = parseVec4(ini.settings.custom_text, imgui.ImVec4(1,1,1,0.96)) local customButton = parseVec4(ini.settings.custom_button, imgui.ImVec4(1,1,1,0.12)) local customChildBg = parseVec4(ini.settings.custom_child_bg, imgui.ImVec4(1,1,1,0.06)) local customFrameBg = parseVec4(ini.settings.custom_frame_bg, imgui.ImVec4(1,1,1,0.10)) local customWindowRounding = imgui.ImFloat(tonumber(ini.settings.custom_window_rounding) or 18.0) local customFrameRounding = imgui.ImFloat(tonumber(ini.settings.custom_frame_rounding) or 10.0) local customAlpha = imgui.ImFloat(tonumber(ini.settings.custom_alpha) or 1.00) ------------- [cleaner] ------------- function round(num, idp) local mult = 10 ^ (idp or 0) return math.floor(num * mult + 0.5) / mult end function get_memory() return round(memory.read(0x8E4CB4, 4, true) / 1048576, 1) end --------------------------------------- -- Variabel untuk efek suara UI local soundClickPath = uiSoundsDir .. "click.mp3" local soundHoverPath = uiSoundsDir .. "hover.mp3" local lastHoverTime = 0 local lastClickTime = 0 function playUISound(file, vol) if not doesFileExist(file) then return end local audio = loadAudioStream(file) if audio then setAudioStreamVolume(audio, vol or 0.3) setAudioStreamState(audio, 1) lua_thread.create(function() while getAudioStreamState(audio) == 1 do wait(50) end collectgarbage() end) end end -- Variabel animasi tab local tabFadeAlpha = 1.0 local tabFadeStart = 0 local uiLastMenuState = false local uiOpenStart = 0 local uiAccentPhase = 0.0 local uiPulsePhase = 0.0 local uiHoverT = {} function uiLerp(a, b, t) return a + (b - a) * t end function uiClamp01(v) if v < 0 then return 0 end if v > 1 then return 1 end return v end function uiEaseOutCubic(t) t = uiClamp01(t) local u = 1 - t return 1 - u * u * u end function uiAnimatedScale(now) if not uiLastMenuState and main_menu.v then uiOpenStart = now end uiLastMenuState = main_menu.v if not main_menu.v then return 1.0 end return uiEaseOutCubic((now - uiOpenStart) / 0.24) end function uiTextColor(alpha, light) if light then return imgui.ImVec4(0.05, 0.05, 0.07, alpha) end return imgui.ImVec4(1.00, 1.00, 1.00, alpha) end function uiAccentColor(alpha, light) -- Monochrome BMS UI: white/silver focus in dark mode, graphite focus in light mode. if light then return imgui.ImVec4(0.10, 0.12, 0.15, alpha) end return imgui.ImVec4(0.92, 0.95, 0.98, alpha) end function uiDrawModernBackdrop() local dl = imgui.GetWindowDrawList() local wp = imgui.GetWindowPos() local ws = imgui.GetWindowSize() local light = (ini.settings.theme == 2) local base = light and imgui.ImVec4(0.94,0.95,0.97,1.0) or imgui.ImVec4(0.025,0.028,0.034,1.0) local surface = light and imgui.ImVec4(0.985,0.988,0.992,0.98) or imgui.ImVec4(0.045,0.050,0.060,0.98) local border = light and imgui.ImVec4(0.10,0.12,0.15,0.10) or imgui.ImVec4(1.0,1.0,1.0,0.07) dl:AddRectFilled(wp, imgui.ImVec2(wp.x + ws.x, wp.y + ws.y), imgui.GetColorU32(base), 16.0) dl:AddRectFilled(imgui.ImVec2(wp.x + 1, wp.y + 1), imgui.ImVec2(wp.x + ws.x - 1, wp.y + ws.y - 1), imgui.GetColorU32(surface), 15.0) dl:AddRect(imgui.ImVec2(wp.x + 1, wp.y + 1), imgui.ImVec2(wp.x + ws.x - 1, wp.y + ws.y - 1), imgui.GetColorU32(border), 15.0, 0, 1.0) -- Subtle top glow, static so it doesn't distract while using the panel. dl:AddRectFilled( imgui.ImVec2(wp.x + 20, wp.y + 62), imgui.ImVec2(wp.x + ws.x - 20, wp.y + 63), imgui.GetColorU32(uiAccentColor(light and 0.16 or 0.12, light)), 1.0 ) end function uiDrawHeaderAccent() local dl = imgui.GetWindowDrawList() local p = imgui.GetCursorScreenPos() local avail = imgui.GetContentRegionAvail() local light = (ini.settings.theme == 2) local c = uiAccentColor(light and 0.18 or 0.12, light) dl:AddRectFilled( imgui.ImVec2(p.x, p.y), imgui.ImVec2(p.x + math.min(140, avail.x * 0.22), p.y + 2), imgui.GetColorU32(c), 2.0 ) end function uiSidebarButton(label, id, selected, size) local key = tostring(id or label) local light = (ini.settings.theme == 2) local h = size and size.y or 42 local w = size and size.x or -1 local dl local clicked imgui.PushStyleVar(imgui.StyleVar.FrameRounding, 10.0) if selected then imgui.PushStyleColor(imgui.Col.Button, light and imgui.ImVec4(0.06,0.07,0.08,0.10) or imgui.ImVec4(1,1,1,0.11)) imgui.PushStyleColor(imgui.Col.ButtonHovered, light and imgui.ImVec4(0.06,0.07,0.08,0.15) or imgui.ImVec4(1,1,1,0.15)) imgui.PushStyleColor(imgui.Col.ButtonActive, light and imgui.ImVec4(0.06,0.07,0.08,0.19) or imgui.ImVec4(1,1,1,0.19)) imgui.PushStyleColor(imgui.Col.Text, light and imgui.ImVec4(0.04,0.05,0.06,0.96) or imgui.ImVec4(0.97,0.98,1.0,0.98)) else imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(0,0,0,0)) imgui.PushStyleColor(imgui.Col.ButtonHovered, light and imgui.ImVec4(0.06,0.07,0.08,0.07) or imgui.ImVec4(1,1,1,0.06)) imgui.PushStyleColor(imgui.Col.ButtonActive, light and imgui.ImVec4(0.06,0.07,0.08,0.12) or imgui.ImVec4(1,1,1,0.10)) imgui.PushStyleColor(imgui.Col.Text, light and imgui.ImVec4(0.12,0.14,0.17,0.72) or imgui.ImVec4(1,1,1,0.68)) end clicked = imgui.Button(label, imgui.ImVec2(w, h)) dl = imgui.GetWindowDrawList() if selected then local r = imgui.GetItemRectMin() local mx = imgui.GetItemRectMax() dl:AddRectFilled( imgui.ImVec2(r.x + 2, r.y + 9), imgui.ImVec2(r.x + 4, mx.y - 9), imgui.GetColorU32(uiAccentColor(0.92, light)), 2.0 ) elseif imgui.IsItemHovered() then local r = imgui.GetItemRectMin() local mx = imgui.GetItemRectMax() dl:AddRect( imgui.ImVec2(r.x + 1, r.y + 1), imgui.ImVec2(mx.x - 1, mx.y - 1), imgui.GetColorU32(uiAccentColor(light and 0.07 or 0.08, light)), 10.0, 0, 1.0 ) end imgui.PopStyleColor(4) imgui.PopStyleVar() return clicked end function uiCardHeader(title, subtitle) local light = (ini.settings.theme == 2) local titleCol = light and imgui.ImVec4(0.06,0.07,0.09,0.96) or imgui.ImVec4(0.96,0.97,0.99,0.96) local subCol = light and imgui.ImVec4(0.38,0.41,0.47,0.84) or imgui.ImVec4(0.66,0.69,0.75,0.72) imgui.PushStyleVar(imgui.StyleVar.ItemSpacing, imgui.ImVec2(4, 2)) imgui.TextColored(titleCol, u8(title)) if subtitle and subtitle ~= "" then imgui.TextColored(subCol, u8(subtitle)) end imgui.PopStyleVar() end function uiPill(text, active) local light = (ini.settings.theme == 2) local bg = active and (light and imgui.ImVec4(0.06,0.07,0.08,0.09) or imgui.ImVec4(1,1,1,0.10)) or (light and imgui.ImVec4(0,0,0,0.05) or imgui.ImVec4(1,1,1,0.05)) local fg = active and (light and imgui.ImVec4(0.05,0.06,0.08,0.90) or imgui.ImVec4(0.95,0.97,1.0,0.90)) or (light and imgui.ImVec4(0.28,0.31,0.36,0.70) or imgui.ImVec4(1,1,1,0.55)) imgui.PushStyleColor(imgui.Col.ChildWindowBg, bg) imgui.PushStyleVar(imgui.StyleVar.ChildWindowRounding, 999.0) imgui.PushStyleVar(imgui.StyleVar.WindowPadding, imgui.ImVec2(10, 5)) imgui.BeginChild("##pill_" .. tostring(text), imgui.ImVec2(0, 28), true, imgui.WindowFlags.NoScrollbar + imgui.WindowFlags.NoScrollWithMouse) imgui.TextColored(fg, u8(text)) imgui.EndChild() imgui.PopStyleVar(2) imgui.PopStyleColor() end function uiAnimatedButton(label, id, size) local key = tostring(id or label) local light = (ini.settings.theme == 2) local hovered = imgui.IsItemHovered() local now = os.clock() local t = uiHoverT[key] or 0.0 local target = hovered and 1.0 or 0.0 t = uiLerp(t, target, math.min(1.0, 11.0 * 0.016)) uiHoverT[key] = t local base = light and imgui.ImVec4(0.02,0.03,0.04,0.06 + 0.03*t) or imgui.ImVec4(1,1,1,0.06 + 0.04*t) local over = light and imgui.ImVec4(0.02,0.03,0.04,0.10 + 0.04*t) or imgui.ImVec4(1,1,1,0.10 + 0.05*t) imgui.PushStyleColor(imgui.Col.Button, base) imgui.PushStyleColor(imgui.Col.ButtonHovered, over) imgui.PushStyleColor(imgui.Col.ButtonActive, light and imgui.ImVec4(0.02,0.03,0.04,0.15) or imgui.ImVec4(1,1,1,0.14)) imgui.PushStyleVar(imgui.StyleVar.FrameRounding, 10.0) local clicked = imgui.Button(label, size) imgui.PopStyleVar() imgui.PopStyleColor(3) if hovered then local r = imgui.GetItemRectMin() local mx = imgui.GetItemRectMax() imgui.GetWindowDrawList():AddRect( imgui.ImVec2(r.x, r.y), imgui.ImVec2(mx.x, mx.y), imgui.GetColorU32(uiAccentColor(0.12 + 0.08*t, light)), 10.0, 0, 1.0 ) end return clicked end function main() ------------- [ dual monitor fix] ------------- ffi.C.GetWindowRect(ffi.C.GetActiveWindow(), rcClip); ffi.C.ClipCursor(rcClip); --------------------------------------- repeat wait(100) until isSampAvailable() -- Hard-coded memory patches are only valid for SA-MP 0.3.7-R1 / GTA SA 1.0. -- On another build, abort cleanly instead of writing into arbitrary addresses and crashing GTA. local sampVer = sampGetVersion() if sampVer ~= "0.3.7-R1" then sampAddChatMessage(script_name.." {FFFFFF}Unsupported SA-MP build: {dc4747}" .. tostring(sampVer) .. " {FFFFFF}(required: {dc4747}0.3.7-R1{FFFFFF}). Script disabled for safety.", 0x73b461) return end sampAddChatMessage(script_name.."{FFFFFF} Loaded. Open menu: {dc4747}" ..ini.commands.openmenu..". {FFFFFF}Author: {dc4747}" ..script_author..". {FFFFFF}Translator: {dc4747}" ..script_translator, 0x73b461) sampRegisterChatCommand("q", fastquit) sampRegisterChatCommand("quit", fastquit) pcall(loadSounds) gotofunc("all") SwitchTheStyle(ini.settings.theme) pcall(function() if not doesDirectoryExist('moonloader/MP3 Player') then createDirectory('moonloader/MP3 Player') end end) pcall(bmsSensBoot) -- SensFix native: auto-patch saat boot (tanpa on/off manual) save() pcall(function() bindPanelHotKey = rkeys.registerHotKey(PanelHotKey.v, true, function() if not sampIsCursorActive() then bmsTogglePanel() end end) end) bindFastActiveUgenrl = rkeys.registerHotKey(FastUgenrlKey.v, true, function() if not sampIsCursorActive() then ini.ugenrl_main.enable = not ini.ugenrl_main.enable checkboxes.ugenrl_enable.v = ini.ugenrl_main.enable if ini.ugenrl_main.autonosounds then if ini.ugenrl_main.enable then ini.settings.nosounds = false else ini.settings.nosounds = true end save() gotofunc("NoSounds") end sampAddChatMessage(ini.ugenrl_main.enable and script_name.." {FFFFFF}Ultimate Genrl has been {73b461}Switched On" or script_name.." {FFFFFF}Ultimate Genrl has been {dc4747}Switched Off", 0x73b461) end end) while true do wait(0) pcall(function() local d = getMousewheelDelta() if d ~= nil and d ~= 0 then table.insert(kbWheel, {d, os.clock()+0.05}) end end) if (kbShow.v or kbMouse.v) and not imgui.Process then imgui.Process = true end -- pengaman debug view: jalan tiap frame walau menu tutup (global, pcall aman) pcall(bmsRsDebugPump) -- pompa SensFix tiap ±10 dtk (600 frame): jaga patch tetap aktif sejak boot bmsSensTick = (bmsSensTick or 0) + 1 if bmsSensTick >= 600 then bmsSensTick = 0 pcall(bmsSensPump) end -- BMS KillState native: hitung tembakan tiap frame (rising edge) pcall(bmsKsPump) if ini.settings.adkfix then if isCharInAnyCar(playerPed) and getCharHealth(playerPed) >= 1 then if isCharPlayingAnim(playerPed, "CAR_fallout_LHS") then local fX, fY, fZ = getOffsetFromCharInWorldCoords(playerPed, 0, 0, 2.5); warpCharFromCarToCoord(playerPed, fX, fY, fZ); elseif isCharPlayingAnim(playerPed, "CAR_rollout_LHS") then wait(1610); clearCharTasksImmediately(playerPed); end end end if ini.cleaner.autoclean then if tonumber(get_memory()) > tonumber(ini.cleaner.limit) then gotofunc("CleanMemory") end end ------------------ [ HP] ------------------ if ini.hphud.active then if sampIsLocalPlayerSpawned() and not created and sampIsChatVisible() and ini.settings.showhud then if ini.hphud.mode == 1 then sampTextdrawCreate(2029, "_", getposhphud(), 66.500) created = true elseif ini.hphud.mode == 2 then sampTextdrawCreate(2029, "_", getposhphud(), 66.500) created = true end elseif sampTextdrawIsExists(2029) and sampIsLocalPlayerSpawned() and created and memory.read(0xBA676C, 1, true) ~= 0 or not sampIsChatVisible() and ini.settings.showchat then sampTextdrawDelete(2029) end if created and not sampTextdrawIsExists(2029) then created = false end if created then sampTextdrawSetLetterSizeAndColor(2029, 0.270, 0.900, 4294967295) if ini.hphud.mode == 1 then sampTextdrawSetPos(2029, getposhphud(), 66.500) elseif ini.hphud.mode == 2 then sampTextdrawSetPos(2029, getposhphud(), 76.500) end sampTextdrawSetStyle(2029, ini.hphud.text) sampTextdrawSetAlign(2029, ini.hphud.pos) sampTextdrawSetOutlineColor(2029, 1, 4278190080) if ini.hphud.active and not sampIsScoreboardOpen() then local hp = getCharHealth(playerPed) if hp > 160 then hp = "160+" end sampTextdrawSetString(2029, hp..""..stringhphud('hp')) else sampTextdrawSetString(2029, "_") end end end if not ini.settings.blockweather ~= true and ini.settings.weather ~= memory.read(0xC81320, 2, false) then memory.write(0xC81320, ini.settings.weather, 2, false) end if not ini.settings.blocktime ~= true and ini.settings.hours ~= memory.read(0xB70153, 1, false) then memory.write(0xB70153, ini.settings.hours, 1, false) end ------------- [ urgenrl ] ------------- if ini.ugenrl_main.enable and sampIsLocalPlayerSpawned() then if ini.ugenrl_main.weapon then if isCharShooting(PLAYER_PED) then playSound(ini.ugenrl_sounds[getCurrentCharWeapon(PLAYER_PED)], ini.ugenrl_volume.weapon) end if ini.ugenrl_main.enemyWeapon then local myX, myY, myZ = getCharCoordinates(PLAYER_PED) repeat local hasFoundChars, randomCharHandle = findAllRandomCharsInSphere(myX, myY, myZ, ini.ugenrl_main.enemyWeaponDist, true, true) if hasFoundChars and isCharShooting(randomCharHandle) then playSound(ini.ugenrl_sounds[getCurrentCharWeapon(randomCharHandle)], ini.ugenrl_volume.weapon, randomCharHandle) end until not hasFoundChars end end if playPain then playSound(ini.ugenrl_sounds.pain, ini.ugenrl_volume.pain) playPain = false if weaponSoundDelay[dmgWeaponId] then wait(weaponSoundDelay[dmgWeaponId]) end end if playHit then playSound(ini.ugenrl_sounds.hit, ini.ugenrl_volume.hit) playHit = false if weaponSoundDelay[dmgWeaponId] then wait(weaponSoundDelay[dmgWeaponId]) end end end if not sampIsDialogActive() then if ini.settings.chatt and isKeyJustPressed(84) then sampSetChatInputEnabled(true) end end if ini.settings.antiblockedplayer and not isCharInAnyCar(PLAYER_PED) then for i = 0, sampGetMaxPlayerId(true) do if sampIsPlayerConnected(i) then local result, id = sampGetCharHandleBySampPlayerId(i) if result then if doesCharExist(id) then local x, y, z = getCharCoordinates(id) local mX, mY, mZ = getCharCoordinates(playerPed) if 0.7 > getDistanceBetweenCoords3d(x, y, z, mX, mY, mZ) then setCharCollision(id, false) end end end end end end if ini.settings.givemedist then if isCharInAnyPlane(PLAYER_PED) or isCharInAnyHeli(PLAYER_PED) then if memory.getfloat(12044272, false) ~= ini.settings.drawdistair then memory.setfloat(12044272, ini.settings.drawdistair, false) memory.setfloat(13210352, ini.settings.fog, false) memory.setfloat(0x858FD8, ini.settings.lod, false) end else if memory.getfloat(12044272, false) ~= ini.settings.drawdist then memory.setfloat(12044272, ini.settings.drawdist, false) memory.setfloat(13210352, ini.settings.fog, false) memory.setfloat(0x858FD8, ini.settings.lod, false) end end if memory.getfloat(13210352, false) >= memory.getfloat(12044272, false) then memory.setfloat(13210352, ini.settings.drawdist - 1.0, false) ini.settings.fog = ini.settings.drawdist - 1.0 save() end end end end function ev.onSendCommand(cmd) if cmd:find("^"..ini.commands.openmenu.."$") then gotofunc("OpenMenu") return false elseif cmd:find("^"..ini.commands.givemedist.."$") then ini.settings.givemedist = not ini.settings.givemedist sampAddChatMessage(ini.settings.givemedist and script_name..' {FFFFFF}The ability to change the Distance is now {73b461} Enabled ' or script_name..' {FFFFFF}The ability to change the Distance is now {dc4747}Disabled', 0x73b461) save() gotofunc("GivemeDist") return false elseif cmd:find("^"..ini.commands.drawdistance.." .+") or cmd:find("^"..ini.commands.drawdistance.."$") then local drawdist = cmd:match(ini.commands.drawdistance.." (.+)") drawdist = tonumber(drawdist) if ini.settings.givemedist then if type(drawdist) ~= 'number' or drawdist > 3600 or drawdist < 35 then sampAddChatMessage(script_name.." {FFFFFF}use: {dc4747}"..ini.commands.drawdistance.." [35-3600]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.settings.drawdist, 0x73b461) else ini.settings.drawdist = drawdist save() sliders.drawdist.v = ini.settings.drawdist memory.setfloat(12044272, ini.settings.drawdist..".0", false) sampAddChatMessage(script_name.." {FFFFFF}Draw Distance Set to: {dc4747}"..ini.settings.drawdist, 0x73b461) end else sampAddChatMessage(script_name.." {FFFFFF}The ability to Change Distance is Not Enabled, Enable it: {dc4747}"..ini.commands.givemedist, 0x73b461) end return false elseif cmd:find("^"..ini.commands.drawdistanceair.." .+") or cmd:find("^"..ini.commands.drawdistanceair.."$") then local drawdistair = cmd:match(ini.commands.drawdistanceair.." (.+)") drawdistair = tonumber(drawdistair) if ini.settings.givemedist then if type(drawdistair) ~= 'number' or drawdistair > 3600 or drawdistair < 35 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.drawdistanceair.." [35-3600]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.settings.drawdistair, 0x73b461) else ini.settings.drawdistair = drawdistair save() sliders.drawdistair.v = ini.settings.drawdistair memory.setfloat(12044272, ini.settings.drawdistair..".0", false) sampAddChatMessage(script_name.." {FFFFFF}In Air Draw Distance Set to: {dc4747}"..ini.settings.drawdistair, 0x73b461) end else sampAddChatMessage(script_name.." {FFFFFF}The ability to Change Distance is Not Enabled:, Enable it: {dc4747}"..ini.commands.givemedist, 0x73b461) end return false elseif cmd:find("^"..ini.commands.fogdistance.." .+") or cmd:find("^"..ini.commands.fogdistance.."$") then local fogdist = cmd:match(ini.commands.fogdistance.." (.+)") fogdist = tonumber(fogdist) if ini.settings.givemedist then if type(fogdist) ~= 'number' or fogdist > 500 or fogdist < -100 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.fogdistance.." [0-500]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.settings.fog, 0x73b461) else ini.settings.fog = fogdist save() sliders.fog.v = ini.settings.fog memory.setfloat(13210352, ini.settings.fog..".0", false) sampAddChatMessage(script_name.." {FFFFFF}Fog Distance Set to: {dc4747}"..ini.settings.fog, 0x73b461) end else sampAddChatMessage(script_name.." {FFFFFF}The ability to Change Distance is Not Enabled:, Enable it: {dc4747}"..ini.commands.givemedist, 0x73b461) end return false elseif cmd:find("^"..ini.commands.loddistance.." .+") or cmd:find("^"..ini.commands.loddistance.."$") then local loddist = cmd:match(ini.commands.loddistance.." (.+)") loddist = tonumber(loddist) if ini.settings.givemedist then if type(loddist) ~= 'number' or loddist > 300 or loddist < 0 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.loddistance.." [0-300]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.settings.lod, 0x73b461) else ini.settings.lod = loddist save() sliders.lod.v = ini.settings.lod memory.setfloat(0x854FD8, ini.settings.lod..".0", false) sampAddChatMessage(script_name.." {FFFFFF}Lod Distance Set to: {dc4747}"..ini.settings.lod, 0x73b461) end else sampAddChatMessage(script_name.." {FFFFFF}The ability to Change Distance is Not Enabled:, Enable it: {dc4747}"..ini.commands.givemedist, 0x73b461) end return false elseif cmd:find("^"..ini.commands.shownicks.."$") then ini.settings.shownicks = not ini.settings.shownicks gotofunc("ShowNICKS") save() sampAddChatMessage(ini.settings.shownicks and script_name..' {FFFFFF}Player NickNames have been {dc4747}Disabled' or script_name..' {FFFFFF}Player NickNames have been {73b461}Enabled', 0x73b461) return false elseif cmd:find("^"..ini.commands.showhp.."$") then ini.settings.showhp = not ini.settings.showhp save() sampAddChatMessage(ini.settings.showhp and script_name..' {FFFFFF}Player HP Bar has been {dc4747}Disabled' or script_name..' {FFFFFF}Player HP Bar has been {73b461}Enabled', 0x73b461) gotofunc("ShowHP") return false elseif cmd:find("^"..ini.commands.hphud.."$") then ini.hphud.active = not ini.hphud.active sampAddChatMessage(ini.hphud.active and script_name..' {FFFFFF}Digital Health Indicator has been {73b461}Enabled' or script_name..' {FFFFFF}Digital Health Indicator has been {dc4747}Disabled', 0x73b461) save() if ini.hphud.active == false then sampTextdrawDelete(2029) end return false elseif cmd:find("^"..ini.commands.offradio.."$") then ini.settings.noradio = not ini.settings.noradio save() sampAddChatMessage(ini.settings.noradio and script_name..' {FFFFFF}Radio has been {73b461}Enabled' or script_name..' {FFFFFF}Radio has been {dc4747}Disabled', 0x73b461) gotofunc("NoRadio") return false elseif cmd:find("^"..ini.commands.clearchat.."$") then gotofunc("ClearChat") return false elseif cmd:find("^"..ini.commands.showchat.."$") then ini.settings.showchat = not ini.settings.showchat sampAddChatMessage(ini.settings.showchat and script_name..' {FFFFFF}Chat has been {73b461}UnHidden' or script_name..' {FFFFFF}Chat has been {dc4747}Hidden', 0x73b461) save() gotofunc("ShowCHAT") return false elseif cmd:find("^"..ini.commands.showhud.."$") then ini.settings.showhud = not ini.settings.showhud sampAddChatMessage(ini.settings.showhud and script_name..' {FFFFFF}HUD Has been {73b461}UnHidden' or script_name..' {FFFFFF}HUD has been {dc4747}Hidden', 0x73b461) save() gotofunc("ShowHUD") return false elseif cmd:find("^"..ini.commands.animmoney.." .+") or cmd:find("^"..ini.commands.animmoney.."$") then local param = cmd:match(ini.commands.animmoney.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param > 3 or param < 1 then sampAddChatMessage(script_name.." {FFFFFF}Use: {DC4747}"..ini.commands.animmoney.." [1-3]", 0x73b461) else ini.settings.animmoney = param save() radio_animmoney = imgui.ImInt(ini.settings.animmoney) if ini.settings.animmoney == 1 then sampAddChatMessage(script_name.." {FFFFFF}Money Change Animation has been changed to: {DC4747}Fast", 0x73b461) elseif ini.settings.animmoney == 2 then sampAddChatMessage(script_name.." {FFFFFF}Money Change Animation has been changed to: {DC4747}No Animation", 0x73b461) elseif ini.settings.animmoney == 3 then sampAddChatMessage(script_name.." {FFFFFF}Money Change Animation has been changed to: {DC4747}Standard", 0x73b461) end end return false elseif cmd:find("^"..ini.commands.bighpbar.."$") then ini.settings.bighpbar = not ini.settings.bighpbar sampAddChatMessage(ini.settings.bighpbar and script_name..' {FFFFFF}160hp Bar has been {73b461}Enabled' or script_name..' {FFFFFF}160hp Bar has been {dc4747}Disabled', 0x73b461) save() gotofunc("BigHPBar") return false elseif cmd:find("^"..ini.commands.fpslock.."$") then ini.settings.unlimitfps = not ini.settings.unlimitfps sampAddChatMessage(ini.settings.unlimitfps and script_name..' {FFFFFF}FPS Unlock has been {73b461}Enabled' or script_name..' {FFFFFF}FPS Unlock has been {dc4747}Disabled', 0x73b461) save() gotofunc("FPSUnlock") return false elseif cmd:find("^"..ini.commands.postfx.."$") then ini.settings.postfx = not ini.settings.postfx sampAddChatMessage(ini.settings.postfx and script_name..' {FFFFFF}Postfx has been {73b461}Enabled' or script_name..' {FFFFFF}Postfx has been {dc4747}Disabled', 0x73b461) save() gotofunc("NoPostfx") return false elseif cmd:find("^"..ini.commands.antiblockedplayer.."$") then ini.settings.antiblockedplayer = not ini.settings.antiblockedplayer checkboxes.antiblockedplayer.v = ini.settings.antiblockedplayer save() sampAddChatMessage(ini.settings.antiblockedplayer and script_name..' {FFFFFF}Anti-Stuck has been {73b461}Enabled' or script_name..' {FFFFFF}Anti-Stuck has been {dc4747}Disabled', 0x73b461) return false elseif cmd:find("^"..ini.commands.chatopenfix.."$") then ini.settings.chatt = not ini.settings.chatt checkboxes.chatt.v = ini.settings.chatt save() sampAddChatMessage(ini.settings.chatt and script_name..' {FFFFFF}Chat Opening Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Chat Opening Fix has been {dc4747}Disabled', 0x73b461) return false elseif cmd:find("^"..ini.commands.autocleaner.."$") then ini.cleaner.autoclean = not ini.cleaner.autoclean save() sampAddChatMessage((script_name.."{FFFFFF} CLL has been % s"):format(ini.cleaner.autoclean and "{73b461}Enabled" or "{dc4747}Disabled"), 0x73b461) return false elseif cmd:find("^"..ini.commands.cleanmemory.."$") then gotofunc("CleanMemory") return false elseif cmd:find("^"..ini.commands.cleaninfo.."$") then ini.cleaner.cleaninfo = not ini.cleaner.cleaninfo save() checkboxes.cleaninfo.v = ini.cleaner.cleaninfo sampAddChatMessage(ini.cleaner.cleaninfo and script_name..' {FFFFFF}CLL Infomer has been {73b461}Enabled' or script_name..' {FFFFFF}CCL Informer has been {dc4747}Disabled', 0x73b461) return false elseif cmd:find("^"..ini.commands.setmbforautocleaner.." .+") or cmd:find("^"..ini.commands.setmbforautocleaner.."$") then local setccl = cmd:match(ini.commands.setmbforautocleaner.." (.+)") setccl = tonumber(setccl) if type(setccl) ~= 'number' or setccl > 2000 or setccl < 0 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.setmbforautocleaner.." [0-2000 MB]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.cleaner.limit.." MB", 0x73b461) else ini.cleaner.limit = setccl save() sampAddChatMessage(script_name.." {FFFFFF}CCL Memory has been set to: {dc4747}"..ini.cleaner.limit.." MB", 0x73b461) end return false elseif cmd:find("^"..ini.commands.nobirds.."$") then ini.settings.nobirds = not ini.settings.nobirds save() sampAddChatMessage(ini.settings.nobirds and script_name..' {FFFFFF}Birds has been{73b461}Enabled' or script_name..' {FFFFFF}Birds has been {dc4747}Disabled', 0x73b461) gotofunc("NoBirds") return false elseif cmd:find("^"..ini.commands.nodust.."$") then ini.settings.nodust = not ini.settings.nodust save() sampAddChatMessage(ini.settings.nodust and script_name..' {FFFFFF}Dust has been {73b461}Enabled' or script_name..' {FFFFFF}Dust has been {dc4747}Disabled', 0x73b461) gotofunc("NoDust") return false elseif cmd:find("^"..ini.commands.fixtimecyc.."$") then ini.fixtimecyc.active = not ini.fixtimecyc.active sampAddChatMessage(ini.fixtimecyc.active and script_name..' {FFFFFF}Timecycle Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Timecycle Fix has been {dc4747}Disabled', 0x73b461) save() gotofunc("FixTimecyc") return false elseif cmd:find("^"..ini.commands.effects.."$") then ini.settings.effects = not ini.settings.effects save() sampAddChatMessage(ini.settings.effects and script_name..' {FFFFFF}Effects has been {73b461}Enabled' or script_name..' {FFFFFF}Effects has been {dc4747}Disabled', 0x73b461) gotofunc("NoEffects") return false elseif cmd:find("^"..ini.commands.editcrosshair.." .+%s.+") or cmd:find("^"..ini.commands.editcrosshair.."$") then local crX1 = cmd:match(ini.commands.editcrosshair.." (.+)%s.+") local crY1 = cmd:match(ini.commands.editcrosshair.." .+%s(.+)") crX1 = tonumber(crX1) crY1 = tonumber(crY1) if type(crY1) ~= 'number' or type(crX1) ~= 'number' or crX1 > 1000 or crX1 < 0 or crY1 > 1000 or crY1 < 0 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.editcrosshair.." X: [0-1000] Y: [0-1000]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}X: "..ini.settings.crosshairX.." Y: "..ini.settings.crosshairY, 0x73b461) else ini.settings.crosshairX = crX1 ini.settings.crosshairY = crY1 buffers.vmenu_crx.v = crX1 buffers.vmenu_cry.v = crY1 save() memory.setfloat(8755780, ini.settings.crosshairX..".0", false) memory.setfloat(8755804, ini.settings.crosshairY..".0", false) sampAddChatMessage(script_name.." {FFFFFF}Crosshair Size Set to: {dc4747}X: "..ini.settings.crosshairX.." Y: "..ini.settings.crosshairY, 0x73b461) end return false elseif cmd:find("^"..ini.commands.shadowedit.."$") then ini.settings.shadowedit = not ini.settings.shadowedit save() sampAddChatMessage(ini.settings.shadowedit and script_name..' {FFFFFF}Ability to edit Shadows has been {73b461}Enabled' or script_name..' {FFFFFF}Ability to edit Shadows has been {dc4747}Disabled', 0x73b461) gotofunc("ShadowEdit") return false elseif cmd:find("^"..ini.commands.nocloudbig.."$") then ini.settings.nocloudbig = not ini.settings.nocloudbig save() sampAddChatMessage(ini.settings.nocloudbig and script_name..' {FFFFFF}BigClouds has been {73b461}Enabled' or script_name..' {FFFFFF}bigClouds has been {dc4747}disabled', 0x73b461) gotofunc("NoCloudBig") return false elseif cmd:find("^"..ini.commands.nocloudsmall.."$") then ini.settings.nocloudsmall = not ini.settings.nocloudsmall save() sampAddChatMessage(ini.settings.nocloudsmall and script_name..' {FFFFFF}SmallClouds has been {73b461}Enabled' or script_name..' {FFFFFF}SmallClouds has been {dc4747}Disabled', 0x73b461) gotofunc("NoCloudSmall") return false elseif cmd:find("^"..ini.commands.noshadows.."$") then ini.settings.noshadows = not ini.settings.noshadows save() sampAddChatMessage(ini.settings.noshadows and script_name..' {FFFFFF}Shadows has been {73b461}Enabled' or script_name..' {FFFFFF}Shadows has been {dc4747}Disabled', 0x73b461) gotofunc("NoShadows") return false elseif cmd:find("^"..ini.commands.vehlods.."$") then ini.settings.vehlods = not ini.settings.vehlods save() sampAddChatMessage(ini.settings.vehlods and script_name..' {FFFFFF}VehLods has been {73b461}Enabled' or script_name..' {FFFFFF}VehLods has been {dc4747}Disabled', 0x73b461) gotofunc("VehLods") return false elseif cmd:find("^"..ini.commands.fixcrosshair.."$") then ini.settings.fixcrosshair = not ini.settings.fixcrosshair save() sampAddChatMessage(ini.settings.fixcrosshair and script_name..' {FFFFFF}Crosshair White Dot Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Crosshair White Dot Fix has been {dc4747}Disabled', 0x73b461) gotofunc("FixCrosshair") return false elseif cmd:find("^"..ini.commands.intrun.."$") then ini.settings.intrun = not ini.settings.intrun save() sampAddChatMessage(ini.settings.intrun and script_name..' {FFFFFF}InteriorRun has been {73b461}Enabled' or script_name..' {FFFFFF}InteriorRun has been {dc4747}Disabled', 0x73b461) gotofunc("InteriorRun") return false elseif cmd:find("^"..ini.commands.waterfixquadro.."$") then ini.settings.waterfixquadro = not ini.settings.waterfixquadro save() sampAddChatMessage(ini.settings.waterfixquadro and script_name..' {FFFFFF}Square Water fix has been {73b461}Enabled' or script_name..' {FFFFFF}Square Water fix has been {dc4747}Disabled', 0x73b461) gotofunc("FixWaterQuadro") return false elseif cmd:find("^"..ini.commands.longarmfix.."$") then ini.settings.longarmfix = not ini.settings.longarmfix save() sampAddChatMessage(ini.settings.longarmfix and script_name..' {FFFFFF}LongArm fix has been {73b461}Enabled' or script_name..' {FFFFFF}LongArm fix has been {dc4747}Disabled', 0x73b461) gotofunc("FixLongArm") return false elseif cmd:find("^"..ini.commands.fixblackroads.."$") then ini.settings.fixblackroads = not ini.settings.fixblackroads save() sampAddChatMessage(ini.settings.fixblackroads and script_name..' {FFFFFF}BlackRoads fix has been {73b461}Enabled' or script_name..' {FFFFFF}BlackRoads fix has been {dc4747}Disabled', 0x73b461) gotofunc("FixBlackRoads") return false elseif cmd:find("^"..ini.commands.sensfix.."$") then ini.settings.sensfix = not ini.settings.sensfix save() sampAddChatMessage(ini.settings.sensfix and script_name..' {FFFFFF}Sensitivity fix has been {73b461}Enabled' or script_name..' {FFFFFF}Sensitivity fix has been {dc4747}Disabled', 0x73b461) gotofunc("FixSensitivity") return false elseif cmd:find("^"..ini.commands.audiostream.."$") then ini.settings.audiostream = not ini.settings.audiostream save() sampAddChatMessage(ini.settings.audiostream and script_name..' {FFFFFF}AudioStream has been {73b461}Enabled' or script_name..' {FFFFFF}AudioStream has been {dc4747}Disabled', 0x73b461) gotofunc("AudioStream") return false elseif cmd:find("^"..ini.commands.intmusic.."$") then ini.settings.intmusic = not ini.settings.intmusic save() sampAddChatMessage(ini.settings.intmusic and script_name..' {FFFFFF}Interior Music has been {73b461}Enabled' or script_name..' {FFFFFF}Interior Music has been {dc4747}Disabled', 0x73b461) gotofunc("InteriorMusic") return false elseif cmd:find("^"..ini.commands.nosounds.."$") then ini.settings.nosounds = not ini.settings.nosounds save() sampAddChatMessage(ini.settings.nosounds and script_name..' {FFFFFF}Sounds has been {73b461}Enabled' or script_name..' {FFFFFF}NoSounds has been {dc4747}Disabled', 0x73b461) gotofunc("NoSounds") return false elseif cmd:find("^"..ini.commands.noplaneline.."$") then ini.settings.noplaneline = not ini.settings.noplaneline save() sampAddChatMessage(ini.settings.noplaneline and script_name..' {FFFFFF}Plane Lines has been {73b461}Enabled' or script_name..' {FFFFFF}Plane Lines has been {dc4747}Disabled', 0x73b461) gotofunc("NoPlaneLine") return false elseif cmd:find("^"..ini.commands.blockkeys.."$") then ini.settings.blockkeys = not ini.settings.blockkeys save() sampAddChatMessage(ini.settings.blockkeys and script_name..' {FFFFFF}Locking SA-MP Keys has been {73b461}Enabled' or script_name..' {FFFFFF}Locking SA-MP Keys has been {dc4747}Disabled', 0x73b461) gotofunc("BlockSampKeys") return false elseif cmd:find("^"..ini.commands.sunfix.."$") then ini.settings.sunfix = not ini.settings.sunfix save() sampAddChatMessage(ini.settings.sunfix and script_name..' {FFFFFF}Sun Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Sun Fix has been {dc4747}Disabled', 0x73b461) gotofunc("SunFix") return false elseif cmd:find("^"..ini.commands.targetblip.."$") then ini.settings.targetblip = not ini.settings.targetblip save() sampAddChatMessage(ini.settings.targetblip and script_name..' {FFFFFF}TagetBlip has been {73b461}Enabled' or script_name..' {FFFFFF}TargetBlip has been {dc4747}Disabled', 0x73b461) gotofunc("TargetBlip") return false elseif cmd:find("^"..ini.commands.vsync.."$") then ini.settings.vsync = not ini.settings.vsync save() sampAddChatMessage(ini.settings.vsync and script_name..' {FFFFFF}Vsync has been {73b461}Enabled' or script_name..' {FFFFFF}Vsync has been {dc4747}Disabled', 0x73b461) gotofunc("Vsync") return false elseif cmd:find("^"..ini.commands.radarfix.."$")then ini.settings.radarfix = not ini.settings.radarfix save() sampAddChatMessage(ini.settings.radarfix and script_name..' {FFFFFF}Radar Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Radar Fix has been {dc4747}Disabled', 0x73b461) gotofunc("Radarfix") return false elseif cmd:find("^"..ini.commands.radar_color_fix.."$")then ini.settings.radar_color_fix = not ini.settings.radar_color_fix save() checkboxes.radar_color_fix.v = ini.settings.radar_color_fix sampAddChatMessage(ini.settings.radar_color_fix and script_name..' {FFFFFF}Radar Outline Color Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Radar Outline Color Fix has been {dc4747}Disabled', 0x73b461) gotofunc("RadarColorFix") return false elseif cmd:find("^"..ini.commands.dual_monitor_fix.."$")then ini.settings.dual_monitor_fix = not ini.settings.dual_monitor_fix save() checkboxes.dual_monitor_fix.v = ini.settings.dual_monitor_fix sampAddChatMessage(ini.settings.dual_monitor_fix and script_name..' {FFFFFF}Dual Monitor Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Dual Monitor Fix has been {dc4747}Disabled', 0x73b461) return false elseif cmd:find("^"..ini.commands.adkfix.."$")then ini.settings.adkfix = not ini.settings.adkfix save() checkboxes.adkfix.v = ini.settings.adkfix sampAddChatMessage(ini.settings.adkfix and script_name..' {FFFFFF}Ninja Hijack Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Ninja Hijack Fix has been {dc4747}Disabled', 0x73b461) return false elseif cmd:find("^"..ini.commands.fixtaxilight.."$")then ini.settings.fixtaxilight = not ini.settings.fixtaxilight save() checkboxes.fixtaxilight.v = ini.settings.fixtaxilight sampAddChatMessage(ini.settings.fixtaxilight and script_name..' {FFFFFF}Taxi Light Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Taxi Light Fix has been {dc4747}Disabled', 0x73b461) gotofunc("FixTaxiLight") return false elseif cmd:find("^"..ini.commands.radarWidth.." .+") or cmd:find("^"..ini.commands.radarWidth.."$")then local param = cmd:match(ini.commands.radarWidth.." (.+)") param = tonumber(param) if type(param) ~= 'number' then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.radarWidth.." [Number]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.settings.radarWidth, 0x73b461) else ini.settings.radarWidth = param save() sliders.radarw.v = ini.settings.radarWidth gotofunc("Radarfix") sampAddChatMessage(script_name.." {FFFFFF}Radar Height has been set to: {dc4747}"..ini.settings.radarWidth, 0x73b461) end return false elseif cmd:find("^"..ini.commands.radarHeight.." .+") or cmd:find("^"..ini.commands.radarHeight.."$")then local param = cmd:match(ini.commands.radarHeight.." (.+)") param = tonumber(param) if type(param) ~= 'number' then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.radarHeight.." [Number]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.settings.radarHeight, 0x73b461) else ini.settings.radarHeight = param save() sliders.radarh.v = ini.settings.radarHeight gotofunc("Radarfix") sampAddChatMessage(script_name.." {FFFFFF}Radar Witch has been set to: {dc4747}"..ini.settings.radarHeight, 0x73b461) end return false elseif cmd:find("^"..ini.commands.radarx.." .+") or cmd:find("^"..ini.commands.radarx.."$")then local param = cmd:match(ini.commands.radarx.." (.+)") param = tonumber(param) if type(param) ~= 'number' then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.radarx.." [Number]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.settings.radarPosX, 0x73b461) else ini.settings.radarPosX = param save() sliders.radarposx.v = ini.settings.radarPosX gotofunc("Radarfix") sampAddChatMessage(script_name.." {FFFFFF}Radar X Position has been set to: {dc4747}"..ini.settings.radarPosX, 0x73b461) end return false elseif cmd:find("^"..ini.commands.radary.." .+") or cmd:find("^"..ini.commands.radary.."$")then local param = cmd:match(ini.commands.radary.." (.+)") param = tonumber(param) if type(param) ~= 'number' then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.radary.." [Number]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.settings.radarPosY, 0x73b461) else ini.settings.radarPosY = param save() sliders.radarposy.v = ini.settings.radarPosY gotofunc("Radarfix") sampAddChatMessage(script_name.." {FFFFFF}Radar Y Position has been set to: {dc4747}"..ini.settings.radarPosY, 0x73b461) end return false elseif cmd:find("^"..ini.commands.ugenrl.."$")then ini.ugenrl_main.enable = not ini.ugenrl_main.enable checkboxes.ugenrl_enable.v = ini.ugenrl_main.enable if ini.ugenrl_main.autonosounds then if ini.ugenrl_main.enable then ini.settings.nosounds = false else ini.settings.nosounds = true end save() gotofunc("NoSounds") end sampAddChatMessage(ini.ugenrl_main.enable and script_name.." {FFFFFF}Ultimate Genrl has been {73b461}Enabled" or script_name.." {FFFFFF}Ultimate Genrl has been {dc4747}Disabled", 0x73b461) return false elseif cmd:find("^"..ini.commands.autonosounds.."$")then ini.ugenrl_main.autonosounds = not ini.ugenrl_main.autonosounds checkboxes.autonosounds.v = ini.ugenrl_main.autonosounds save() sampAddChatMessage(ini.ugenrl_main.autonosounds and script_name.." {FFFFFF}Auto Disabled Sounds has been {73b461}Enabled" or script_name.." {FFFFFF}Auto Disabled Sounds has been {dc4747}Disabled", 0x73b461) return false elseif cmd:find("^"..ini.commands.uds.." .+") or cmd:find("^"..ini.commands.uds.."$")then local param = cmd:match(ini.commands.uds.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 1 or param > tonumber(#deagleSounds) then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.uds.." [1-"..#deagleSounds.."]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..getNumberSounds(24, deagleSounds), 0x73b461) else changeSound(24, deagleSounds[param]) save() sampAddChatMessage(script_name.." {FFFFFF}Deagle Sound has been set to: {dc4747}"..param, 0x73b461) end return false elseif cmd:find("^"..ini.commands.uss.." .+") or cmd:find("^"..ini.commands.uss.."$")then local param = cmd:match(ini.commands.uss.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 1 or param > tonumber(#shotgunSounds) then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.uss.." [1-"..#shotgunSounds.."]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..getNumberSounds(25, shotgunSounds), 0x73b461) else changeSound(25, shotgunSounds[param]) save() sampAddChatMessage(script_name.." {FFFFFF}Shotgun Sound has been set to: {dc4747}"..param, 0x73b461) end return false elseif cmd:find("^"..ini.commands.ums.." .+") or cmd:find("^"..ini.commands.ums.."$")then local param = cmd:match(ini.commands.ums.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 1 or param > tonumber(#m4Sounds) then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.ums.." [1-"..#m4Sounds.."]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..getNumberSounds(31, m4Sounds), 0x73b461) else changeSound(31, m4Sounds[param]) save() sampAddChatMessage(script_name.." {FFFFFF}M4 Sound has been set to: {dc4747}"..param, 0x73b461) end return false elseif cmd:find("^"..ini.commands.urs.." .+") or cmd:find("^"..ini.commands.urs.."$")then local param = cmd:match(ini.commands.urs.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 1 or param > tonumber(#rifleSounds) then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.urs.." [1-"..#rifleSounds.."]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..getNumberSounds(33, rifleSounds), 0x73b461) else changeSound(33, rifleSounds[param]) save() sampAddChatMessage(script_name.." {FFFFFF}Rifle Sound has been set to: {dc4747}"..param, 0x73b461) end return false elseif cmd:find("^"..ini.commands.ursp.." .+") or cmd:find("^"..ini.commands.ursp.."$")then local param = cmd:match(ini.commands.urs.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 1 or param > tonumber(#sniperSounds) then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.urs.." [1-"..#sniperSounds.."]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..getNumberSounds(34, sniperSounds), 0x73b461) else changeSound(34, sniperSounds[param]) save() sampAddChatMessage(script_name.." {FFFFFF}Sniper Sound has been set to: {dc4747}"..param, 0x73b461) end elseif cmd:find("^"..ini.commands.uuzi.." .+") or cmd:find("^"..ini.commands.uuzi.."$")then local param = cmd:match(ini.commands.uuzi.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 1 or param > tonumber(#uziSounds) then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.uuzi.." [1-"..#uziSounds.."]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..getNumberSounds(28, uziSounds), 0x73b461) else changeSound(28, uziSounds[param]) save() sampAddChatMessage(script_name.." {FFFFFF}Uzi Sound has been set to: {dc4747}"..param, 0x73b461) end return false elseif cmd:find("^"..ini.commands.ump5.." .+") or cmd:find("^"..ini.commands.ump5.."$")then local param = cmd:match(ini.commands.ump5.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 1 or param > tonumber(#mp5Sounds) then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.ump5.." [1-"..#mp5Sounds.."]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..getNumberSounds(29, mp5Sounds), 0x73b461) else changeSound(29, mp5Sounds[param]) save() sampAddChatMessage(script_name.." {FFFFFF}Mp5 Sound has been set to: {dc4747}"..param, 0x73b461) end return false elseif cmd:find("^"..ini.commands.ubs.." .+") or cmd:find("^"..ini.commands.ubs.."$")then local param = cmd:match(ini.commands.ubs.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 1 or param > tonumber(#hitSounds) then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.ubs.." [1-"..#hitSounds.."]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..getNumberSounds("hit", hitSounds), 0x73b461) else changeSound("hit", hitSounds[param]) save() sampAddChatMessage(script_name.." {FFFFFF}Hitsound has been set to: {dc4747}"..param, 0x73b461) end return false elseif cmd:find("^"..ini.commands.ups.." .+") or cmd:find("^"..ini.commands.ups.."$")then local param = cmd:match(ini.commands.ups.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 1 or param > tonumber(#painSounds) then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.ups.." [1-"..#painSounds.."]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..getNumberSounds("pain", painSounds), 0x73b461) else changeSound("pain", painSounds[param]) save() sampAddChatMessage(script_name.." {FFFFFF}PainSound has been set to: {dc4747}"..param, 0x73b461) end return false elseif cmd:find("^"..ini.commands.ugd.." .+") or cmd:find("^"..ini.commands.ugd.."$")then local param = cmd:match(ini.commands.ugd.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 0 or param > 100 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.ugd.." [0-100]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.ugenrl_main.enemyWeaponDist, 0x73b461) else ini.ugenrl_main.enemyWeaponDist = param save() sampAddChatMessage(script_name.." {FFFFFF}Enemy Weapon Sound Dist has been to: {dc4747}"..ini.ugenrl_main.enemyWeaponDist, 0x73b461) end return false elseif cmd:find("^"..ini.commands.ugvw.." .+") or cmd:find("^"..ini.commands.ugvw.."$")then local param = cmd:match(ini.commands.ugvw.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 0.00 or param > 1.00 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.ugvw.." [0.0-1.00]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.ugenrl_volume.weapon, 0x73b461) else ini.ugenrl_volume.weapon = param save() sampAddChatMessage(script_name.." {FFFFFF}Shots Sound volume has been set to: {dc4747}"..ini.ugenrl_volume.weapon, 0x73b461) end return false elseif cmd:find("^"..ini.commands.ugvh.." .+") or cmd:find("^"..ini.commands.ugvh.."$")then local param = cmd:match(ini.commands.ugvh.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 0.00 or param > 1.00 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.ugvh.." [0.0-1.00]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.ugenrl_volume.hit, 0x73b461) else ini.ugenrl_volume.hit = param save() sampAddChatMessage(script_name.." {FFFFFF}HitSound Volume has been set to: {dc4747}"..ini.ugenrl_volume.hit, 0x73b461) end return false elseif cmd:find("^"..ini.commands.ugvp.." .+") or cmd:find("^"..ini.commands.ugvp.."$")then local param = cmd:match(ini.commands.ugvp.." (.+)") param = tonumber(param) if type(param) ~= 'number' or param < 0.00 or param > 1.00 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.ugvp.." [0.0-1.00]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.ugenrl_volume.pain, 0x73b461) else ini.ugenrl_volume.pain = param save() sampAddChatMessage(script_name.." {FFFFFF}PainSound Volume has been set to: {dc4747}"..ini.ugenrl_volume.pain, 0x73b461) end return false elseif cmd:find("^"..ini.commands.forceaniso.."$")then ini.settings.forceaniso = not ini.settings.forceaniso save() sampAddChatMessage(ini.settings.forceaniso and script_name..' {FFFFFF}Anisotropic texture filtering has been {73b461}Enabled' or script_name..' {FFFFFF}Anisotropic texture filtering has been {dc4747}Disabled', 0x73b461) gotofunc("ForceAniso") return false elseif cmd:find("^"..ini.commands.mapzoomfixer.."$")then ini.settings.mapzoomfixer = not ini.settings.mapzoomfixer checkboxes.mapzoomfixer.v = ini.settings.mapzoomfixer save() sampAddChatMessage(ini.settings.mapzoomfixer and script_name..' {FFFFFF}Map Zoom Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Map Zoom Fix has been {dc4747}Disabled', 0x73b461) return false elseif cmd:find("^"..ini.commands.shadowcp.." .+") or cmd:find("^"..ini.commands.shadowcp.."$")then local param = cmd:match(ini.commands.shadowcp.." (.+)") param = tonumber(param) if ini.settings.shadowedit then if type(param) ~= 'number' or param < 0 or param > 255 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.shadowcp.." [0-255]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.settings.shadowcp, 0x73b461) else ini.settings.shadowcp = param save() sliders.shadowcp.v = ini.settings.shadowcp gotofunc("ShadowEdit") sampAddChatMessage(script_name.." {FFFFFF}Shadow Opacity has been set to: {dc4747}"..ini.settings.shadowcp, 0x73b461) end else sampAddChatMessage(script_name.." {FFFFFF}Ability to Edit Shadows is disabled, Enable it: {dc4747}"..ini.commands.shadowedit, 0x73b461) end return false elseif cmd:find("^"..ini.commands.shadowlight.." .+") or cmd:find("^"..ini.commands.shadowlight.."$")then local param = cmd:match(ini.commands.shadowlight.." (.+)") param = tonumber(param) if ini.settings.shadowedit then if type(param) ~= 'number' or param < 0 or param > 255 then sampAddChatMessage(script_name.." {FFFFFF}Use: {dc4747}"..ini.commands.shadowlight.." [0-255]", 0x73b461) sampAddChatMessage(script_name.." {FFFFFF}Current Parameter: {dc4747}"..ini.settings.shadowlight, 0x73b461) else ini.settings.shadowlight = param save() sliders.shadowlight.v = ini.settings.shadowlight gotofunc("ShadowEdit") sampAddChatMessage(script_name.." {FFFFFF}Shadow Light has been set to: {dc4747}"..ini.settings.shadowlight, 0x73b461) end else sampAddChatMessage(script_name.." {FFFFFF}Ability to Edit Shadows is disabled, Enable it: {dc4747}"..ini.commands.shadowedit, 0x73b461) end return false elseif cmd:find("^"..ini.commands.dhook.."$") then ini.discord.all = not ini.discord.all discord_all.v = ini.discord.all save() sampAddChatMessage(ini.discord.all and script_name..' {FFFFFF}Discord webhook has been {73b461}Enabled' or script_name..' {FFFFFF}Discord webhook has been {dc4747}Disabled', 0x73b461) if ini.discord.all and (ini.discord.url == nil or ini.discord.url == "") then sampAddChatMessage(script_name.." {FFFFFF}Webhook URL empty, set it in Tools tab first", 0x73b461) end return false elseif cmd:find("^"..ini.commands.keyboard.."$") then ini.keyboard.active = not ini.keyboard.active kbShow.v = ini.keyboard.active save() if kbShow.v then imgui.Process = true end sampAddChatMessage(ini.keyboard.active and script_name..' {FFFFFF}Keyboard overlay has been {73b461}Enabled' or script_name..' {FFFFFF}Keyboard overlay has been {dc4747}Disabled', 0x73b461) return false elseif cmd:find("^"..ini.commands.mp3pl.."$") then main_menu.v = true imgui.Process = true tab.v = 7 return false elseif cmd:find("^"..ini.commands.ssao.."$") then bmsSsaoSetOn(not ini.ssao.enable) return false elseif cmd:find("^"..ini.commands.hudchanger.."$") then main_menu.v = true imgui.Process = true tab.v = 11 return false end end function ev.onServerMessage(color, text) if ini.discord.all then sendDiscordWebhook(ini.discord.nick, text) end end function ev.onChatMessage(id, text) if ini.discord.all then sendDiscordWebhook(ini.discord.nick, text) end end function ev.onSendChat(msg) local prefix = ini.discord.cmd if prefix ~= nil and prefix ~= "" then local p = msg:match("^%"..prefix.."(.+)") if p then sendDiscordWebhook(ini.discord.nick, p) return false end end if msg == "/mxaodbg" or (msg ~= nil and msg:match("^/mxaodbg%s")) then local arg = msg:match("^/mxaodbg%s+(%d+)") bmsRsDebugCmd(arg) return false end end function fastquit() local adr = getModuleProcAddress("Kernel32.DLL", "ExitProcess") callFunction(adr, 1, 0, 0) end -- BMS KILLSTATE NATIVE hooks (di sini agar dekat handler ev lain; fungsi bmsKs* di bawah) function ev.onPlayerDeathNotification(killerId, killedId, reason) pcall(bmsKsOnDeath, killerId, killedId, reason) end function ev.onSendGiveDamage(playerId, damage, weapon, bodypart) pcall(bmsKsOnGive, playerId, damage) end function ev.onSendTakeDamage(playerId, damage, weapon, bodypart) end ----------------------------------- [ugenrl] ------------------------------------------------------------ function getListOfSounds(name) local soundFiles = {} local ok, iter, dirObj = pcall(lfs.dir, soundsDir) if not ok or not iter then return soundFiles end for line in iter, dirObj do if type(line) == "string" and line:match(name) then soundFiles[#soundFiles+1] = line end end table.sort(soundFiles) return soundFiles end function loadSounds() deagleSounds = getListOfSounds('Deagle') shotgunSounds = getListOfSounds('Shotgun') rifleSounds = getListOfSounds('Rifle') sniperSounds = getListOfSounds('Sniper') m4Sounds = getListOfSounds('M4') mp5Sounds = getListOfSounds('MP5') uziSounds = getListOfSounds('Uzi') hitSounds = getListOfSounds('Bell') painSounds = getListOfSounds('Pain') end function changeSound(id, name) playSound(name, ini.ugenrl_volume.weapon) ini.ugenrl_sounds[id] = name save() end function getNumberSounds(id, name) for i, v in ipairs(name) do if v == ini.ugenrl_sounds[id] then n = i end end return n end function playSound(soundFile, soundVol, charHandle) if not soundFile or not doesFileExist(soundsDir..soundFile) then return false end if audio then collectgarbage() end if charHandle == nil then audio = loadAudioStream(soundsDir..soundFile) else audio = load3dAudioStream(soundsDir..soundFile) setPlay3dAudioStreamAtChar(audio, charHandle) end setAudioStreamVolume(audio, soundVol) setAudioStreamState(audio, 1) clearSound(audio) end function clearSound(audio) lua_thread.create(function() while getAudioStreamState(audio) == 1 do wait(50) end collectgarbage() end) end -------------- local lanesOk, lanesLib = pcall(require, 'lanes') local discordLanes = nil if lanesOk and lanesLib and lanesLib.configure then pcall(function() discordLanes = lanesLib.configure() end) end function discordEscape(s) s = tostring(s or "") s = s:gsub("\\", "\\\\"):gsub('"', '\\"'):gsub("\n", "\\n"):gsub("\r", "\\r") return s end function discordStrip(s) return tostring(s or ""):gsub("{......}", "") end function discordPost(body) local url = ini.discord.url if url == nil or url == "" then return false end if not url:find("^https://") then return false end if discordLanes then local okLane, laneGen = pcall(function() return discordLanes.gen('*', {package = {path = package.path, cpath = package.cpath}}, function() local requests = require 'requests' local ok, result = pcall(requests.request, "POST", url, { data = body, headers = { ['content-type'] = 'application/json' }, }) if ok and result then result.json, result.xml = nil, nil end return ok end) end) if okLane and laneGen then lua_thread.create(function() local okRun, lh = pcall(laneGen) if not okRun or not lh then return end while true do local st = lh.status if st == 'done' or st == 'error' or st == 'killed' or st == 'cancelled' then return end wait(0) end end) return true end end -- fallback tanpa lanes: thread biasa (request sync di thread terpisah, game tidak freeze) lua_thread.create(function() local okReq, requests = pcall(require, 'requests') if okReq and requests then pcall(requests.request, "POST", url, { data = body, headers = { ['content-type'] = 'application/json' }, }) end end) return true end function sendDiscordWebhook(user, text) if not ini.discord.all then return false end text = discordStrip(text) if text == "" then return false end local okTxt, uTxt = pcall(u8, text) if not okTxt then uTxt = text end return discordPost({ content = uTxt, username = tostring(user or ini.discord.nick or "BMS") }) end function testDiscordWebhook() local keep = ini.discord.all ini.discord.all = true local ok = sendDiscordWebhook(ini.discord.nick, "Test webhook BMS GameFixer OK") ini.discord.all = keep return ok end -- Data keyboard overlay (dari keyboard.lua CaJlaT v2.1, theme dibuang = ikut style GameFixer) local bmsKeyboards = { { { {'Esc', 0x1B}, {'F1', 0x70}, {'F2', 0x71}, {'F3', 0x72}, {'F4', 0x73}, {'F5', 0x74}, {'F6', 0x75}, {'F7', 0x76}, {'F8', 0x77}, {'F9', 0x78}, {'F10', 0x79}, {'F11', 0x7A}, {'F12', 0x7B, 23}, {'PS', 0x2C}, {'SL', 0x91}, {'P', 0x13} }, { {'`', 0xC0}, {'1', 0x31}, {'2', 0x32}, {'3', 0x33}, {'4', 0x34}, {'5', 0x35}, {'6', 0x36}, {'7', 0x37}, {'8', 0x38}, {'9', 0x39}, {'0', 0x30}, {'-', 0xBD}, {'+', 0xBB}, {'<-', 0x08}, {'Ins', 0x2D}, {'Home', 0x24}, {'PgUp', 0x21}, {'NL', 0x90}, {'/', 0x6F}, {'*', 0x6A}, {'-', 0x6D} }, { {'Tab', 0x09}, {'Q', 0x51}, {'W', 0x57}, {'E', 0x45}, {'R', 0x52}, {'T', 0x54}, {'Y', 0x59}, {'U', 0x55}, {'I', 0x49}, {'O', 0x4F}, {'P', 0x50}, {'[', 0xDB}, {']', 0xDD}, {'\\', 0xDC}, {'Del', 0x2E}, {'End', 0x23}, {'PgDn', 0x22, 6}, {'7', 0x67}, {'8', 0x68}, {'9', 0x69}, {'\n+', 0x6B} }, { {'Caps ', 0x14}, {'A', 0x41}, {'S', 0x53}, {'D', 0x44}, {'F', 0x46}, {'G', 0x47}, {'H', 0x48}, {'J', 0x4A}, {'K', 0x4B}, {'L', 0x4C}, {';', 0xBA}, {'\'', 0xDE}, {' Enter ', 0x0D, 96}, {'4', 0x64}, {'5', 0x65}, {'6', 0x66} }, { {' LShift ', 0xA0}, {'Z', 0x5A}, {'X', 0x58}, {'C', 0x43}, {'V', 0x56}, {'B', 0x42}, {'N', 0x4E}, {'M', 0x4D}, {',', 0xBC}, {'.', 0xBE}, {'/', 0xBF}, {' RShift ', 0xA1, 37}, {'/\\', 0x26, 37}, {'1', 0x61}, {'2', 0x62}, {'3', 0x63}, {'\nE', 0x0D} }, { {'Ctrl', 0xA2}, {'Win', 0x5B}, {'Alt', 0xA4}, {' ', 0x20}, {'Alt', 0xA5}, {'Win', 0x5C}, {'Ctrl', 0xA3, 17}, {'<', 0x25}, {'\\/', 0x28}, {'>', 0x27, 16}, {'0 ', 0x60}, {'.', 0x6E} }, }, { { {'Esc', 0x1B}, {'F1', 0x70}, {'F2', 0x71}, {'F3', 0x72}, {'F4', 0x73}, {'F5', 0x74}, {'F6', 0x75}, {'F7', 0x76}, {'F8', 0x77}, {'F9', 0x78}, {'F10', 0x79}, {'F11', 0x7A}, {'F12', 0x7B} }, { {'`', 0xC0}, {'1', 0x31}, {'2', 0x32}, {'3', 0x33}, {'4', 0x34}, {'5', 0x35}, {'6', 0x36}, {'7', 0x37}, {'8', 0x38}, {'9', 0x39}, {'0', 0x30}, {'-', 0xBD}, {'+', 0xBB}, {'<-', 0x08}, {'Ins', 0x2D}, {'Home', 0x24}, {'PU', 0x21} }, { {'Tab', 0x09}, {'Q', 0x51}, {'W', 0x57}, {'E', 0x45}, {'R', 0x52}, {'T', 0x54}, {'Y', 0x59}, {'U', 0x55}, {'I', 0x49}, {'O', 0x4F}, {'P', 0x50}, {'[', 0xDB}, {']', 0xDD}, {'\\', 0xDC}, {'Del', 0x2E}, {'End', 0x23}, {'PD', 0x22} }, { {'Caps ', 0x14}, {'A', 0x41}, {'S', 0x53}, {'D', 0x44}, {'F', 0x46}, {'G', 0x47}, {'H', 0x48}, {'J', 0x4A}, {'K', 0x4B}, {'L', 0x4C}, {';', 0xBA}, {'\'', 0xDE}, {' Enter ', 0x0D} }, { {' LShift ', 0xA0}, {'Z', 0x5A}, {'X', 0x58}, {'C', 0x43}, {'V', 0x56}, {'B', 0x42}, {'N', 0x4E}, {'M', 0x4D}, {',', 0xBC}, {'.', 0xBE}, {'/', 0xBF}, {' RShift ', 0xA1, 33}, {'/\\', 0x26} }, { {'Ctrl', 0xA2}, {'Win', 0x5B}, {'Alt', 0xA4}, {' ', 0x20}, {'Alt', 0xA5}, {'Win', 0x5C}, {'Ctrl', 0xA3, 10}, {'<', 0x25}, {'\\/', 0x28}, {'>', 0x27} }, }, { { {'1', 0x31}, {'2', 0x32}, {'3', 0x33}, {'4', 0x34}, {'5', 0x35}, {'6', 0x36}, {'7', 0x37}, {'8', 0x38}, {'9', 0x39}, {'0', 0x30} }, { {'N', 0x4E}, {' Enter ', 0x0D} }, }, { { {'1', 0x31}, {'2', 0x32}, {'3', 0x33} }, { {'4', 0x34}, {'5', 0x35}, {'6', 0x36} }, { {'7', 0x37}, {'8', 0x38}, {'9', 0x39} }, { {'0', 0x30}, {'N', 0x4E} }, { {' Enter ', 0x0D} }, }, { { {'Tab', 0x09}, {'Q', 0x51}, {'W', 0x57}, {'E', 0x45}, {'R', 0x52} }, { {'Shift', 0x10}, {'A', 0x41}, {'S', 0x53}, {'D', 0x44}, {'C', 0x43} }, { {'Ctrl', 0xA2}, {'Alt', 0xA4}, {' ', 0x20} }, }, } local bmsMouseKeys = { {'LMB', 0x01, 50}, {'MMB', 0x04}, {'RMB', 0x02, 50}, {'FWD', 0x06, _, 53}, {'BWD', 0x05, _, 53}, } function bmsRenderWheel() if #kbWheel > 0 then local p = imgui.GetCursorScreenPos() local draw_list = imgui.GetWindowDrawList() draw_list:AddRectFilled(imgui.ImVec2(p.x, p.y), imgui.ImVec2(p.x+36, p.y+34), imgui.GetColorU32(kbWheel[1][1] > 0 and imgui.GetStyle().Colors[imgui.Col.ButtonActive] or imgui.ImVec4(0,0,0,0)), 10) draw_list:AddRectFilled(imgui.ImVec2(p.x, p.y+16), imgui.ImVec2(p.x+36, p.y+49), imgui.GetColorU32(kbWheel[1][1] < 0 and imgui.GetStyle().Colors[imgui.Col.ButtonActive] or imgui.ImVec4(0,0,0,0)), 10) if kbWheel[1][2] < os.clock() then table.remove(kbWheel, 1) end end end -- scene dasar: angka 1-4 yg ditahan -> scene tsb; selain itu skin idle pilihan user function bmsBongoBaseTex(numDown) local pick = numDown or math.max(1, math.min(4, (tonumber(bmsBongoSkin.v) or 1) + 1)) local t = bmsBongoTex[pick .. '.png'] if t then return t end for i = 1, 4 do if bmsBongoTex[i .. '.png'] then return bmsBongoTex[i .. '.png'] end end return nil end function drawBongoCatOverlay() -- SATU gambar komposit (bukan menyamping): scene dasar + overlay paw (w/a/s/d/ -- space/up/f) ditumpuk di rect yg sama — semua PNG 612x354 shg paw jatuh tepat -- di tombolnya. f.png (1280x673) di-fit-inside + center. bmsBongoLoad() if next(bmsBongoTex) == nil then return end local down = {} for _, e in ipairs(bmsBongoVKs) do local d = false pcall(function() d = isKeyDown(e[1]) end) down[e[1]] = d end local numDown = nil for vk = 0x31, 0x34 do if down[vk] then numDown = vk - 0x30; break end end local base = bmsBongoBaseTex(numDown) if not base then return end local bw, bh = 306, 177 -- 612x354 @0.5 imgui.PushStyleVar(imgui.StyleVar.WindowPadding, imgui.ImVec2(6.0, 6.0)) imgui.PushStyleColor(imgui.Col.WindowBg, imgui.ImVec4(0,0,0,0.35)) imgui.SetNextWindowPos(kbPos, imgui.Cond.FirstUseEver, imgui.ImVec2(0, 0)) local bFlags = imgui.WindowFlags.NoResize + imgui.WindowFlags.NoTitleBar + imgui.WindowFlags.AlwaysAutoResize if not kbMove.v then bFlags = bFlags + imgui.WindowFlags.NoMove end imgui.Begin('##bms_kb_bongo', _, bFlags) kbPos = imgui.GetWindowPos() local cur = imgui.GetCursorScreenPos() local ox, oy = cur.x, cur.y local dl = imgui.GetWindowDrawList() imgui.Dummy(imgui.ImVec2(bw, bh)) -- reserve area agar window pas seukuran gambar dl:AddImage(base, imgui.ImVec2(ox, oy), imgui.ImVec2(ox + bw, oy + bh)) for _, e in ipairs(bmsBongoVKs) do local fname = e[2] -- scene angka sudah jadi base; overlay hanya paw (w/a/s/d/space/up/f) if fname ~= '1.png' and fname ~= '2.png' and fname ~= '3.png' and fname ~= '4.png' then if down[e[1]] then local tex = bmsBongoTex[fname] if tex then if fname == 'f.png' then local s = math.min(bw / 1280, bh / 673) local dw, dh = 1280 * s, 673 * s local fx, fy = ox + (bw - dw) * 0.5, oy + (bh - dh) * 0.5 dl:AddImage(tex, imgui.ImVec2(fx, fy), imgui.ImVec2(fx + dw, fy + dh)) else dl:AddImage(tex, imgui.ImVec2(ox, oy), imgui.ImVec2(ox + bw, oy + bh)) end end end end end imgui.End() imgui.PopStyleColor() imgui.PopStyleVar() end function drawKeyboardOverlay() -- mode 5 dipisah (visual) — panggil handler terpisah di drawToolsOverlays() if kbMode.v == 5 then return end local mode = bmsKeyboards[kbMode.v + 1] or bmsKeyboards[1] imgui.PushStyleVar(imgui.StyleVar.WindowPadding, imgui.ImVec2(5.0, 2.4)) imgui.PushStyleVar(imgui.StyleVar.ItemSpacing, imgui.ImVec2(3.0, 3.0)) imgui.PushStyleVar(imgui.StyleVar.ItemInnerSpacing, imgui.ImVec2(3.0, 3.0)) imgui.PushStyleVar(imgui.StyleVar.ChildWindowRounding, 10.0) imgui.PushStyleColor(imgui.Col.WindowBg, imgui.ImVec4(0,0,0,0)) imgui.SetNextWindowPos(kbPos, imgui.Cond.FirstUseEver, imgui.ImVec2(0, 0)) local kbFlags = imgui.WindowFlags.NoResize + imgui.WindowFlags.NoTitleBar + imgui.WindowFlags.AlwaysAutoResize if not kbMove.v then kbFlags = kbFlags + imgui.WindowFlags.NoMove end imgui.Begin('##bms_kb', _, kbFlags) kbPos = imgui.GetWindowPos() for i, line in ipairs(mode) do if (kbMode.v == 0 or kbMode.v == 1) and i == 4 then imgui.SetCursorPosY(68) elseif (kbMode.v == 0 or kbMode.v == 1) and i == 6 then imgui.SetCursorPosY(112) end for key, v in ipairs(line) do local size = imgui.CalcTextSize(v[1]) local down = false pcall(function() down = isKeyDown(v[2]) end) if down then imgui.PushStyleColor(imgui.Col.ChildWindowBg, imgui.GetStyle().Colors[imgui.Col.ButtonActive]) else imgui.PushStyleColor(imgui.Col.ChildWindowBg, imgui.ImVec4(0,0,0,0.4)) end imgui.BeginChild('##bmskb'..i..'_'..key, imgui.ImVec2(size.x+11, (v[1] == '\n+' or v[1] == '\nE') and size.y + 14 or size.y + 5), true) imgui.Text(v[1]) imgui.EndChild() imgui.PopStyleColor() if key ~= #line then imgui.SameLine() if v[3] then imgui.SameLine(imgui.GetCursorPosX()+v[3]) end end end end imgui.End() imgui.PopStyleColor() imgui.PopStyleVar(4) end function drawMouseOverlay() imgui.PushStyleVar(imgui.StyleVar.WindowPadding, imgui.ImVec2(5.0, 2.4)) imgui.PushStyleVar(imgui.StyleVar.ItemSpacing, imgui.ImVec2(3.0, 3.0)) imgui.PushStyleVar(imgui.StyleVar.ItemInnerSpacing, imgui.ImVec2(3.0, 3.0)) imgui.PushStyleVar(imgui.StyleVar.ChildWindowRounding, 10.0) imgui.PushStyleColor(imgui.Col.WindowBg, imgui.ImVec4(0,0,0,0)) imgui.SetNextWindowPos(kbMousePos, imgui.Cond.FirstUseEver, imgui.ImVec2(0, 0)) local mFlags = imgui.WindowFlags.NoResize + imgui.WindowFlags.NoTitleBar + imgui.WindowFlags.AlwaysAutoResize if not kbMove.v then mFlags = mFlags + imgui.WindowFlags.NoMove end imgui.Begin('##bms_mouse', _, mFlags) kbMousePos = imgui.GetWindowPos() for key, v in ipairs(bmsMouseKeys) do if key == 2 then bmsRenderWheel() imgui.SetCursorPosY(18) elseif key == 3 then imgui.SetCursorPosY(2) end local size = imgui.CalcTextSize(v[1]) local down = false pcall(function() down = isKeyDown(v[2]) end) if down then imgui.PushStyleColor(imgui.Col.ChildWindowBg, imgui.GetStyle().Colors[imgui.Col.ButtonActive]) else imgui.PushStyleColor(imgui.Col.ChildWindowBg, imgui.ImVec4(0,0,0,0.4)) end imgui.BeginChild('##bmsms'..key, imgui.ImVec2(v[4] and v[4] or size.x+11, v[3] and v[3] or size.y+5), true) if v[3] then imgui.SetCursorPosY((v[3]-size.y)/2) end imgui.SetCursorPosX((imgui.GetWindowWidth()-size.x)/2) imgui.Text(v[1]) imgui.EndChild() imgui.PopStyleColor() if key ~= 3 then imgui.SameLine() end end imgui.End() imgui.PopStyleColor() imgui.PopStyleVar(4) end function drawToolsOverlays() if kbShow.v then if kbMode.v == 5 then pcall(drawBongoCatOverlay) else pcall(drawKeyboardOverlay) end end if kbMouse.v then pcall(drawMouseOverlay) end end -------------- local as_action = nil pcall(function() as_action = require('moonloader').audiostream_state end) local bmsMusicDir = 'moonloader/MP3 Player/' function getMusicList() local files = {} local ok, handleFile, nameFile = pcall(findFirstFile, bmsMusicDir..'*.mp3') if not ok or not handleFile then return files end while nameFile do files[#files+1] = nameFile nameFile = findNextFile(handleFile) end pcall(findClose, handleFile) table.sort(files) return files end -- global (tanpa local): dipanggil onScriptTerminate yg posisinya SEBELUM blok ini di file function bmsMusicStopAll() if as_action == nil then bmsPlaysound, bmsOnlineSong = nil, nil return end if bmsPlaysound ~= nil then pcall(setAudioStreamState, bmsPlaysound, as_action.STOP) bmsPlaysound = nil end if bmsOnlineSong ~= nil then pcall(setAudioStreamState, bmsOnlineSong, as_action.STOP) bmsOnlineSong = nil end end function bmsMusicPlayOffline(name) if name == nil or name == "" or as_action == nil then return end bmsMusicStopAll() local ok, st = pcall(loadAudioStream, bmsMusicDir..name) if ok and st ~= nil then bmsPlaysound = st pcall(setAudioStreamState, bmsPlaysound, as_action.PLAY) pcall(setAudioStreamVolume, bmsPlaysound, math.floor(bmsMusicVol.v)) end end function bmsMusicPlayLink(url) if url == nil or url == "" or as_action == nil then return false end if not string.lower(url):find('http', 1, true) then return false end bmsMusicStopAll() local ok, st = pcall(loadAudioStream, url) if ok and st ~= nil then bmsOnlineSong = st pcall(setAudioStreamState, bmsOnlineSong, as_action.PLAY) pcall(setAudioStreamVolume, bmsOnlineSong, math.floor(bmsMusicVol.v)) end return true end -------------- ----------------------------------------------------------------------------------------- function onSendRpc(id, bs, priority, reliability, orderingChannel, shiftTs) if ini.ugenrl_main.enable then if id == 115 then local act = raknetBitStreamReadBool(bs) dmgId = raknetBitStreamReadInt16(bs) dmgValue = raknetBitStreamReadFloat(bs) dmgWeaponId = raknetBitStreamReadInt32(bs) dmgBodypart = raknetBitStreamReadInt32(bs) if ini.ugenrl_main.pain and act then playPain = true end if ini.ugenrl_main.hit and not act then playHit = true end end end end ----------------------------------------------------------------------------------------- function sampGetVersion() local ver = getModuleHandle("samp.dll") if ( ver == 0x0 ) then return false end local cmp = memory.tohex( ver + 0xBABE, 10, true ) if ( cmp == "F8036A004050518D4C24" ) then version = "0.3.7-R1" end return version end function onReceiveRpc(id, bs) if id == 29 and ini.settings.blocktime then return false end if id == 152 and ini.settings.blockweather then return false end end function getposhphud() if ini.hphud.pos == 1 then if ini.hphud.mode == 1 then return 548 elseif ini.hphud.mode == 2 then return 510 end end if ini.hphud.pos == 2 then if ini.hphud.mode == 1 then return 577 elseif ini.hphud.mode == 2 then return 560 end end if ini.hphud.pos == 3 then return 606 end end function stringhphud(param) if ini.hphud.style == 1 then return '_'..param end if ini.hphud.style == 0 then return '' end end function onSystemInitialized() -- These addresses are GTA SA 1.0 / SA-MP 0.3.7-R1 specific. -- Never patch them before the supported runtime is confirmed. local ok, ver = pcall(sampGetVersion) if not ok or ver ~= "0.3.7-R1" then return end pcall(function() writeMemory(0x5B8E55, 4, 90000, false) writeMemory(0x5B8EB0, 4, 90000, false) memory.setfloat(11926728, 1.0, false) end) end function onScriptTerminate(script, quitGame) pcall(function() ini.keyboard.active = kbShow.v ini.keyboard.mouse = kbMouse.v ini.keyboard.move = kbMove.v ini.keyboard.mode = kbMode.v ini.keyboard.kx, ini.keyboard.ky = kbPos.x, kbPos.y ini.keyboard.mx, ini.keyboard.my = kbMousePos.x, kbMousePos.y ini.killstate.ksx, ini.killstate.ksy = bmsKsPos.x, bmsKsPos.y inicfg.save(ini, directIni) end) pcall(function() bmsMusicStopAll() end) if quitGame then sendEmptyPacket(PACKET_DISCONNECTION_NOTIFICATION) local adr = getModuleProcAddress("Kernel32.DLL", "ExitProcess") callFunction(adr, 1, 0, 0) end end function sendEmptyPacket(id) local bs = raknetNewBitStream() raknetBitStreamWriteInt8(bs, id) raknetSendBitStream(bs) raknetDeleteBitStream(bs) end local leftmenu = nil function imgui.BeforeDrawFrame() if leftmenu == nil then local ok, font = pcall(function() local fonts = imgui.GetIO().Fonts return fonts:AddFontFromFileTTF('moonloader//gamefixer//fonts//pricedown_rus.ttf', 20.0, nil, fonts:GetGlyphRangesCyrillic()) end) if ok then leftmenu = font end end -- Only touch the loading asset while the panel is actually being shown. if main_menu and main_menu.v then bmsEnsureLoadingImage() bmsCreateLoadingTexture() end end ------------- [ first-open loading — NEO OBSIDIAN v2 ] ------------- -- Layout, tema & style BARU TOTAL (tidak reuse layout lama). Vertikal, centered, dengan -- ring progress + step indicator + status berganti. Durasi 1.9s, easing sama agar halus. local loadT0 = nil local loadDone = false local loadStepsId = { "Memuat vault & preferensi", "Menyiapkan HUD & overlay", "Sinkronisasi SAMP", "Finalisasi antarmuka" } local loadStepsEn = { "Loading vault & prefs", "Preparing HUD & overlay", "Syncing SAMP", "Finalizing interface" } function drawPanelLoading() local now = os.clock() if not loadT0 then loadT0 = now end -- Slightly longer, but still snappy. The progress is visual only and does not -- alter any initialization logic underneath. local raw = math.min(1, (now - loadT0) / 2.35) local p = uiEaseOutCubic(raw) local light = (ini.settings.theme == 2) local avail = imgui.GetContentRegionAvail() local dl = imgui.GetWindowDrawList() local origin = imgui.GetWindowPos() local cardW = math.min(620, math.max(470, avail.x - 60)) local cardH = math.min(360, math.max(320, avail.y - 80)) local cx = origin.x + (avail.x - cardW) * 0.5 local cy = origin.y + (avail.y - cardH) * 0.5 local cardBg = light and imgui.ImVec4(1.0,1.0,1.0,0.98) or imgui.ImVec4(0.055,0.062,0.075,0.99) local edge = light and imgui.ImVec4(0.07,0.09,0.12,0.10) or imgui.ImVec4(1,1,1,0.08) local muted = light and imgui.ImVec4(0.36,0.39,0.45,0.78) or imgui.ImVec4(1,1,1,0.55) local strong = light and imgui.ImVec4(0.06,0.07,0.09,0.98) or imgui.ImVec4(0.96,0.98,1.0,0.98) local accent = uiAccentColor(0.98, light) dl:AddRectFilled(imgui.ImVec2(cx,cy), imgui.ImVec2(cx+cardW,cy+cardH), imgui.GetColorU32(cardBg), 18.0) dl:AddRect(imgui.ImVec2(cx,cy), imgui.ImVec2(cx+cardW,cy+cardH), imgui.GetColorU32(edge), 18.0, 0, 1.0) -- top utility line dl:AddRectFilled( imgui.ImVec2(cx+24, cy+22), imgui.ImVec2(cx+cardW-24, cy+24), imgui.GetColorU32(light and imgui.ImVec4(0.08,0.10,0.13,0.05) or imgui.ImVec4(1,1,1,0.05)), 1.0 ) local logoSize = 74 local logoX = cx + 34 local logoY = cy + 42 if loadingTexture then dl:AddRectFilled( imgui.ImVec2(logoX-5,logoY-5), imgui.ImVec2(logoX+logoSize+5,logoY+logoSize+5), imgui.GetColorU32(light and imgui.ImVec4(0.05,0.06,0.08,0.06) or imgui.ImVec4(1,1,1,0.06)), 16.0 ) imgui.SetCursorScreenPos(imgui.ImVec2(logoX, logoY)) imgui.Image(loadingTexture, imgui.ImVec2(logoSize, logoSize)) else dl:AddRectFilled( imgui.ImVec2(logoX,logoY), imgui.ImVec2(logoX+logoSize,logoY+logoSize), imgui.GetColorU32(light and imgui.ImVec4(0.08,0.09,0.11,0.06) or imgui.ImVec4(1,1,1,0.06)), 16.0 ) dl:AddText(imgui.ImVec2(logoX+19, logoY+27), imgui.GetColorU32(accent), "BMS") end local tx = logoX + logoSize + 28 imgui.SetCursorScreenPos(imgui.ImVec2(tx, cy+52)) imgui.PushFont(leftmenu) imgui.TextColored(strong, u8("BMS GAMEFIXER")) imgui.PopFont() imgui.SetCursorScreenPos(imgui.ImVec2(tx, cy+82)) imgui.TextColored(muted, u8("BMS STUDIO • BUILD v11")) local steps = (curLang == "id") and loadStepsId or loadStepsEn local sIdx = math.min(#steps, math.max(1, math.floor(p * #steps) + 1)) if p >= 0.985 then sIdx = #steps end local status = steps[sIdx] imgui.SetCursorScreenPos(imgui.ImVec2(tx, cy+118)) imgui.TextColored(strong, u8(status)) -- Step rail, easier to read than a giant rotating ring. local railX = tx local railY = cy + 154 local railW = cardW - (railX - cx) - 34 local railH = 6 dl:AddRectFilled( imgui.ImVec2(railX, railY), imgui.ImVec2(railX+railW, railY+railH), imgui.GetColorU32(light and imgui.ImVec4(0.08,0.10,0.13,0.08) or imgui.ImVec4(1,1,1,0.08)), 3.0 ) dl:AddRectFilled( imgui.ImVec2(railX, railY), imgui.ImVec2(railX+railW*p, railY+railH), imgui.GetColorU32(accent), 3.0 ) for i = 1, #steps do local x = railX + railW * ((i-1) / (#steps-1)) local done = p >= ((i-1) / #steps) local current = (i == sIdx) local dotCol = current and accent or (done and uiAccentColor(0.62, light) or (light and imgui.ImVec4(0.40,0.43,0.49,0.25) or imgui.ImVec4(1,1,1,0.18))) dl:AddCircleFilled(imgui.ImVec2(x, railY + railH*0.5), current and 5.0 or 3.5, imgui.GetColorU32(dotCol), 16) end -- Progress percentage local pct = string.format("%d%%", math.floor(p * 100)) local pctW = imgui.CalcTextSize(pct).x dl:AddText( imgui.ImVec2(cx + cardW - pctW - 30, cy + 54), imgui.GetColorU32(accent), pct ) imgui.SetCursorScreenPos(imgui.ImVec2(tx, cy + 184)) imgui.TextColored(muted, u8((curLang == "id") and "Memulai modul GameFixer..." or "Starting GameFixer modules...")) -- Small checklist at the bottom. local listY = cy + 218 for i = 1, #steps do local done = p >= (i / #steps) local active = (i == sIdx) local labelCol = active and strong or muted local markerCol = done and accent or (light and imgui.ImVec4(0.25,0.28,0.33,0.35) or imgui.ImVec4(1,1,1,0.20)) dl:AddCircleFilled(imgui.ImVec2(tx + 3, listY + 7), active and 4.0 or 3.0, imgui.GetColorU32(markerCol), 12) dl:AddText(imgui.ImVec2(tx + 16, listY), imgui.GetColorU32(labelCol), steps[i]) listY = listY + 24 end dl:AddText( imgui.ImVec2(cx + 26, cy + cardH - 28), imgui.GetColorU32(light and imgui.ImVec4(0.45,0.48,0.54,0.55) or imgui.ImVec4(1,1,1,0.34)), "BMS STUDIO" ) if p >= 1 then loadDone = true end end -- Fungsi untuk mendeteksi hover/klik tombol dan memutar suara local hoverCooldown = 0 local clickCooldown = 0 function handleButtonSound() if imgui.IsItemHovered() and not imgui.IsItemActive() then local now = os.clock() if now - hoverCooldown > 0.1 then playUISound(soundHoverPath, 0.2) hoverCooldown = now end end if imgui.IsItemClicked() then local now = os.clock() if now - clickCooldown > 0.05 then playUISound(soundClickPath, 0.3) clickCooldown = now end end end function drawToolsTab() imgui.BeginChild("##Tools", imgui.ImVec2(-1, -1), true) if imgui.CollapsingHeader(T("Discord Webhook"), true, imgui.TreeNodeFlags.DefaultOpen) then if imgui.Checkbox(T("Discord Active"), discord_all) then ini.discord.all = discord_all.v save() end imgui.Spacing() imgui.Text(T("Discord Name")) imgui.PushItemWidth(-1) if imgui.InputText("##discord_nick", buffers.discord_nick) then ini.discord.nick = buffers.discord_nick.v save() end imgui.PopItemWidth() imgui.Text(T("Discord URL")) imgui.PushItemWidth(-1) if imgui.InputText("##discord_url", buffers.discord_url) then ini.discord.url = buffers.discord_url.v save() end imgui.PopItemWidth() imgui.Text(T("Discord Command")) imgui.PushItemWidth(120) if imgui.InputText("##discord_cmd", buffers.discord_cmd) then ini.discord.cmd = buffers.discord_cmd.v save() end imgui.PopItemWidth() imgui.Spacing() if imgui.Button(T("Save"), imgui.ImVec2(200, 25)) then ini.discord.nick = buffers.discord_nick.v ini.discord.url = buffers.discord_url.v ini.discord.cmd = buffers.discord_cmd.v ini.discord.all = discord_all.v save() handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Send Test"), imgui.ImVec2(200, 25)) then if ini.discord.url == nil or ini.discord.url == "" then -- BMS MOJIBAKE: chat SAMP single-byte, jangan kirim —/• (hanya panel imgui yg UTF-8) sampAddChatMessage(script_name.." {FFFFFF}"..(curLang == "en" and "No URL set - save webhook URL first" or "URL belum diisi - simpan URL webhook dulu"), 0x73b461) else testDiscordWebhook() end handleButtonSound() end handleButtonSound() end imgui.Spacing() imgui.Separator() imgui.Spacing() if imgui.CollapsingHeader(T("Keyboard Overlay"), true, imgui.TreeNodeFlags.DefaultOpen) then if imgui.Checkbox(T("Show Keyboard"), kbShow) then ini.keyboard.active = kbShow.v save() end if imgui.Checkbox(T("Show Mouse"), kbMouse) then ini.keyboard.mouse = kbMouse.v save() end if imgui.Checkbox(T("Allow Window Move"), kbMove) then ini.keyboard.move = kbMove.v save() end imgui.Text(T("Keyboard Mode")) imgui.PushItemWidth(220) if imgui.Combo("##kbmode", kbMode, tKbMode, #tKbMode) then ini.keyboard.mode = kbMode.v save() end imgui.PopItemWidth() imgui.Text(T("KB Bongo Skin")) imgui.PushItemWidth(220) if imgui.Combo("##bongoskin", bmsBongoSkin, tBongoSkin, #tBongoSkin) then ini.keyboard.bongo_skin = math.max(1, math.min(4, (bmsBongoSkin.v or 0) + 1)) save() end imgui.PopItemWidth() end imgui.Spacing() imgui.Separator() imgui.Spacing() if imgui.CollapsingHeader(T("MP3 Player"), true, imgui.TreeNodeFlags.DefaultOpen) then if tab.v == 7 then bmsMusicCache = getMusicList() end -- scan hanya saat tab terbuka if imgui.Button(T("Music Offline"), imgui.ImVec2(200, 25)) then bmsMusicMode = 1 ini.music.mode = 1 save() handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Music Online"), imgui.ImVec2(200, 25)) then bmsMusicMode = 2 ini.music.mode = 2 save() handleButtonSound() end handleButtonSound() imgui.Spacing() if bmsMusicMode == 1 then if #bmsMusicCache == 0 then imgui.TextColored(DIM(0.45), T("No Tracks")) else if bmsMusicSel > #bmsMusicCache then bmsMusicSel = 1 end imgui.BeginChild("##bmsmuslist", imgui.ImVec2(-1, 180), true) for num, name in ipairs(bmsMusicCache) do if imgui.Selectable(u8((name:gsub('%.mp3$', ''))), bmsMusicSel == num) then bmsMusicSel = num end end imgui.EndChild() imgui.Spacing() local track = bmsMusicCache[bmsMusicSel] if track ~= nil then bmsTextU8(u8((track:gsub('%.mp3$', '')))) if imgui.Button(T("Play This Song"), imgui.ImVec2(200, 25)) then bmsMusicPlayOffline(track) handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Stop"), imgui.ImVec2(120, 25)) then bmsMusicStopAll() handleButtonSound() end handleButtonSound() end imgui.Spacing() if imgui.Button(T("Pause"), imgui.ImVec2(150, 25)) then if bmsPlaysound ~= nil and as_action ~= nil then pcall(setAudioStreamState, bmsPlaysound, as_action.PAUSE) end handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Continue"), imgui.ImVec2(150, 25)) then if bmsPlaysound ~= nil and as_action ~= nil then pcall(setAudioStreamState, bmsPlaysound, as_action.RESUME) end handleButtonSound() end handleButtonSound() end else bmsTextColU8(DIM(0.55), T("Online Link Hint")) imgui.Spacing() imgui.PushItemWidth(-1) imgui.InputText("##bmsmuslink", buffers.music_link, imgui.InputTextFlags.EnterReturnsTrue + imgui.InputTextFlags.CharsNoBlank) imgui.PopItemWidth() imgui.Spacing() if imgui.Button(T("Run Via Link"), imgui.ImVec2(200, 25)) then bmsMusicPlayLink(buffers.music_link.v) handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Stop"), imgui.ImVec2(120, 25)) then bmsMusicStopAll() handleButtonSound() end handleButtonSound() imgui.Spacing() if imgui.Button(T("Pause"), imgui.ImVec2(150, 25)) then if bmsOnlineSong ~= nil and as_action ~= nil then pcall(setAudioStreamState, bmsOnlineSong, as_action.PAUSE) end handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Continue"), imgui.ImVec2(150, 25)) then if bmsOnlineSong ~= nil and as_action ~= nil then pcall(setAudioStreamState, bmsOnlineSong, as_action.RESUME) end handleButtonSound() end handleButtonSound() end imgui.Spacing() imgui.Text(T("Volume")) imgui.PushItemWidth(-1) if imgui.SliderFloat("##bmsmusvol", bmsMusicVol, 0, 100) then ini.music.volume = tostring(math.floor(bmsMusicVol.v)) save() if bmsPlaysound ~= nil then pcall(setAudioStreamVolume, bmsPlaysound, math.floor(bmsMusicVol.v)) end if bmsOnlineSong ~= nil then pcall(setAudioStreamVolume, bmsOnlineSong, math.floor(bmsMusicVol.v)) end end imgui.PopItemWidth() end imgui.EndChild() end -- ================= BMS HUDCHANGER 2026-09-06 ================= -- Manajemen 6 kategori texture HUD: -- 1) fist — sprite tangan (fist/*.png, hanya file manager; tab Fist dihapus) -- 2) sitem16 — crosshair Site-M16 .png) → nempel di tab -- 3) radardisc — titik radar (radardisc/.. .png) → nempel di tab -- 4) weapon icon — icon senjata (weapon_icon/.png) → nama WAJIB sama dgn GTA SA -- 5) font hud — font HUD (font_hud/font1+font2.png) — slot kaku -- 6) radar map — tile radar (map/radarXXX.txd) → copy ke GTA/models/ + loadTxd -- -- Sumber: C:\Users\Admin\Documents\mod gta\HUD CHANGER\monetloader\loader\ -- Tujuan: moonloader/gamefixer/hudchanger/ (otomatis tercopy via bmsHcCopyFromMod) -- -- Mekanisme: -- - File PNG disimpan di moonloader/gamefixer/hudchanger// (siap dipakai user) -- - Untuk weapon icon / font: GameFixer tidak menulis ke game memory (TXD PNG buat user) -- melainkan MEMBUKA folder agar user bisa drag-drop ke game TXD tools external -- (CLEO TXD, TXD Workshop, atau GTA SA TXD Replacer). -- - Untuk radar map: file TXD di-copy ke /models/ lalu `loadAllModelsNow(raider)` -- membuat game me-load-nya tanpa restart sebagian besar kasus. -- -- CATATAN: perubahan texture HUD (PNG → TXD) butuh eksternal tool (CLEO/TXD Workshop) -- atau mod HUD yang memuatnya. BMS GameFixer TIDAK menyentuh memory TXD internal. -- Yang BMS lakukan: pastikan file siap di folder yg benar + status terlihat. local bmsHcSrcRoot = "C:\\Users\\Admin\\Documents\\mod gta\\HUD CHANGER\\monetloader\\loader\\" local bmsHcDstRoot = getWorkingDirectory() .. "/gamefixer/hudchanger/" -- src = nama folder ASLI di mod (case + spasi harus persis; key = nama folder tujuan) local bmsHcSubDirs = { {key = "fist", src = "fist", tk = "HC Fist", sk = "HC Fist Sub", ext = ".png"}, {key = "sitem16", src = "siteM16", tk = "HC Crosshair", sk = "HC Crosshair Sub", ext = ".png"}, {key = "radardisc", src = "radardisc", tk = "HC Radardisc", sk = "HC Radardisc Sub", ext = ".png"}, {key = "weapon_icon", src = "weapon icon", tk = "HC Weapon Icon", sk = "HC Weapon Icon Sub", ext = ".png"}, {key = "font_hud", src = "font hud", tk = "HC Font", sk = "HC Font Sub", ext = ".png"}, } -- key tujuan -> nama folder sumber asli (fallback = key itu sendiri, mis. "map") function bmsHcSrcName(subKey) for _, sd in ipairs(bmsHcSubDirs) do if sd.key == subKey then return sd.src end end return subKey end -- pilih file texture via inbox menu (pakai sampAddChatMessage/listbox sederhana) local bmsHcSel = {} for _, sd in ipairs(bmsHcSubDirs) do bmsHcSel[sd.key] = 1 end local bmsHcScanCache = {} function bmsHcScanFolder(subKey) local subPath = bmsHcDstRoot .. subKey .. "/" local files = {} pcall(function() if not doesDirectoryExist(subPath) then return end for name in lfs.dir(subPath) do if name and name ~= "." and name ~= ".." then local full = subPath .. name pcall(function() local attr = lfs.attributes(full) if attr and attr.mode == "file" then files[#files + 1] = name end end) end end end) table.sort(files) return files end function bmsHcRefreshCache() bmsHcScanCache = {} for _, sd in ipairs(bmsHcSubDirs) do bmsHcScanCache[sd.key] = bmsHcScanFolder(sd.key) end end function bmsHcDstHas(subKey, fileName) return doesFileExist(bmsHcDstRoot .. subKey .. "/" .. (fileName or "")) end function bmsHcCopyFile(subKey, fileName) local src = bmsHcSrcRoot .. bmsHcSrcName(subKey) .. "/" .. fileName local dst = bmsHcDstRoot .. subKey .. "/" .. fileName if not doesFileExist(src) then return false, "source not found" end local ok, err = pcall(function() if not doesDirectoryExist(bmsHcDstRoot .. subKey) then createDirectory(bmsHcDstRoot .. subKey) end local f1 = assert(io.open(src, "rb")) local data = f1:read("*a"); f1:close() local f2 = assert(io.open(dst, "wb")) f2:write(data); f2:close() end) if not ok then return false, tostring(err) end if doesFileExist(dst) then return true end return false, "verify failed" end function bmsHcCopyAllFromMod() local nCopied = 0 local nSkipped = 0 for _, sd in ipairs(bmsHcSubDirs) do local srcDir = bmsHcSrcRoot .. sd.src pcall(function() if not doesDirectoryExist(srcDir) then nSkipped = nSkipped + 1; return end for name in lfs.dir(srcDir) do if name and name ~= "." and name ~= ".." then local ok, _ = bmsHcCopyFile(sd.key, name) if ok then nCopied = nCopied + 1 end end end end) end return nCopied, nSkipped end function bmsHcOpenFolder(subKey) local p = bmsHcDstRoot .. subKey pcall(function() if not doesDirectoryExist(p) then createDirectory(p) end os.execute('explorer "' .. p:gsub("/", "\\") .. '"') end) end function bmsHcOpenSourceFolder(subKey) local p = bmsHcSrcRoot .. bmsHcSrcName(subKey) pcall(function() if not doesDirectoryExist(p) then return end os.execute('explorer "' .. p:gsub("/", "\\") .. '"') end) end -- radar map (TXD files) local bmsHcMapDir = bmsHcDstRoot .. "map" local bmsHcMapSrc = bmsHcSrcRoot .. "map" function bmsHcRadarMapCount() local n = 0 pcall(function() if not doesDirectoryExist(bmsHcMapDir) then return end for name in lfs.dir(bmsHcMapDir) do if name and name:match("^radar%d+%.txd$") then n = n + 1 end end end) return n end function bmsHcRadarMapInstall() local gtaDir = getGameDirectory() or getWorkingDirectory() .. "/.." local modelsDir = gtaDir .. "/models" pcall(function() if not doesDirectoryExist(modelsDir) then createDirectory(modelsDir) end end) local copied = 0 pcall(function() if not doesDirectoryExist(bmsHcMapDir) then return end for name in lfs.dir(bmsHcMapDir) do if name and name:match("^radar%d+%.txd$") then local src = bmsHcMapDir .. "/" .. name local dst = modelsDir .. "/" .. name pcall(function() local f1 = io.open(src, "rb") if f1 then local d = f1:read("*a"); f1:close() local f2 = io.open(dst, "wb") if f2 then f2:write(d); f2:close(); copied = copied + 1 end end end) end end end) -- loadAllModelsNow(raider) — opcode 0x0382 untuk GTA SA radar map pcall(function() loadAllModelsNow(0) end) return copied end function bmsHcRadarMapRemove() local gtaDir = getGameDirectory() or getWorkingDirectory() .. "/.." local modelsDir = gtaDir .. "/models" local removed = 0 pcall(function() if not doesDirectoryExist(modelsDir) then return end for name in lfs.dir(modelsDir) do if name and name:match("^radar%d+%.txd$") then pcall(function() os.remove(modelsDir .. "/" .. name); removed = removed + 1 end) end end end) pcall(function() loadAllModelsNow(0) end) return removed end function bmsHcRadarMapReload() pcall(function() loadAllModelsNow(0) end) end local bmsHcChecked = false function bmsHcEnsureChecked() if bmsHcChecked then return end bmsHcChecked = true bmsHcRefreshCache() end -- apply selection: simpan ke ini (untuk track file yg dipakai user) function bmsHcApplyChoice(subKey, fileName) if subKey == "fist" then -- tab Fist dihapus: hanya salin + catat pilihan (tanpa /fist typing) ini.hudchanger.fist = fileName or "" save() return true elseif subKey == "sitem16" then ini.hudchanger.sitem16 = fileName or ""; save(); return true elseif subKey == "radardisc" then ini.hudchanger.radardisc = fileName or ""; save(); return true elseif subKey == "weapon_icon" then ini.hudchanger.weapon_icon = fileName or ""; save(); return true elseif subKey == "font_hud" then ini.hudchanger.font_hud = fileName or ""; save(); return true end return false end -- ini current choice per sub local bmsHcCurrent = { fist = function() return ini.hudchanger.fist end, sitem16 = function() return ini.hudchanger.sitem16 end, radardisc = function() return ini.hudchanger.radardisc end, weapon_icon = function() return ini.hudchanger.weapon_icon end, font_hud = function() return ini.hudchanger.font_hud end, } local bmsHcStatusMsg = "" local bmsHcStatusUntil = 0 function bmsHcSetStatus(msg, dur) bmsHcStatusMsg = msg or "" bmsHcStatusUntil = os.clock() + (dur or 3.0) end function bmsHcDrawStatus() if bmsHcStatusMsg ~= "" and os.clock() < bmsHcStatusUntil then imgui.Spacing() imgui.TextColored(imgui.ImVec4(0.55, 1, 0.65, 1), u8(bmsHcStatusMsg)) end end -- helper: pilih folder untuk tab (CollapsingHeader + listbox + tombol) function bmsHcDrawSub(sd) local key = sd.key local title = T(sd.tk) -- resolve tiap frame agar ganti bahasa langsung tercermin local sub = T(sd.sk) local files = bmsHcScanCache[key] or {} local current = bmsHcCurrent[key] and bmsHcCurrent[key]() or "" local selIdx = bmsHcSel[key] or 1 if current ~= "" then for i, f in ipairs(files) do if f == current then selIdx = i; break end end end if imgui.CollapsingHeader(title, true, imgui.TreeNodeFlags.DefaultOpen) then bmsTextColU8(DIM(0.55), u8(sub)) imgui.Spacing() local statusCol if current ~= "" and #files > 0 then local found = false for _, f in ipairs(files) do if f == current then found = true; break end end if found then statusCol = imgui.ImVec4(0.4, 1, 0.5, 1) imgui.TextColored(statusCol, u8(T("HUDChanger Installed") .. ": " .. current)) else statusCol = imgui.ImVec4(1, 0.7, 0.3, 1) imgui.TextColored(statusCol, u8(T("HUDChanger Not Installed") .. " (file hilang dari folder)")) end else statusCol = imgui.ImVec4(1, 1, 1, 0.45) imgui.TextColored(statusCol, u8(current == "" and T("HUDChanger None") or current)) end imgui.Spacing() -- Tombol Copy + Open Folder (sumber & tujuan) if imgui.Button(T("HUDChanger Copy All") .. "##hccopy_" .. key, imgui.ImVec2(220, 24)) then local n, _ = bmsHcCopyAllFromMod() bmsHcRefreshCache() bmsHcSetStatus(string.format("%d file %s", n, T("HUDChanger Copied"))) handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("HUDChanger Open Folder") .. "##hcopend_" .. key, imgui.ImVec2(150, 24)) then bmsHcOpenFolder(key) handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Open") .. " src##hcopen_" .. key, imgui.ImVec2(80, 24)) then bmsHcOpenSourceFolder(key) handleButtonSound() end handleButtonSound() imgui.Spacing() -- List file imgui.Text(T("HUDChanger Files")) if #files == 0 then imgui.TextColored(DIM(0.45), u8(T("HUDChanger Empty"))) else if selIdx > #files then selIdx = 1 end bmsHcSel[key] = selIdx imgui.PushItemWidth(-1) local listboxSel = imgui.ImInt(selIdx - 1) -- Build display labels (tanpa ekstensi untuk readability) local labels = {} for i, f in ipairs(files) do labels[i] = f if f == current then labels[i] = labels[i] .. " *" end end local changed = false -- ComboBox (lebih cocok untuk daftar panjang dgn pratinjau) if imgui.Combo("##hcsel_" .. key, listboxSel, labels, #labels) then selIdx = listboxSel.v + 1 bmsHcSel[key] = selIdx changed = true end if changed then handleButtonSound() end imgui.PopItemWidth() imgui.Spacing() -- Tombol Apply / Reset -- (file yg SUDAH ada di tujuan langsung dipakai; copy dari mod hanya bila belum ada) if imgui.Button(T("HUDChanger Apply") .. "##hcapply_" .. key, imgui.ImVec2(150, 26)) then local fname = files[selIdx] local dstHas = bmsHcDstHas(key, fname) local copied, err = false, nil if not dstHas then copied, err = bmsHcCopyFile(key, fname) end if dstHas or copied then bmsHcApplyChoice(key, fname) bmsHcRefreshCache() bmsHcSetStatus(string.format("%s -> %s", fname, T("HUDChanger Apply"))) else bmsHcSetStatus(string.format("Copy gagal: %s", err or "?")) end handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("HUDChanger Reset") .. "##hcreset_" .. key, imgui.ImVec2(150, 26)) then bmsHcApplyChoice(key, "") bmsHcSetStatus(T("HUDChanger Reset")) handleButtonSound() end handleButtonSound() imgui.SameLine() -- Tulis PNG ke TXD game (hud.txd / fonts.txd). Berlaku setelah restart game. if imgui.Button(T("HC Apply Game") .. "##hcgame_" .. key, imgui.ImVec2(170, 26)) then local fname = files[selIdx] local ok, msg = bmsHcApplyToGame(key, fname) bmsHcSetStatus(msg or "?", 6) handleButtonSound() end handleButtonSound() end if key == "fist" then imgui.Spacing() imgui.TextColored(imgui.ImVec4(1, 0.7, 0.3, 1), u8(T("HC Fist ApplyHint"))) end if key == "weapon_icon" then imgui.Spacing() imgui.TextColored(imgui.ImVec4(1, 0.7, 0.3, 1), u8(T("HC Weapon Icon Warn"))) end if key == "font_hud" then imgui.Spacing() imgui.TextColored(imgui.ImVec4(1, 0.7, 0.3, 1), u8(T("HC Font Warn"))) end imgui.Spacing() imgui.Separator() imgui.Spacing() end end -- ================= BMS TXD PATCHER 2026-09-06 ================= -- Menulis PNG user LANGSUNG ke models/hud.txd & models/fonts.txd (offline, tanpa GTASA/render). -- Format 32-bit mengikuti preseden 8888 yg terbukti ada di file (rfmt 0x8500, d3d 21) — tanpa tebak. -- hud.txd: pixel-swap in-place (ukuran file TETAP, byte lain identik). -- fonts.txd: rebuild entry (DXT3->8888, single mip). Backup otomatis *.bms-bak. Berlaku setelah restart. -- Terverifikasi offline: re-parse valid + byte-diff hanya di pixel target (lihat harness txd_patchtest). local bmsGdipTok = nil -- ffi lokal sendiri (tidak bergantung pada 'local ffi' di atas file — tetap aman bila blok dipindah) local bmsFfi = ffi or require("ffi") function bmsGdipInit() if bmsGdipTok then return true end local ok, err = pcall(function() bmsFfi.cdef[[ typedef unsigned long bmsULONG; typedef long bmsLONG; typedef unsigned int bmsUINT; typedef int bmsINT; typedef wchar_t bmsWCHAR; typedef const bmsWCHAR *bmsLPCWSTR; typedef void bmsVOID; typedef int bmsBOOL; typedef struct { bmsINT X; bmsINT Y; bmsINT Width; bmsINT Height; } bmsRect; typedef struct { bmsINT Width; bmsINT Height; bmsINT Stride; bmsINT PixelFormat; bmsVOID *Scan0; bmsVOID *Reserved; } bmsBitmapData; typedef struct { bmsUINT GdiplusVersion; bmsVOID *DebugEventCallback; bmsBOOL SuppressBackgroundThread; bmsBOOL SuppressExternalCodecs; } bmsGdiplusStartupInput; typedef long bmsStatus; bmsStatus __stdcall GdiplusStartup(unsigned long *token, const bmsGdiplusStartupInput *input, bmsVOID *output); bmsStatus __stdcall GdipCreateBitmapFromFile(bmsLPCWSTR filename, bmsVOID **bitmap); bmsStatus __stdcall GdipGetImageWidth(bmsVOID *image, bmsUINT *width); bmsStatus __stdcall GdipGetImageHeight(bmsVOID *image, bmsUINT *height); bmsStatus __stdcall GdipBitmapLockBits(bmsVOID *bitmap, const bmsRect *rect, bmsUINT flags, bmsINT format, bmsBitmapData *locked); bmsStatus __stdcall GdipBitmapUnlockBits(bmsVOID *bitmap, const bmsBitmapData *locked); bmsStatus __stdcall GdipDisposeImage(bmsVOID *image); ]] local gd = bmsFfi.load("gdiplus") bmsGdipTok = { lib = gd, tok = bmsFfi.new("unsigned long[1]") } local inp = bmsFfi.new("bmsGdiplusStartupInput", { 1, nil, 0, 0 }) assert(gd.GdiplusStartup(bmsGdipTok.tok, inp, nil) == 0, "GdiplusStartup") end) if not ok then bmsGdipTok = nil return false, tostring(err) end return true end function bmsUtf16le(s) local out = {} local i = 1 while i <= #s do local c = s:byte(i) local cp if c < 0x80 then cp = c; i = i + 1 elseif c < 0xE0 then cp = (c - 0xC0) * 64 + (s:byte(i + 1) - 0x80); i = i + 2 elseif c < 0xF0 then cp = (c - 0xE0) * 4096 + (s:byte(i + 1) - 0x80) * 64 + (s:byte(i + 2) - 0x80); i = i + 3 else cp = (c - 0xF0) * 262144 + (s:byte(i + 1) - 0x80) * 4096 + (s:byte(i + 2) - 0x80) * 64 + (s:byte(i + 3) - 0x80); i = i + 4 end if cp < 0x10000 then out[#out + 1] = string.char(cp % 256, math.floor(cp / 256)) else cp = cp - 0x10000; local hi = 0xD800 + math.floor(cp / 1024); local lo = 0xDC00 + (cp % 1024) out[#out + 1] = string.char(hi % 256, math.floor(hi / 256), lo % 256, math.floor(lo / 256)) end end return table.concat(out) .. "\0\0" end -- decode PNG -> {w,h,px(BGRA)} / nil,err (GDI+, tanpa D3D device) function bmsDecodePng(path) local okInit, errInit = bmsGdipInit() if not okInit then return nil, "GDI+: " .. tostring(errInit) end local gd = bmsGdipTok.lib local wpath = bmsUtf16le(path) local wbuf = bmsFfi.new("uint8_t[?]", #wpath) bmsFfi.copy(wbuf, wpath, #wpath) local bmp = bmsFfi.new("void*[1]") if gd.GdipCreateBitmapFromFile(bmsFfi.cast("bmsLPCWSTR", wbuf), bmp) ~= 0 then return nil, "buka PNG gagal" end local w, h = bmsFfi.new("unsigned int[1]"), bmsFfi.new("unsigned int[1]") gd.GdipGetImageWidth(bmp[0], w); gd.GdipGetImageHeight(bmp[0], h) local W, H = tonumber(w[0]), tonumber(h[0]) if not W or not H or W <= 0 or H <= 0 or W > 4096 or H > 4096 then gd.GdipDisposeImage(bmp[0]); return nil, "dimensi PNG aneh" end local bd = bmsFfi.new("bmsBitmapData") if gd.GdipBitmapLockBits(bmp[0], bmsFfi.new("bmsRect", { 0, 0, W, H }), 1, 0x0026200A, bd) ~= 0 then gd.GdipDisposeImage(bmp[0]); return nil, "lock PNG gagal" end local stride = tonumber(bd.Stride) local absS, rowB = math.abs(stride), W * 4 local base = bmsFfi.cast("uint8_t*", bd.Scan0) local ch = {} for y = 0, H - 1 do local sy = (stride < 0) and (H - 1 - y) or y ch[#ch + 1] = bmsFfi.string(base + sy * absS, rowB) end gd.GdipBitmapUnlockBits(bmp[0], bd) gd.GdipDisposeImage(bmp[0]) return { w = W, h = H, px = table.concat(ch) } end -- resize box-filter -> string BGRA dw*dh*4 function bmsResizeBox(img, dw, dh) if img.w == dw and img.h == dh then return img.px end local sw, sh, sp = img.w, img.h, img.px local out = {} local xR, yR = sw / dw, sh / dh for dy = 0, dh - 1 do local sy0 = math.floor(dy * yR) local sy1 = math.min(sh - 1, math.floor((dy + 1) * yR - 0.0001)) if sy1 < sy0 then sy1 = sy0 end local row = {} for dx = 0, dw - 1 do local sx0 = math.floor(dx * xR) local sx1 = math.min(sw - 1, math.floor((dx + 1) * xR - 0.0001)) if sx1 < sx0 then sx1 = sx0 end local br, bg, bb, ba, n = 0, 0, 0, 0, 0 for sy = sy0, sy1 do local base = sy * sw * 4 for sx = sx0, sx1 do local o = base + sx * 4 bb = bb + sp:byte(o + 1); bg = bg + sp:byte(o + 2) br = br + sp:byte(o + 3); ba = ba + sp:byte(o + 4) n = n + 1 end end row[#row + 1] = string.char(math.floor(bb / n + 0.5), math.floor(bg / n + 0.5), math.floor(br / n + 0.5), math.floor(ba / n + 0.5)) end out[#out + 1] = table.concat(row) end return table.concat(out) end -- rantai mip penuh (level0 = px w,h); single=true -> 1 level saja (fonts) function bmsMipChain(px, w, h, single) local levels = { { px = px, w = w, h = h } } if single then return levels end while w > 1 or h > 1 do local nw, nh = math.max(1, math.floor(w / 2)), math.max(1, math.floor(h / 2)) local prev = levels[#levels] levels[#levels + 1] = { px = bmsResizeBox({ w = prev.w, h = prev.h, px = prev.px }, nw, nh), w = nw, h = nh } w, h = nw, nh end return levels end local function bmsU16(s, o) local a, b = s:byte(o, o + 1); return a + b * 256 end local function bmsU32(s, o) local a, b, c, d = s:byte(o, o + 3) return a + b * 256 + c * 65536 + d * 16777216 end local function bmsP32(v) v = v % 4294967296 return string.char(v % 256, math.floor(v / 256) % 256, math.floor(v / 65536) % 256, math.floor(v / 16777216) % 256) end local function bmsZstr(s, o, n) local t = {} for i = 0, n - 1 do local c = s:byte(o + i); if c == 0 then break end; t[#t + 1] = string.char(c) end return table.concat(t) end local function bmsSkipExt(data, pos) while pos + 12 <= #data + 1 and bmsU32(data, pos) == 0x03 do pos = pos + 12 + bmsU32(data, pos + 4) end return pos end -- parse TXD -> entries {name,entryPos,entryEnd,w,h,depth,mips,rfmt,d3d,head88,mipBlocks{off,size},pixStart,pixEnd} function bmsTxdParse(data) if not data or #data < 12 or bmsU32(data, 1) ~= 0x16 then return nil, "bukan TXD" end local dictVer = data:sub(9, 12) local ss = bmsU32(data, 17) local count = bmsU16(data, 25) if count <= 0 or count > 5000 then return nil, "count aneh" end local countEnd = 25 + ss local countStruct = data:sub(13, countEnd - 1) local pos = bmsSkipExt(data, countEnd) local topExt = data:sub(countEnd, pos - 1) local entries = {} for i = 1, count do if pos + 12 > #data + 1 or bmsU32(data, pos) ~= 0x15 then return nil, "entry rusak #" .. i end local ts = bmsU32(data, pos + 4) local base = pos + 12 local q = base + 12 local e = { name = bmsZstr(data, q + 8, 32), entryPos = pos, entrySize = ts, w = bmsU16(data, q + 80), h = bmsU16(data, q + 82), } e.rfmt = bmsU32(data, q + 72); e.d3d = bmsU32(data, q + 76) e.depth = data:byte(q + 84); e.mips = data:byte(q + 85) e.head88 = data:sub(q, q + 87) e.mipBlocks = {} local mo = base + 12 + 88 for m = 1, e.mips do if mo + 4 > #data + 1 then return nil, "mip rusak" end local ds = bmsU32(data, mo) if ds <= 0 or mo + 4 + ds > #data + 1 then return nil, "mip size aneh" end e.mipBlocks[#e.mipBlocks + 1] = { off = mo + 4, size = ds } mo = mo + 4 + ds end e.pixStart = base + 12 + 88 e.pixEnd = mo entries[#entries + 1] = e pos = pos + 12 + ts end return entries, count, topExt, dictVer, countStruct end local function bmsPatchHead88(raw88, o) local b = { raw88:byte(1, 88) } local function w32(off0, v) v = v % 4294967296 b[off0 + 1], b[off0 + 2], b[off0 + 3], b[off0 + 4] = v % 256, math.floor(v / 256) % 256, math.floor(v / 65536) % 256, math.floor(v / 16777216) % 256 end local function w16(off0, v) b[off0 + 1], b[off0 + 2] = v % 256, math.floor(v / 256) % 256 end if o.rfmt then w32(72, o.rfmt) end if o.d3d then w32(76, o.d3d) end if o.w then w16(80, o.w) end if o.h then w16(82, o.h) end if o.depth then b[85] = o.depth end if o.mips then b[86] = o.mips end local t = {} for i = 1, 88 do t[i] = string.char(b[i]) end return table.concat(t) end local function bmsBuildEntry(head88, levels, ver) ver = ver or 0x1803FFFF local mp = { head88 } for _, lv in ipairs(levels) do mp[#mp + 1] = bmsP32(#lv.px) mp[#mp + 1] = lv.px end local structPay = table.concat(mp) local ext0 = bmsP32(0x03) .. bmsP32(0) .. bmsP32(ver) local payload = bmsP32(0x01) .. bmsP32(#structPay) .. bmsP32(ver) .. structPay .. ext0 return bmsP32(0x15) .. bmsP32(#payload) .. bmsP32(ver) .. payload end local function bmsReadAll(path) local f = io.open(path, "rb") if not f then return nil end local d = f:read("*a"); f:close() return d end local function bmsWriteAtomic(path, data) local tmp = path .. ".bms-tmp" local f = io.open(tmp, "wb") if not f then return false, "tulis gagal" end f:write(data); f:close() pcall(os.remove, path .. ".bms-tmp2") if not os.rename(tmp, path) then -- fallback: tulis langsung local f2 = io.open(path, "wb") if not f2 then return false, "tulis gagal" end f2:write(data); f2:close() end return true end function bmsTxdGamePath(name) local gta = getGameDirectory() if not gta or gta == "" then return nil end return gta .. "/models/" .. name end -- backup sekali (tidak menimpa backup yg sudah ada) function bmsTxdBackup(name) local p = bmsTxdGamePath(name) if not p or not doesFileExist(p) then return false, name .. " tidak ada" end local bak = p .. ".bms-bak" if doesFileExist(bak) then return true end local ok, err = pcall(function() local f1 = assert(io.open(p, "rb")) local d = f1:read("*a"); f1:close() local f2 = assert(io.open(bak, "wb")) f2:write(d); f2:close() end) if not ok then return false, tostring(err) end return doesFileExist(bak) end -- patch SATU texture 32-bit di hud.txd (in-place, ukuran file tetap) function bmsTxdPatchHud(pngPath, texName) local txd = bmsTxdGamePath("hud.txd") if not txd or not doesFileExist(txd) then return false, "hud.txd tidak ketemu" end local img, derr = bmsDecodePng(pngPath) if not img then return false, derr end local data = bmsReadAll(txd) if not data then return false, "baca hud.txd gagal" end local entries, err = bmsTxdParse(data) if not entries then return false, err end local tgt for _, e in ipairs(entries) do if e.name == texName or e.name:lower() == texName:lower() then tgt = e; break end end if not tgt then return false, "texture '" .. texName .. "' tidak ada di hud.txd" end if tgt.rfmt ~= 0x8500 or tgt.d3d ~= 21 then return false, "format '" .. texName .. "' bukan 32-bit" end local base = bmsResizeBox(img, tgt.w, tgt.h) local levels = bmsMipChain(base, tgt.w, tgt.h, false) if #levels ~= #tgt.mipBlocks then return false, "rantai mip beda" end for i, lv in ipairs(levels) do if #lv.px ~= tgt.mipBlocks[i].size then return false, "ukuran mip beda" end end local okB, errB = bmsTxdBackup("hud.txd") if not okB then return false, "backup gagal: " .. tostring(errB) end local out = data for i, lv in ipairs(levels) do local mb = tgt.mipBlocks[i] out = out:sub(1, mb.off - 1) .. lv.px .. out:sub(mb.off + mb.size) end if #out ~= #data then return false, "ukuran berubah?!" end local okW, errW = bmsWriteAtomic(txd, out) if not okW then return false, tostring(errW) end return true, "'" .. texName .. "' terpasang — restart game" end -- patch font1+font2 di fonts.txd (slot yg file-nya ada). DXT3->8888, single mip. function bmsTxdPatchFonts() local txd = bmsTxdGamePath("fonts.txd") if not txd or not doesFileExist(txd) then return false, "fonts.txd tidak ketemu" end local data = bmsReadAll(txd) if not data then return false, "baca fonts.txd gagal" end local entries, count, topExt, dictVer, countStruct = bmsTxdParse(data) if not entries then return false, count end local done, msgs = 0, {} for _, slot in ipairs({ "font1", "font2" }) do local png = bmsHcDstRoot .. "font_hud/" .. slot .. ".png" if not doesFileExist(png) then msgs[#msgs + 1] = slot .. ": file tidak ada" else local img, derr = bmsDecodePng(png) if not img then msgs[#msgs + 1] = slot .. ": " .. tostring(derr) else local tgt for _, e in ipairs(entries) do if e.name == slot then tgt = e; break end end if not tgt then msgs[#msgs + 1] = slot .. ": tidak ada di fonts.txd" else local base = bmsResizeBox(img, tgt.w, tgt.h) local levels = bmsMipChain(base, tgt.w, tgt.h, true) if #levels[1].px ~= tgt.w * tgt.h * 4 then msgs[#msgs + 1] = slot .. ": ukuran aneh" else local head = bmsPatchHead88(tgt.head88, { rfmt = 0x8500, d3d = 21, depth = 32, mips = 1 }) tgt.newEntry = bmsBuildEntry(head, levels, 0x1803FFFF) tgt.newLevels = levels done = done + 1 end end end end end if done == 0 then return false, table.concat(msgs, "; ") end local okB, errB = bmsTxdBackup("fonts.txd") if not okB then return false, "backup gagal: " .. tostring(errB) end local body = {} for _, e in ipairs(entries) do if e.newEntry then body[#body + 1] = e.newEntry else body[#body + 1] = data:sub(e.entryPos, e.entryEnd - 1) end end local payload = countStruct .. topExt .. table.concat(body) local out = bmsP32(0x16) .. bmsP32(#payload) .. dictVer .. payload -- validasi: re-parse hasil sebelum tulis local ve = bmsTxdParse(out) if not ve then return false, "validasi gagal" end local okW, errW = bmsWriteAtomic(txd, out) if not okW then return false, tostring(errW) end msgs[#msgs + 1] = "restart game" return true, table.concat(msgs, "; ") end -- kembalikan backup ("hud" / "fonts" / "all") function bmsTxdRestore(which) local n, msgs = 0, {} for _, name in ipairs({ "hud.txd", "fonts.txd" }) do if which == "all" or which == name:gsub("%.txd$", "") then local p = bmsTxdGamePath(name) local bak = p .. ".bms-bak" if p and doesFileExist(bak) then local ok = pcall(function() local f1 = assert(io.open(bak, "rb")) local d = f1:read("*a"); f1:close() local f2 = assert(io.open(p, "wb")) f2:write(d); f2:close() end) if ok and doesFileExist(p) then n = n + 1; msgs[#msgs + 1] = name .. " OK" end else msgs[#msgs + 1] = name .. ": no backup" end end end if n == 0 then return false, table.concat(msgs, "; ") end return true, table.concat(msgs, "; ") .. " — restart game" end -- dispatcher tombol "Pasang ke Game" per sub hudchanger function bmsHcApplyToGame(subKey, fileName) if fileName == nil or fileName == "" then return false, "Pilih file dulu" end local png = bmsHcDstRoot .. subKey .. "/" .. fileName if not doesFileExist(png) then local ok, err = bmsHcCopyFile(subKey, fileName) if not ok then return false, "Copy gagal: " .. tostring(err) end end if subKey == "font_hud" then return bmsTxdPatchFonts() end local texName = fileName:gsub("%.[Pp][Nn][Gg]$", "") if subKey == "fist" then texName = "fist" elseif subKey == "sitem16" then texName = "siteM16" elseif subKey == "radardisc" then texName = "radardisc" end return bmsTxdPatchHud(png, texName) end function drawHUDChangerTab() bmsHcEnsureChecked() imgui.BeginChild("##HUDChanger", imgui.ImVec2(-1, -1), true) imgui.TextColored(DIM(0.96), u8(T("HUDChanger") .. " v1.0")) bmsTextColU8(DIM(0.55), u8(T("HUDChanger Sub"))) imgui.Spacing() bmsTextColU8(DIM(0.40), u8(T("HUDChanger Source"))) bmsTextColU8(DIM(0.40), u8(T("HUDChanger Dest"))) imgui.Spacing() imgui.Separator() imgui.Spacing() -- Tombol global: copy all + buka folder utama if imgui.Button(T("HUDChanger Copy All") .. "##hcglobal", imgui.ImVec2(220, 26)) then local n, skipped = bmsHcCopyAllFromMod() bmsHcRefreshCache() if n == 0 and (skipped or 0) > 0 then bmsHcSetStatus(T("HUDChanger No Source")) else bmsHcSetStatus(string.format("%d file %s", n, T("HUDChanger Copied"))) end handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("HUDChanger Open Folder") .. "##hcglobal_open", imgui.ImVec2(180, 26)) then pcall(function() if not doesDirectoryExist(bmsHcDstRoot) then createDirectory(bmsHcDstRoot) end os.execute('explorer "' .. bmsHcDstRoot:gsub("/", "\\") .. '"') end) handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button("Refresh##hcglobal_refresh", imgui.ImVec2(90, 26)) then bmsHcRefreshCache() bmsHcSetStatus("Refreshed") handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("HC Restore") .. "##hc_restore", imgui.ImVec2(150, 26)) then local ok, msg = bmsTxdRestore("all") bmsHcSetStatus(msg or "?", 6) handleButtonSound() end handleButtonSound() bmsHcDrawStatus() imgui.Spacing() bmsTextColU8(DIM(0.45), u8(T("HUDChanger ApplyHint"))) bmsTextColU8(DIM(0.45), u8(T("HC Game Hint"))) imgui.Spacing() imgui.Separator() imgui.Spacing() -- Per-sub sections for _, sd in ipairs(bmsHcSubDirs) do bmsHcDrawSub(sd) end -- Radar Map section (TXD) if imgui.CollapsingHeader(T("HC Radar Map"), true, imgui.TreeNodeFlags.DefaultOpen) then bmsTextColU8(DIM(0.55), u8(T("HC Radar Map Sub"))) imgui.Spacing() local mapCount = bmsHcRadarMapCount() local gtaDir = getGameDirectory() or getWorkingDirectory() .. "/.." local modelsDir = gtaDir .. "/models" local installedCount = 0 pcall(function() if doesDirectoryExist(modelsDir) then for name in lfs.dir(modelsDir) do if name and name:match("^radar%d+%.txd$") then installedCount = installedCount + 1 end end end end) local col = (installedCount > 0) and imgui.ImVec4(0.4, 1, 0.5, 1) or imgui.ImVec4(1, 1, 1, 0.45) imgui.TextColored(col, u8(string.format("%s: %d | %s: %d", T("HUDChanger Files"), mapCount, T("HC Radar Map Installed"), installedCount))) imgui.Spacing() if imgui.Button(T("HUDChanger Copy All") .. "##hc_radar_copy", imgui.ImVec2(180, 26)) then local n = 0 pcall(function() if not doesDirectoryExist(bmsHcMapSrc) then return end for name in lfs.dir(bmsHcMapSrc) do if name and name:match("^radar%d+%.txd$") then local ok, _ = bmsHcCopyFile("map", name) if ok then n = n + 1 end end end end) bmsHcRefreshCache() bmsHcSetStatus(string.format("%d TXD %s", n, T("HUDChanger Copied"))) handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("HC Radar Map Action") .. "##hc_radar_install", imgui.ImVec2(180, 26)) then local copied = bmsHcRadarMapInstall() bmsHcSetStatus(string.format("%s (%d TXD)", T("HC Radar Map Installed"), copied)) handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("HC Radar Map Reload") .. "##hc_radar_reload", imgui.ImVec2(160, 26)) then bmsHcRadarMapReload() bmsHcSetStatus("loadAllModelsNow(0) dipanggil") handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("HC Radar Map Reset") .. "##hc_radar_reset", imgui.ImVec2(150, 26)) then local removed = bmsHcRadarMapRemove() bmsHcSetStatus(string.format("%s (%d TXD)", T("HC Radar Map ResetDone"), removed)) handleButtonSound() end handleButtonSound() imgui.Spacing() imgui.TextColored(imgui.ImVec4(1, 0.7, 0.3, 1), u8(T("HC Restart Needed"))) end imgui.EndChild() end -- ================= BMS KILLSTATE NATIVE 2026-09-06 ================= -- Pengganti killstate.lua eksternal (luacrypted, butuh rename+reload, terbukti bikin -- artefak fist saat unload). Versi native 100% di dalam GameFixer: -- kill feed (ev.onPlayerDeathNotification) + K/D + akurasi (shots vs give-damage). -- Toggle = boolean biasa -> overlay langsung hilang/muncul, TANPA reload, TANPA file. local bmsKsKills, bmsKsDeaths = 0, 0 local bmsKsShots, bmsKsHits, bmsKsDmg = 0, 0, 0 local bmsKsFeed = {} -- {kn, vn, wn, t} local bmsKsMyIdCache = nil local bmsKsWasShooting = false local bmsKsPos = imgui.ImVec2(tonumber(ini.killstate.ksx) or 300, tonumber(ini.killstate.ksy) or 120) local bmsKsMaxFeed = imgui.ImInt(math.max(3, math.min(10, tonumber(ini.killstate.maxfeed) or 5))) local bmsKsShowFeed = imgui.ImBool(ini.killstate.show_feed ~= false) local bmsKsShowStats = imgui.ImBool(ini.killstate.show_stats ~= false) local bmsKsWnames = nil function bmsKsWeaponName(reason) if not bmsKsWnames then bmsKsWnames = { [49] = "Vehicle", [50] = "Heli Blades", [51] = "Explosion", [53] = "Drowned", [54] = "Fall" } pcall(function() local w = require("game.weapons") if type(w) == "table" then for n, id in pairs(w) do if type(n) == "string" and type(id) == "number" then local pretty = n:sub(1, 1) .. n:sub(2):lower() bmsKsWnames[id] = pretty end end end end) end local id = tonumber(reason) or -1 return bmsKsWnames[id] or ("W" .. tostring(id)) end function bmsKsMyId() if bmsKsMyIdCache ~= nil then return bmsKsMyIdCache end local ok, id = pcall(function() return select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)) end) if ok and type(id) == "number" and id >= 0 and id <= 1005 then bmsKsMyIdCache = id return id end return nil end function bmsKsName(pid) if pid == nil then return "--" end local id = tonumber(pid) if not id or id < 0 or id > 1005 then return "--" end local ok, nm = pcall(sampGetPlayerNickname, id) if ok and type(nm) == "string" and nm ~= "" then return nm end return "ID:" .. tostring(id) end function bmsKsPushFeed(killerId, killedId, reason) local me = bmsKsMyId() if me ~= nil then if killerId == me and killedId ~= me then bmsKsKills = bmsKsKills + 1 end if killedId == me then bmsKsDeaths = bmsKsDeaths + 1 end end table.insert(bmsKsFeed, 1, { kn = bmsKsName(killerId), vn = bmsKsName(killedId), wn = bmsKsWeaponName(reason), t = os.clock(), mine = (me ~= nil and (killerId == me or killedId == me)), }) local cap = math.max(3, math.min(10, tonumber(ini.killstate.maxfeed) or 5)) * 2 while #bmsKsFeed > cap do table.remove(bmsKsFeed) end end function bmsKsOnDeath(killerId, killedId, reason) bmsKsPushFeed(tonumber(killerId), tonumber(killedId), tonumber(reason)) end function bmsKsOnGive(playerId, damage) bmsKsHits = bmsKsHits + 1 bmsKsDmg = bmsKsDmg + (tonumber(damage) or 0) end function bmsKsReset() bmsKsKills, bmsKsDeaths = 0, 0 bmsKsShots, bmsKsHits, bmsKsDmg = 0, 0, 0 bmsKsFeed = {} end function bmsKsAcc() if bmsKsShots <= 0 then return 0 end return math.floor(bmsKsHits * 100 / bmsKsShots + 0.5) end -- pompa tiap frame dari main loop: hitung tembakan (rising edge) function bmsKsPump() local ok, shooting = pcall(isCharShooting, PLAYER_PED) if not ok then return end if shooting and not bmsKsWasShooting then bmsKsShots = bmsKsShots + 1 end bmsKsWasShooting = shooting and true or false end function drawKillStateOverlay() if not ini.killstate.enable then return end local okS, spawned = pcall(sampIsLocalPlayerSpawned) if not (okS and spawned) then return end imgui.PushStyleVar(imgui.StyleVar.WindowPadding, imgui.ImVec2(8.0, 6.0)) imgui.PushStyleColor(imgui.Col.WindowBg, imgui.ImVec4(0, 0, 0, 0.45)) imgui.SetNextWindowPos(bmsKsPos, imgui.Cond.FirstUseEver, imgui.ImVec2(0, 0)) local fl = imgui.WindowFlags.NoTitleBar + imgui.WindowFlags.AlwaysAutoResize imgui.Begin("##bms_ks", _, fl) bmsKsPos = imgui.GetWindowPos() local now = os.clock() if ini.killstate.show_stats then imgui.TextColored(imgui.ImVec4(1.0, 0.85, 0.4, 1), string.format("K:%d D:%d ACC:%d%% DMG:%d", bmsKsKills, bmsKsDeaths, bmsKsAcc(), math.floor(bmsKsDmg))) imgui.Separator() end if ini.killstate.show_feed then local maxf = math.max(3, math.min(10, tonumber(ini.killstate.maxfeed) or 5)) local shown = 0 for _, e in ipairs(bmsKsFeed) do if shown >= maxf then break end if now - (e.t or 0) < 8 then shown = shown + 1 local col = e.mine and imgui.ImVec4(0.5, 1, 0.6, 1) or imgui.ImVec4(1, 1, 1, 0.85) imgui.TextColored(col, e.kn .. " [" .. e.wn .. "] " .. e.vn) end end if shown == 0 then imgui.TextColored(imgui.ImVec4(1, 1, 1, 0.35), "--") end end imgui.End() imgui.PopStyleColor() imgui.PopStyleVar() end function drawKillStateTab() imgui.BeginChild("##KillState", imgui.ImVec2(-1, -1), true) imgui.TextColored(DIM(0.96), u8(T("KillState") .. " (native)")) imgui.TextColored(DIM(0.55), u8(T("KillState Info"))) imgui.Separator() imgui.Spacing() -- status live: INSTAN via boolean, tanpa reload/file eksternal local col = ini.killstate.enable and imgui.ImVec4(0.4,1,0.5,1) or imgui.ImVec4(1,1,1,0.45) imgui.TextColored(col, u8((ini.killstate.enable and T("KillState Enabled") or T("KillState Disabled")) .. string.format(" • K:%d D:%d ACC:%d%%", bmsKsKills, bmsKsDeaths, bmsKsAcc()))) imgui.Spacing() if imgui.Checkbox(T("Enable KillState"), bmsKillStateOn) then ini.killstate.enable = bmsKillStateOn.v save() handleButtonSound() sampAddChatMessage(script_name.." {FFFFFF}KillState "..(ini.killstate.enable and "{73b461}Enabled" or "{dc4747}Disabled"), 0x73b461) end handleButtonSound() imgui.Spacing() if imgui.Checkbox(T("KS Show Feed"), bmsKsShowFeed) then ini.killstate.show_feed = bmsKsShowFeed.v save() handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Checkbox(T("KS Show Stats"), bmsKsShowStats) then ini.killstate.show_stats = bmsKsShowStats.v save() handleButtonSound() end handleButtonSound() imgui.Spacing() imgui.Text(T("KS Max")) imgui.PushItemWidth(-1) if imgui.SliderInt("##ksmaxfeed", bmsKsMaxFeed, 3, 10) then ini.killstate.maxfeed = bmsKsMaxFeed.v save() end imgui.PopItemWidth() imgui.Spacing() if imgui.Button(T("KS Clear"), imgui.ImVec2(160, 28)) then bmsKsFeed = {} handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("KS Reset"), imgui.ImVec2(160, 28)) then bmsKsReset() handleButtonSound() end handleButtonSound() imgui.Spacing() imgui.Separator() imgui.Spacing() bmsTextColU8(DIM(0.55), u8(T("KillState Hint"))) imgui.EndChild() end function bmsSsaoSnap() bmsSsaoPrev = { active = ini.fixtimecyc.active, allambient = tostring(ini.fixtimecyc.allambient), objambient = tostring(ini.fixtimecyc.objambient), worldambientR = tostring(ini.fixtimecyc.worldambientR), worldambientG = tostring(ini.fixtimecyc.worldambientG), worldambientB = tostring(ini.fixtimecyc.worldambientB), shadowedit = ini.settings.shadowedit, shadowcp = tostring(ini.settings.shadowcp), shadowlight = tostring(ini.settings.shadowlight), } end function bmsSsaoSyncSliders() pcall(function() sliders.allambient.v = tonumber(ini.fixtimecyc.allambient) or sliders.allambient.v sliders.objambient.v = tonumber(ini.fixtimecyc.objambient) or sliders.objambient.v sliders.worldambientR.v = tonumber(ini.fixtimecyc.worldambientR) or sliders.worldambientR.v sliders.worldambientG.v = tonumber(ini.fixtimecyc.worldambientG) or sliders.worldambientG.v sliders.worldambientB.v = tonumber(ini.fixtimecyc.worldambientB) or sliders.worldambientB.v sliders.shadowcp.v = tonumber(ini.settings.shadowcp) or sliders.shadowcp.v sliders.shadowlight.v = tonumber(ini.settings.shadowlight) or sliders.shadowlight.v end) end function bmsSsaoApply() local tk = math.max(0, math.min(100, bmsSsaoThick.v)) / 100 local it = math.max(0, math.min(100, bmsSsaoIntens.v)) / 100 local k = tk * it ini.ssao.thick = math.floor(tk * 100 + 0.5) ini.ssao.intens = math.floor(it * 100 + 0.5) ini.fixtimecyc.active = true ini.settings.shadowedit = true ini.fixtimecyc.allambient = ("%.3f"):format(0.80 - 0.55 * k) ini.fixtimecyc.objambient = ("%.3f"):format(0.80 - 0.60 * k) ini.fixtimecyc.worldambientR = ("%.3f"):format(0.80 - 0.45 * k) ini.fixtimecyc.worldambientG = ("%.3f"):format(0.80 - 0.45 * k) ini.fixtimecyc.worldambientB = ("%.3f"):format(0.80 - 0.45 * k) ini.settings.shadowcp = tostring(math.floor(180 * k + 0.5)) ini.settings.shadowlight = tostring(math.floor(120 * k + 0.5)) save() bmsSsaoSyncSliders() gotofunc("FixTimecyc") gotofunc("ShadowEdit") end -- (assignment agar forward-decl terisi, bukan shadow; dipanggil /ssao) bmsSsaoSetOn = function(on) if on then if bmsRsSetOn then bmsRsSetOn(false) end if not bmsSsaoPrev then bmsSsaoSnap() end ini.ssao.enable = true bmsSsaoOn.v = true bmsSsaoApply() sampAddChatMessage(script_name.." {FFFFFF}SSAO (Fake AO) has been {73b461}Enabled", 0x73b461) else ini.ssao.enable = false bmsSsaoOn.v = false if bmsSsaoPrev then ini.fixtimecyc.active = bmsSsaoPrev.active ini.fixtimecyc.allambient = bmsSsaoPrev.allambient ini.fixtimecyc.objambient = bmsSsaoPrev.objambient ini.fixtimecyc.worldambientR = bmsSsaoPrev.worldambientR ini.fixtimecyc.worldambientG = bmsSsaoPrev.worldambientG ini.fixtimecyc.worldambientB = bmsSsaoPrev.worldambientB ini.settings.shadowedit = bmsSsaoPrev.shadowedit ini.settings.shadowcp = bmsSsaoPrev.shadowcp ini.settings.shadowlight = bmsSsaoPrev.shadowlight bmsSsaoPrev = nil end save() bmsSsaoSyncSliders() gotofunc("FixTimecyc") gotofunc("ShadowEdit") sampAddChatMessage(script_name.." {FFFFFF}SSAO (Fake AO) has been {dc4747}Disabled", 0x73b461) end end function bmsSsaoPreset(v) bmsSsaoThick.v = math.max(0, math.min(100, v)) if ini.ssao.enable then bmsSsaoApply() else ini.ssao.thick = bmsSsaoThick.v save() end end -- ================= BMS SSAO REAL 2026-09-04 (ReShade MXAO, payload portable) ================= -- Payload 100% moonloader/gamefixer/ssao/ (qUINT_mxao.fx + qUINT_common.fxh + ReShadePreset.ini lokal), -- diekstrak dari RESHADE FREEZIN Step 3. PPFX_SSDO.fx SENGAJA dibuang (gagal compile X3003 x2 di ReShade.log). -- Install = arahkan ReShade.ini root ke payload + aktifkan preset lokal. Root steril (tanpa reshade-shaders). d3d9.dll TIDAK dicopy -- (sudah identik di GTA: ReShade 4.9.0 32-bit). Toggle = tambah/hapus MXAO dari Techniques + reload ReShade. local bmsRsPayloadDir = getWorkingDirectory() .. "/gamefixer/ssao" local bmsRsPresetFile = getWorkingDirectory() .. "/gamefixer/ssao/ReShadePreset.ini" function bmsRsGtaDir() local ok, dir = pcall(getGameDirectory) if ok and dir and dir ~= "" then return dir end return getWorkingDirectory() .. "/.." end local bmsRsMxaoTech = "MXAO@qUINT_mxao.fx" function bmsRsRead(path) local f = io.open(path, "r") if not f then return nil end local s = f:read("*a"); f:close() return s end function bmsRsWrite(path, data) local f = io.open(path, "wb") if not f then return false end f:write(data); f:close() return true end function bmsRsBackup(path) if doesFileExist(path) and not doesFileExist(path .. ".bak-bms") then pcall(function() local src = io.open(path, "rb") if src then local d = src:read("*a"); src:close() local dst = io.open(path .. ".bak-bms", "wb") if dst then dst:write(d); dst:close() end end end) end end function bmsRsSplitTech(s) local t = {} for item in (s .. ","):gmatch("([^,]*),") do item = item:gsub("^%s*(.-)%s*$", "%1") if item ~= "" then t[#t + 1] = item end end return t end function bmsRsHasTech(list, tech) for _, v in ipairs(list) do if v == tech then return true end end return false end function bmsRsWriteMxaoSection(preset) local block = "[qUINT_mxao.fx]\nMXAO_BLEND_TYPE=3\nMXAO_DEBUG_VIEW_ENABLE=" .. tostring(bmsRsDebug.v) .. "\n" .. "MXAO_FADE_DEPTH_END=" .. ("%.6f"):format(bmsRsFadeE.v) .. "\nMXAO_FADE_DEPTH_START=" .. ("%.6f"):format(bmsRsFadeS.v) .. "\n" .. "MXAO_GLOBAL_RENDER_SCALE=" .. ("%.6f"):format(bmsRsRender.v) .. "\nMXAO_GLOBAL_SAMPLE_QUALITY_PRESET=" .. tostring(bmsRsQuality.v) .. "\n" .. "MXAO_SAMPLE_NORMAL_BIAS=0.066000\nMXAO_SAMPLE_RADIUS=" .. ("%.6f"):format(bmsRsRadius.v) .. "\n" .. "MXAO_SSAO_AMOUNT=" .. ("%.6f"):format(bmsRsAmount.v) .. "\n" -- buang SEMUA section lama lalu tambah 1 blok bersih (anti duplikat/korup, self-repair) preset = preset:gsub("%[qUINT_mxao%.fx%][^%[]*", "") preset = preset:gsub("[\r\n]+$", "") return preset .. "\n" .. block end function bmsRsSetTech(preset, on) local cur = preset:match("Techniques[ \t]*=[ \t]*([^\r\n]*)") or "" local list = bmsRsSplitTech(cur) -- buang MXAO lama + SAMPAH (item ber-'[' atau tanpa '@' bukan teknik valid) — self-repair local clean = {} for _, v in ipairs(list) do if v ~= bmsRsMxaoTech and not v:find("%[", 1, true) and v:find("@", 1, true) then clean[#clean + 1] = v end end if on then clean[#clean + 1] = bmsRsMxaoTech end local joined = table.concat(clean, ",") if preset:match("Techniques[ \t]*=") then preset = preset:gsub("Techniques[ \t]*=[ \t]*[^\r\n]*", "Techniques=" .. joined, 1) else preset = preset:gsub("[\r\n]+$", "") preset = preset .. "\nTechniques=" .. joined .. "\n" end return preset end local bmsRsLogFile = getWorkingDirectory() .. "/gamefixer/ssao/ssao-debug.log" function bmsRsLog(msg) pcall(function() local f = io.open(bmsRsLogFile, "a") if not f then return end local sz = f:seek("end") if sz and sz > 204800 then f:close() os.remove(bmsRsLogFile .. ".old") os.rename(bmsRsLogFile, bmsRsLogFile .. ".old") f = io.open(bmsRsLogFile, "a") if not f then return end end f:write(os.date("[%Y-%m-%d %H:%M:%S] ") .. tostring(msg) .. "\n") f:close() end) end function bmsRsCheckRestart() -- true bila injector ada tapi bukti game-jalan (d3d9.log) tak ada / lebih tua dari dll local need = false pcall(function() local gta = bmsRsGtaDir() if not gta then return end local dll, log = gta .. "/d3d9.dll", gta .. "/d3d9.log" if not doesFileExist(dll) then return end if not doesFileExist(log) then need = true; return end local md, ml = lfs.attributes(dll, "modification"), lfs.attributes(log, "modification") if md and ml and ml < md then need = true end end) return need end function bmsRsDiag(reason) pcall(function() local L = {} local function add(s) L[#L + 1] = tostring(s) end add("===== SSAO DIAG [" .. tostring(reason) .. "] =====") local gta = bmsRsGtaDir() add("gtaDir=" .. tostring(gta)) add("payload=" .. bmsRsPayloadDir) for _, f in ipairs({"/qUINT_mxao.fx", "/qUINT_common.fxh", "/d3d9-reshade.dll", "/ReShadePreset.ini"}) do local p = bmsRsPayloadDir .. f local sz = nil pcall(function() local a = lfs.attributes(p); if a then sz = a.size end end) add("payload " .. f .. " exists=" .. tostring(doesFileExist(p)) .. " size=" .. tostring(sz)) end if gta then for _, f in ipairs({"/d3d9.dll", "/ReShade.ini", "/dxgi.dll"}) do add("root " .. f .. " exists=" .. tostring(doesFileExist(gta .. f))) end local ptxt = bmsRsRead(bmsRsPresetFile) or "" local tech = ptxt:match("Techniques[ \t]*=[ \t]*([^\r\n]*)") or "(tak ada baris Techniques)" add("preset Techniques=" .. tech) local sec = ptxt:match("%[qUINT_mxao%.fx%]([^%[]*)") or "" add("preset MXAO amount/radius/quality=" .. (sec:match("MXAO_SSAO_AMOUNT[ \t]*=[ \t]*([%d%.]+)") or "?") .. "/" .. (sec:match("MXAO_SAMPLE_RADIUS[ \t]*=[ \t]*([%d%.]+)") or "?") .. "/" .. (sec:match("MXAO_GLOBAL_SAMPLE_QUALITY_PRESET[ \t]*=[ \t]*(%d+)") or "?")) local rtxt = bmsRsRead(gta .. "/ReShade.ini") or "" add("preset MXAO render=" .. (sec:match("MXAO_GLOBAL_RENDER_SCALE[ \t]*=[ \t]*([%d%.]+)") or "?")) add("preset MXAO fade_s/fade_e=" .. (sec:match("MXAO_FADE_DEPTH_START[ \t]*=[ \t]*([%d%.]+)") or "?") .. "/" .. (sec:match("MXAO_FADE_DEPTH_END[ \t]*=[ \t]*([%d%.]+)") or "?")) add("root-ini EffectSearchPaths=" .. (rtxt:match("EffectSearchPaths[ \t]*=[ \t]*([^\r\n]*)") or "(tak ada)")) add("root-ini DepthCopy/Preproc=" .. (rtxt:match("DepthCopyBeforeClears[ \t]*=[ \t]*([^\r\n]*)") or "?") .. "/" .. ((rtxt:match("PreprocessorDefinitions[ \t]*=[ \t]*([^\r\n]*)") or "?"):sub(1, 80))) add("preset MXAO debug=" .. (sec:match("MXAO_DEBUG_VIEW_ENABLE[ \t]*=[ \t]*(%d+)") or "?")) add("root-ini PresetPath=" .. (rtxt:match("PresetPath[ \t]*=[ \t]*([^\r\n]*)") or "(tak ada)")) local lp = gta .. "/d3d9.log" if doesFileExist(lp) then local lm = nil pcall(function() lm = lfs.attributes(lp, "modification") end) add("d3d9.log mtime=" .. tostring(lm and os.date("%Y-%m-%d %H:%M:%S", lm) or "?")) local hits = {} pcall(function() local f = io.open(lp, "rb") if f then local size = f:seek("end") or 0 local back = math.min(size, 16384) f:seek("set", math.max(0, size - back)) local tail = f:read("*a") or "" f:close() for line in tail:gmatch("[^\r\n]+") do local low = line:lower() if low:find("mxao", 1, true) or low:find("error", 1, true) or low:find("preset", 1, true) then hits[#hits + 1] = line:sub(1, 220) if #hits > 14 then table.remove(hits, 1) end end end end end) add("d3d9.log baris cocok MXAO/ERROR/preset: " .. tostring(#hits)) for _, h in ipairs(hits) do add(" LOG: " .. h) end else add("d3d9.log TIDAK ADA -> game belum jalan dengan injector (restart game dulu)") end end add("ini ssao_reshade enable/amount/radius/quality=" .. tostring(ini.ssao_reshade.enable) .. "/" .. tostring(ini.ssao_reshade.amount) .. "/" .. tostring(ini.ssao_reshade.radius) .. "/" .. tostring(ini.ssao_reshade.quality)) add("state ui on/needRestart=" .. tostring(bmsRsOn.v) .. "/" .. tostring(bmsRsNeedRestart)) if not bmsRsInjector then add("VONIS: injector tidak ada di root -> centang Enable untuk pasang otomatis") elseif not doesFileExist(gta .. "/d3d9.log") then add("VONIS: GAME BELUM RESTART sejak injector dipasang") elseif bmsRsNeedRestart then add("VONIS: d3d9.log lebih tua dari dll -> restart game lagi") elseif not bmsRsOn.v then add("VONIS: teknik MXAO OFF di preset") else add("VONIS: file OK, teknik ON, log segar -> bila tetap tak terlihat, curigai depth buffer (DepthCopyBeforeClears=1)") end local f = io.open(bmsRsLogFile, "a") if f then f:write(table.concat(L, "\n") .. "\n") f:close() end end) end -- ================= BMS SSAO reload paksa (ReShade 4.9 tak selalu reload preset otomatis) ================= -- ScrollLock (VK 0x91) = KeyReload di ReShade.ini. keybd_event ditekan via WinAPI agar perubahan -- preset (slider/preset/toggle) langsung terlihat tanpa restart. Slider di-debounce 0.8 dtk. local bmsRsReloadAt = 0 local bmsRsKeyInited = false function bmsRsPressScrollLock() -- global (tanpa local) agar bisa di-stub saat uji; pcall agar tak pernah crash game. -- Urutan UP-dulu: bila UP sebelumnya hilang (mis. thread mati saat reload script), -- ScrollLock nyangkut-DOWN dan semua DOWN berikutnya diabaikan ReShade -> reload mati total. -- UP dulu menjamin edge DOWN selalu baru. Semua async agar tak freeze game. pcall(function() if not bmsRsKeyInited then ffi.cdef[[ void keybd_event(unsigned char bVk, unsigned char bScan, unsigned long dwFlags, unsigned long dwExtraInfo); ]] bmsRsKeyInited = true end lua_thread.create(function() pcall(function() ffi.C.keybd_event(0x91, 0x45, 2, 0) end) wait(30) pcall(function() ffi.C.keybd_event(0x91, 0x45, 0, 0) end) wait(80) pcall(function() ffi.C.keybd_event(0x91, 0x45, 2, 0) end) end) end) end function bmsRsReloadNow() bmsRsPressScrollLock() bmsRsReloadAt = 0 bmsRsLog("reshade reload key") end function bmsRsRequestReload() bmsRsReloadAt = os.clock() end function bmsRsPumpReload() if bmsRsReloadAt ~= 0 and os.clock() - bmsRsReloadAt > 0.8 then bmsRsReloadNow() if bmsRsDebug.v ~= 0 then bmsRsDebugUntil = os.clock() + 2 end end end function bmsRsRefresh() -- moonloader-only: payload 100% di gamefixer/ssao/ (fx + fxh + preset + installer dll) bmsRsInstalled = doesFileExist(bmsRsPayloadDir .. "/qUINT_mxao.fx") and doesFileExist(bmsRsPayloadDir .. "/qUINT_common.fxh") bmsRsChecked = true local gtaDirRs = bmsRsGtaDir() -- injector = d3d9.dll ReShade di root (pastikan file ReShade asli; GTA vanilla tidak punya d3d9.dll di root) bmsRsInjector = false if gtaDirRs and doesFileExist(gtaDirRs .. "/d3d9.dll") then local okh, hit = pcall(function() local f = io.open(gtaDirRs .. "/d3d9.dll", "rb") if not f then return false end local d = f:read("*a"); f:close() return d and d:find("ReShade", 1, true) ~= nil end) bmsRsInjector = (okh and hit) or false end -- pointer root HANYA bila injector ada (hormati sterilisasi: tanpa injector, jangan tulis apa-apa ke root) if bmsRsInstalled and bmsRsInjector and gtaDirRs then local rini = gtaDirRs .. "/ReShade.ini" if not doesFileExist(rini) then local winpay = bmsRsPayloadDir:gsub("/", "\\") bmsRsWrite(rini, "[DEPTH]\nDepthCopyAtClearIndex=0\nDepthCopyBeforeClears=0\nDisableINTZ=0\nUseAspectRatioHeuristics=1\n\n" .. "[GENERAL]\nEffectSearchPaths=" .. winpay .. "\nTextureSearchPaths=" .. winpay .. "\nPresetPath=" .. winpay .. "\\ReShadePreset.ini\n\n" .. "[INPUT]\nKeyReload=145,0,0,0\n") end end -- baca status ON + nilai dari preset lokal local preset = bmsRsPresetFile local txt = bmsRsRead(preset) -- self-heal: teknik hilang (mis. ReShade timpa preset saat exit / file terhapus) → tulis ulang bila enable if bmsRsInstalled and ini.ssao_reshade.enable and (not txt or not txt:match("MXAO@qUINT_mxao%.fx")) then txt = bmsRsWriteMxaoSection(txt or "") txt = bmsRsSetTech(txt, true) bmsRsWrite(preset, txt) end bmsRsOn.v = false if txt then local tech = txt:match("Techniques[ \t]*=[ \t]*([^\r\n]*)") or "" if bmsRsHasTech(bmsRsSplitTech(tech), bmsRsMxaoTech) then bmsRsOn.v = true end local sec = txt:match("%[qUINT_mxao%.fx%]([^%[]*)") or "" local am = sec:match("MXAO_SSAO_AMOUNT[ \t]*=[ \t]*([%d%.]+)") local rd = sec:match("MXAO_SAMPLE_RADIUS[ \t]*=[ \t]*([%d%.]+)") local ql = sec:match("MXAO_GLOBAL_SAMPLE_QUALITY_PRESET[ \t]*=[ \t]*(%d+)") if am then bmsRsAmount.v = math.max(0, math.min(4.0, tonumber(am) or bmsRsAmount.v)) end if rd then bmsRsRadius.v = math.max(0.5, math.min(6.0, tonumber(rd) or bmsRsRadius.v)) end if ql then bmsRsQuality.v = math.max(0, math.min(7, math.floor(tonumber(ql) or bmsRsQuality.v))) end local rr = sec:match("MXAO_GLOBAL_RENDER_SCALE[ \t]*=[ \t]*([%d%.]+)") if rr then bmsRsRender.v = math.max(0.25, math.min(1.0, tonumber(rr) or bmsRsRender.v)) end local fs = sec:match("MXAO_FADE_DEPTH_START[ \t]*=[ \t]*([%d%.]+)") if fs then bmsRsFadeS.v = math.max(0, math.min(1.0, tonumber(fs) or bmsRsFadeS.v)) end local fe = sec:match("MXAO_FADE_DEPTH_END[ \t]*=[ \t]*([%d%.]+)") if fe then bmsRsFadeE.v = math.max(0, math.min(1.0, tonumber(fe) or bmsRsFadeE.v)) end if bmsRsFadeS.v > bmsRsFadeE.v then bmsRsFadeE.v = bmsRsFadeS.v end local db = sec:match("MXAO_DEBUG_VIEW_ENABLE[ \t]*=[ \t]*(%d+)") if db then bmsRsDebug.v = math.max(0, math.min(2, tonumber(db))) end -- tulis balik bila preset lama di luar spek (mis. 7.92) agar sinkron; teknik tak disentuh do local sec0 = txt:match("%[qUINT_mxao%.fx%]([^%[]*)") or "" local a0 = tonumber(sec0:match("MXAO_SSAO_AMOUNT[ \t]*=[ \t]*([%d%.]+)") or "-1") local r0 = tonumber(sec0:match("MXAO_GLOBAL_RENDER_SCALE[ \t]*=[ \t]*([%d%.]+)") or "-1") local f0s = tonumber(sec0:match("MXAO_FADE_DEPTH_START[ \t]*=[ \t]*([%d%.]+)") or "-1") local f0e = tonumber(sec0:match("MXAO_FADE_DEPTH_END[ \t]*=[ \t]*([%d%.]+)") or "-1") if a0 ~= bmsRsAmount.v or r0 ~= bmsRsRender.v or f0s ~= bmsRsFadeS.v or f0e ~= bmsRsFadeE.v then txt = bmsRsWriteMxaoSection(txt) bmsRsWrite(preset, txt) end end end if not bmsRsInjector then bmsRsOn.v = false end bmsRsNeedRestart = bmsRsCheckRestart() bmsRsDiag("refresh") ini.ssao_reshade.enable = bmsRsOn.v ini.ssao_reshade.amount = ("%.2f"):format(bmsRsAmount.v) ini.ssao_reshade.radius = ("%.2f"):format(bmsRsRadius.v) ini.ssao_reshade.quality = bmsRsQuality.v ini.ssao_reshade.render = ("%.2f"):format(bmsRsRender.v) ini.ssao_reshade.fade_s = ("%.2f"):format(bmsRsFadeS.v) ini.ssao_reshade.fade_e = ("%.2f"):format(bmsRsFadeE.v) save() end function bmsRsEnsureGeneral(iniPath) -- moonloader-only: semua path mutlak ke payload; timpa nilai lama yg menunjuk root reshade-shaders local txt = bmsRsRead(iniPath) or "" if not txt:match("%[GENERAL%]") then txt = txt .. "\n[GENERAL]\n" end local winpay = bmsRsPayloadDir:gsub("/", "\\") -- tulis kunci HANYA di dalam section-nya (anti salah sasaran antar-section; -- pelajaran: TutorialProgress wajib ada di GENERAL SEKALIGUS OVERLAY, helper lama -- yg cek-seisi-file membuat salinan kedua tak pernah tertulis) local function setIn(sec, key, val) if not txt:match("%[" .. sec .. "%]") then txt = txt .. "\n[" .. sec .. "]\n" end local _, e0 = txt:find("%[" .. sec .. "%]") local n0 = txt:find("\n%[", e0 + 1) local bodyEnd = n0 or #txt local head = txt:sub(1, e0) local body = txt:sub(e0 + 1, bodyEnd) local tail = (n0 and txt:sub(bodyEnd + 1)) or "" if body:match(key .. "[ \t]*=") then body = body:gsub(key .. "[ \t]*=[ \t]*[^\r\n]*", key .. "=" .. val, 1) else if body:sub(-1) ~= "\n" then body = body .. "\n" end body = body .. key .. "=" .. val .. "\n" end txt = head .. body .. tail end local function setKey(key, val) setIn("GENERAL", key, val) end setKey("EffectSearchPaths", winpay) setKey("TextureSearchPaths", winpay) setKey("PresetPath", winpay .. "\\ReShadePreset.ini") setKey("PerformanceMode", "1") setKey("SkipLoadingDisabledEffects", "1") -- TutorialProgress di DUA section: crosire 2020 ([GENERAL], era 4.6) vs modern ([OVERLAY]). -- 4.9.0 tidak jelas bacanya dari mana + splash user nempel persis seperti bug BlueTalon -- (progress tak terbaca) -> tulis di keduanya, aman karena hanya angka yg diabaikan bila tak dikenal. setKey("TutorialProgress", "4") setKey("PreprocessorDefinitions", "RESHADE_DEPTH_LINEARIZATION_FAR_PLANE=1000.0,RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0,RESHADE_DEPTH_INPUT_IS_REVERSED=0,RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=0") if not txt:match("%[DEPTH%]") then txt = txt .. "\n[DEPTH]\nDepthCopyAtClearIndex=0\nDepthCopyBeforeClears=1\nDisableINTZ=0\nUseAspectRatioHeuristics=1\n" end txt = txt:gsub("DepthCopyBeforeClears[ \t]*=[ \t]*%d+", "DepthCopyBeforeClears=1", 1) -- matikan UI bawaan ReShade yg mengganggu di atas (FPS/clock/pesan/tutorial) if not txt:match("%[OVERLAY%]") then txt = txt .. "\n[OVERLAY]\n" end local function setOv(key, val) setIn("OVERLAY", key, val) end setOv("ShowFPS", "0") setOv("ShowClock", "0") setOv("ShowScreenshotMessage", "0") setOv("TutorialProgress", "4") -- IntermediateCachePath bawaan Step 3 menunjuk PC orang (faeyz) — JANGAN ikut dicopy return txt end function bmsRsInstall() -- moonloader-only: TIDAK copy apa-apa (payload sudah di gamefixer/ssao/). -- Hanya pastikan ReShade.ini root menunjuk ke payload + preset lokal AKTIF. if not (doesFileExist(bmsRsPayloadDir .. "/qUINT_mxao.fx") and doesFileExist(bmsRsPayloadDir .. "/qUINT_common.fxh")) then sampAddChatMessage(script_name .. " {FFFFFF}SSAO payload hilang di moonloader/gamefixer/ssao/ - install ulang GameFixer", 0xFF4444) return end local gta = bmsRsGtaDir() -- 0. injector: restore d3d9.dll ReShade dari payload bila belum ada (wajib restart game setelahnya) if not doesFileExist(gta .. "/d3d9.dll") then local okr, errr = pcall(function() local src = io.open(bmsRsPayloadDir .. "/d3d9-reshade.dll", "rb") if not src then error("payload d3d9-reshade.dll hilang") end local data = src:read("*a"); src:close() local dst = io.open(gta .. "/d3d9.dll", "wb") if not dst then error("tidak bisa tulis " .. gta .. "/d3d9.dll") end dst:write(data); dst:close() end) if not okr then sampAddChatMessage(script_name .. " {FFFFFF}SSAO install gagal: " .. tostring(errr), 0xFF4444); return end end -- ReShade.ini root: backup + pastikan GENERAL menunjuk payload local rini = gta .. "/ReShade.ini" bmsRsBackup(rini) local rtxt = bmsRsEnsureGeneral(rini) -- [INPUT] KeyReload agar bisa reload tanpa restart (ScrollLock=145) if not rtxt:match("KeyReload[ \t]*=") then if not rtxt:match("%[INPUT%]") then rtxt = rtxt .. "\n[INPUT]\n" end rtxt = rtxt:gsub("(%[INPUT%][^\n]*\n)", "%1KeyReload=145,0,0,0\n", 1) end bmsRsWrite(rini, rtxt) -- Preset lokal: backup + tulis section MXAO + pastikan technique ON bmsRsBackup(bmsRsPresetFile) local ptxt = bmsRsRead(bmsRsPresetFile) or "" ptxt = bmsRsWriteMxaoSection(ptxt) ptxt = bmsRsSetTech(ptxt, true) bmsRsWrite(bmsRsPresetFile, ptxt) bmsRsRefresh() sampAddChatMessage(script_name .. " {FFFFFF}SSAO (MXAO) terhubung - RESTART GAME (wajib bila injector baru dipasang)", 0x73b461) bmsRsLog("install done") bmsRsDiag("install") end function bmsRsApplyLive() local preset = bmsRsPresetFile local ptxt = bmsRsRead(preset) or "" ptxt = bmsRsWriteMxaoSection(ptxt) bmsRsWrite(preset, ptxt) bmsRsRequestReload() ini.ssao_reshade.amount = ("%.2f"):format(bmsRsAmount.v) ini.ssao_reshade.radius = ("%.2f"):format(bmsRsRadius.v) ini.ssao_reshade.quality = bmsRsQuality.v ini.ssao_reshade.render = ("%.2f"):format(bmsRsRender.v) ini.ssao_reshade.fade_s = ("%.2f"):format(bmsRsFadeS.v) ini.ssao_reshade.fade_e = ("%.2f"):format(bmsRsFadeE.v) save() end -- (definisi via assignment agar forward-decl di atas terisi, bukan shadow) -- gabung set-debug + pastikan Real ON (klik debug saat teknik OFF = tak terlihat!). -- Dipakai tombol None/AO/Normals + /mxaodbg agar satu perilaku. function bmsRsDebugSet(v) v = math.max(0, math.min(2, v or 0)) bmsRsDebug.v = v if v == 0 then bmsRsDebugUntil = 0 else bmsRsDebugUntil = os.clock() + 2 end if v ~= 0 and not bmsRsOn.v then bmsRsSetOn(true) end if bmsRsOn.v then bmsRsApplyLive() end end bmsRsSetOn = function(on) if on and not bmsRsInjector then -- tanpa tombol Install: Enable langsung pasang otomatis (dll + pointer + preset) bmsRsInstall() bmsRsInjector = doesFileExist(bmsRsGtaDir() .. "/d3d9.dll") if not bmsRsInjector then bmsRsOn.v = false return end end local preset = bmsRsPresetFile local ptxt = bmsRsRead(preset) or "" if on then ptxt = bmsRsWriteMxaoSection(ptxt) end ptxt = bmsRsSetTech(ptxt, on) bmsRsWrite(preset, ptxt) if on and ini.ssao.enable then bmsSsaoSetOn(false) end bmsRsOn.v = on ini.ssao_reshade.enable = on save() sampAddChatMessage(script_name .. (on and " {FFFFFF}SSAO (MXAO) {73b461}Enabled - reload ReShade bila belum muncul" or " {FFFFFF}SSAO (MXAO) {dc4747}Disabled"), 0x73b461) bmsRsReloadNow() bmsRsLog("seton " .. tostring(on)) bmsRsDiag("seton-" .. tostring(on)) end function bmsRsPreset(amount, radius, quality, render) bmsRsAmount.v = amount bmsRsRadius.v = radius bmsRsQuality.v = quality if render then bmsRsRender.v = math.max(0.25, math.min(1.0, render)) end if bmsRsOn.v then bmsRsApplyLive() else ini.ssao_reshade.amount = ("%.2f"):format(amount) ini.ssao_reshade.radius = ("%.2f"):format(radius) ini.ssao_reshade.quality = quality if render then ini.ssao_reshade.render = ("%.2f"):format(bmsRsRender.v) end save() end end function bmsRsUninstall() -- sterilkan root: hapus file ReShade (injector + config + preset + log + backup kami). -- Aman: d3d9.dll hanya dihapus bila isinya ReShade (GTA vanilla tidak punya d3d9.dll di root). local gta = bmsRsGtaDir() local gone, kept = 0, 0 local dll = gta .. "/d3d9.dll" if doesFileExist(dll) then local isRs = false pcall(function() local f = io.open(dll, "rb") if f then local d = f:read("*a"); f:close() isRs = d and d:find("ReShade", 1, true) ~= nil end end) if isRs then pcall(os.remove, dll); gone = gone + 1 else sampAddChatMessage(script_name .. " {FFFFFF}d3d9.dll bukan ReShade - TIDAK dihapus (aman)", 0xFF4444); kept = kept + 1 end end for _, f in ipairs({"/ReShade.ini", "/ReShade.ini.bak-bms", "/ReShadePreset.ini", "/ReShadePreset.ini.bak-bms2", "/ReShade.log", "/dxgi.dll"}) do if doesFileExist(gta .. f) then pcall(os.remove, gta .. f); gone = gone + 1 end end bmsRsOn.v = false ini.ssao_reshade.enable = false save() bmsRsRefresh() sampAddChatMessage(script_name .. " {FFFFFF}Root steril (" .. tostring(gone) .. " file ReShade dihapus" .. (kept > 0 and ", 1 dipertahankan" or "") .. ") - Fake AO tetap bisa dipakai", 0x73b461) bmsRsLog("uninstall gone=" .. tostring(gone) .. " kept=" .. tostring(kept)) end -- pengaman: debug view (AO/Normals) menutupi SELURUH frame termasuk menu & chat! -- Tanpa ini user terkunci di layar pelangi dan tak bisa klik None. Auto-revert 2 dtk. function bmsRsDebugPump() if bmsRsDebug.v ~= 0 and bmsRsDebugUntil ~= 0 and os.clock() > bmsRsDebugUntil then bmsRsDebug.v = 0 bmsRsDebugUntil = 0 if bmsRsOn.v then bmsRsApplyLive() end sampAddChatMessage(script_name .. " {FFFFFF}Debug view OFF otomatis (pengaman 2 dtk)", 0x73b461) bmsRsLog("debug auto-revert") end end -- kendali debug buta via chat /mxaodbg [0|1|2] (tanpa arg = None). Global agar bisa -- dipanggil onSendChat yg didefinisikan jauh di atas (hindari forward-ref nil). -- Berguna saat layar penuh normal-map dan panel tak terbaca: ketik buta + Enter. function bmsRsDebugCmd(arg) local v = 0 if arg == "1" then v = 1 elseif arg == "2" then v = 2 end bmsRsDebugSet(v) sampAddChatMessage(script_name .. " {FFFFFF}MXAO debug = " .. ({"None", "AO", "Normals"})[v + 1] .. (v == 0 and "" or " (2 dtk, otomatis kembali)"), 0x73b461) bmsRsLog("mxaodbg " .. tostring(v)) end function drawSSAOTab() if not bmsRsChecked then bmsRsRefresh() end imgui.BeginChild("##SSAO", imgui.ImVec2(-1, -1), true) -- ===== SECTION 1: SSAO REAL (ReShade MXAO) ===== imgui.TextColored(DIM(0.96), u8(T("SSAO Real"))) imgui.Spacing() local rcol = (bmsRsInstalled and bmsRsInjector and bmsRsOn.v) and imgui.ImVec4(0.4,1,0.5,1) or ((bmsRsInstalled and bmsRsInjector) and imgui.ImVec4(1,0.7,0.3,1) or imgui.ImVec4(1,0.35,0.35,1)) local rstatus = (not bmsRsInstalled) and T("SSAO Not Installed") or ((not bmsRsInjector) and T("Injector Missing") or ((T("SSAO Installed") .. " • " .. (bmsRsOn.v and T("SSAO Active") or T("SSAO Inactive"))))) imgui.TextColored(rcol, u8(rstatus)) imgui.Spacing() if bmsRsNeedRestart and bmsRsInjector then imgui.TextColored(imgui.ImVec4(1,0.7,0.3,1), u8(T("Need Restart"))) imgui.Spacing() end if not bmsRsInstalled then imgui.TextColored(imgui.ImVec4(1,0.35,0.35,1), u8(T("SSAO Not Installed") .. " — moonloader/gamefixer/ssao/ rusak")) else if not bmsRsInjector then imgui.TextColored(imgui.ImVec4(1,0.7,0.3,1), u8(T("Injector Missing") .. " — centang Enable untuk pasang otomatis (restart game)")) imgui.Spacing() end if imgui.Checkbox(T("Enable SSAO") .. " (MXAO)", bmsRsOn) then bmsRsSetOn(bmsRsOn.v) handleButtonSound() end handleButtonSound() imgui.Spacing() imgui.Text(T("MXAO Amount") .. ": " .. ("%.2f"):format(bmsRsAmount.v)) imgui.PushItemWidth(-1) if imgui.SliderFloat("##rsamount", bmsRsAmount, 0.0, 4.0, "%.2f") then if bmsRsOn.v then bmsRsApplyLive() else ini.ssao_reshade.amount = ("%.2f"):format(bmsRsAmount.v); save() end end imgui.PopItemWidth() imgui.Text(T("MXAO Radius") .. ": " .. ("%.2f"):format(bmsRsRadius.v)) imgui.PushItemWidth(-1) if imgui.SliderFloat("##rsradius", bmsRsRadius, 0.5, 6.0, "%.2f") then if bmsRsOn.v then bmsRsApplyLive() else ini.ssao_reshade.radius = ("%.2f"):format(bmsRsRadius.v); save() end end imgui.PopItemWidth() imgui.Text(T("MXAO Quality") .. ": " .. tostring(bmsRsQuality.v)) imgui.PushItemWidth(-1) if imgui.SliderInt("##rsquality", bmsRsQuality, 0, 7) then if bmsRsOn.v then bmsRsApplyLive() else ini.ssao_reshade.quality = bmsRsQuality.v; save() end end imgui.PopItemWidth() imgui.Spacing() imgui.Text(T("Render Scale") .. ": " .. ("%.2f"):format(bmsRsRender.v)) imgui.PushItemWidth(-1) if imgui.SliderFloat("##rsrender", bmsRsRender, 0.25, 1.0, "%.2f") then if bmsRsOn.v then bmsRsApplyLive() else ini.ssao_reshade.render = ("%.2f"):format(bmsRsRender.v); save() end end imgui.PopItemWidth() imgui.Spacing() imgui.Text(T("Fade Start") .. ": " .. ("%.2f"):format(bmsRsFadeS.v)) imgui.PushItemWidth(-1) if imgui.SliderFloat("##rsfadeS", bmsRsFadeS, 0.0, 1.0, "%.2f") then if bmsRsFadeS.v > bmsRsFadeE.v then bmsRsFadeE.v = bmsRsFadeS.v end if bmsRsOn.v then bmsRsApplyLive() else ini.ssao_reshade.fade_s = ("%.2f"):format(bmsRsFadeS.v); ini.ssao_reshade.fade_e = ("%.2f"):format(bmsRsFadeE.v); save() end end imgui.PopItemWidth() imgui.Text(T("Fade End") .. ": " .. ("%.2f"):format(bmsRsFadeE.v)) imgui.PushItemWidth(-1) if imgui.SliderFloat("##rsfadeE", bmsRsFadeE, 0.0, 1.0, "%.2f") then if bmsRsFadeE.v < bmsRsFadeS.v then bmsRsFadeS.v = bmsRsFadeE.v end if bmsRsOn.v then bmsRsApplyLive() else ini.ssao_reshade.fade_s = ("%.2f"):format(bmsRsFadeS.v); ini.ssao_reshade.fade_e = ("%.2f"):format(bmsRsFadeE.v); save() end end imgui.PopItemWidth() imgui.Spacing() imgui.Text(T("Debug View") .. ": " .. (({"None", "AO", "Normals"})[math.max(0, math.min(2, bmsRsDebug.v)) + 1] or "?")) if imgui.Button("None##rsdbg0", imgui.ImVec2(120, 28)) then bmsRsDebugSet(0); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button("AO##rsdbg1", imgui.ImVec2(120, 28)) then bmsRsDebugSet(1); sampAddChatMessage(script_name .. " {FFFFFF}Debug view ON 2 detik (otomatis kembali)", 0x73b461); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button("Normals##rsdbg2", imgui.ImVec2(120, 28)) then bmsRsDebugSet(2); sampAddChatMessage(script_name .. " {FFFFFF}Debug view ON 2 detik (otomatis kembali)", 0x73b461); handleButtonSound() end handleButtonSound() imgui.Spacing() if imgui.Button(T("Thin") .. "##rsp1", imgui.ImVec2(120, 28)) then bmsRsPreset(1.0, 1.5, 1); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Medium") .. "##rsp2", imgui.ImVec2(120, 28)) then bmsRsPreset(4.0, 2.0, 2); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Thick") .. "##rsp3", imgui.ImVec2(120, 28)) then bmsRsPreset(3.0, 2.5, 3); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Reload ReShade") .. "##rsreload", imgui.ImVec2(150, 28)) then bmsRsApplyLive() bmsRsReloadNow() bmsRsRefresh() sampAddChatMessage(script_name .. " {FFFFFF}Preset tersimpan - ReShade reload otomatis", 0x73b461) handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Open GTA Folder") .. "##rsopen", imgui.ImVec2(150, 28)) then pcall(function() os.execute('explorer "' .. bmsRsPayloadDir:gsub("/", "\\") .. '"') end) handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Uninstall SSAO") .. "##rsuninst", imgui.ImVec2(150, 28)) then bmsRsUninstall() handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Open Log") .. "##rslog", imgui.ImVec2(150, 28)) then bmsRsDiag("manual") sampAddChatMessage(script_name .. " {FFFFFF}SSAO log: moonloader/gamefixer/ssao/ssao-debug.log", 0x73b461) pcall(function() os.execute('notepad "' .. bmsRsLogFile:gsub("/", "\\") .. '"') end) handleButtonSound() end handleButtonSound() imgui.Spacing() if imgui.Button(T("Light Preset") .. "##rsp4", imgui.ImVec2(220, 28)) then bmsRsPreset(2.0, 2.0, 1, 0.5); handleButtonSound() end handleButtonSound() imgui.SameLine() imgui.TextColored(DIM(0.45), u8("Quality 1 + Scale 0.5 (ringan)")) end imgui.Spacing() bmsTextColU8(DIM(0.55), u8(T("SSAO Real Hint"))) imgui.Spacing() imgui.Separator() imgui.Spacing() -- ===== SECTION 2: FAKE AO (fallback) ===== imgui.TextColored(DIM(0.96), u8(T("Fake AO Fallback"))) imgui.Spacing() local col = ini.ssao.enable and imgui.ImVec4(0.4,1,0.5,1) or imgui.ImVec4(1,1,1,0.45) imgui.TextColored(col, u8(ini.ssao.enable and T("SSAO Active") or T("SSAO Inactive"))) imgui.Spacing() if imgui.Checkbox(T("Enable SSAO") .. " (Fake)", bmsSsaoOn) then bmsSsaoSetOn(bmsSsaoOn.v) handleButtonSound() end handleButtonSound() imgui.Spacing() imgui.Text(T("Thickness") .. ": " .. tostring(bmsSsaoThick.v)) imgui.PushItemWidth(-1) if imgui.SliderInt("##ssaothick", bmsSsaoThick, 0, 100) then if ini.ssao.enable then bmsSsaoApply() else ini.ssao.thick = bmsSsaoThick.v; save() end end imgui.PopItemWidth() imgui.Text(T("Intensity") .. ": " .. tostring(bmsSsaoIntens.v)) imgui.PushItemWidth(-1) if imgui.SliderInt("##ssaointens", bmsSsaoIntens, 0, 100) then if ini.ssao.enable then bmsSsaoApply() else ini.ssao.intens = bmsSsaoIntens.v; save() end end imgui.PopItemWidth() imgui.Spacing() imgui.TextColored(DIM(0.55), u8(T("SSAO Preset"))) if imgui.Button(T("Thin") .. "##ssaop1", imgui.ImVec2(120, 28)) then bmsSsaoPreset(25); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Medium") .. "##ssaop2", imgui.ImVec2(120, 28)) then bmsSsaoPreset(55); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Thick") .. "##ssaop3", imgui.ImVec2(120, 28)) then bmsSsaoPreset(85); handleButtonSound() end handleButtonSound() imgui.Spacing() imgui.Separator() imgui.Spacing() bmsTextColU8(DIM(0.55), u8(T("SSAO Hint"))) -- pompa reload debounce (tanpa ini slider menulis file yg tak dibaca ulang ReShade) bmsRsPumpReload() pcall(bmsRsDebugPump) imgui.EndChild() end -- ================= BMS SENSFIX NATIVE 2026-09-05 (pengganti sensfix.asi, tanpa file ASI) ================= -- Hasil bedah sensfix.asi (bukti dari biner, bukan tebakan): 4 instruksi game "fmul [0x85A5C4]" -- (0x522265 + 0x522329 = lihat biasa, 0x510C12 + 0x510C83 = membidik) di-patch operandnya -- menunjuk ke 2 float milik ASI (global + aiming_sniper, dari sensfix.ini). -- Versi native meniru MEKANISME yg sama dari Lua: alokasi 2 float -> patch 4 operand -> tulis nilai live. -- Tanpa ASI, tanpa restart, tanpa detour machine-code. Terverifikasi dari gta_sa.exe 1.0 US -- (14383616 B): pola D8 0D C4 A5 85 00 di ke-4 titik; master 0x85A5C4 = 0.0125. -- Deteksi sniper: ped=*[0xB7CD98], slot=byte[ped+0x718], type=dword[ped+0x5A0+slot*28]; ID 34 = sniper. -- Fix bawaan panel (Fixes > Sensitivity Fix, memory) tetap independen apa adanya. local bmsSensIni = getWorkingDirectory() .. "/config/sensfix.ini" -- migrasi sekali: pindahkan sensfix.ini lama dari root game ke folder config (agar rapi, satu tempat) pcall(function() local oldIni = getGameDirectory() .. "/sensfix.ini" if oldIni ~= bmsSensIni and doesFileExist(oldIni) and not doesFileExist(bmsSensIni) then os.rename(oldIni, bmsSensIni) end end) local bmsSensDef = { global = 0.0125, aiming = 0.003, sniping = 0.0018 } bmsSensPatchAddrs = { look1 = 0x522265, look2 = 0x522329, aim1 = 0x510C12, aim2 = 0x510C83 } bmsSensMasterAddr = 0x85A5C4 bmsSensMem = { a = 0, b = 0, patched = false, busy = false } function bmsSensReadIni() local vals = { global = bmsSensDef.global, aiming = bmsSensDef.aiming, sniping = bmsSensDef.sniping } local f = io.open(bmsSensIni, "r") if f then for line in f:lines() do local k, v = line:match("^%s*([%w_]+)%s*=%s*([%d%.eE+-]+)") if k == "global" then vals.global = tonumber(v) or vals.global elseif k == "aiming" then vals.aiming = tonumber(v) or vals.aiming elseif k == "aiming_sniper" then vals.sniping = tonumber(v) or vals.sniping end end f:close() end return vals end function bmsSensWriteIni(vals) if doesFileExist(bmsSensIni) and not doesFileExist(bmsSensIni .. ".bak-bms") then pcall(function() local src = io.open(bmsSensIni, "rb") if src then local d = src:read("*a"); src:close() local dst = io.open(bmsSensIni .. ".bak-bms", "wb") if dst then dst:write(d); dst:close() end end end) end local function fmt(x) return ("%.6f"):format(x) end local lines, seen, hasSec = {}, {}, false local f = io.open(bmsSensIni, "r") if f then for line in f:lines() do if line:match("^%s*%[sensfix%]") then hasSec = true end local k = line:match("^%s*([%w_]+)%s*=") if k == "global" then line = "global=" .. fmt(vals.global); seen.global = true elseif k == "aiming" then line = "aiming=" .. fmt(vals.aiming); seen.aiming = true elseif k == "aiming_sniper" then line = "aiming_sniper=" .. fmt(vals.sniping); seen.sniping = true end lines[#lines + 1] = line end f:close() end if not hasSec then table.insert(lines, 1, "[sensfix]") end if not seen.global then lines[#lines + 1] = "global=" .. fmt(vals.global) end if not seen.aiming then lines[#lines + 1] = "aiming=" .. fmt(vals.aiming) end if not seen.sniping then lines[#lines + 1] = "aiming_sniper=" .. fmt(vals.sniping) end local w = io.open(bmsSensIni, "w") if w then w:write(table.concat(lines, "\n") .. "\n"); w:close() end end local bmsSensInit = bmsSensReadIni() local bmsSensGlobal = imgui.ImFloat(bmsSensInit.global) local bmsSensAiming = imgui.ImFloat(bmsSensInit.aiming) local bmsSensSniper = imgui.ImFloat(bmsSensInit.sniping) local bmsSensOn = imgui.ImBool(true) local bmsSensChecked = false local bmsSensStatus = "" local bmsSensLock = imgui.ImBool(false) function bmsSensRefreshStatus() bmsSensChecked = true if bmsSensMem.patched and bmsSensOn.v then bmsSensStatus = T("SensFix Installed") .. " • " .. T("SensFix Enabled") .. " (native)" elseif bmsSensMem.patched then bmsSensStatus = T("SensFix Installed") .. " • " .. T("SensFix Disabled") else bmsSensStatus = T("SensFix Not Installed") end local cur = bmsSensReadIni() bmsSensGlobal.v = cur.global bmsSensAiming.v = cur.aiming bmsSensSniper.v = cur.sniping return bmsSensMem.patched end function bmsSensAimValue() -- pilih nilai bidik: kunci manual > sniper otomatis (senjata ID 34) > aiming; gagal-aman ke aiming if bmsSensLock.v then return bmsSensSniper.v end local ok, wtype = pcall(function() local ped = memory.read(0xB7CD98, 4, false) if ped == nil or ped == 0 then return -1 end local slot = memory.read(ped + 0x718, 1, false) if slot == nil or slot < 0 or slot > 12 then return -1 end return memory.read(ped + 0x5A0 + slot * 28, 4, false) end) if ok and wtype == 34 then return bmsSensSniper.v end return bmsSensAiming.v end function bmsSensPushFloats() -- tulis nilai live ke 2 float alokasi (tanpa patch ulang); gagal-aman total if bmsSensMem.a ~= 0 then pcall(memory.setfloat, bmsSensMem.a, bmsSensGlobal.v, false) end if bmsSensMem.b ~= 0 then pcall(memory.setfloat, bmsSensMem.b, bmsSensAimValue(), false) end end function bmsSensPatchNow() -- alokasi sekali + patch 4 operand game -> true bila sukses if bmsSensMem.a == 0 or bmsSensMem.b == 0 then local ok, mem = pcall(allocateMemory, 8) if not ok or mem == nil or mem == 0 then return false end bmsSensMem.a, bmsSensMem.b = mem, mem + 4 end bmsSensPushFloats() local ok = pcall(function() memory.write(bmsSensPatchAddrs.look1, bmsSensMem.a, 4, true) memory.write(bmsSensPatchAddrs.look2, bmsSensMem.a, 4, true) memory.write(bmsSensPatchAddrs.aim1, bmsSensMem.b, 4, true) memory.write(bmsSensPatchAddrs.aim2, bmsSensMem.b, 4, true) end) if ok then bmsSensMem.patched = true end return ok end function bmsSensUnpatch() -- kembalikan 4 operand ke master game 0x85A5C4 (seperti semula) pcall(function() memory.write(bmsSensPatchAddrs.look1, bmsSensMasterAddr, 4, true) memory.write(bmsSensPatchAddrs.look2, bmsSensMasterAddr, 4, true) memory.write(bmsSensPatchAddrs.aim1, bmsSensMasterAddr, 4, true) memory.write(bmsSensPatchAddrs.aim2, bmsSensMasterAddr, 4, true) end) bmsSensMem.patched = false end function bmsSensWatch() -- thread: tunggu game init (master != 0, maks ~60 dtk) -> patch -> jaga nilai bidik tiap 200 ms if bmsSensMem.busy then return end bmsSensMem.busy = true local n = 0 while n < 120 do if not bmsSensOn.v then bmsSensMem.busy = false return end local ok, v = pcall(memory.read, bmsSensMasterAddr, 4, false) if ok and v ~= nil and v ~= 0 then break end wait(500) n = n + 1 end if not bmsSensOn.v then bmsSensMem.busy = false return end if not bmsSensPatchNow() then -- GAGAL patch bukan alasan mati total: biarkan On=true agar pump mencoba lagi -- (dulu: On=false -> tidak pernah retry kecuali user on/off manual = bug laporan user) bmsSensRefreshStatus() bmsSensMem.busy = false return end bmsSensRefreshStatus() while bmsSensOn.v and bmsSensMem.patched do wait(200) if bmsSensMem.b ~= 0 then pcall(memory.setfloat, bmsSensMem.b, bmsSensAimValue(), false) end end bmsSensMem.busy = false end -- pompa periodik: pastikan selalu ter-patch (dipanggil saat boot + tiap ±10 dtk + saat tab dibuka) function bmsSensPump() bmsSensOn.v = true -- SensFix selalu aktif, tidak ada tombol on/off (permintaan user) if not bmsSensMem.patched and not bmsSensMem.busy then lua_thread.create(bmsSensWatch) elseif bmsSensMem.patched then bmsSensPushFloats() end end -- global (tanpa local): dipanggil main() saat boot yg posisinya SEBELUM blok ini di file function bmsSensBoot() bmsSensOn.v = true pcall(bmsSensPump) end function bmsSensApply() local vals = { global = math.max(0.001, math.min(0.05, bmsSensGlobal.v)), aiming = math.max(0.0002, math.min(0.02, bmsSensAiming.v)), sniping = math.max(0.0002, math.min(0.02, bmsSensSniper.v)), } bmsSensGlobal.v, bmsSensAiming.v, bmsSensSniper.v = vals.global, vals.aiming, vals.sniping bmsSensWriteIni(vals) bmsSensPushFloats() bmsSensRefreshStatus() end function onExitScript() if bmsSensMem.patched then bmsSensUnpatch() end end function bmsSensPreset(which) if which == "def" then bmsSensGlobal.v, bmsSensAiming.v, bmsSensSniper.v = bmsSensDef.global, bmsSensDef.aiming, bmsSensDef.sniping elseif which == "steady" then bmsSensGlobal.v, bmsSensAiming.v, bmsSensSniper.v = bmsSensDef.global, 0.002, 0.0012 elseif which == "fast" then bmsSensGlobal.v, bmsSensAiming.v, bmsSensSniper.v = 0.02, 0.004, 0.0025 end bmsSensApply() handleButtonSound() end function drawSensFixTab() if not bmsSensChecked then bmsSensRefreshStatus() end pcall(bmsSensPump) imgui.BeginChild("##SensFix", imgui.ImVec2(-1, -1), true) imgui.TextColored(DIM(0.96), u8(T("SensFix") .. " (native)")) imgui.TextColored(DIM(0.55), u8(T("SensFix Sub"))) imgui.Separator() imgui.Spacing() local col = bmsSensMem.patched and imgui.ImVec4(0.4,1,0.5,1) or imgui.ImVec4(1,0.7,0.3,1) imgui.TextColored(col, u8(bmsSensStatus)) imgui.Spacing() -- SensFix selalu AKTIF (tanpa tombol on/off). Status di atas menunjukkan hasil patch. imgui.TextColored(imgui.ImVec4(0.4,1,0.5,1), u8(T("Sens Live Note"))) imgui.Spacing() if imgui.Checkbox(T("Sens Lock Sniper"), bmsSensLock) then bmsSensPushFloats() handleButtonSound() end handleButtonSound() imgui.Spacing() imgui.Separator() imgui.Spacing() imgui.Text(T("Sens Global") .. ": " .. ("%.6f"):format(bmsSensGlobal.v)) imgui.PushItemWidth(-1) if imgui.InputFloat("##sensglobal", bmsSensGlobal, 0.0005, 0.005, 4) then bmsSensApply() end imgui.PopItemWidth() imgui.Text(T("Sens Aiming") .. ": " .. ("%.6f"):format(bmsSensAiming.v)) imgui.PushItemWidth(-1) if imgui.InputFloat("##sensaiming", bmsSensAiming, 0.0005, 0.005, 4) then bmsSensApply() end imgui.PopItemWidth() imgui.Text(T("Sens Sniper") .. ": " .. ("%.6f"):format(bmsSensSniper.v)) imgui.PushItemWidth(-1) if imgui.InputFloat("##senssniper", bmsSensSniper, 0.0005, 0.005, 4) then bmsSensApply() end imgui.PopItemWidth() imgui.Spacing() imgui.TextColored(DIM(0.55), u8(T("Sens Preset"))) if imgui.Button(T("Sens Default") .. "##sensp1", imgui.ImVec2(140, 28)) then bmsSensPreset("def") end handleButtonSound() imgui.SameLine() if imgui.Button(T("Sens Steady") .. "##sensp2", imgui.ImVec2(140, 28)) then bmsSensPreset("steady") end handleButtonSound() imgui.SameLine() if imgui.Button(T("Sens Fast") .. "##sensp3", imgui.ImVec2(140, 28)) then bmsSensPreset("fast") end handleButtonSound() imgui.Spacing() imgui.Separator() imgui.Spacing() bmsTextColU8(DIM(0.55), u8(T("SensFix Hint"))) imgui.Spacing() imgui.TextColored(imgui.ImVec4(0.4,1,0.5,1), u8(T("Sens Live Note"))) imgui.Spacing() bmsTextColU8(DIM(0.45), u8(T("Sens Classic Note"))) imgui.EndChild() end function imgui.OnDrawFrame() if not main_menu.v and imgui.Process and not kbShow.v and not kbMouse.v then imgui.Process = false end if (kbShow.v or kbMouse.v) and not imgui.Process then imgui.Process = true end imgui.ShowCursor = main_menu.v if main_menu.v then local now = os.clock() local openAnim = uiAnimatedScale(now) imgui.SetNextWindowSize(imgui.ImVec2(1020, 640), imgui.Cond.FirstUseEver) imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5)) imgui.PushStyleVar(imgui.StyleVar.Alpha, 0.96 + 0.04 * openAnim) imgui.PushStyleVar(imgui.StyleVar.WindowRounding, 16.0) imgui.Begin("GameFixer", main_menu, imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoTitleBar + imgui.WindowFlags.NoScrollbar + imgui.WindowFlags.NoResize) uiDrawModernBackdrop() local isLight = (ini.settings.theme == 2) local titleCol = isLight and imgui.ImVec4(0.05,0.06,0.08,0.96) or imgui.ImVec4(0.96,0.98,1.0,0.96) local subCol = isLight and imgui.ImVec4(0.38,0.41,0.47,0.78) or imgui.ImVec4(1,1,1,0.48) local mutedCol = isLight and imgui.ImVec4(0.42,0.45,0.50,0.72) or imgui.ImVec4(1,1,1,0.42) -- TOP BAR imgui.SetCursorPos(imgui.ImVec2(22, 16)) if loadingTexture then imgui.PushStyleVar(imgui.StyleVar.WindowPadding, imgui.ImVec2(2,2)) imgui.PushStyleColor(imgui.Col.ChildWindowBg, isLight and imgui.ImVec4(0,0,0,0.05) or imgui.ImVec4(1,1,1,0.07)) imgui.BeginChild("##HeaderLogo", imgui.ImVec2(38,38), true, imgui.WindowFlags.NoScrollbar + imgui.WindowFlags.NoScrollWithMouse) imgui.Image(loadingTexture, imgui.ImVec2(34,34)) imgui.EndChild() imgui.PopStyleColor() imgui.PopStyleVar() else imgui.BeginChild("##HeaderLogoFallback", imgui.ImVec2(38,38), true, imgui.WindowFlags.NoScrollbar + imgui.WindowFlags.NoScrollWithMouse) imgui.TextColored(uiAccentColor(0.95, isLight), u8("BMS")) imgui.EndChild() end imgui.SameLine(nil, 12) imgui.BeginGroup() imgui.PushFont(leftmenu) imgui.TextColored(titleCol, u8("BMS GameFixer")) imgui.PopFont() imgui.TextColored(subCol, u8("BMS STUDIO • v11")) imgui.EndGroup() imgui.SameLine() local topAvail = imgui.GetContentRegionAvail() imgui.SetCursorPosX(imgui.GetCursorPosX() + math.max(0, topAvail.x - 190)) imgui.PushStyleVar(imgui.StyleVar.FrameRounding, 9.0) imgui.PushStyleColor(imgui.Col.Button, isLight and imgui.ImVec4(0.02,0.03,0.04,0.06) or imgui.ImVec4(1,1,1,0.07)) imgui.PushStyleColor(imgui.Col.ButtonHovered, isLight and imgui.ImVec4(0.02,0.03,0.04,0.10) or imgui.ImVec4(1,1,1,0.12)) imgui.PushStyleColor(imgui.Col.ButtonActive, isLight and imgui.ImVec4(0.02,0.03,0.04,0.14) or imgui.ImVec4(1,1,1,0.16)) imgui.PushStyleColor(imgui.Col.Text, isLight and imgui.ImVec4(0.08,0.09,0.11,0.85) or imgui.ImVec4(1,1,1,0.78)) imgui.Button(u8("BMS STORE"), imgui.ImVec2(104, 34)) imgui.PopStyleColor(4) imgui.PopStyleVar() uiDrawHeaderAccent() imgui.SetCursorPosY(72) if not loadDone then -- Full-width loading composition. The sidebar is intentionally hidden -- while initialization is visually in progress. drawPanelLoading() imgui.End() imgui.PopStyleVar(2) return end -- NEW LAYOUT: LEFT SIDEBAR + WORKSPACE local tabsNew = { {1, T("Main"), "01"}, {2, T("Fixes"), "02"}, {3, T("Boost FPS"), "03"}, {4, T("UGenrl"), "04"}, {5, T("Commands"), "05"}, {6, T("Settings"), "06"}, {7, T("Tools"), "07"}, {8, T("KillState"), "08"}, {9, T("SSAO"), "09"}, {10, T("SensFix"), "10"}, {11, T("HUDChanger"), "11"}, } local sidebarW = 190 local workW = -1 local workH = -1 imgui.PushStyleVar(imgui.StyleVar.ChildWindowRounding, 13.0) imgui.BeginChild("##BMS_Sidebar", imgui.ImVec2(sidebarW, workH), true, imgui.WindowFlags.NoScrollbar + imgui.WindowFlags.NoScrollWithMouse) imgui.TextColored(titleCol, u8("MODULES")) imgui.TextColored(mutedCol, u8("Game configuration")) imgui.Spacing() imgui.Separator() imgui.Spacing() for _, item in ipairs(tabsNew) do local idx, nm, no = item[1], item[2], item[3] if uiSidebarButton(no .. " " .. nm, "nav_" .. idx, tab.v == idx, imgui.ImVec2(-1, 40)) then if tab.v ~= idx then tab.v = idx tabFadeAlpha = 0.0 tabFadeStart = os.clock() end handleButtonSound() end handleButtonSound() imgui.Dummy(imgui.ImVec2(1, 2)) end imgui.SetCursorPosY(imgui.GetWindowHeight() - 66) imgui.Separator() imgui.Spacing() imgui.TextColored(mutedCol, u8("PANEL")) imgui.TextColored(subCol, u8("F11 • " .. (curLang == "id" and "buka/tutup" or "toggle panel"))) imgui.EndChild() imgui.PopStyleVar() imgui.SameLine(nil, 12) imgui.BeginChild("##BMS_Workspace", imgui.ImVec2(workW, workH), true) local tabTitles = { [1] = {T("Main"), "Core gameplay, HUD and visual controls"}, [2] = {T("Fixes"), "Stability and compatibility fixes"}, [3] = {T("Boost FPS"), "Performance and render options"}, [4] = {T("UGenrl"), "Ultimate Genrl sound configuration"}, [5] = {T("Commands"), "Edit your GameFixer command bindings"}, [6] = {T("Settings"), "Theme, language and panel preferences"}, [7] = {T("Tools"), "Utility tools and extra modules"}, [8] = {T("KillState"), "Kill feed and combat statistics"}, [9] = {T("SSAO"), "Ambient occlusion controls"}, [10] = {T("SensFix"), "Native mouse sensitivity tuning"}, [11] = {T("HUDChanger"), "HUD texture and resource manager"}, } local meta = tabTitles[tab.v] or {T("Main"), ""} imgui.SetCursorPos(imgui.ImVec2(18, 16)) imgui.BeginGroup() imgui.PushFont(leftmenu) imgui.TextColored(titleCol, u8(meta[1])) imgui.PopFont() imgui.TextColored(mutedCol, u8(meta[2])) imgui.EndGroup() imgui.SameLine() local wsAvail = imgui.GetContentRegionAvail() imgui.SetCursorPosX(imgui.GetCursorPosX() + math.max(0, wsAvail.x - 130)) uiPill((curLang == "id") and "AKTIF" or "ACTIVE", true) imgui.SetCursorPosY(70) imgui.Separator() imgui.Spacing() local elapsed = os.clock() - tabFadeStart if tabFadeAlpha < 1.0 then tabFadeAlpha = math.min(1.0, elapsed / 0.22) end imgui.PushStyleVar(imgui.StyleVar.Alpha, tabFadeAlpha) -- KONTEN FITUR LAMA, dipertahankan utuh. if tab.v == 1 then imgui.BeginChild("##Main", imgui.ImVec2(-1, -1), true) if imgui.Checkbox(T("Automatic map scaling"), checkboxes.mapzoom) then ini.settings.mapzoom = checkboxes.mapzoom.v save() gotofunc("MapZoom") end imgui.Text(T("Map zoom out:")) imgui.PushItemWidth(-1) if imgui.SliderFloat("##mapzoomvalue", sliders.mapzoomvalue, 260.0, 1000.0, "%.1f") then if ini.settings.mapzoom then ini.settings.mapzoomvalue = ("%.1f"):format(sliders.mapzoomvalue.v) save() memory.setfloat(5719357, ini.settings.mapzoomvalue, false) else memory.setfloat(5719357, 1000.0, false) end end imgui.PopItemWidth() imgui.Text(T("Money Animation:")) for i, value in ipairs(arr_animmoney) do if imgui.RadioButton(value, radio_animmoney, i) then ini.settings.animmoney = i save() gotofunc("AnimationMoney") end if i < #arr_animmoney then imgui.SameLine() end end imgui.Spacing() imgui.Text(T("Sight size X:")) imgui.SameLine() imgui.PushItemWidth(110) if imgui.InputInt("##crxvmenu", buffers.vmenu_crx) then if buffers.vmenu_crx.v > 1000 then buffers.vmenu_crx.v = 1000 elseif buffers.vmenu_crx.v < 30 then buffers.vmenu_crx.v = 30 end ini.settings.crosshairX = buffers.vmenu_crx.v save() memory.setfloat(8755780, ini.settings.crosshairX..".0", false) end imgui.PopItemWidth() imgui.Text(T("Sight size in Y:")) imgui.SameLine() imgui.PushItemWidth(110) if imgui.InputInt("##cryvmenu", buffers.vmenu_cry, 1, 100) then if buffers.vmenu_cry.v > 1000 then buffers.vmenu_cry.v = 1000 elseif buffers.vmenu_cry.v < 30 then buffers.vmenu_cry.v = 30 end ini.settings.crosshairY = buffers.vmenu_cry.v save() memory.setfloat(8755804, ini.settings.crosshairY..".0", false) end imgui.PopItemWidth() if imgui.CollapsingHeader(T("Weather and time editor"), true, imgui.TreeNodeFlags.DefaultOpen) then imgui.Text(T("Weather:")) imgui.PushItemWidth(-1) if imgui.SliderInt("##Weather", sliders.weather, 0, 45) then ini.settings.weather = sliders.weather.v; save() end imgui.PopItemWidth() imgui.Text(T("Time:")) imgui.PushItemWidth(-1) if imgui.SliderInt("##Time", sliders.hours, 0, 23) then ini.settings.hours = sliders.hours.v; save() end imgui.PopItemWidth() imgui.Text(T("Minutes:")) imgui.PushItemWidth(-1) if imgui.SliderInt("##min", sliders.min, 0, 59) then ini.settings.min = sliders.min.v; save(); gotofunc("SetTime") end imgui.PopItemWidth() if imgui.Checkbox(T("Freeze Weather"), checkboxes.blockweather) then ini.settings.blockweather = checkboxes.blockweather.v; save() end if imgui.Checkbox(T("Freeze Time"), checkboxes.blocktime) then ini.settings.blocktime = checkboxes.blocktime.v; save() end end if imgui.CollapsingHeader(T("HP HUD"), true, imgui.TreeNodeFlags.DefaultOpen) then if imgui.Button((ini.hphud.active and T("Disable") or T("Enable")) .. " " .. T("Digital Health Indicator"), imgui.ImVec2(300, 25)) then ini.hphud.active = not ini.hphud.active sampAddChatMessage(ini.hphud.active and '{73b461}'..script_name..' {FFFFFF}Digital Health Indicator has been {73b461}Enabled' or '{73b461}'..script_name..' {FFFFFF}Digital Health Indicator has been {dc4747}Disabled', -1) save() if ini.hphud.active == false then sampTextdrawDelete(2029) end handleButtonSound() end handleButtonSound() imgui.Text(T("Health Indicator Font:")) imgui.PushItemWidth(330) if imgui.SliderInt("##fontshp", sliders.fontshp, 0, 3) then ini.hphud.text = sliders.fontshp.v; save() end imgui.Text(T("Health Indicator Position:")) if imgui.SliderInt("##poshp", sliders.poshp, 1, 3) then ini.hphud.pos = sliders.poshp.v; save() end imgui.PopItemWidth() if imgui.Checkbox(T("Show 'HP' Behind Numbers"), checkboxes.hpt) then ini.hphud.hpt = checkboxes.hpt.v; gotofunc("HPStyle"); save() end end if imgui.Button((ini.settings.bighpbar and T("Disable") or T("Enable")) .. " " .. T("160 HP Bar"), imgui.ImVec2(200, 25)) then ini.settings.bighpbar = not ini.settings.bighpbar sampAddChatMessage(ini.settings.bighpbar and script_name..' {FFFFFF}160hp Bar has been {73b461}Enabled' or script_name..' {FFFFFF}160hp Bar has been {dc4747}Disabled', 0x73b461) save(); gotofunc("BigHPBar"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.noradio and T("Disable") or T("Enable")) .. " " .. T("Radio"), imgui.ImVec2(200, 25)) then ini.settings.noradio = not ini.settings.noradio sampAddChatMessage(ini.settings.noradio and script_name..' {FFFFFF}Radio has been {73b461}Enabled' or script_name..' {FFFFFF}Radio has been {dc4747}Disabled', 0x73b461) save(); gotofunc("NoRadio"); handleButtonSound() end handleButtonSound() if imgui.Button((ini.settings.nosounds and T("Disable") or T("Enable")) .. " " .. T("Sound"), imgui.ImVec2(200, 25)) then ini.settings.nosounds = not ini.settings.nosounds sampAddChatMessage(ini.settings.nosounds and script_name..' {FFFFFF}Sounds has been {73b461}Enabled' or script_name..' {FFFFFF}Sounds has been {dc4747}Disabled', 0x73b461) save(); gotofunc("NoSounds"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.intmusic and T("Disable") or T("Enable")) .. " " .. T("InteriorMusic"), imgui.ImVec2(200, 25)) then ini.settings.intmusic = not ini.settings.intmusic sampAddChatMessage(ini.settings.intmusic and script_name..' {FFFFFF}Interior Music has been {73b461}Enabled' or script_name..' {FFFFFF}Interior Music has been {dc4747}Disabled', 0x73b461) save(); gotofunc("InteriorMusic"); handleButtonSound() end handleButtonSound() if imgui.Button((ini.settings.audiostream and T("Disable") or T("Enable")) .. " " .. T("Audiostream"), imgui.ImVec2(200, 25)) then ini.settings.audiostream = not ini.settings.audiostream sampAddChatMessage(ini.settings.audiostream and script_name..' {FFFFFF}Audiostream has been {73b461}Enabled' or script_name..' {FFFFFF}Audiostream has been {dc4747}Disabled', 0x73b461) save(); gotofunc("AudioStream"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button(T("Clear Chat"), imgui.ImVec2(200, 25)) then gotofunc("ClearChat"); handleButtonSound() end handleButtonSound() if imgui.Button((ini.settings.targetblip and T("Disable") or T("Enable")) .. " " .. T("TargetBlip"), imgui.ImVec2(413, 25)) then ini.settings.targetblip = not ini.settings.targetblip sampAddChatMessage(ini.settings.targetblip and script_name..' {FFFFFF}TargetBlip has been {73b461}Enabled' or script_name..' {FFFFFF}TargetBlip has been {dc4747}Disabled', 0x73b461) save(); gotofunc("TargetBlip"); handleButtonSound() end handleButtonSound() if imgui.Button((ini.settings.blockkeys and T("Disable") or T("Enable")) .. " " .. T("SA-MP Keys Lock"), imgui.ImVec2(413, 25)) then ini.settings.blockkeys = not ini.settings.blockkeys sampAddChatMessage(ini.settings.blockkeys and script_name..' {FFFFFF}SA-MP Keys Lock has been {73b461}Enabled' or script_name..' {FFFFFF}SA-MP Keys Lock has been {dc4747}Disabled', 0x73b461) save(); gotofunc("BlockSampKeys"); handleButtonSound() end handleButtonSound() if imgui.Button((ini.settings.vsync and T("Disable") or T("Enable")) .. " " .. T("Vsync"), imgui.ImVec2(413, 25)) then ini.settings.vsync = not ini.settings.vsync sampAddChatMessage(ini.settings.vsync and script_name..' {FFFFFF}Vsync has been {73b461}Enabled' or script_name..' {FFFFFF}Vsync has been {dc4747}Disabled', 0x73b461) save(); gotofunc("Vsync"); handleButtonSound() end handleButtonSound() imgui.EndChild() elseif tab.v == 2 then imgui.BeginChild("##Fixes", imgui.ImVec2(-1, -1), true) if imgui.Checkbox(T("Getting Stuck in other players Fix"), checkboxes.antiblockedplayer) then ini.settings.antiblockedplayer = checkboxes.antiblockedplayer.v; save() end if imgui.Checkbox(T("Chat Opening Fix"), checkboxes.chatt) then ini.settings.chatt = checkboxes.chatt.v; save() end if imgui.Checkbox(T("Sensitivity Fix"), checkboxes.sensfix) then ini.settings.sensfix = checkboxes.sensfix.v; save(); gotofunc("FixSensitivity") end if imgui.Checkbox(T("BlackRoads Fix"), checkboxes.fixblackroads) then ini.settings.fixblackroads = checkboxes.fixblackroads.v; save(); gotofunc("FixBlackRoads") end if imgui.Checkbox(T("Ninja Hijack Fix"), checkboxes.adkfix) then ini.settings.adkfix = checkboxes.adkfix.v; save() end if imgui.Checkbox(T("LongArm Fix"), checkboxes.longarmfix) then ini.settings.longarmfix = checkboxes.longarmfix.v; save(); gotofunc("FixLongArm") end if imgui.Checkbox(T("Square Water Fix"), checkboxes.waterfixquadro) then ini.settings.waterfixquadro = checkboxes.waterfixquadro.v; save(); gotofunc("FixWaterQuadro") end if imgui.Checkbox(T("InteriorRun Fix"), checkboxes.intrun) then ini.settings.intrun = checkboxes.intrun.v; save(); gotofunc("InteriorRun") end if imgui.Checkbox(T("Crosshair White Dot Fix"), checkboxes.fixcrosshair) then ini.settings.fixcrosshair = checkboxes.fixcrosshair.v; save(); gotofunc("FixCrosshair") end if imgui.Checkbox(T("Bring Back Sun"), checkboxes.sunfix) then ini.settings.sunfix = checkboxes.sunfix.v; save(); gotofunc("SunFix") end if imgui.Checkbox(T("Taxi Light fix"), checkboxes.fixtaxilight) then ini.settings.fixtaxilight = checkboxes.fixtaxilight.v; save(); gotofunc("FixTaxiLight") end if imgui.Checkbox(T("DualMonitorFix"), checkboxes.dual_monitor_fix) then ini.settings.dual_monitor_fix = checkboxes.dual_monitor_fix.v; save() end if imgui.Checkbox(T("Texture Correction/Anisotropic"), checkboxes.forceaniso) then ini.settings.forceaniso = checkboxes.forceaniso.v; save(); gotofunc("ForceAniso") end if imgui.Checkbox(T("Map Zom Low Sensitivity Fix"), checkboxes.mapzoomfixer) then ini.settings.mapzoomfixer = checkboxes.mapzoomfixer.v; save() end if imgui.Checkbox(T("Radar Outline Fix"), checkboxes.radar_color_fix) then ini.settings.radar_color_fix = checkboxes.radar_color_fix.v; save(); gotofunc("RadarColorFix") end if imgui.Checkbox(T("Radar Fix"), checkboxes.radarfix) then ini.settings.radarfix = checkboxes.radarfix.v; save(); gotofunc("Radarfix") end if checkboxes.radarfix.v then imgui.PushItemWidth(430) if imgui.SliderInt(T("Radar Width"), sliders.radarw, 50, 150) then ini.settings.radarWidth = sliders.radarw.v; save(); gotofunc("Radarfix") end if imgui.SliderInt(T("Radar Height"), sliders.radarh, 50, 150) then ini.settings.radarHeight = sliders.radarh.v; save(); gotofunc("Radarfix") end if imgui.SliderInt(T("Radar Position X"), sliders.radarposx, 20, 555) then ini.settings.radarPosX = sliders.radarposx.v; save(); gotofunc("Radarfix") end if imgui.SliderInt(T("Radar Position Y"), sliders.radarposy, 20, 555) then ini.settings.radarPosY = sliders.radarposy.v; save(); gotofunc("Radarfix") end imgui.PopItemWidth() end imgui.EndChild() elseif tab.v == 3 then imgui.BeginChild("##FPSBoost", imgui.ImVec2(-1, -1), true) if imgui.Button((ini.settings.shownicks and T("Show") or T("Hide")) .. " " .. T("NickNames"), imgui.ImVec2(200, 25)) then ini.settings.shownicks = not ini.settings.shownicks; sampAddChatMessage(ini.settings.shownicks and script_name..' {FFFFFF}NickNames has been {dc4747}Disabled' or script_name..' {FFFFFF}NickNames has been {73b461}Enabled', 0x73b461); save(); gotofunc("ShowNICKS"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.showhp and T("Show") or T("Hide")) .. " " .. T("PlayerHP"), imgui.ImVec2(200, 25)) then ini.settings.showhp = not ini.settings.showhp; sampAddChatMessage(ini.settings.showhp and script_name..' {FFFFFF}PlayerHP has been {dc4747}Disabled' or script_name..' {FFFFFF}PlayerHP has been {73b461}Enabled', 0x73b461); save(); gotofunc("ShowHP"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.showchat and T("Hide") or T("Show")) .. " " .. T("Chat"), imgui.ImVec2(200, 25)) then ini.settings.showchat = not ini.settings.showchat; sampAddChatMessage(ini.settings.showchat and script_name..' {FFFFFF}Chat has been {73b461}UnHidden' or script_name..' {FFFFFF}Chat has been {dc4747}Hidden', 0x73b461); save(); gotofunc("ShowCHAT"); handleButtonSound() end handleButtonSound() if imgui.Button((ini.settings.showhud and T("Hide") or T("Show")) .. " " .. T("HUD"), imgui.ImVec2(200, 25)) then ini.settings.showhud = not ini.settings.showhud; sampAddChatMessage(ini.settings.showhud and script_name..' {FFFFFF}HUD has been {73b461}UnHidden' or script_name..' {FFFFFF}HUD has been {dc4747}Hidden', 0x73b461); save(); gotofunc("ShowHUD"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.unlimitfps and T("Disable") or T("Enable")) .. " " .. T("FPS unlock"), imgui.ImVec2(200, 25)) then ini.settings.unlimitfps = not ini.settings.unlimitfps; sampAddChatMessage(ini.settings.unlimitfps and script_name..' {FFFFFF}FPS Unlock has been {73b461}Enabled' or script_name..' {FFFFFF}FPS Unlock has been {dc4747}Disabled', 0x73b461); save(); gotofunc("FPSUnlock"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.postfx and T("Disable") or T("Enable")) .. " " .. T("Postfx"), imgui.ImVec2(200, 25)) then ini.settings.postfx = not ini.settings.postfx; sampAddChatMessage(ini.settings.postfx and script_name..' {FFFFFF}Postfx has been {73b461}Enabled' or script_name..' {FFFFFF}Postfx has been {dc4747}Disabled', 0x73b461); save(); gotofunc("NoPostfx"); handleButtonSound() end handleButtonSound() if imgui.Button((ini.settings.nocloudsmall and T("Disable") or T("Enable")) .. " " .. T("Low Clouds"), imgui.ImVec2(200, 25)) then ini.settings.nocloudsmall = not ini.settings.nocloudsmall; save(); sampAddChatMessage(ini.settings.nocloudsmall and script_name..' {FFFFFF}Low Clouds has been {73b461}Enabled' or script_name..' {FFFFFF}Low Clouds has been {dc4747}Disabled', 0x73b461); gotofunc("NoCloudSmall"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.nocloudbig and T("Disable") or T("Enable")) .. " " .. T("High Clouds"), imgui.ImVec2(200, 25)) then ini.settings.nocloudbig = not ini.settings.nocloudbig; save(); sampAddChatMessage(ini.settings.nocloudbig and script_name..' {FFFFFF}High Clouds has been {73b461}Enabled' or script_name..' {FFFFFF}High Clouds has been {dc4747}Disabled', 0x73b461); gotofunc("NoCloudBig"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.nobirds and T("Disable") or T("Enable")) .. " " .. T("Birds"), imgui.ImVec2(200, 25)) then ini.settings.nobirds = not ini.settings.nobirds; save(); sampAddChatMessage(ini.settings.nobirds and script_name..' {FFFFFF}Birds has been {73b461}Enabled' or script_name..' {FFFFFF}Birds has been {dc4747}Disabled', 0x73b461); gotofunc("NoBirds"); handleButtonSound() end handleButtonSound() if imgui.Button((ini.settings.effects and T("Disable") or T("Enable")) .. " " .. T("Effects"), imgui.ImVec2(200, 25)) then ini.settings.effects = not ini.settings.effects; save(); sampAddChatMessage(ini.settings.effects and script_name..' {FFFFFF}Effects has been {73b461}Enabled' or script_name..' {FFFFFF}Effects has been {dc4747}Disabled', 0x73b461); gotofunc("NoEffects"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.vehlods and T("Disable") or T("Enable")) .. " " .. T("VehLods"), imgui.ImVec2(200, 25)) then ini.settings.vehlods = not ini.settings.vehlods; save(); sampAddChatMessage(ini.settings.vehlods and script_name..' {FFFFFF}VehLods has been {73b461}Enabled' or script_name..' {FFFFFF}VehLods has been {dc4747}Disabled', 0x73b461); gotofunc("VehLods"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.noshadows and T("Disable") or T("Enable")) .. " " .. T("Shadows"), imgui.ImVec2(200, 25)) then ini.settings.noshadows = not ini.settings.noshadows; save(); sampAddChatMessage(ini.settings.noshadows and script_name..' {FFFFFF}Shadows has been {73b461}Enabled' or script_name..' {FFFFFF}Shadows has been {dc4747}Disabled', 0x73b461); gotofunc("NoShadows"); handleButtonSound() end handleButtonSound() if imgui.Button((ini.settings.nodust and T("Disable") or T("Enable")) .. " " .. T("Dust"), imgui.ImVec2(300, 25)) then ini.settings.nodust = not ini.settings.nodust; save(); sampAddChatMessage(ini.settings.nodust and script_name..' {FFFFFF}Dust has been {73b461}Enabled' or script_name..' {FFFFFF}Dust has been {dc4747}Disabled', 0x73b461); gotofunc("NoDust"); handleButtonSound() end handleButtonSound() imgui.SameLine() if imgui.Button((ini.settings.noplaneline and T("Disable") or T("Enable")) .. " " .. T("Plane Lines"), imgui.ImVec2(300, 25)) then ini.settings.noplaneline = not ini.settings.noplaneline; save(); sampAddChatMessage(ini.settings.noplaneline and script_name..' {FFFFFF}Plane Lines has been {73b461}Enabled' or script_name..' {FFFFFF}Plane Lines has been {dc4747}Disabled', 0x73b461); gotofunc("NoPlaneLine"); handleButtonSound() end handleButtonSound() if imgui.CollapsingHeader(T("Distance Editor")) then if imgui.Button((ini.settings.givemedist and T("Disable") or T("Enable")) .. " " .. T("Ability to Change Distance"), imgui.ImVec2(300, 25)) then ini.settings.givemedist = not ini.settings.givemedist; sampAddChatMessage(ini.settings.givemedist and script_name..' {FFFFFF}Ability to Change Distance has been {73b461}Enabled' or script_name..' {FFFFFF}Ability to Change Distance has been {dc4747}Disabled', 0x73b461); save(); gotofunc("GivemeDist"); handleButtonSound() end handleButtonSound() if ini.settings.givemedist then imgui.Text(T("Draw Distance:")) imgui.PushItemWidth(-1) if imgui.SliderInt("##Drawdist", sliders.drawdist, 35, 3600) then ini.settings.drawdist = sliders.drawdist.v; save(); memory.setfloat(12044272, ini.settings.drawdist, false) end imgui.Text(T("In Air Draw Distance:")) if imgui.SliderInt("##drawdistair", sliders.drawdistair, 35, 3600) then ini.settings.drawdistair = sliders.drawdistair.v; save(); if isCharInAnyPlane(PLAYER_PED) or isCharInAnyHeli(PLAYER_PED) then if memory.getfloat(12044272, false) ~= ini.settings.drawdistair then memory.setfloat(12044272, ini.settings.drawdistair, false) end end end imgui.Text(T("Fog Distance:")) if imgui.SliderInt("##fog", sliders.fog, 0, 500) then ini.settings.fog = sliders.fog.v; save(); memory.setfloat(13210352, ini.settings.fog, false) end imgui.Text(T("Lod Distance:")) if imgui.SliderInt("##lod", sliders.lod, 0, 2000) then ini.settings.lod = sliders.lod.v; save(); memory.setfloat(8753112, ini.settings.lod, false) end imgui.PopItemWidth() end end if imgui.CollapsingHeader(T("Shadow Editor")) then if imgui.Button((ini.settings.shadowedit and T("Disable") or T("Enable")) .. " " .. T("Ability to Edit Shadows"), imgui.ImVec2(300, 25)) then ini.settings.shadowedit = not ini.settings.shadowedit; sampAddChatMessage(ini.settings.shadowedit and script_name..' {FFFFFF}Ability to Edit Shadows has been {73b461}Enabled' or script_name..' {FFFFFF}Ability to Edit Shadows has been {dc4747}Disabled', 0x73b461); save(); gotofunc("ShadowEdit"); handleButtonSound() end handleButtonSound() if ini.settings.shadowedit then imgui.Text(T("Main Shadow:")) imgui.PushItemWidth(-1) if imgui.SliderInt(u8"##shadowcp", sliders.shadowcp, 0, 255) then ini.settings.shadowcp = sliders.shadowcp.v; save(); memory.setint32(12043496, "1114"..ini.settings.shadowcp + 112, false) end imgui.Text(T("Shadow Light:")) if imgui.SliderInt("##shadowlight", sliders.shadowlight, 0, 255) then ini.settings.shadowlight = sliders.shadowlight.v; save(); memory.setint32(12043500, ini.settings.shadowlight, false) end imgui.PopItemWidth() end end if imgui.CollapsingHeader(T("Timecycle Fix")) then if imgui.Button((ini.fixtimecyc.active and T("Disable") or T("Enable")) .. " " .. T("Timecycle Fix"), imgui.ImVec2(300, 25)) then ini.fixtimecyc.active = not ini.fixtimecyc.active; sampAddChatMessage(ini.fixtimecyc.active and script_name..' {FFFFFF}Timecycle Fix has been {73b461}Enabled' or script_name..' {FFFFFF}Timecycle Fix has been {dc4747}Disabled', 0x73b461); save(); gotofunc("FixTimecyc"); handleButtonSound() end handleButtonSound() imgui.Text(u8"All Ambient:") imgui.PushItemWidth(-1) if imgui.SliderFloat("##AllAmbient", sliders.allambient, 0.000, 1.000, "%.3f") then if ini.fixtimecyc.active then ini.fixtimecyc.allambient = ("%.3f"):format(sliders.allambient.v); save(); memory.setfloat(9228384, ini.fixtimecyc.allambient, false) end end imgui.Text(T("Object Ambient:")) if imgui.SliderFloat("##ObjAmbient", sliders.objambient, 0.000, 1.000, "%.3f") then if ini.fixtimecyc.active then ini.fixtimecyc.objambient = ("%.3f"):format(sliders.objambient.v); save(); memory.setfloat(12044024, ini.fixtimecyc.objambient, false) end end imgui.Text(T("World Ambient_R:")) if imgui.SliderFloat("##WorldAmbientR", sliders.worldambientR, 0.000, 1.000, "%.3f") then if ini.fixtimecyc.active then ini.fixtimecyc.worldambientR = ("%.3f"):format(sliders.worldambientR.v); save(); memory.setfloat(12044048, ini.fixtimecyc.worldambientR, false) end end imgui.Text(T("World Ambient_G:")) if imgui.SliderFloat("##WorldAmbientG", sliders.worldambientG, 0.000, 1.000, "%.3f") then if ini.fixtimecyc.active then ini.fixtimecyc.worldambientG = ("%.3f"):format(sliders.worldambientG.v); save(); memory.setfloat(12044072, ini.fixtimecyc.worldambientG, false) end end imgui.Text(T("World Ambient_B:")) if imgui.SliderFloat("##WorldAmbientB", sliders.worldambientB, 0.000, 1.000, "%.3f") then if ini.fixtimecyc.active then ini.fixtimecyc.worldambientB = ("%.3f"):format(sliders.worldambientB.v); save(); memory.setfloat(12044096, ini.fixtimecyc.worldambientB, false) end end imgui.PopItemWidth() end if imgui.CollapsingHeader(T("CCL")) then if imgui.Checkbox(T("Show message about CCL"), checkboxes.cleaninfo) then ini.cleaner.cleaninfo = checkboxes.cleaninfo.v; save() end if imgui.Button((ini.cleaner.autoclean and T("Disable") or T("Enable")) .. " " .. T("CCL"), imgui.ImVec2(300, 25)) then ini.cleaner.autoclean = not ini.cleaner.autoclean; save(); sampAddChatMessage((script_name.."{FFFFFF} CCL has been %s"):format(ini.cleaner.autoclean and "{73b461}Enabled" or "{dc4747}Disabled"), 0x73b461); handleButtonSound() end handleButtonSound() imgui.Text(T("Limit For CCL:")) imgui.PushItemWidth(-1) if imgui.SliderInt("##memlimit", sliders.limitmem, 80, 2000) then ini.cleaner.limit = sliders.limitmem.v; save() end imgui.PopItemWidth() if imgui.Button(T("Clean Memory"), imgui.ImVec2(300, 25)) then gotofunc("CleanMemory"); handleButtonSound() end handleButtonSound() end imgui.EndChild() elseif tab.v == 4 then imgui.BeginChild("##Ugenrl", imgui.ImVec2(-1, -1), true) if imgui.Checkbox(T("Enable Ultimate Genrl"), checkboxes.ugenrl_enable) then ini.ugenrl_main.enable = checkboxes.ugenrl_enable.v checkboxes.ugenrl_enable.v = ini.ugenrl_main.enable if ini.ugenrl_main.autonosounds then if ini.ugenrl_main.enable then ini.settings.nosounds = false else ini.settings.nosounds = true end save(); gotofunc("NoSounds") end end if checkboxes.ugenrl_enable.v then imgui.SameLine(); imgui.SetCursorPosX(221) if imgui.Checkbox(T("Automatically Disable game sound when Ultimate Genrl is Enabled"), checkboxes.autonosounds) then ini.ugenrl_main.autonosounds = checkboxes.autonosounds.v; save() end if imgui.Checkbox(T("Shots Sound"), checkboxes.weapon_checkbox) then ini.ugenrl_main.weapon = checkboxes.weapon_checkbox.v; save() end imgui.SameLine(); imgui.SetCursorPosX(221) if checkboxes.weapon_checkbox.v then if imgui.Checkbox(T("Shot Sounds"), checkboxes.enemyweapon_checkbox) then ini.ugenrl_main.enemyWeapon = checkboxes.enemyweapon_checkbox.v; save() end end if imgui.Checkbox(T("Hitsound"), checkboxes.hit_checkbox) then ini.ugenrl_main.hit = checkboxes.hit_checkbox.v; save() end imgui.SameLine() if imgui.Checkbox(T("PainSound"), checkboxes.pain_checkbox) then ini.ugenrl_main.pain = checkboxes.pain_checkbox.v; save() end imgui.Text(T("Quick Activation / Deactivation Ultimate Genrl:")) imgui.SameLine() if imgui.HotKey(u8"##ugkey", FastUgenrlKey, tLastKeys, 70) then rkeys.changeHotKey(bindFastActiveUgenrl, FastUgenrlKey.v) sampAddChatMessage(script_name.." {FFFFFF}Old Bind: {dc4747}" .. table.concat(rkeys.getKeysName(tLastKeys.v), " + ") .. "{ffffff} | New Bind: {dc4747}" .. table.concat(rkeys.getKeysName(FastUgenrlKey.v), " + "), 0x73b461) ini.ugenrl_main.fastactive = encodeJson(FastUgenrlKey.v); save() end imgui.Separator() local sndLists = { {24, deagleSounds, T("Deagle Sounds:")}, {25, shotgunSounds, T("Shotgun Sounds:")}, {31, m4Sounds, T("M4 Sounds:")}, {33, rifleSounds, T("Rifle Sounds:")}, {34, sniperSounds, T("Sniper Sounds:")}, {29, mp5Sounds, T("Mp5 Sounds:")}, {28, uziSounds, T("Uzi Sounds:")}, {"hit", hitSounds, T("HitSounds:")}, {"pain", painSounds, T("PainSounds:")}, } local sndAvail = imgui.GetContentRegionAvail() local sndW = (sndAvail.x - 2 * 6) / 3 for idx, e in ipairs(sndLists) do if idx > 1 and (idx - 1) % 3 ~= 0 then imgui.SameLine(nil, 6) end imgui.BeginGroup() imgui.Text(e[3]) imgui.BeginChild("##snd" .. tostring(e[1]), imgui.ImVec2(sndW, 170), true) bmsUgenrlSel[e[1]] = getNumberSounds(e[1], e[2]) for i, v in ipairs(e[2]) do if imgui.Selectable(tostring(i) .. ". " .. v, bmsUgenrlSel[e[1]] == i) then changeSound(e[1], e[2][i]) end end imgui.EndChild() imgui.EndGroup() end imgui.Dummy(imgui.ImVec2(1, 8)) imgui.Separator() imgui.Spacing() imgui.PushItemWidth(-1) imgui.Text(T("Sound volume:")) if imgui.SliderFloat("Shots Volume##1", sliders.weapon_volume_slider, 0.00, 1.00, "%.2f") then ini.ugenrl_volume.weapon = ("%.2f"):format(sliders.weapon_volume_slider.v); save() end if imgui.SliderFloat("HitSound volume##1", sliders.hit_volume_slider, 0.00, 1.00, "%.2f") then ini.ugenrl_volume.hit = ("%.2f"):format(sliders.hit_volume_slider.v); save() end if imgui.SliderFloat("Pain Volume##1", sliders.pain_volume_slider, 0.00, 1.00, "%.2f") then ini.ugenrl_volume.pain = ("%.2f"):format(sliders.pain_volume_slider.v); save() end imgui.Spacing() imgui.Text(T("Shot Sound Range:")) if imgui.SliderInt("##enemydist", sliders.enemyweapon_dist, 0, 100) then ini.ugenrl_main.enemyWeaponDist = sliders.enemyweapon_dist.v; save() end imgui.PopItemWidth() end imgui.EndChild() elseif tab.v == 5 then imgui.BeginChild("##Perintah", imgui.ImVec2(-1, -1), true) imgui.PushItemWidth(130) if imgui.InputText(T("Command to open menu"), buffers.cmd_openmenu) then ini.commands.openmenu = buffers.cmd_openmenu.v; save() end if imgui.InputText(T("Enable / Disable Ability to change Distance"), buffers.cmd_givemedist) then ini.commands.givemedist = buffers.cmd_givemedist.v; save() end if imgui.InputText(T("Change Draw Distance"), buffers.cmd_drawdistance) then ini.commands.drawdistance = buffers.cmd_drawdistance.v; save() end if imgui.InputText(T("Change In Air Draw Distance"), buffers.cmd_drawdistanceair) then ini.commands.drawdistanceair = buffers.cmd_drawdistanceair.v; save() end if imgui.InputText(T("Change Fog Distance"), buffers.cmd_fogdistance) then ini.commands.fogdistance = buffers.cmd_fogdistance.v; save() end if imgui.InputText(T("Change Lod Distance"), buffers.cmd_loddistance) then ini.commands.loddistance = buffers.cmd_loddistance.v; save() end if imgui.InputText(T("Show / Hide NickNames"), buffers.cmd_shownicks) then ini.commands.shownicks = buffers.cmd_shownicks.v; save() end if imgui.InputText(T("Show / Hide Player Health Indicator"), buffers.cmd_showhp) then ini.commands.showhp = buffers.cmd_showhp.v; save() end if imgui.InputText(T("Enable / Disable Radio"), buffers.cmd_offradio) then ini.commands.offradio = buffers.cmd_offradio.v; save() end if imgui.InputText(T("Clear Chat"), buffers.cmd_clearchat) then ini.commands.clearchat = buffers.cmd_clearchat.v; save() end if imgui.InputText(T("Hide / Show Chat"), buffers.cmd_showchat) then ini.commands.showchat = buffers.cmd_showchat.v; save() end if imgui.InputText(T("Hide / Show HUD"), buffers.cmd_showhud) then ini.commands.showhud = buffers.cmd_showhud.v; save() end if imgui.InputText(T("Change The Speed of Increasing / Decreasing Money"), buffers.cmd_animmoney) then ini.commands.animmoney = buffers.cmd_animmoney.v; save() end if imgui.InputText(T("Enable / Disable 160HP Bar"), buffers.cmd_bighpbar) then ini.commands.bighpbar = buffers.cmd_bighpbar.v; save() end if imgui.InputText(T("Enable / Disable FPS Unlock"), buffers.cmd_fpslock) then ini.commands.fpslock = buffers.cmd_fpslock.v; save() end if imgui.InputText(T("Enable / Disable PostFX"), buffers.cmd_postfx) then ini.commands.postfx = buffers.cmd_postfx.v; save() end if imgui.InputText(T("Enable / Disable AntiStuck"), buffers.cmd_antiblockedplayer) then ini.commands.antiblockedplayer = buffers.cmd_antiblockedplayer.v; save() end if imgui.InputText(T("Enable / Disable Chat Opening on E Fix"), buffers.cmd_chatopenfix) then ini.commands.chatopenfix = buffers.cmd_chatopenfix.v; save() end if imgui.InputText(T("Enable / Disable Digital Health Indicator"), buffers.cmd_hphud) then ini.commands.hphud = buffers.cmd_hphud.v; save() end if imgui.InputText(T("Change Style of Digital Health Indicator"), buffers.cmd_hpstyle) then ini.commands.hpstyle = buffers.cmd_hpstyle.v; save() end if imgui.InputText(T("Change Position of Digital Health Indicator"), buffers.cmd_hppos) then ini.commands.hppos = buffers.cmd_hppos.v; save() end if imgui.InputText(T("Enable / Disable 'HP' behind Numbers"), buffers.cmd_hptext) then ini.commands.hptext = buffers.cmd_hptext.v; save() end if imgui.InputText(T("Enable / Disable Auto CCL"), buffers.cmd_autocleaner) then ini.commands.autocleaner = buffers.cmd_autocleaner.v; save() end if imgui.InputText(T("CCL"), buffers.cmd_cleanmemory) then ini.commands.cleanmemory = buffers.cmd_cleanmemory.v; save() end if imgui.InputText(T("Enable / Disable CCl Message"), buffers.cmd_cleaninfo) then ini.commands.cleaninfo = buffers.cmd_cleaninfo.v; save() end if imgui.InputText(T("Limit for CCL"), buffers.cmd_setmbforautocleaner) then ini.commands.setmbforautocleaner = buffers.cmd_setmbforautocleaner.v; save() end if imgui.InputText(T("Enable / Disable Birds"), buffers.cmd_nobirds) then ini.commands.nobirds = buffers.cmd_nobirds.v; save() end if imgui.InputText(T("Enable / Disable Dust"), buffers.cmd_nodust) then ini.commands.nodust = buffers.cmd_nodust.v; save() end if imgui.InputText(T("Enable / Disable Timecycle Fix"), buffers.cmd_fixtimecyc) then ini.commands.fixtimecyc = buffers.cmd_fixtimecyc.v; save() end if imgui.InputText(T("Toggle SSAO"), buffers.cmd_ssao) then ini.commands.ssao = buffers.cmd_ssao.v; save() end if imgui.InputText(T("Open HUDChanger"), buffers.cmd_hudchanger) then ini.commands.hudchanger = buffers.cmd_hudchanger.v; save() end if imgui.InputText(T("Enable / Disable Effects"), buffers.cmd_effects) then ini.commands.effects = buffers.cmd_effects.v; save() end if imgui.InputText(T("Resize Crosshair"), buffers.cmd_editcrosshair) then ini.commands.editcrosshair = buffers.cmd_editcrosshair.v; save() end if imgui.InputText(T("Enable / Disable Ability to Edit Shadows"), buffers.cmd_shadowedit) then ini.commands.shadowedit = buffers.cmd_shadowedit.v; save() end if imgui.InputText(T("Enable / Disable High Clouds"), buffers.cmd_nocloudbig) then ini.commands.nocloudbig = buffers.cmd_nocloudbig.v; save() end if imgui.InputText(T("Enable / Disable Low Clouds"), buffers.cmd_nocloudsmall) then ini.commands.nocloudsmall = buffers.cmd_nocloudsmall.v; save() end if imgui.InputText(T("Enable / Disable Shadows"), buffers.cmd_noshadows) then ini.commands.noshadows = buffers.cmd_noshadows.v; save() end if imgui.InputText(T("Enable / Disable VehLods"), buffers.cmd_vehlods) then ini.commands.vehlods = buffers.cmd_vehlods.v; save() end if imgui.InputText(T("Enable / Disable Crosshair White Dot Fix"), buffers.cmd_fixcrosshair) then ini.commands.fixcrosshair = buffers.cmd_fixcrosshair.v; save() end if imgui.InputText(T("Enable / Disable Interior Running Fix"), buffers.cmd_intrun) then ini.commands.intrun = buffers.cmd_intrun.v; save() end if imgui.InputText(T("Enable / Disable Ninja Hijack Fix"), buffers.cmd_adkfix) then ini.commands.adkfix = buffers.cmd_adkfix.v; save() end if imgui.InputText(T("Enable / Disable Square Water Fix"), buffers.cmd_waterfixquadro) then ini.commands.waterfixquadro = buffers.cmd_waterfixquadro.v; save() end if imgui.InputText(T("Enable / Disable Long Arm Fix"), buffers.cmd_longarmfix) then ini.commands.longarmfix = buffers.cmd_longarmfix.v; save() end if imgui.InputText(T("Enable / Disable BlackRoads Fix"), buffers.cmd_fixblackroads) then ini.commands.fixblackroads = buffers.cmd_fixblackroads.v; save() end if imgui.InputText(T("Enable / Disable Sensitivity Fix"), buffers.cmd_fixsens) then ini.commands.sensfix = buffers.cmd_fixsens.v; save() end if imgui.InputText(T("Enable / Disable Audiostream"), buffers.cmd_audiostream) then ini.commands.audiostream = buffers.cmd_audiostream.v; save() end if imgui.InputText(T("Enable / Disable InteriorMusic"), buffers.cmd_intmusic) then ini.commands.intmusic = buffers.cmd_intmusic.v; save() end if imgui.InputText(T("Enable / Disable Sounds"), buffers.cmd_nosounds) then ini.commands.nosounds = buffers.cmd_nosounds.v; save() end if imgui.InputText(T("Enable / Disable SA-MP Key Lock"), buffers.cmd_blocksampkeys) then ini.commands.blockkeys = buffers.cmd_blocksampkeys.v; save() end if imgui.InputText(T("Enable / Disable Plane Lines"), buffers.cmd_noplaneline) then ini.commands.noplaneline = buffers.cmd_noplaneline.v; save() end if imgui.InputText(T("Enable / Disable SunFix / Bring Back Sun"), buffers.cmd_sunfix) then ini.commands.sunfix = buffers.cmd_sunfix.v; save() end if imgui.InputText(T("Enable / Disable TargetBlip"), buffers.cmd_targetblip) then ini.commands.targetblip = buffers.cmd_targetblip.v; save() end if imgui.InputText(T("Enable / Disable Vsync"), buffers.cmd_vsync) then ini.commands.vsync = buffers.cmd_vsync.v; save() end if imgui.InputText(T("Enable / Disable Radar Outline Fix"), buffers.cmd_radar_color_fix) then ini.commands.radar_color_fix = buffers.cmd_radar_color_fix.v; save() end if imgui.InputText(T("Enable / Disable Radar Fix"), buffers.cmd_radarfix) then ini.commands.radarfix = buffers.cmd_radarfix.v; save() end if imgui.InputText(T("Enable / Disable DualMonitorFix"), buffers.cmd_dual_monitor_fix) then ini.commands.dual_monitor_fix = buffers.cmd_dual_monitor_fix.v; save() end if imgui.InputText(T("Enable / Disable TaxiLightFix"), buffers.cmd_fixtaxilight) then ini.commands.fixtaxilight = buffers.cmd_fixtaxilight.v; save() end if imgui.InputText(T("Edit Radar Width"), buffers.cmd_radarwidth) then ini.commands.radarWidth = buffers.cmd_radarwidth.v; save() end if imgui.InputText(T("Edit Radar Height"), buffers.cmd_radarheight) then ini.commands.radarHeight = buffers.cmd_radarheight.v; save() end if imgui.InputText(T("Edit Radar Position X"), buffers.cmd_radarx) then ini.commands.radarx = buffers.cmd_radarx.v; save() end if imgui.InputText(T("Edit Radar Position Y"), buffers.cmd_radary) then ini.commands.radary = buffers.cmd_radary.v; save() end if imgui.InputText(T("Enable / Disable Ultimate Genrl"), buffers.cmd_ugenrl) then ini.commands.ugenrl = buffers.cmd_ugenrl.v; save() end if imgui.InputText(T("Enable / Disable Automatically Disable game Sound When Ultimate Genrl Is Enabled "), buffers.cmd_autonosounds) then ini.commands.autonosounds = buffers.cmd_autonosounds.v; save() end if imgui.InputText(T("Change Deagle Sound"), buffers.cmd_uds) then ini.commands.uds = buffers.cmd_uds.v; save() end if imgui.InputText(T("Change Shotgun Sound"), buffers.cmd_uss) then ini.commands.uss = buffers.cmd_uss.v; save() end if imgui.InputText(T("Change M4 Sound"), buffers.cmd_ums) then ini.commands.ums = buffers.cmd_ums.v; save() end if imgui.InputText(T("Change Rifle Sound"), buffers.cmd_urs) then ini.commands.urs = buffers.cmd_urs.v; save() end if imgui.InputText(T("Change Uzi Sound"), buffers.cmd_uuzi) then ini.commands.uuzi = buffers.cmd_uuzi.v; save() end if imgui.InputText(T("Change Mp5 Sound"), buffers.cmd_ump5) then ini.commands.ump5 = buffers.cmd_ump5.v; save() end if imgui.InputText(T("Change HitSound"), buffers.cmd_ubs) then ini.commands.ubs = buffers.cmd_ubs.v; save() end if imgui.InputText(T("Change PainSound"), buffers.cmd_ups) then ini.commands.ups = buffers.cmd_ups.v; save() end if imgui.InputText(T("Change Shot Sound Range"), buffers.cmd_ugd) then ini.commands.ugd = buffers.cmd_ugd.v; save() end if imgui.InputText(T("Change Volume of Shots"), buffers.cmd_ugvw) then ini.commands.ugvw = buffers.cmd_ugvw.v; save() end if imgui.InputText(T("Change HitSound Volume"), buffers.cmd_ugvh) then ini.commands.ugvh = buffers.cmd_ugvh.v; save() end if imgui.InputText(T("Change PainSound Volume"), buffers.cmd_ugvp) then ini.commands.ugvp = buffers.cmd_ugvp.v; save() end if imgui.InputText(T("Enable / Disable Anisotropic"), buffers.cmd_forceaniso) then ini.commands.forceaniso = buffers.cmd_forceaniso.v; save() end if imgui.InputText(T("Enable / Disable MapZoomFix"), buffers.cmd_mapzoomfixer) then ini.commands.mapzoomfixer = buffers.cmd_mapzoomfixer.v; save() end if imgui.InputText(T("Edit Main Shadow"), buffers.cmd_shadowcp) then ini.commands.shadowcp = buffers.cmd_shadowcp.v; save() end if imgui.InputText(T("Edit Shadow Light"), buffers.cmd_shadowlight) then ini.commands.shadowlight = buffers.cmd_shadowlight.v; save() end if imgui.InputText(T("Toggle Discord Webhook"), buffers.cmd_dhook) then ini.commands.dhook = buffers.cmd_dhook.v; save() end if imgui.InputText(T("Toggle Keyboard Overlay"), buffers.cmd_keyboard) then ini.commands.keyboard = buffers.cmd_keyboard.v; save() end if imgui.InputText(T("Open MP3 Player"), buffers.cmd_mp3pl) then ini.commands.mp3pl = buffers.cmd_mp3pl.v; save() end imgui.PopItemWidth() imgui.EndChild() elseif tab.v == 6 then imgui.BeginChild("##Settings", imgui.ImVec2(-1, -1), true) imgui.Text(T("Change Theme:")) imgui.PushItemWidth(220) if imgui.Combo("##thgm", iStyle, tStyle, #tStyle) then ini.settings.theme = iStyle.v+1 save() SwitchTheStyle(ini.settings.theme) end imgui.PopItemWidth() imgui.Spacing() imgui.Separator() imgui.Spacing() imgui.Text(T("Language:")) imgui.PushItemWidth(220) if imgui.Combo("##lang", iLang, tLang, #tLang) then local code = langCodes[iLang.v+1] setLang(code) end imgui.PopItemWidth() imgui.Spacing() imgui.TextColored(DIM(0.45), u8(T("Language:") .. " " .. tLang[iLang.v+1] .. " (" .. langCodes[iLang.v+1] .. ")")) imgui.Spacing() imgui.Separator() imgui.Spacing() imgui.Text(T("Panel Key")) imgui.SameLine() if imgui.HotKey(u8"##panelkey", PanelHotKey, tLastPanelKeys, 70) then pcall(rkeys.changeHotKey, bindPanelHotKey, PanelHotKey.v) sampAddChatMessage(script_name.." {FFFFFF}Panel key: {dc4747}" .. table.concat(rkeys.getKeysName(PanelHotKey.v), " + "), 0x73b461) ini.panelkey.keys = encodeJson(PanelHotKey.v) save() end imgui.Spacing() imgui.Separator() imgui.Spacing() if imgui.Checkbox(T("Enable Custom Colors"), customEnabled) then ini.settings.custom_enabled = customEnabled.v save() SwitchTheStyle(ini.settings.theme) end imgui.Spacing() imgui.Text(T("Window Background")) do local col = ffi.new("float[4]", customWindowBg.x, customWindowBg.y, customWindowBg.z, customWindowBg.w) local edited = false local ok, res = pcall(imgui.ColorEdit4, "##cWB", col, imgui.ColorEditFlags.AlphaBar) if ok then edited = res else local ok2, res2 = pcall(imgui.ColorEdit4, "##cWB", customWindowBg); if ok2 then edited = res2 end end if edited then customWindowBg.x, customWindowBg.y, customWindowBg.z, customWindowBg.w = col[0], col[1], col[2], col[3] ini.settings.custom_window_bg = string.format("%.2f,%.2f,%.2f,%.2f", col[0], col[1], col[2], col[3]) save(); if ini.settings.custom_enabled then SwitchTheStyle(ini.settings.theme) end end end imgui.Text(T("Text Color")) do local col = ffi.new("float[4]", customText.x, customText.y, customText.z, customText.w) local edited = false local ok, res = pcall(imgui.ColorEdit4, "##cTX", col, imgui.ColorEditFlags.AlphaBar) if ok then edited = res else local ok2, res2 = pcall(imgui.ColorEdit4, "##cTX", customText); if ok2 then edited = res2 end end if edited then customText.x, customText.y, customText.z, customText.w = col[0], col[1], col[2], col[3] ini.settings.custom_text = string.format("%.2f,%.2f,%.2f,%.2f", col[0], col[1], col[2], col[3]) save(); if ini.settings.custom_enabled then SwitchTheStyle(ini.settings.theme) end end end imgui.Text(T("Button Color")) do local col = ffi.new("float[4]", customButton.x, customButton.y, customButton.z, customButton.w) local edited = false local ok, res = pcall(imgui.ColorEdit4, "##cBT", col, imgui.ColorEditFlags.AlphaBar) if ok then edited = res else local ok2, res2 = pcall(imgui.ColorEdit4, "##cBT", customButton); if ok2 then edited = res2 end end if edited then customButton.x, customButton.y, customButton.z, customButton.w = col[0], col[1], col[2], col[3] ini.settings.custom_button = string.format("%.2f,%.2f,%.2f,%.2f", col[0], col[1], col[2], col[3]) save(); if ini.settings.custom_enabled then SwitchTheStyle(ini.settings.theme) end end end imgui.Text(T("Child Bg")) do local col = ffi.new("float[4]", customChildBg.x, customChildBg.y, customChildBg.z, customChildBg.w) local edited = false local ok, res = pcall(imgui.ColorEdit4, "##cCB", col, imgui.ColorEditFlags.AlphaBar) if ok then edited = res else local ok2, res2 = pcall(imgui.ColorEdit4, "##cCB", customChildBg); if ok2 then edited = res2 end end if edited then customChildBg.x, customChildBg.y, customChildBg.z, customChildBg.w = col[0], col[1], col[2], col[3] ini.settings.custom_child_bg = string.format("%.2f,%.2f,%.2f,%.2f", col[0], col[1], col[2], col[3]) save(); if ini.settings.custom_enabled then SwitchTheStyle(ini.settings.theme) end end end imgui.Text(T("Frame Bg")) do local col = ffi.new("float[4]", customFrameBg.x, customFrameBg.y, customFrameBg.z, customFrameBg.w) local edited = false local ok, res = pcall(imgui.ColorEdit4, "##cFB", col, imgui.ColorEditFlags.AlphaBar) if ok then edited = res else local ok2, res2 = pcall(imgui.ColorEdit4, "##cFB", customFrameBg); if ok2 then edited = res2 end end if edited then customFrameBg.x, customFrameBg.y, customFrameBg.z, customFrameBg.w = col[0], col[1], col[2], col[3] ini.settings.custom_frame_bg = string.format("%.2f,%.2f,%.2f,%.2f", col[0], col[1], col[2], col[3]) save(); if ini.settings.custom_enabled then SwitchTheStyle(ini.settings.theme) end end end imgui.Spacing() imgui.Text(T("Window Rounding")) if imgui.SliderFloat("##cWR", customWindowRounding, 0.0, 20.0) then ini.settings.custom_window_rounding = tostring(customWindowRounding.v); save(); if ini.settings.custom_enabled then SwitchTheStyle(ini.settings.theme) end end imgui.Text(T("Frame Rounding")) if imgui.SliderFloat("##cFR", customFrameRounding, 0.0, 20.0) then ini.settings.custom_frame_rounding = tostring(customFrameRounding.v); save(); if ini.settings.custom_enabled then SwitchTheStyle(ini.settings.theme) end end imgui.Text(T("Alpha")) if imgui.SliderFloat("##cAL", customAlpha, 0.2, 1.0) then ini.settings.custom_alpha = tostring(customAlpha.v); save(); if ini.settings.custom_enabled then SwitchTheStyle(ini.settings.theme) end end imgui.Spacing() imgui.Separator() imgui.Spacing() imgui.EndChild() elseif tab.v == 7 then drawToolsTab() elseif tab.v == 8 then drawKillStateTab() elseif tab.v == 9 then drawSSAOTab() elseif tab.v == 10 then drawSensFixTab() elseif tab.v == 11 then drawHUDChangerTab() end imgui.PopStyleVar() imgui.EndChild() imgui.End() imgui.PopStyleVar(2) end drawToolsOverlays() pcall(drawKillStateOverlay) end local wm = require 'lib.windows.message' function onWindowMessage(msg, wparam, lparam) -- ESC hanya ditelan saat PANEL TERBUKA (main_menu.v). Dulu: imgui.Process (true terus -- saat overlay keyboard/mouse nyala) -> ESC tidak pernah sampai ke game: chat kiri atas -- tidak bisa ditutup, dialog/pause ikut macet. Jangan ganti objek main_menu, set .v saja. if (msg == 256 or msg == 257) and wparam == 27 and main_menu.v then consumeWindowMessage(true, true) if msg == 257 then main_menu.v = false end end if ini.settings.mapzoomfixer then if (msg == 522 and readMemory(0xBA68A5, 1, false) == 5) then if wparam == 7864320 and memory.getfloat(0xBA67AC, false) < 1000.0 then memory.setfloat(0xBA67AC, memory.getfloat(0xBA67AC, false) + 50.0, false) elseif wparam == 4287102976 and memory.getfloat(0xBA67AC, false) > 301.5 then memory.setfloat(0xBA67AC, memory.getfloat(0xBA67AC, false) - 50.0, false) end end if readMemory(0xBA68A5, 1, false) == 5 then if isKeyDown(187) and memory.getfloat(0xBA67AC, false) < 1000.0 then memory.setfloat(0xBA67AC, memory.getfloat(0xBA67AC, false) + 50.0, false) elseif isKeyDown(189) and memory.getfloat(0xBA67AC, false) > 301.5 then memory.setfloat(0xBA67AC, memory.getfloat(0xBA67AC, false) - 50.0, false) end end end if ini.settings.dual_monitor_fix then if msg == wm.WM_KILLFOCUS then ffi.C.GetClipCursor(rcOldClip); ffi.C.ClipCursor(rcOldClip); elseif msg == wm.WM_SETFOCUS then ffi.C.GetWindowRect(ffi.C.GetActiveWindow(), rcClip); ffi.C.ClipCursor(rcClip); end end if msg == 261 and wparam == 13 then consumeWindowMessage(true, true) end end ------------------ [ Functions ] ------------------ function gotofunc(fnc) ------------------ [ fixes and other ] ------------------ if fnc == "all" then memory.setuint32(0x736F88, 0, true) memory.fill(0x4217F4, 0x90, 21, true) memory.fill(0x4218D8, 0x90, 17, true) memory.fill(0x5F80C0, 0x90, 10, true) memory.fill(0x5FBA47, 0x90, 10, true) memory.write(0x53E94C, 0, 1, false) memory.write(0x555854, 0x90909090, 4, false) memory.write(0x555858, 0x90, 1, false) memory.write(0x745BC9, 0x9090, 2, false) memory.fill(0x460773, 0x90, 7, false) memory.setuint32(12761548, 1051965045, false) local oldProtect = memory.unprotect(0x748063, 5) memory.hex2bin('E8F83BDFFF', 0x748063, 5) memory.protect(0x748063, 5, oldProtect) if sampGetVersion() == "0.3.7-R1" then memory.write(sampGetBase() + 0x64C8C, 1, 1, true) memory.write(sampGetBase() + 0x64C91, 200, 1, true) memory.write(sampGetBase() + 0xD7B79, 0x2D393939, 4, true) memory.write(sampGetBase() + 0xD7B78, 0x31, 1, true) memory.write(sampGetBase() + 0x64ACA, 0xFB, 1, true) memory.write(sampGetBase() + 0x64ACF, 0x07, 1, true) memory.write(sampGetBase() + 0xD7B00, 1948267821, 4, true) memory.write(sampGetBase() + 0xD7B04, 3612783, 4, true) memory.write(sampGetBase() + 0x64A51, 0x32, 1, true) memory.write(sampGetBase() + 0xD7AD5, 0x35, 1, true) end ---------------------------------------------------------------------------- memory.setfloat(8755780, ini.settings.crosshairX..".0", false) memory.setfloat(8755804, ini.settings.crosshairY..".0", false) memory.write(5825313, 8755804, 4, false) ----------------------------------------------------------------------------- memory.setfloat(12044272, ini.settings.drawdist..".0", false) memory.setfloat(13210352, ini.settings.fog..".0", false) memory.setfloat(8753112, ini.settings.lod..".0", false) ------------------------------------------------------------------------------ end ----------------------------------------------------------------------- if fnc == "OpenMenu" then main_menu.v = not main_menu.v imgui.Process = main_menu.v end if fnc == "ClearChat" then if sampGetVersion() == "0.3.7-R1" then memory.fill(sampGetChatInfoPtr() + 306, 0x0, 25200) memory.write(sampGetChatInfoPtr() + 306, 25562, 4, 0x0) memory.write(sampGetChatInfoPtr() + 0x63DA, 1, 1) end end -- BMS FIX: SetTime dipanggil slider menit tapi cabangnya tak pernah ada (dead call). -- Tulis jam+menit game langsung (freeze per-frame tetap via blocktime di main loop). if fnc == "SetTime" then local h = math.max(0, math.min(23, tonumber(ini.settings.hours) or 12)) local m = math.max(0, math.min(59, tonumber(ini.settings.min) or 0)) memory.write(0xB70153, h, 1, false) memory.write(0xB70152, m, 1, false) end if fnc == "FixTimecyc" or fnc == "all" then if ini.fixtimecyc.active then memory.write(6359759, 144, 1, false) memory.write(6359760, 144, 1, false) memory.write(6359761, 144, 1, false) memory.write(6359762, 144, 1, false) memory.write(6359763, 144, 1, false) memory.write(6359764, 144, 1, false) memory.write(6359778, 144, 1, false) memory.write(6359779, 144, 1, false) memory.write(6359780, 144, 1, false) memory.write(6359781, 144, 1, false) memory.write(6359782, 144, 1, false) memory.write(6359783, 144, 1, false) memory.write(6359784, 144, 1, false) memory.write(6359785, 144, 1, false) memory.write(6359786, 144, 1, false) memory.write(6359787, 144, 1, false) memory.write(5637016, 12044024, 4, false) memory.write(5637032, 12044024, 4, false) memory.write(5637048, 12044024, 4, false) memory.write(5636920, 12044048, 4, false) memory.write(5636936, 12044072, 4, false) memory.write(5636952, 12044096, 4, false) memory.setfloat(9228384, ini.fixtimecyc.allambient, false) memory.setfloat(12044024, ini.fixtimecyc.objambient, false) memory.setfloat(12044048, ini.fixtimecyc.worldambientR, false) memory.setfloat(12044072, ini.fixtimecyc.worldambientG, false) memory.setfloat(12044096, ini.fixtimecyc.worldambientB, false) else memory.write(6359759, 217, 1, false) memory.write(6359760, 21, 1, false) memory.write(6359761, 96, 1, false) memory.write(6359762, 208, 1, false) memory.write(6359763, 140, 1, false) memory.write(6359764, 0, 1, false) memory.write(6359778, 199, 1, false) memory.write(6359779, 5, 1, false) memory.write(6359780, 96, 1, false) memory.write(6359781, 208, 1, false) memory.write(6359782, 140, 1, false) memory.write(6359783, 0, 1, false) memory.write(6359784, 0, 1, false) memory.write(6359785, 0, 1, false) memory.write(6359786, 128, 1, false) memory.write(6359787, 63, 1, false) memory.write(5637016, 12043448, 4, false) memory.write(5637032, 12043452, 4, false) memory.write(5637048, 12043456, 4, false) memory.write(5636920, 12043424, 4, false) memory.write(5636936, 12043428, 4, false) memory.write(5636952, 12043432, 4, false) end end if fnc == "GivemeDist" or fnc == "all" then if ini.settings.givemedist then memory.write(5499541, 12044272, 4, false) memory.write(8381985, 13213544, 4, false) else memory.write(5499541, 12043504, 4, false) memory.write(8381985, 13210352, 4, false) end end if fnc == "NoBirds" or fnc == "all" then if ini.settings.nobirds then memory.write(5497200, 232, 1, false) memory.write(5497201, 1918619, 4, false) else memory.fill(5497200, 144, 5, false) end end if fnc == "NoDust" or fnc == "all" then if ini.settings.nodust then memory.write(7205311, 1056964608, 4, false) memory.write(7205316, 1065353216, 4, false) memory.write(7205321, 1065353216, 4, false) memory.write(7205389, 1056964608, 4, false) memory.write(7204123, 1050253722, 4, false) memory.write(7204128, 1065353216, 4, false) memory.write(7204133, 1060320051, 4, false) memory.write(5527777, 1036831949, 4, false) memory.write(4846974, 1053609165, 4, false) memory.write(4846757, 1053609165, 4, false) else memory.write(7205311, 0, 4, false) memory.write(7205316, 0, 4, false) memory.write(7205321, 0, 4, false) memory.write(7205389, 0, 4, false) memory.write(7204123, 0, 4, false) memory.write(7204128, 0, 4, false) memory.write(7204133, 0, 4, false) memory.write(5527777, -1, 4, false) memory.write(4846974, -1, 4, false) memory.write(4846757, -1, 4, false) end end if fnc == "ShadowEdit" or fnc == "all" then if ini.settings.shadowedit then memory.write(5635169, 0, 1, false) memory.write(5635259, 0, 1, false) memory.setint32(12043496, "1114"..ini.settings.shadowcp + 113, false) memory.setint32(12043500, ini.settings.shadowlight, false) else memory.write(5635169, 72, 1, false) memory.write(5635259, 76, 1, false) end end if fnc == "NoCloudBig" or fnc == "all" then if ini.settings.nocloudbig then memory.write(5497268, 495044584, 4, false) memory.write(5497272, 0, 1, false) else memory.write(5497268, -1869574000, 4, false) memory.write(5497272, 144, 1, false) end end if fnc == "NoCloudSmall" or fnc == "all" then if ini.settings.nocloudsmall then memory.write(5497121, 494111464, 4, false) memory.write(5497125, 0, 1, false) else memory.fill(5497121, 144, 5, false) end end if fnc == "NoShadows" or fnc == "all" then if ini.settings.noshadows then memory.write(5497177, 233, 1, false) memory.write(5489067, 492560616, 4, false) memory.write(5489071, 0, 1, false) memory.write(6186889, 33807, 2, false) memory.write(7388587, 111379727, 4, false) memory.write(7388591, 0, 2, false) memory.write(7391066, 32081167, 4, false) memory.write(7391070, -1869611008, 4, false) else memory.write(5497177, 195, 1, false) memory.fill(5489067, 144, 5, false) memory.write(6186889, 59792, 2, false) memory.fill(7388587, 144, 6, false) memory.fill(7391066, 144, 9, false) end end if fnc == "VehLods" or fnc == "all" then if ini.settings.vehlods then memory.write(5425646, 1, 1, false) else memory.write(5425646, 0, 1, false) end end if fnc == "NoPostfx" or fnc == "all" then if ini.settings.postfx then memory.write(7358318, 1448280247, 4, false) memory.write(7358314, -988281383, 4, false) else memory.write(7358318, 2866, 4, false) memory.write(7358314, -380152237, 4, false) end end if fnc == "FPSUnlock" or fnc == "all" then if sampGetVersion() == "0.3.7-R1" then if ini.settings.unlimitfps then memory.write(sampGetBase() + 0x9D9D0, 1347550997, 4, true) else memory.write(sampGetBase() + 0x9D9D0, -549912, 4, true) end end end if fnc == "NoEffects" or fnc == "all" then if ini.settings.effects then memory.write(4891712, 1443425411, 4, false) else memory.write(4891712, 8386, 4, false) end end if fnc == "HPStyle" or fnc == "all" then if ini.hphud.hpt then ini.hphud.style = 1 elseif ini.hphud.hpt == false then ini.hphud.style = 0 end end if fnc == "ShowHUD" or fnc == "all" then if ini.settings.showhud then displayHud(true) memory.setint8(0xBA676C, 0) else displayHud(false) memory.setint8(0xBA676C, 2) end end if fnc == "ShowCHAT" or fnc == "all" then if sampGetVersion() == "0.3.7-R1" then if ini.settings.showchat then memory.write(sampGetBase() + 0x7140F, 0, 1, true) sampSetChatDisplayMode(2) else memory.write(sampGetBase() + 0x7140F, 1, 1, true) sampSetChatDisplayMode(0) end end end if fnc == "ShowHP" or fnc == "all" then if sampGetVersion() == "0.3.7-R1" then if ini.settings.showhp then memory.setint16(sampGetBase() + 0x6FC30, 0xC390, true) else memory.setint16(sampGetBase() + 0x6FC30, 0x8B55, true) end end end if fnc == "ShowNICKS" or fnc == "all" then if sampGetVersion() == "0.3.7-R1" then if ini.settings.shownicks then memory.setint16(sampGetBase() + 0x70D40, 0xC390, true) else memory.setint16(sampGetBase() + 0x70D40, 0x8B55, true) end end end if fnc == "FixCrosshair" or fnc == "all" then if ini.settings.fixcrosshair then memory.write(5825141, 144, 1, false) memory.write(5825142, 144, 1, false) memory.write(5825143, 144, 1, false) memory.write(5825144, 144, 1, false) memory.write(5825145, 144, 1, false) memory.write(5825146, 144, 1, false) else memory.write(5825141, 216, 1, false) memory.write(5825142, 29, 1, false) memory.write(5825143, 196, 1, false) memory.write(5825144, 140, 1, false) memory.write(5825145, 133, 1, false) memory.write(5825146, 0, 1, false) end checkboxes.fixcrosshair.v = ini.settings.fixcrosshair end if fnc == "InteriorRun" or fnc == "all" then if ini.settings.intrun then memory.write(5630064, -1027591322, 4, false) memory.write(5630068, 4, 2, false) else memory.write(5630064, 69485707, 4, false) memory.write(5630068, 1165, 2, false) end checkboxes.intrun.v = ini.settings.intrun end if fnc == "FixWaterQuadro" or fnc == "all" then if ini.settings.waterfixquadro then memory.setfloat(13101856, 0.0, false) memory.write(7249056, 13101856, 4, false) memory.write(7249115, 13101856, 4, false) memory.write(7249175, 13101856, 4, false) memory.write(7249235, 13101856, 4, false) else memory.write(7249056, 8752012, 4, false) memory.write(7249115, 8752012, 4, false) memory.write(7249175, 8752012, 4, false) memory.write(7249235, 8752012, 4, false) end checkboxes.waterfixquadro.v = ini.settings.waterfixquadro end if fnc == "FixLongArm" or fnc == "all" then if ini.settings.longarmfix then memory.write(7045634, 33807, 2, false) memory.write(7046489, 33807, 2, false) else memory.write(7045634, 59792, 2, false) memory.write(7046489, 59792, 2, false) end checkboxes.longarmfix.v = ini.settings.longarmfix end if fnc == "FixBlackRoads" or fnc == "all" then if ini.settings.fixblackroads then memory.write(8931716, 0, 4, false) else memory.write(8931716, 2, 4, false) end checkboxes.fixblackroads.v = ini.settings.fixblackroads end if fnc == "FixSensitivity" or fnc == "all" then if ini.settings.sensfix then memory.write(5382798, 11987996, 4, false) memory.write(5311528, 11987996, 4, false) memory.write(5316106, 11987996, 4, false) else memory.write(5382798, 11987992, 4, false) memory.write(5311528, 11987992, 4, false) memory.write(5316106, 11987992, 4, false) end checkboxes.sensfix.v = ini.settings.sensfix end if fnc == "AudioStream" or fnc == "all" then if sampGetVersion() == "0.3.7-R1" then if ini.settings.audiostream then memory.write(sampGetBase() + 104848, 9449, 2, true) else memory.write(sampGetBase() + 104848, 50064, 2, true) end end end if fnc == "NoSounds" or fnc == "all" then if ini.settings.nosounds then callFunction(0x507440, 0, 0) writeMemory(0x507750, 1, 86, true) else callFunction(0x507430, 0, 0) writeMemory(0x507750, 1, 0xC3, true) raknetEmulRpcReceiveBitStream(42, bs) raknetDeleteBitStream(bs) end end if fnc == "InteriorMusic" or fnc == "all" then if ini.settings.intmusic then memory.write(5276752, -591647351, 4, false) memory.write(5276756, 182, 2, false) memory.write(5277719, -591647351, 4, false) memory.write(5277723, 182, 2, false) else memory.fill(5276752, 144, 6, false) memory.fill(5277719, 144, 6, false) end end if fnc == "NoRadio" or fnc == "all" then if ini.settings.noradio then memory.write(5159328, -1947628715, 4, false) else memory.write(5159328, -1962933054, 4, false) end end if fnc == "BigHPBar" or fnc == "all" then if ini.settings.bighpbar then memory.setfloat(12030944, 910.4, true) ini.hphud.mode = 2 save() else memory.setfloat(12030944, 569.0, true) ini.hphud.mode = 1 save() end end if fnc == "MapZoom" or fnc == "all" then if ini.settings.mapzoom then memory.setfloat(5719357, ini.settings.mapzoomvalue, false) else memory.setfloat(5719357, 1000.0, false) end end if fnc == "AnimationMoney" or fnc == "all" then if ini.settings.animmoney == 1 then memory.write(5707667, 138, 1, false) elseif ini.settings.animmoney == 2 then memory.write(5707667, 137, 1, false) elseif ini.settings.animmoney == 3 then memory.write(5707667, 139, 1, false) end end if fnc == "BlockSampKeys" or fnc == "all" then if sampGetVersion() == "0.3.7-R1" then if ini.settings.blockkeys then memory.fill(sampGetBase() + 31102, 0, 1, true) memory.fill(sampGetBase() + 463840, 0, 1, true) memory.write(sampGetBase() + 383732, -1869574000, 4, true) else memory.fill(sampGetBase() + 31102, 115, 1, true) memory.fill(sampGetBase() + 463840, 112, 1, true) memory.write(sampGetBase() + 383732, 69489803, 4, true) end end end if fnc == "NoPlaneLine" or fnc == "all" then if ini.settings.noplaneline then memory.hex2bin('E9ABFAFFFF', 0x7178F0, 5) else memory.fill(0x7178F0, 0x90, 5, false) end end if fnc == "SunFix" or fnc == "all" then if ini.settings.sunfix then memory.hex2bin("E865041C00", 0x53C136, 5) else memory.fill(0x53C136, 0x90, 5, true) end checkboxes.sunfix.v = ini.settings.sunfix end if fnc == "TargetBlip" or fnc == "all" then if ini.settings.targetblip then memory.write(5497324, 116, 1, false) else memory.write(5497324, 235, 1, false) end end if fnc == "CleanMemory" then local oldram =("%d"):format(get_memory()) callFunction(0x53C500, 2, 2, true, true) callFunction(0x53C810, 1, 1, true) callFunction(0x40CF80, 0, 0) callFunction(0x4090A0, 0, 0) callFunction(0x5A18B0, 0, 0) callFunction(0x707770, 0, 0) local newram =("%d"):format(get_memory()) if ini.cleaner.cleaninfo then sampAddChatMessage(script_name.."{FFFFFF} Clean Memory up to: {dc4747}"..oldram.." MB. {FFFFFF}Memory After: {dc4747}"..newram.." MB. {FFFFFF}Cleared: {dc4747}"..oldram - newram.." MB.", 0x73b461) end end if fnc == "Vsync" or fnc == "all" then if ini.settings.vsync then memory.write(12216212, 1, 1, true) else memory.write(12216212, 0, 1, true) end end if fnc == "RadarColorFix" or fnc == "all" then if ini.settings.radar_color_fix then memory.write(0x58A798, 255, 1, false) memory.write(0x58A790, 255, 1, false) memory.write(0x58A78E, 255, 1, false) memory.write(0x58A89A, 255, 1, false) memory.write(0x58A896, 255, 1, false) memory.write(0x58A894, 255, 1, false) memory.write(0x58A8EE, 255, 1, false) memory.write(0x58A8E6, 255, 1, false) memory.write(0x58A8DE, 255, 1, false) memory.write(0x58A9A2, 255, 1, false) memory.write(0x58A99A, 255, 1, false) memory.write(0x58A996, 255, 1, false) else memory.write(0x58A798, 0, 1, false) memory.write(0x58A790, 0, 1, false) memory.write(0x58A78E, 0, 1, false) memory.write(0x58A89A, 0, 1, false) memory.write(0x58A896, 0, 1, false) memory.write(0x58A894, 0, 1, false) memory.write(0x58A8EE, 0, 1, false) memory.write(0x58A8E6, 0, 1, false) memory.write(0x58A8DE, 0, 1, false) memory.write(0x58A9A2, 0, 1, false) memory.write(0x58A99A, 0, 1, false) memory.write(0x58A996, 0, 1, false) end end if fnc == "Radarfix" or fnc == "all" then if ini.settings.radarfix then memory.setfloat(8809336, ini.settings.radarHeight, false) memory.setfloat(8809332, ini.settings.radarWidth, false) memory.setfloat(8751632, ini.settings.radarPosX, false) memory.setfloat(8809328, ini.settings.radarPosY, false) ---------------- [fix bug edit pos elements] ---------------- memory.write(5828441, 9263116, 4, false) memory.write(5828895, 9263116, 4, false) memory.write(7422387, 5108644, 4, false) memory.write(7422456, 5108644, 4, false) memory.write(7441684, 5108644, 4, false) ------------------------------------------------------------- else memory.setfloat(8809336, 94.0, false) memory.setfloat(8809332, 76.0, false) memory.setfloat(8751632, 40.0, false) memory.setfloat(8809328, 104.0, false) end checkboxes.radarfix.v = ini.settings.radarfix end if fnc == "FixTaxiLight" or fnc == "all" then if ini.settings.fixtaxilight then memory.write(12697552, 1, 1, false) else memory.write(12697552, 0, 1, false) end checkboxes.fixtaxilight.v = ini.settings.fixtaxilight end if fnc == "ForceAniso" or fnc == "all" then if ini.settings.forceaniso then if readMemory(0x730F9C, 1, false) ~= 0 then memory.write(0x730F9C, 0, 1, false) loadScene(1337, 1337, 1337) callFunction(0x40D7C0, 1, 1, -1) end else if readMemory(0x730F9C, 1, false) ~= 1 then memory.write(0x730F9C, 1, 1, false) loadScene(1337, 1337, 1337) callFunction(0x40D7C0, 1, 1, -1) end end checkboxes.forceaniso.v = ini.settings.forceaniso end end ---------------------------------------------- [imgui func] ---------------------------------------------------- function imgui.CustomMenu(labels, selected, size, speed, centering) local bool = false speed = speed and speed or 0.2 local radius = size.y * 0.50 local draw_list = imgui.GetWindowDrawList() if LastActiveTime == nil then LastActiveTime = {} end if LastActive == nil then LastActive = {} end local function ImSaturate(f) return f < 0.0 and 0.0 or (f > 1.0 and 1.0 or f) end for i, v in ipairs(labels) do local c = imgui.GetCursorPos() local p = imgui.GetCursorScreenPos() if imgui.InvisibleButton(v..'##'..i, size) then selected.v = i LastActiveTime[v] = os.clock() LastActive[v] = true bool = true end imgui.SetCursorPos(c) local t = selected.v == i and 1.0 or 0.0 if LastActive[v] then local time = os.clock() - LastActiveTime[v] if time <= 0.3 then local t_anim = ImSaturate(time / speed) t = selected.v == i and t_anim or 1.0 - t_anim else LastActive[v] = false end end local col_bg = imgui.GetColorU32(selected.v == i and imgui.ImVec4(0.40, 0.40, 0.40, 0.80) or imgui.ImVec4(0,0,0,0)) local col_box = imgui.GetColorU32(selected.v == i and imgui.GetStyle().Colors[imgui.Col.Button] or imgui.ImVec4(0,0,0,0)) local col_hovered = imgui.GetStyle().Colors[imgui.Col.ButtonHovered] local col_hovered = imgui.GetColorU32(imgui.ImVec4(col_hovered.x, col_hovered.y, col_hovered.z, (imgui.IsItemHovered() and 0.2 or 0))) draw_list:AddRectFilled(imgui.ImVec2(p.x-size.x/6, p.y), imgui.ImVec2(p.x + (radius * 0.65) + t * size.x, p.y + size.y), col_bg, 0.0) draw_list:AddRectFilled(imgui.ImVec2(p.x-size.x/6, p.y), imgui.ImVec2(p.x + (radius * 0.65) + size.x, p.y + size.y), col_hovered, 0.0) imgui.SetCursorPos(imgui.ImVec2(c.x+(centering and (size.x-imgui.CalcTextSize(v).x)/2 or 15), c.y+(size.y-imgui.CalcTextSize(v).y)/2)) imgui.Text(v) imgui.SetCursorPos(imgui.ImVec2(c.x, c.y+size.y)) end return bool end ------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------ [theme] ---------------------------------- function SwitchTheStyle(theme) imgui.SwitchContext() local style = imgui.GetStyle() local colors = style.Colors local clr = imgui.Col local ImVec4 = imgui.ImVec4 local ImVec2 = imgui.ImVec2 local light = (theme == 2) -- Geometry style.WindowPadding = ImVec2(14, 12) style.FramePadding = ImVec2(10, 8) style.ItemSpacing = ImVec2(9, 8) style.ItemInnerSpacing = ImVec2(7, 6) style.IndentSpacing = 22.0 style.ScrollbarSize = 0.0 style.GrabMinSize = 10.0 style.ChildWindowRounding = 13.0 style.FrameRounding = 9.0 style.ScrollbarRounding = 10.0 style.GrabRounding = 8.0 style.WindowTitleAlign = ImVec2(0.0, 0.5) style.ButtonTextAlign = ImVec2(0.5, 0.5) if not light then colors[clr.Text] = ImVec4(0.95, 0.97, 1.00, 0.96) colors[clr.TextDisabled] = ImVec4(0.95, 0.97, 1.00, 0.34) colors[clr.WindowBg] = ImVec4(0.025,0.028,0.034,1.00) colors[clr.ChildWindowBg] = ImVec4(0.050,0.056,0.068,0.96) colors[clr.PopupBg] = ImVec4(0.065,0.072,0.086,0.99) colors[clr.Border] = ImVec4(1.00,1.00,1.00,0.075) colors[clr.BorderShadow] = ImVec4(0,0,0,0) colors[clr.FrameBg] = ImVec4(1.00,1.00,1.00,0.055) colors[clr.FrameBgHovered] = ImVec4(1.00,1.00,1.00,0.090) colors[clr.FrameBgActive] = ImVec4(1.00,1.00,1.00,0.135) colors[clr.TitleBg] = ImVec4(0.035,0.038,0.046,1.00) colors[clr.TitleBgActive] = ImVec4(0.045,0.050,0.060,1.00) colors[clr.TitleBgCollapsed] = ImVec4(0.030,0.033,0.040,0.80) colors[clr.MenuBarBg] = ImVec4(0.040,0.044,0.052,1.00) colors[clr.ScrollbarBg] = ImVec4(0,0,0,0) colors[clr.ScrollbarGrab] = ImVec4(0,0,0,0) colors[clr.ScrollbarGrabHovered] = ImVec4(0,0,0,0) colors[clr.ScrollbarGrabActive] = ImVec4(0,0,0,0) colors[clr.ComboBg] = ImVec4(0.075,0.082,0.097,0.99) colors[clr.CheckMark] = ImVec4(0.94,0.96,0.99,1.00) colors[clr.SliderGrab] = ImVec4(0.82,0.86,0.92,0.50) colors[clr.SliderGrabActive] = ImVec4(0.95,0.97,1.00,0.95) colors[clr.Button] = ImVec4(1.00,1.00,1.00,0.065) colors[clr.ButtonHovered] = ImVec4(1.00,1.00,1.00,0.105) colors[clr.ButtonActive] = ImVec4(1.00,1.00,1.00,0.145) colors[clr.Header] = ImVec4(1.00,1.00,1.00,0.065) colors[clr.HeaderHovered] = ImVec4(1.00,1.00,1.00,0.105) colors[clr.HeaderActive] = ImVec4(1.00,1.00,1.00,0.145) colors[clr.Separator] = ImVec4(1.00,1.00,1.00,0.09) colors[clr.SeparatorHovered] = ImVec4(1.00,1.00,1.00,0.16) colors[clr.SeparatorActive] = ImVec4(1.00,1.00,1.00,0.22) colors[clr.ResizeGrip] = ImVec4(1.00,1.00,1.00,0.08) colors[clr.ResizeGripHovered] = ImVec4(1.00,1.00,1.00,0.17) colors[clr.ResizeGripActive] = ImVec4(1.00,1.00,1.00,0.24) colors[clr.CloseButton] = colors[clr.FrameBg] colors[clr.CloseButtonHovered] = colors[clr.FrameBgHovered] colors[clr.CloseButtonActive] = colors[clr.FrameBgActive] colors[clr.PlotLines] = ImVec4(1,1,1,0.55) colors[clr.PlotLinesHovered] = ImVec4(1,1,1,0.95) colors[clr.PlotHistogram] = ImVec4(1,1,1,0.45) colors[clr.PlotHistogramHovered] = ImVec4(1,1,1,0.80) colors[clr.TextSelectedBg] = ImVec4(1,1,1,0.18) colors[clr.ModalWindowDarkening] = ImVec4(0,0,0,0.62) else colors[clr.Text] = ImVec4(0.075,0.085,0.10,0.96) colors[clr.TextDisabled] = ImVec4(0.075,0.085,0.10,0.34) colors[clr.WindowBg] = ImVec4(0.94,0.95,0.97,1.00) colors[clr.ChildWindowBg] = ImVec4(1.00,1.00,1.00,0.94) colors[clr.PopupBg] = ImVec4(1.00,1.00,1.00,0.99) colors[clr.Border] = ImVec4(0.08,0.10,0.13,0.11) colors[clr.BorderShadow] = ImVec4(0,0,0,0) colors[clr.FrameBg] = ImVec4(0.04,0.05,0.06,0.055) colors[clr.FrameBgHovered] = ImVec4(0.04,0.05,0.06,0.09) colors[clr.FrameBgActive] = ImVec4(0.04,0.05,0.06,0.135) colors[clr.TitleBg] = ImVec4(0.90,0.91,0.93,1.00) colors[clr.TitleBgActive] = ImVec4(0.96,0.97,0.98,1.00) colors[clr.TitleBgCollapsed] = ImVec4(0.88,0.89,0.91,0.82) colors[clr.MenuBarBg] = ImVec4(0.91,0.92,0.94,1.00) colors[clr.ScrollbarBg] = ImVec4(0,0,0,0) colors[clr.ScrollbarGrab] = ImVec4(0,0,0,0) colors[clr.ScrollbarGrabHovered] = ImVec4(0,0,0,0) colors[clr.ScrollbarGrabActive] = ImVec4(0,0,0,0) colors[clr.ComboBg] = ImVec4(0.985,0.988,0.992,0.99) colors[clr.CheckMark] = ImVec4(0.075,0.085,0.10,0.96) colors[clr.SliderGrab] = ImVec4(0.20,0.23,0.28,0.45) colors[clr.SliderGrabActive] = ImVec4(0.08,0.10,0.13,0.92) colors[clr.Button] = ImVec4(0.04,0.05,0.06,0.06) colors[clr.ButtonHovered] = ImVec4(0.04,0.05,0.06,0.10) colors[clr.ButtonActive] = ImVec4(0.04,0.05,0.06,0.15) colors[clr.Header] = ImVec4(0.04,0.05,0.06,0.06) colors[clr.HeaderHovered] = ImVec4(0.04,0.05,0.06,0.10) colors[clr.HeaderActive] = ImVec4(0.04,0.05,0.06,0.15) colors[clr.Separator] = ImVec4(0.08,0.10,0.13,0.10) colors[clr.SeparatorHovered] = ImVec4(0.08,0.10,0.13,0.18) colors[clr.SeparatorActive] = ImVec4(0.08,0.10,0.13,0.25) colors[clr.ResizeGrip] = ImVec4(0.08,0.10,0.13,0.08) colors[clr.ResizeGripHovered] = ImVec4(0.08,0.10,0.13,0.16) colors[clr.ResizeGripActive] = ImVec4(0.08,0.10,0.13,0.24) colors[clr.CloseButton] = colors[clr.FrameBg] colors[clr.CloseButtonHovered] = colors[clr.FrameBgHovered] colors[clr.CloseButtonActive] = colors[clr.FrameBgActive] colors[clr.PlotLines] = ImVec4(0.08,0.10,0.13,0.55) colors[clr.PlotLinesHovered] = ImVec4(0.08,0.10,0.13,0.95) colors[clr.PlotHistogram] = ImVec4(0.08,0.10,0.13,0.45) colors[clr.PlotHistogramHovered] = ImVec4(0.08,0.10,0.13,0.82) colors[clr.TextSelectedBg] = ImVec4(0.08,0.10,0.13,0.15) colors[clr.ModalWindowDarkening] = ImVec4(0,0,0,0.40) end -- Preserve the existing custom-color feature. if ini.settings.custom_enabled then local function pc(str, def) local r, g, b, a = str:match('([^,]+),([^,]+),([^,]+),([^,]+)') if r and g and b and a then return ImVec4(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) end return def end colors[clr.WindowBg] = pc(ini.settings.custom_window_bg, colors[clr.WindowBg]) colors[clr.Text] = pc(ini.settings.custom_text, colors[clr.Text]) colors[clr.Button] = pc(ini.settings.custom_button, colors[clr.Button]) colors[clr.ChildWindowBg] = pc(ini.settings.custom_child_bg, colors[clr.ChildWindowBg]) colors[clr.FrameBg] = pc(ini.settings.custom_frame_bg, colors[clr.FrameBg]) style.WindowRounding = tonumber(ini.settings.custom_window_rounding) or style.WindowRounding style.FrameRounding = tonumber(ini.settings.custom_frame_rounding) or style.FrameRounding style.Alpha = tonumber(ini.settings.custom_alpha) or style.Alpha end end