GithubHelp home page GithubHelp logo

iondegen / ps-inventory Goto Github PK

View Code? Open in Web Editor NEW
57.0 6.0 26.0 4.99 MB

Project-Sloth's FiveM Inventory System Redesigned to Look Like NoPixel 4.0

License: GNU General Public License v3.0

Lua 49.54% CSS 9.90% JavaScript 37.16% HTML 3.40%

ps-inventory's Introduction

ps-inventory

Project-Sloth's FiveM Inventory System Redesigned to Look Like and Feel like NoPixel 4.0

I removed the item images for my own sanity while uploading the changes. So please use your own item images

Preview

image

Credit where Credit is Due

Thanks to loljoshie for originally creating the lj-inventory we've all come to love.

Thanks to ok1ez and the project sloth dev team for continuing lj-inventory's existence with keeping it up to date and maintaining it as ps-inventory.

Thanks to root_ for making the items actually droppable with their respective props.

Thanks to the Project Sloth Community. Without the support on the first version this release wouldn't be possible.

Importing

If you've downloaded the previous version, I've included descriptions / tags above all the UI Changes i've made so you can easily convert over but below will be certain snippets if you'd like to add things yourself without inspecting the code.

Personal Information Snippet

-- Client-Side LUA --

QBCore.Functions.TriggerCallback('inventory:server:ConvertQuality', function(data) inventory = data.inventory other = data.other SendNUIMessage({ action = "open", inventory = inventory, slots = Config.MaxInventorySlots, other = other, maxweight = Config.MaxInventoryWeight, Ammo = PlayerAmmo, maxammo = Config.MaximumAmmoValues, Name = PlayerData.charinfo.firstname .." ".. PlayerData.charinfo.lastname .." - [".. GetPlayerServerId(PlayerId()) .."]", pName = PlayerData.charinfo.firstname .. PlayerData.charinfo.lastname, pNumber = PlayerData.charinfo.phone, pCID = PlayerData.citizenid, pID = GetPlayerServerId(PlayerId()), })

QBCore.Functions.TriggerCallback('inventory:server:ConvertQuality', function(data) inventory = data.inventory other = data.other SendNUIMessage({ action = "open", inventory = inventory, slots = Config.MaxInventorySlots, other = other, maxweight = Config.MaxInventoryWeight, Ammo = PlayerAmmo, maxammo = Config.MaximumAmmoValues, Name = PlayerData.charinfo.firstname .." ".. PlayerData.charinfo.lastname .." - [".. GetPlayerServerId(PlayerId()) .."]", pName = PlayerData.charinfo.firstname .. PlayerData.charinfo.lastname, pNumber = PlayerData.charinfo.phone, pCID = PlayerData.citizenid, pID = GetPlayerServerId(PlayerId()), })

-- HTML --

Name :
Player-Name
Phone Number :
Player-Phone-Number
State ID :
Player-State-ID
Citizen ID :
Player-Citizen-ID

-- JS --

$(".player-name-title").html('Name'); $(".player-name").html(data.pName); $(".phone-number-title").html('Phone Number'); $(".phone-number").html(data.pNumber); $(".player-id-title").html('State ID'); $(".player-id").html(data.pID); $(".citizen-id-title").html('Citizen ID'); $(".citizen-id").html(data.pCID);

-- CSS --

.ply-number-line { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; background-color: rgb(137, 245, 169) !important; border: 1px solid rgba(55, 55, 55, 1); box-shadow: 0 0 1vh rgba(0, 0, 0, 0.3); top: 75%; margin-left: 6%; height: 5.6vh; width: 0.7vh; }

.player-name-title { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.6vh; color: rgb(160, 160, 160); top: 73.5%; margin-left: 6%; font-weight: 300; }

.player-name { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.95vh; color: white; top: 75%; margin-left: 6%; font-weight: 300; }

.phone-number-line { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; background-color: rgb(214, 137, 245) !important; border: 1px solid rgba(55, 55, 55, 1); box-shadow: 0 0 1vh rgba(0, 0, 0, 0.3); top: 75%; margin-left: 17.5%; height: 5.6vh; width: 0.7vh; }

.phone-number-title { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.6vh; color: rgb(160, 160, 160); top: 73.5%; margin-left: 17.5%; font-weight: 300; }

.phone-number { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.95vh; color: white; top: 75%; margin-left: 17.5%; font-weight: 300; }

.player-id-line { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; background-color: rgb(137, 232, 245) !important; border: 1px solid rgba(55, 55, 55, 1); box-shadow: 0 0 1vh rgba(0, 0, 0, 0.3); top: 85%; margin-left: 6%; height: 5.6vh; width: 0.7vh; }

.player-id-title { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.6vh; color: rgb(160, 160, 160); top: 83.5%; margin-left: 6%; font-weight: 300; }

.player-id { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.95vh; color: white; top: 85%; margin-left: 6%; font-weight: 300; }

.citizen-id-line { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; background-color: rgb(245, 207, 137) !important; border: 1px solid rgba(55, 55, 55, 1); box-shadow: 0 0 1vh rgba(0, 0, 0, 0.3); top: 85%; margin-left: 17.5%; height: 5.6vh; width: 0.7vh; }

.citizen-id-title { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.6vh; color: rgb(160, 160, 160); top: 83.5%; margin-left: 17.5%; font-weight: 300; }

.citizen-id { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.95vh; color: white; top: 85%; margin-left: 17.5%; font-weight: 300; }

Basic Damage / Health Snippet

-- Client-Side LUA --

local stress = 0

RegisterNetEvent('hud:client:UpdateStress', function(newStress) -- Add this event with adding stress elsewhere stress = newStress end)

QBCore.Functions.TriggerCallback('inventory:server:ConvertQuality', function(data) inventory = data.inventory other = data.other SendNUIMessage({ action = "open", inventory = inventory, slots = Config.MaxInventorySlots, other = other, maxweight = Config.MaxInventoryWeight, Ammo = PlayerAmmo, maxammo = Config.MaximumAmmoValues, Name = PlayerData.charinfo.firstname .." ".. PlayerData.charinfo.lastname .." - [".. GetPlayerServerId(PlayerId()) .."]", pName = PlayerData.charinfo.firstname .. PlayerData.charinfo.lastname, pNumber = PlayerData.charinfo.phone, pCID = PlayerData.citizenid, pID = GetPlayerServerId(PlayerId()), pStress = stress, pHealth = 200 - GetEntityHealth(PlayerPedId()), })

QBCore.Functions.TriggerCallback('inventory:server:ConvertQuality', function(data) inventory = data.inventory other = data.other SendNUIMessage({ action = "open", inventory = inventory, slots = Config.MaxInventorySlots, other = other, maxweight = Config.MaxInventoryWeight, Ammo = PlayerAmmo, maxammo = Config.MaximumAmmoValues, Name = PlayerData.charinfo.firstname .." ".. PlayerData.charinfo.lastname .." - [".. GetPlayerServerId(PlayerId()) .."]", pName = PlayerData.charinfo.firstname .. PlayerData.charinfo.lastname, pNumber = PlayerData.charinfo.phone, pCID = PlayerData.citizenid, pID = GetPlayerServerId(PlayerId()), pStress = stress, pHealth = 200 - GetEntityHealth(PlayerPedId()), })

-- JS -- $(".skull-damage").html('Stress : '); $(".skull-damage-title").html(data.pStress);

$(".body-damage").html('Damage : '); $(".body-damage-title").html(data.pDamage + "%");

-- HTML --

player-body

-- CSS --

/* Player Body */ .player-body-container { position: absolute; bottom: 27.8%; margin: 0 auto; left: -65%; right: 0; text-align: center; width: 15%; height: 55%; padding: 10%; }

.player-body { position: absolute; bottom: 48%; margin: 0 auto; left: -23%; right: 0; text-align: center; width: 15%; height: 45%; }

/* Player Body & Health */ #player-damage-container { position: absolute; display: none; user-select: none; width: 100%; height: 100%; }

.skull-damage-title { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.35vh; color: white; top: 20.5%; margin-left: 22%; font-weight: 300; opacity: 0; transition: opacity 0.5s; z-index: 1; }

.skull-damage { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.35vh; color: white; top: 20.5%; margin-left: 20%; font-weight: 300; opacity: 0; transition: opacity 0.5s; z-index: 1; }

.skull-damage-line { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; background-color: rgb(255, 255, 255) !important; border: 1px solid rgba(55, 55, 55, 1); box-shadow: 0 0 1vh rgba(0, 0, 0, 0.3); top: 20.5%; margin-left: 23%; height: 7.6vh; width: 0.2vh; rotate: 90deg; opacity: 0; transition: opacity 0.5s; z-index: 1; }

.skull-damage-container:hover .skull-damage, .skull-damage-container:hover .skull-damage-title, .skull-damage-container:hover .skull-damage-line { opacity: 1; }

.body-damage-title { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.35vh; color: white; top: 28%; margin-left: 13%; font-weight: 300; opacity: 0; transition: opacity 0.5s; z-index: 1; }

.body-damage { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; padding: 1%; font-size: 1.35vh; color: white; top: 28%; margin-left: 10.5%; font-weight: 300; opacity: 0; transition: opacity 0.5s; z-index: 1; }

.body-damage-line { overflow: hidden; position: absolute; font-family: 'Oswald', sans-serif; background-color: rgb(255, 255, 255) !important; border: 1px solid rgba(55, 55, 55, 1); box-shadow: 0 0 1vh rgba(0, 0, 0, 0.3); top: 28%; margin-left: 13.5%; height: 7.6vh; width: 0.2vh; rotate: 90deg; opacity: 0; transition: opacity 0.5s; z-index: 1; }

.body-damage-container:hover .body-damage, .body-damage-container:hover .body-damage-title, .body-damage-container:hover .body-damage-line { opacity: 1; }

ps-inventory's People

Contributors

iondegen avatar i-kulgu avatar

Stargazers

Nat avatar Enigmatiic avatar  avatar Mert Ayhan avatar Glen Klijn avatar  avatar  avatar  avatar Jeay avatar FoxDevelopment avatar Anas Mazouni avatar Madsen avatar ND0P avatar  avatar Thiago Turco avatar  avatar Chas avatar  avatar MrBerk avatar  avatar Erick avatar Ryuukii avatar Sugarberry avatar Dekwer avatar Mr panda king avatar  avatar Keekay D avatar Magu avatar  avatar Mist the Goat avatar  avatar Ilham Wicaksono avatar  avatar Aladin Chaouachi avatar  avatar  avatar HelixHEX avatar  avatar SpMex avatar Atikur Rahaman Santo avatar 0zul avatar Xennare avatar P-lauski avatar Kocaka avatar .DK. avatar RemoSpys avatar  avatar Guardian avatar  avatar Kar avatar _root avatar rpRIGGS avatar toby avatar Nikola Yordanov avatar  avatar Eivor avatar  avatar

Watchers

 avatar .DK. avatar Tiɱɱỿ avatar  avatar  avatar  avatar

ps-inventory's Issues

robbing another player

so... basically if you try to rob someone
1.bag is not showing up so you cant rob anything inside the bag
2.player pockets is not showing up too

so i fixed the bag by removing it (cuz i didn't like it anyway so its doesn't matter)
but the pocket, im starting to see if i can add the another player pocket to show up but i don't know if i can do it or not

if there is any way to fix it please do it.

also you can't rob the money (atleast i don't know how)

trunk problem

MainThrd/ error during NUI callback CloseInventory: @qb-inventory/client/main.lua:897: attempt to call a nil value (global 'CloseTrunk')

got this on the inventory any thing what do i wrong game freeze totaly if i wil look in trunk from cars

Images doesn't work.

When i put my images from my other inv to the new, it just doesn't work in game.
Don't see my images in the inventory.

Some slots looks like you can type in it

so in the backpack or some of the slots when you hover over them or try and grab and item your mouse start to turn into the type mouse like you can type in the slots also in some of the slots you have to find the right spot to grab item like it shows up real fast then goes away. One more thing with the 1 2 3 4 5 slots can't you go back to the one you had the first time where it was on the left like it was in the pocket if you no what i mean thanks for reading this

20240205104533_1

Drag item

If you drag an iitem next to backpack text, it will use item.
split item doesn't work if you use input value manually.

Item description

Hello is there a fix for the issue where the item description goes behind the inventory and gets hidden? Maybe a way to make it fixed in the bottom right

Several Problems

Hello,
There are several Problems with this Inventory that makes it almost useless. Players Can hide their Items in the Backpack Area & in the Blank Slots that are left and right of the body. Maybe make them normal inventory slots? Or make the different slots accessible for other players to see. Maybe add the Quickslots to the left pouch too.

Except these Issues It would be a perfect Inventory

Weapon Attachments

This inventory isn't detecting any weapon attachments, nor am I able to remove them.

Every event is calling ps-inventory and the resource has been correctly installed to my knowledge.

Any updates regarding this issue soon? If not are there any workarounds in the meantime?

Serial Number always the same

Hi, after taking out a gun from the qb-policejob armory the serial number of the gun is always the same as the gun you already have in your inventory. Example: You have a pistol with s. number 1234 and you want to take out the same pistol. After taking it out both of the pistols have the s. number of 1234.. Any fix?

4k / 2k Support Request

Would it be possible to add 4k and 2k support for this ui? Even the original ui for ps-inventory has this issue, kind of ruins it for 2k/4k players.
Screenshot 2024-05-15 152203

UI Breaks on Higher Res

So on 1080p it works perfect. When you go up to 1440p and 4k is breaks the UI.
image
Here is an example of 1440p
image
and here is 1080p

any help is appreciated!

Craft don't work

The crafting system doesn't work nothing happen when we press E for the weapons attachment and the normal craft

when i drop item on groung and take back its gona missing how can i fix it

[ script:qb-inventory] SCRIPT ERROR: @qb-inventory/server/main.lua:991: attempt to call a nil value (global 'OnDropUpdate')
[ script:qb-inventory] SCRIPT ERROR: @qb-inventory/server/main.lua:931: attempt to call a nil value (global 'OnDropUpdate')

when i drop item on groung and take back its gona missing how can i fix it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.