Added a bit in the sql that adds the items for sale in the Liquor store. (if you don’t use this system just remove that section of the sql)
Thanks massively to @JiminyKroket for these changes!
What is this?
This resource is basically abit of a fix up of the existing eden_accessories. I have translated it fully to English, Fixed the SQL and made sure the attachments now work as items.
This allows you to purchase weapon attachments from a shop of your choosing (default configured to the liquor store)
Then equip a weapon and then use the attachment in your inventory that then puts the attachment on the gun you’re holding. It then removes the attachment from you inventory but when you take it off you get it back.
Super simple!
Planned Features :
(Added/ESX Supports this by default now) Weapon Attachments saving to the gun via DB
I installed this and it works great but it seems my hunger bar stopped working. I disabled the script and it is still not working. Have you had this happen before? I have no errors and didn’t have any issues before installing.
Not sure what the original author did but oh well here’s some feedback:
You forgot to add “USE `essentialmode`;” in your SQL file and the `price` column is not a default column. Which means people won’t be able to run it unless they’ve added that column. And they will most likely send you screenshots of their errors. (It’s very simple to fix but you know how people are…)
You have an empty config file that you don’t use
You have a couple of unused xPlayer variables in the server file
I suggest you look into something called tables to narrow your code down. Having hundreds lines of code that pretty much does the same thing is not something you want to have. (Talking about these):
GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_SUPP"))
ESX.ShowNotification(("You have equipped your suppressor. Re-equip this next time you're in the city."))
used = used + 1
i know it doesnt but for some reason when i load it in my hunger stops working every time. just wanted to see if you anyone else had this problem or if there was something i could do.
I’m glad he didn’t put that in. I’ve never used a database named essentialmode and it’s not needed. If it’s not there, those that don’t use that for a database name won’t need to edit it out and those that do, don’t need to edit it in. It will just work.
As far as checking the player’s inventory for an item, use this snippet of code I found for reference.
if not GUI.IsOpen then --checking if phone hud is already present
ESX.TriggerServerCallback('esx_phone:getItemAmount', function(qtty)
if not ESX.UI.Menu.IsOpen('phone', GetCurrentResourceName(), 'main') and qtty > 0 then
ESX.UI.Menu.CloseAll()
ESX.UI.Menu.Open('phone', GetCurrentResourceName(), 'main')
else
ESX.ShowNotification("~r~You do not have a phone \n~b~(Buy one from a nearby shop)")
end
end, 'phone')
end
You’re giving me feedback on my feedback?.. That’s great, instead of giving the author some feedback.
It’s not needed? That depends on how you run the SQL query and you unfortunately can’t assume every user will run it in the selected database.
People will of course have to change that name if they’re using something else. But most of the ESX users does have a database called Essentialmode.
It’s of course up to the author to do whatever he think is necessary. I just know out of experience that some people might contact him and ask him about the error.
yup i got the new one, they do remove and go back to inventory but im talking about when you attach it, so when you attach it your inventory menu is still up, if you close inventory with escape it doesnt put on the attachment. not a big deal though