[Release][ES] Weapon Store [v1.1]

There is some code where I check if it is the first time the player logs in. You can move the code to get weapons there. Then when he dies, no weapons are given

AddEventHandler('playerSpawned', function(spawn)
if firstspawn == 0 then
	ShowWeashopBlips(true)
	firstspawn = 1
end
TriggerServerEvent("weaponshop:playerSpawned", spawn)
end)

Into

AddEventHandler('playerSpawned', function(spawn)
if firstspawn == 0 then
	ShowWeashopBlips(true)
	firstspawn = 1
TriggerServerEvent("weaponshop:playerSpawned", spawn)
end
end)

That should work.

1 Like

yes but what ajout for a dies spawn because actualy itā€™s not work

Not sure if you just copy pasted that codeā€¦ But it was wrong, i changed the mistake of my copy/paste

itā€™s good thx hoegarden

Can you explain where you copy this code ? Thanks !

1 Like

There problem here is that weapons come back after the player reconnectā€¦
We need to clear the database after the player death.

1 Like

Well that is up to you. People here wanted the weapons stored.

On my server, i donā€™t even store the weapons in the database.

How do you not store the weapon in your database

Hi man,

Thanks a lot for sharing that plugin!
I havenā€™t manage to find where that code goes, can you give me a hand?

Iā€™ll try to make the query to clear the DB when the player die, if it works (& if you want) I can send it to you so you update the script :wink:

Cheers,

Could you tell us how to disable storing in database ?

1 Like

Hi,

Thanks again for sharing the script. I added it to my server, the database stuff works (I have the weapon when I join the serv), but I can buy the gun in shops. Have you any lead?

Cheers,

There is a limit to the number of weapons. This is for RP purpose.
@Ryload Disabling the weapon storage is possible, but if you want to keep the max number of weapons, you need to store it in the player.lua.

I can post code for that, but it will be with very limited support.

1 Like

Yeah itā€™s okay, share the code then buddy :stuck_out_tongue:

1 Like

Okay Iā€™ve followed the Instructions to the letter and the area you use to buy weapons is not there in the weapons shops. I see you dont need the changes in the player.lua file anymore. Iā€™ve seen this working in other servers and have been at the same shops. So not even sure what to ask for assistance at this point.

Yes the changes in player.lua is only if you donā€™t use the database (Like on my server)
Just make sure the database is correct and do you see any errors when running the server ?

Okay so I donā€™t need that then I am using a DB server. I confirmed the the login info as correct.(Got the simple banking mod working and compared the info with that as well.) I see the message from Roberto ā€œYour weapons have been returnedā€ when logging in. I donā€™t see the info when the server is starting up as Iā€™m not hosting the server locally,using a VPS. No error messages in the console in game either.

Againā€¦ the script is in FRā€¦

Why not EN?? ā€¦

Can you tell me where it is still in french ?

Menā€¦ all script in this forum i trad in french. why you donā€™t trad ? go work a little dude --"

4 Likes

I have this working perfectly, it saves to db, but Id like it not to keep weapons forever, only sessionā€¦ how can this be done?