[Release] Inventory System v2.1 (Personal Menu)

Hello ! Nice script, again !

But, it seems the event
AddEventHandler(“playerDropped”, function()
updateQuantities()
end)

is not working for me… (And i think is normal, this is an server event and we trigger it in client…)

Can you add couchdb support

man i love this
made some fun stuff wiht it :slight_smile:
lockpick type 4 value 0
bodyarmor type 5 value 0
healkit type 6 value 0
repairkit type 3 value 0

carjack.rar (1.0 KB)
use this for lockpick and repair cars :slight_smile: most cars a looked now u cant carjack ,well u can if u shot em out of :slight_smile: for hit car sometime they come out can wanna paunch u hehe

cardmg u can make lower or higher it at 900 atm its fine for me

here full code
just add into your db the types(id need be same like shop :smiley:

function DrawMissionText(m_text, showtime)
    ClearPrints()
	SetTextEntry_2("STRING")
	AddTextComponentString(m_text)
	DrawSubtitleTimed(showtime, 1)
end

function ShowNotification(text)
	SetNotificationTextEntry("STRING")
	AddTextComponentString(text)
	DrawNotification(false, false)
end

function use(item)
    if (ITEMS[item].quantity - 1 >= 0) then
        -- Nice var swap for nothing
        TriggerEvent("player:looseItem", item, 1)
        -- Calling the Hunger/Thirst
        if ITEMS[item].type == 2 then
            TriggerEvent("food:eat", ITEMS[item])
        elseif ITEMS[item].type == 1 then
            TriggerEvent("food:drink", ITEMS[item])
        elseif ITEMS[item].type == 3 then 
            RepairVehicle()
	        elseif ITEMS[item].type == 4 then
            lockpick()
	        elseif ITEMS[item].type == 5 then
            armor()
		    elseif ITEMS[item].type == 6 then
            heal()
			elseif ITEMS[item].type == 7 then
            Toxicated()
            Citizen.Wait(3000)
            ClearPedTasks(GetPlayerPed(-1))
            Reality()
			
	        else
            -- Any other type? Drugs??????
            Toxicated()
            Citizen.Wait(3000)
            ClearPedTasks(GetPlayerPed(-1))
            Reality()
        end
    end
end


Citizen.CreateThread(function()
 
  -- Load the bouncer animation (testing)
  RequestAnimDict("mini@repair")
  while not HasAnimDictLoaded("mini@repair") do
    Wait(1)
  end
end)

------this asd only if u have probs wiht repair kit  rename   asd into RepairVehicle and rename RepairVehicle 2anything only can use 1 code and asd has no ainimation and only work inside the car--------
function asd()
	  Citizen.Wait(5000)
			SetVehicleFixed(GetVehiclePedIsUsing(GetPlayerPed(-1)))
			SetVehicleDeformationFixed(GetVehiclePedIsUsing(GetPlayerPed(-1)))
			SetVehicleUndriveable(GetVehiclePedIsUsing(GetPlayerPed(-1)), false)
		    ShowNotification("~g~Vehicle is fully Repaired.")
end

function RepairVehicle()
		Citizen.CreateThread(function()
		local ply = GetPlayerPed(-1)
		local plyCoords = GetEntityCoords(ply, 0)
		veh = GetClosestVehicle(plyCoords["x"], plyCoords["y"], plyCoords["z"], 5.001, 0, 70)
		--ClearPedTasksImmediately(GetPlayerPed(-1))
	    --TaskStartScenarioInPlace(GetPlayerPed(-1), "WORLD_HUMAN_VEHICLE_MECHANIC", 0, true)  
        TaskPlayAnim(GetPlayerPed(-1),"mini@repair","fixing_a_player", 8.0, 0.0, -1, 1, 0, 0, 0, 0)		
	    Citizen.Wait(20000)
		SetVehicleFixed(veh, 1)
		SetVehicleDeformationFixed(veh, 1)
		SetVehicleUndriveable(veh, 1)
		ClearPedTasksImmediately(GetPlayerPed(-1))
	  --  ShowNotification("~g~Vehicle is fully Repaired~r~Turn on Engine via Vehicle Menu Key:M or select")
		DrawMissionText("~g~Vehicle is fully Repaired. ~y~Turn on Engine via Vehicle Menu Key:M or select", 30000)
	end)
end

function lockpick()
		Citizen.CreateThread(function()
		local ply = GetPlayerPed(-1)
		local plyCoords = GetEntityCoords(ply, 0)
		veh = GetClosestVehicle(plyCoords["x"], plyCoords["y"], plyCoords["z"], 5.001, 0, 70)
        TaskPlayAnim(GetPlayerPed(-1),"mini@repair","fixing_a_player", 8.0, 0.0, -1, 1, 0, 0, 0, 0)		
		StartVehicleAlarm(veh)
	    Citizen.Wait(20000)
        SetVehicleDoorsLocked(veh, 1)
		ClearPedTasksImmediately(GetPlayerPed(-1))
	    --ShowNotification("~g~test")
		DrawMissionText("~y~You unlocked the vehicle", 15000)
		
	end)
end

function armor()
		Citizen.CreateThread(function()
	    Citizen.Wait(200)
        AddArmourToPed(GetPlayerPed(-1), 100)
		--ShowNotification("~g~test")
		DrawMissionText("~y~You use a new BodyArmor", 15000)
		
	end)
end

function heal()
		Citizen.CreateThread(function()
	    Citizen.Wait(200)
        SetPedMaxHealth(GetPlayerPed(-1), 200)
		SetEntityHealth(GetPlayerPed(-1), 200)
		--ShowNotification("~g~test")
		DrawMissionText("~y~You used a ~r~HealKit", 15000)
		
	end)
end

function Toxicated()
	  Citizen.Wait(5000)
	  DoScreenFadeOut(1000)
	  Citizen.Wait(1000)
	  ClearPedTasksImmediately(GetPlayerPed(-1))
	  SetTimecycleModifier("spectator5")
	  SetPedMotionBlur(GetPlayerPed(-1), true)
	  SetPedMovementClipset(GetPlayerPed(-1), "MOVE_M@DRUNK@SLIGHTLYDRUNK", true)
	  SetPedIsDrunk(GetPlayerPed(-1), true)
	  DoScreenFadeIn(1000)
end

function Reality()
  Citizen.Wait(500000)
  DoScreenFadeOut(1000)
  Citizen.Wait(1000)
  DoScreenFadeIn(1000)
  ClearTimecycleModifier()
  ResetScenarioTypesEnabled()
  ResetPedMovementClipset(GetPlayerPed(-1), 0)
  SetPedIsDrunk(GetPlayerPed(-1), false)
  SetPedMotionBlur(GetPlayerPed(-1), false)
end

2 Likes

2 Likes

No I don’t MySQL Asynchronous is sufficient :wink:

You got to help me Vodkhard or anyone else with this problem. I have followed the instructions on how to install the async libary but everytime i replace “require “resources/essentialmode/lib/MySQL”” with “require “resources/mysql-async/lib/MySQL”” it comes up with these errors on every single script i have so far :frowning:

You can’t use mysql async in every script, is not the same logic so you need to wait that the author make his script compatible or do it yourself :wink:

Thanks a lot! it make sense. I just took the instructions to literally ¯_(ツ)_/¯ I don’t think i’m good enough yet to convert the scripts myself. I do kinda understand the scripts (functions , events & etc.) but yea thanks for the quick answer :smiley:

1 Like

Update 10/06

Include PutInCoffre function who introduce my next release :wink:

1 Like

can you integrate these for new update

This tease woooooooooooooooooooooooooooooooooo

1 Like

You can check my new release here :wink: :
https://forum.cfx.re/t/realease-car-inventory-system-v1-10-06/

I have the problem that the database gets updated if a player dies, but the items are still in the inventory until reconnecting.

My friend manage to adapt hunger/thirst Hud the new inventory system(but he apparently disable canUse, i ask him later)
So now you can have the menu and the “putInCoffre” fonction work properly with your favorite hunger/thirst hud.

I’ll ask him tomorow if i can upload his modification or not, and if not, i will help you (a bit) to fix it by your own

Hey I want to create to usable Items…Handcuffs and Handcuffkeys…does anyone knows how to make that?
The main Problem is to create the usable Items…can anyone pls show me how to do this? ^^

Can anyone help me with the Translation of this mod, I try to translate this mod but for some reason the server breaks whenever I try to translate the stuff to English.

where would this be placed? i want to add lockpicks/bandage etc to my shop but how to implement them into usable items?

update to couchdb? :smiley:

1 Like

Can anyone shed any light on how to add bandages, repair kits, lockpicks etc. I’ve added them to my shop and can purchase them fine but how would i make lockpick usable on a car as i don’t want to eat or drink them, what usuable id would i give it in the database? Where would i add bensen2017 part of the script?

anybody have la life gameode I wanna convert those items he posted into that gamemode