[Release] esx-ecobottles, retrieve bottles, sell bottles

This is a script that makes you able to retrieve bottles from all trashbins around the map, you then sell them for a small price at the mall in the ghetto. Positions are changed in Coordinates table.

If you find any bug feel free to comment down below.
If you wanna give feedback on improvements feel free to comment down below.

Download

esx-ecobottles

Preview

29 Likes

This can be useful, Keep it up man!!

najs script :clap: (20 char)

Thanks, ye very simple but cool function :thinking:

Hey,
where we can change the price?
can you add a TriggerClientEvent(“pNotify:SendNotification”, source, {?
cordially

Server.lua,

local randomMoney = math.random(1, 4)
1 Like

Ty Qualle_H1z1…

Nice script keep up the good ideas

2 Likes

Hi! I tried to add more objects but when I add them nothing happens. I can’t even interract with the new props just the old ones that are already in.

I added them here:

        local entity, distance = ESX.Game.GetClosestObject({
            'prop_bin_01a',
            'prop_bin_03a',
            'prop_bin_05a',
            'prop_bin_04a',
			'prop_bin_11a',
			'prop_bin_11b',
			'prop_bin_12a',
			'prop_bin_13a',
			'prop_bin_14a',
			'prop_bin_14b',
			'prop_bin_delpiero',
			'prop_bin_delpiero_b',
			'prop_bin_beach_01d',
			'prop_cs_bin_01',
			'prop_cs_bin_01_lid',
			'prop_cs_bin_01_skinned',
			'prop_cs_bin_02',
			'prop_cs_bin_03',
        })
2 Likes

Seems wierd should work, all of em is real entitys?

I copied them from there https://gist.github.com/leonardosnt/53faac01a38fc94505e9 Can you add these bins in your script?

Try getting rid of your last comma?
:woman_shrugging:

Awesome resource! Can’t wait to see more of your work.

Do I have? The guy who wrote the script didn’t do that but I try it out.

Great job, lets try.

thank you for release. Very interactive for rp servers

Curious How you got the background on yours like in the picture


Mine ^^
image
Yours…

It’s because my ESX.Game.Utils.DrawText3D is remade to fit to my notifications.

Im using drawRct

@KrizFrost

    local factor = (string.len(text)) / 370
    DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 41, 11, 41, 68)

Add that to your DrawText function. ^^^

function DrawText3D(x,y,z, text)
    local onScreen,_x,_y=World3dToScreen2d(x,y,z)
    local px,py,pz=table.unpack(GetGameplayCamCoords())
    SetTextScale(0.35, 0.35)
    SetTextFont(4)
    SetTextProportional(1)
    SetTextColour(255, 255, 255, 215)
    SetTextEntry("STRING")
    SetTextCentre(1)
    AddTextComponentString(text)
    DrawText(_x,_y)
    local factor = (string.len(text)) / 370
    DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 41, 11, 41, 68)
end

It should look something like that^^^

2 Likes

I’m expanding this script to possibly find things like cigarettes, alcohol, etc.
Do u want pull request or separate it, because it will not be just “ecobottles” anymore?