#pan-containers

39 messages · Page 1 of 1 (latest)

mild sparrow
#

This is pan-containers, one of the first scripts I started from scratch a while ago and I am now working on a rewrite to clean up the spaghetti I did the first time around.

A little bit about how it works

There are 2 items added as of now, a gps and a key. When using a GPS you will begin placement and see a transparent shipping container model, there are 4 circle markers in the corners for some basic placement validation since the containers need clearance to drop from above. Once confirmed you are asked to label the container (and the key) to help keep organised. After labeling a cargobob spawns with an NPC some distance away and begins traveling toward the marked destination where the container will be dropped and an inventory will be accessible via a target option if the player has a correct key.

All containers are persistent through server restarts. You can make duplicates of keys to hand out at the locksmith in southside (not shown in the preview).

The script began as a sort of joke between friends about having storage containers delivered by NPCs via a cargobob. At the time I knew relatively little about lua and fivem scripting so seemed like a decent project to learn with. It was made for QB-Core using qb-inventory and qb-target, but the rewrite will be using ox-inventory and ox-target instead. It is roughly 60-70% done I'd say.

Preview

Big ol' thanks to @frozen lichen for the preview video!
Any thoughts and feedback is welcome! :)

mild sparrow
#

pan-containers

neat cliff
#

and also menu is like this

#

matadata is not visble like in the video Preview

mild sparrow
#

Anything in client or server console? Was definitely working before posting, but maybe I missed something uploading to github

#

hmm seems to be working on my local, can you give a bit more info on the server you're running? core, inv (whether its just a reskin of ox or also renamed) etc.

neat cliff
#

no remamed

mild sparrow
#

Can you go to the resource start event at client/client.lua:476 and add prints like this

AddEventHandler('onResourceStart', function(resourceName)
    if (GetCurrentResourceName() ~= resourceName) then return end
    TriggerServerEvent('pan-containers:server:loadcontainertargets')
    lib.print.debug('Print 1')
    ox_inventory:displayMetadata('keylabel', 'Label')
    lib.print.debug('Print 2')
end)
#

then restart the script and check client console if you can see both of em

#

(also make sure you run set ox:printlevel:pan-containers "debug" before restarting )

neat cliff
mild sparrow
#

did you set print level? should see 2 debug ones and a verbose one

neat cliff
mild sparrow
#

oh client console*

neat cliff
mild sparrow
#

hmm, what version of ox inventory is that?

#

Also definitely ensuring pan-containers after all dependancies? Cause I can't see another reason why metadata wouldnt be shown

neat cliff
neat cliff
mild sparrow
#

any errors in server console when starting the script?

mild sparrow
#

Do you get all these prints in server console if you move the key in your inventory?

neat cliff
neat cliff
#

i have a suggestion
when it comes to rp many player may lose their key and there is not way to replicate the key
in keycuting ped
and my suggestion is instead of only showing the key which are in player inventorycan you make it show every key of the player (not require to have the key to replacate it ) will more usefull

frozen lichen
#

You can make a copy of the key at the key shop, and give those to other players. It'll then show them where that container is.

neat cliff
#

what if the player lost the key before he make the copy of the key ? than there is noway for the player to access the container without the key

frozen lichen
#

I understand - good point

nocturne cosmos
neat cliff
nocturne cosmos
#

private edit or public?

neat cliff
mild sparrow