[FREE] [Open Source] Posters | Use For Graffiti, Adverts, Billboards Etc

Posters

A FiveM Poster system, designed for placing images on walls, all you need is a URL!

Video Preview

Streamable Link

Information

This is a “poster” system designed to allow people to create their own posters and draw them on any vertically flat surface. There are already a few of these systems out there, but I wanted to share a version that is free, and only requires really one dependancy (ox_lib).
This has QBCore code with ox_inventory items, feel free to fork and make your own framework/inventory version, I will not do so for you!

This version does not require you to input any image size data, it is automatically captured by the images url. All you need is a valid image URL. Thats it. The DUI will be created based on the images actual size.

This system is great for “graffiti” tagging, advertising your player owned business, billboards etc.

Dependencies

  • ox_lib
  • QBCore
  • ox_inventory

As I stated above, feel free to rework this how you would like with your own systems. You can even make it framework free.

Download

15 Likes

wow thats pretty cool, love it

1 Like

Another great script using DUIs!!

I was however wondering one thing after looking at the code. From what I saw (might have missed something), you load all DUIs at the same time. Isn’t there some sort of limit on how many can be loaded at the same time?

A few months ago I tried doing something with DUIs that would load them (create DUIs) only when the person was close to the object (using a grid system), but ended up it was lagging (lag spike / freezing and then returning) a lot when creating/destroying DUIs. Is this the reason you keep them all loaded?

Trying to figure out the best optimized way to deal with DUIs overall.

yet another W release

2 Likes

Hey cool script. Is it possible to make this job-related?

@Tugamars I havent experienced any issues with an exorbitant amount of DUI’s. Essentially I am using them the same as an NUI would. I think there are other factors involved. I do load and create the DUIs for any previously placed poster on player load, but I have not seen any issues with this.

The only crashes I have seen have been via the improper creation of a DUI, and the improper handle being given to a DestroyDUI call. As for FPS, I am using natives to draw them every tick when within radius, but as you can see in my video, FPS is not impacted. Resmon is obviously impacted, but as long as there isnt 50 posters next to each other, using this in a healthy way has not proved to have any downsides.

1 Like

I made the ESX version :slight_smile:
ESXposters.rar (1.4 MB)

4 Likes

qb inventory support please

2 Likes
RegisterNetEvent("posters:addNewImage", function(data)
    local Player = QBCore.Functions.GetPlayer(source)
    RegisteredSprays[#RegisteredSprays+1] = data
    TriggerClientEvent("posters:sendAddedImage", -1, data)
    --exports.ox_inventory:RemoveItem(source, "poster", 1)
    if not Player then return end
    Player.Functions.RemoveItem("poster", 1)
end)

lib.callback.register('posters:getImages', function(source)
    return RegisteredSprays
end)

RegisterNetEvent("posters:deleteImage", function(id, isOwner)
    local Player = QBCore.Functions.GetPlayer(source)
    for k,v in pairs(RegisteredSprays) do
        if v.id == id then
            table.remove(RegisteredSprays, k)
            TriggerClientEvent("posters:deleteClientImage", -1, id)
        end
    end
    if isOwner then
        --exports.ox_inventory:AddItem(source, "poster", 1)
        if not Player then return end
        Player.Functions.AddItem("poster", 1)
    end
end)
``` not tested

Well done, i will try

this works so thank you

make that for esx please :pray:

dude, read the comments, someone has already done it and posted the link

Waiting for the author to merge it but here you go : GitHub - FripeX/posters: A Poster system for FiveM using DUIs (ESX Version)

this is rad! would love if anyone has a full lj/qb-inventory conversion <3

qb-inventory support added.

thanks a lot