раньше это работало до обновления Windows, я не знаю, теперь это больше не работает, я все перепробовалу тебя что то, мне помогало переустановкой плагина полностью, типо удаление папки HUD и самого асишника
-- Define all weapon IDs and their corresponding slots
local weaponIDs = {
0, 1, 2, 3, 4, 5, 6, 7, 8, -- Melee
17, 18, 19, -- Handguns
20, 21, 22, -- Shotguns
23, 24, 25, -- Sub-Machine Guns
26, 27, -- Assault Rifles
28, 29, -- Rifles
30, 31, 32, 33, -- Heavy Weapons
34, 35, 36, 37, -- Projectiles
38, 39, 40, -- Special 1
41, 42, -- Gifts
43 -- Satchel Detonator
}
-- Function to check if the player owns a weapon with a given ID
local function playerHasWeapon(weaponID)
local slot = weapon_idFromSlot(weaponID)
return slot ~= -1
end
-- Function to get the next weapon ID that the player owns
local function getNextOwnedWeaponID(currentWeaponID)
-- Find the index of the current weapon in the weaponIDs table
local currentIndex
for i = 1, #weaponIDs do
if weaponIDs[i] == currentWeaponID then
currentIndex = i
break
end
end
-- Iterate from the next index to find the next weapon the player owns
for i = currentIndex + 1, #weaponIDs do
if playerHasWeapon(weaponIDs[i]) then
return weaponIDs[i]
end
end
-- If no next owned weapon is found, loop from the beginning
for i = 1, currentIndex - 1 do
if playerHasWeapon(weaponIDs[i]) then
return weaponIDs[i]
end
end
return nil -- If no next owned weapon is found
end
-- Function to get the previous weapon ID that the player owns
local function getPreviousOwnedWeaponID(currentWeaponID)
-- Find the index of the current weapon in the weaponIDs table
local currentIndex
for i = 1, #weaponIDs do
if weaponIDs[i] == currentWeaponID then
currentIndex = i
break
end
end
-- Iterate from the previous index to find the previous weapon the player owns
for i = currentIndex - 1, 1, -1 do
if playerHasWeapon(weaponIDs[i]) then
return weaponIDs[i]
end
end
-- If no previous owned weapon is found, loop from the end
for i = #weaponIDs, currentIndex + 1, -1 do
if playerHasWeapon(weaponIDs[i]) then
return weaponIDs[i]
end
end
return nil -- If no previous owned weapon is found
end
-- Get the current weapon ID (replace this with your function)
local currentWeaponID = weapon_currentId()
-- Get the next and previous owned weapon IDs
local nextOwnedWeaponID = getNextOwnedWeaponID(currentWeaponID)
local previousOwnedWeaponID = getPreviousOwnedWeaponID(currentWeaponID)
-- Store the next and previous weapon IDs in global storage
store_int("nextWeaponID", nextOwnedWeaponID)
store_int("prevWeaponID", previousOwnedWeaponID)
-- Load the next and previous weapon IDs from global storage
local loadedNextWeaponID = load_int("nextWeaponID")
local loadedPrevWeaponID = load_int("prevWeaponID")
-- Set the textures for the next and previous weapons
local nextTexture = weapon_textureIcon(loadedNextWeaponID)
local prevTexture = weapon_textureIcon(loadedPrevWeaponID)
image_setTexture('t', nextTexture)
image_setTexture('t2', prevTexture)
выглядит аппетитноany one knows how to get next owned weapon id to make next weapon texture visable without change currnet weapon something like thatПосмотреть вложение 238114
i have tried alot even with the help of chatgpt only give me code give next weapon id but it does not matter if i have or not just use +1 in code
chatgpt code:-- Define all weapon IDs and their corresponding slots local weaponIDs = { 0, 1, 2, 3, 4, 5, 6, 7, 8, -- Melee 17, 18, 19, -- Handguns 20, 21, 22, -- Shotguns 23, 24, 25, -- Sub-Machine Guns 26, 27, -- Assault Rifles 28, 29, -- Rifles 30, 31, 32, 33, -- Heavy Weapons 34, 35, 36, 37, -- Projectiles 38, 39, 40, -- Special 1 41, 42, -- Gifts 43 -- Satchel Detonator } -- Function to check if the player owns a weapon with a given ID local function playerHasWeapon(weaponID) local slot = weapon_idFromSlot(weaponID) return slot ~= -1 end -- Function to get the next weapon ID that the player owns local function getNextOwnedWeaponID(currentWeaponID) -- Find the index of the current weapon in the weaponIDs table local currentIndex for i = 1, #weaponIDs do if weaponIDs[i] == currentWeaponID then currentIndex = i break end end -- Iterate from the next index to find the next weapon the player owns for i = currentIndex + 1, #weaponIDs do if playerHasWeapon(weaponIDs[i]) then return weaponIDs[i] end end -- If no next owned weapon is found, loop from the beginning for i = 1, currentIndex - 1 do if playerHasWeapon(weaponIDs[i]) then return weaponIDs[i] end end return nil -- If no next owned weapon is found end -- Function to get the previous weapon ID that the player owns local function getPreviousOwnedWeaponID(currentWeaponID) -- Find the index of the current weapon in the weaponIDs table local currentIndex for i = 1, #weaponIDs do if weaponIDs[i] == currentWeaponID then currentIndex = i break end end -- Iterate from the previous index to find the previous weapon the player owns for i = currentIndex - 1, 1, -1 do if playerHasWeapon(weaponIDs[i]) then return weaponIDs[i] end end -- If no previous owned weapon is found, loop from the end for i = #weaponIDs, currentIndex + 1, -1 do if playerHasWeapon(weaponIDs[i]) then return weaponIDs[i] end end return nil -- If no previous owned weapon is found end -- Get the current weapon ID (replace this with your function) local currentWeaponID = weapon_currentId() -- Get the next and previous owned weapon IDs local nextOwnedWeaponID = getNextOwnedWeaponID(currentWeaponID) local previousOwnedWeaponID = getPreviousOwnedWeaponID(currentWeaponID) -- Store the next and previous weapon IDs in global storage store_int("nextWeaponID", nextOwnedWeaponID) store_int("prevWeaponID", previousOwnedWeaponID) -- Load the next and previous weapon IDs from global storage local loadedNextWeaponID = load_int("nextWeaponID") local loadedPrevWeaponID = load_int("prevWeaponID") -- Set the textures for the next and previous weapons local nextTexture = weapon_textureIcon(loadedNextWeaponID) local prevTexture = weapon_textureIcon(loadedPrevWeaponID) image_setTexture('t', nextTexture) image_setTexture('t2', prevTexture)