[ESX] [FREE] esx_ammosystem

Welcome everyone! Today I release another one of my scripts.
I made ammo system which was inspired by some random servers. I asked them for the script but they didn’t give it to me :slightly_frowning_face: so I decided to create my own version of it which I want to share with you!

not many but some.

-Separated ammo types for different types of guns!
-Easy to change and add things script!
-I always offer my help below!


es_extended(obviously). Im using limit system just so you know

And that’s all!

I won’t post any pictures or anything. because It just removes ammo when you shoot a gun. I also tried to make it use as little resources as It could. It shouldn’t crash server or anything(I think…). So yeah. Enjoy!

And I will add that I will be updating later or if someone gives me an idea what could be better! (and yes I will be adding configs. and maybe some translations later on)


Update 1.0
-Changed a little bit how the setting ammo works(on GetHashKey and if you are holding a gun, not every server event there is)
-Slightly reduced the event overflow(if someone would ever get this)

My other work:

[Release] free Simple AI doctor - FiveM Resource Development & Modding / Releases - Cfx.re Community
[Release]esx_autorepairshop - FiveM Resource Development & Modding / Releases - Cfx.re Community


TriggerServerEvent inside while true loop, server goes boom


so true big boom!! :anguished: :anger: :boom:

I will add that I tested this script on more than just localhost. And server wasn’t doomed. And it only triggers when you are holding weapon. Its needed because well, I don’t know any other method for counting how many bullets you have in your inventory. And also Citizen.Wait(100) is because as I said to use as little resources as possible. I will be adding something like GetHashKey for it to be just triggering server event when you are holding one weapon and not all of them.

Edit: I updated script. Its using less server events and If you are holding a type of gun that is defined in setammo. Server is not going to crash. Just don’t touch any Citizen.Wait(100). or else you can get event overflow. Change them to higher values if you want tho!

I would post same reply like I posted above but forum does not let me. Read it if you can. Thanks!

sure but imagine you have 100 players, all have guns in their hand, sending events to server 10 times per second.
The resource usage on clients are minimal, but not the server

Don’t use script then. If 100 players have guns then well. You have good community there :joy:(I know its example, but still. Kinda shitty one.) You can change these numbers if you want. Bigger server can get other script or make it themselfs. Or just don’t use it. And it’s better if you have 10 events per second than 1000. Don’t you think? And you can add something like IfIsPedShooting after every if weapon==[…] so yeah. And if you have better solution then be my guest and tell me or just send here example of how would you solve it

sever trash of vietnam

And another one guy that thinks if he says “trash” he will be cool. No. You are still not cool. Go back to roblox.

ông ơi ! tôi dùng epic connect steam kiểu gì vậy ?

lỗi này xử lí như thế nào vậy a