Update open.lua
This commit is contained in:
		
							parent
							
								
									efaef09a83
								
							
						
					
					
						commit
						8d321f20cf
					
				
					 1 changed files with 47 additions and 52 deletions
				
			
		|  | @ -55,60 +55,55 @@ if not Config.UseOldSlingScript then | |||
|     end | ||||
|  | ||||
|     -- INVENTORY HAS ITEM CHECK | ||||
|     function CheckHasWeapon(Weapon) | ||||
|         if GetResourceState("qs-inventory") == 'started' then | ||||
|             local count = exports['qs-inventory']:Search(Weapon) | ||||
|             if count > 0 then | ||||
|                 return true | ||||
|             else | ||||
|                 return false | ||||
|             end | ||||
|         elseif GetResourceState("qb-inventory") == 'started' then | ||||
|             return exports['qb-inventory']:HasItem(Weapon) | ||||
|         elseif GetResourceState("ps-inventory") == 'started' then | ||||
|             return exports['ps-inventory']:HasItem(Weapon) | ||||
|         elseif GetResourceState("ox_inventory") == 'started' then | ||||
|             local count = exports.ox_inventory:GetItemCount(Weapon) | ||||
|             if count > 0 then | ||||
|                 return true | ||||
|             else | ||||
|                 return false | ||||
|             end | ||||
|         elseif GetResourceState("tgiann-inventory") == 'started' then | ||||
|             local count = exports["tgiann-inventory"]:Items(Weapon) | ||||
|             print("Miho output... \n Weapon: "..Weapon) | ||||
|  | ||||
|             if count then | ||||
|                 return true | ||||
|             else | ||||
|                 return false | ||||
|             end | ||||
|         elseif GetResourceState("core_inventory") == 'started' then | ||||
|             if Framework == "QBCore" then | ||||
|                 local citizenid = FWork.Functions.GetPlayerData().citizenid | ||||
|                 local Primary = exports['core_inventory']:getItems('primary-' .. citizenid, Weapon) | ||||
|                 local Secondry = exports['core_inventory']:getItems('secondry-' .. citizenid, Weapon) | ||||
|                 if Primary > 0 or Secondry > 0 then | ||||
|                     return true | ||||
|                 else | ||||
|                     return false | ||||
|                 end | ||||
|             else | ||||
|                 return false | ||||
|             end | ||||
|         elseif Framework == "QBCore" then | ||||
|             local FinalValue = false | ||||
|             local items = FWork.Functions.GetPlayerData().items | ||||
|             for _, v in pairs(items) do | ||||
|                 if v.name ~= nil then | ||||
|                     if tostring(v.name) == tostring(Weapon) then | ||||
|                         FinalValue = true | ||||
|                     end | ||||
|                 end | ||||
|             end | ||||
|             return FinalValue | ||||
| function CheckHasWeapon(Weapon) | ||||
|     if GetResourceState("qs-inventory") == 'started' then | ||||
|         local count = exports['qs-inventory']:Search(Weapon) | ||||
|         if count > 0 then | ||||
|             return true | ||||
|         else | ||||
|             return false | ||||
|         end | ||||
|     elseif GetResourceState("qb-inventory") == 'started' then | ||||
|         return exports['qb-inventory']:HasItem(Weapon) | ||||
|     elseif GetResourceState("ps-inventory") == 'started' then | ||||
|         return exports['ps-inventory']:HasItem(Weapon) | ||||
|     elseif GetResourceState("ox_inventory") == 'started' then | ||||
|         local count = exports.ox_inventory:GetItemCount(Weapon) | ||||
|         if count > 0 then | ||||
|             return true | ||||
|         else | ||||
|             return false | ||||
|         end | ||||
|     elseif GetResourceState("tgiann-inventory") == 'started' then | ||||
|         -- Fixed implementation for tgiann-inventory | ||||
|         return exports["tgiann-inventory"]:HasItem(Weapon, 1) | ||||
|     elseif GetResourceState("core_inventory") == 'started' then | ||||
|         if Framework == "QBCore" then | ||||
|             local citizenid = FWork.Functions.GetPlayerData().citizenid | ||||
|             local Primary = exports['core_inventory']:getItems('primary-' .. citizenid, Weapon) | ||||
|             local Secondry = exports['core_inventory']:getItems('secondry-' .. citizenid, Weapon) | ||||
|             if Primary > 0 or Secondry > 0 then | ||||
|                 return true | ||||
|             else | ||||
|                 return false | ||||
|             end | ||||
|         else | ||||
|             return false | ||||
|         end | ||||
|     elseif Framework == "QBCore" then | ||||
|         local FinalValue = false | ||||
|         local items = FWork.Functions.GetPlayerData().items | ||||
|         for _, v in pairs(items) do | ||||
|             if v.name ~= nil then | ||||
|                 if tostring(v.name) == tostring(Weapon) then | ||||
|                     FinalValue = true | ||||
|                 end | ||||
|             end | ||||
|         end | ||||
|         return FinalValue | ||||
|     end | ||||
| end | ||||
|  | ||||
|  | ||||
|     local function CheckJobVerified() | ||||
|         local PlayerJob = Config.FrameworkFunctions.GetPlayer().PlayerData.job.name | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nordi98
						Nordi98