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

Hello,

This will be my first release here. YEY. :kissing_heart:

First before you can use this mod, you need Essential Mode. This mod is basicly a modified vehicle shop from here.
(I see in Github that they merged the shops in the es_freeroam folder. Contact me if this can be added.)
So most of the credits will go to the creator to that script.
The mod is now in ENGLISH

What is inside the shop ?
Most of the weapons + some DLC weapons (I removed some DLC weapons but not all
)

Since this is an Essential Mode mod, All the weapons cost some money.

Also the player will stay in the shop as long as he has not reached the maximum. This allows the player to be more efficient in the shop (and spend more money :smiling_imp:)

You can find all the code here : https://github.com/boermansjo/es_weashop

NEW
Weapons are now stored in the database. When the player spawn ingame, the weapons are giving to the player.

Changelog (13-4-2017)

  • [X] Removed the changes needed in player.lua. Mod is now 100% copy/paste

  • [X] Save all the weapons to the database
  • [X] Weapons are given back to the player when he dies or login.
  • [X] Getting weapons back from Roberto cost money. The cost is the price of the weapon/100. (Can be changed)

Installation

  1. Extract the folder and rename it to es_weashop
  2. Place the folder in your resource folder
  3. Add - es_weashop to your citmp-server.yml
  4. Change the mysql connection in sv_weashop.lua
  5. Run the sql.sql into your database
  6. Restart your server
  7. Have fun.

Setup

Changing the limit of weapons :
Open sv_weashop.lua and change the line :
local max_number_weapons = 6

Change the cost of withdrawing the weapons :
Open sv_weashop.lua and change the line :
local cost_ratio = 100

You can add your own blips on the map. If you want to change color of the blip, use this :

SetBlipColour(blipID, color)

If there are any questions or problems, let me know.

Greetings,
Hoegarden31

[details=Summary]
TODO :

  • add a preview while in shop (like the vehicle shop). Not included yet, because it is tricky to do.
  • Check if player has bought the weapon already. This code is in comment because the native client command doesn’t work
 If some hero’s are here who can fix that I would appreciate.
function DoesPlayerHaveWeapon(model,button,y,selected, source)
		local t = false
		local hash = GetHashKey(model)
		--t = HAS_PED_GOT_WEAPON(source,hash,false) --Check if player already has selected weapon !!!! THIS DOES NOT WORK !!!!!
		if t then
			drawMenuRight("OWNED",weashop.menu.x,y,selected)
		else
			drawMenuRight(button.costs.." €",weashop.menu.x,y,selected)
		end
end
```[/details]
21 Likes

Thanks for your release :slight_smile:

1 Like

bonjours tout dabort merci pour ton mod, je les instaler mai il ni a pas de pnj et pas d’action dans le magasin d’arme, comment puis-je faire ?
c’est aussi sur cette partie que je bloque je ne c’est pas ou ca ce trouve : Add “pl.nb_weapons = 0” into the player class of the Essential Mode.

First of all thank you for your mod, I can install them there it nor has no pnj and no action in the weapon store, how can I do?
It is also on this part that I block it I do not it or it finds: Add “pl.nb_weapons = 0” into the player class of the Essential Mode.

1 Like

Well yes, there is no npc or weapon action in the shop. This shop does not work like the cars one. Loading models of weapons does not work like I would.
The line you need to change is in the file : resources\essentialmode\server\classes\player.lua
Next, just check the example. That line is used to keep track on how many weapons you bought.

1 Like

Salut j’ai bien suivis les Ă©tapes du tuto, donc j’ai trouver le marqueur pour acheter, le menu fonctionne bien, pareille pour l’argent qui est dĂ©duis mais le problĂšme c’est que quand nous achetons n’importe quel arme elle nous ai pas donnĂ©.
Ensuite il y aurait moyen de pouvoir ajuster ton script et les mettre dans les Ammu Nation au lieu de les mettre dans un quartier ?

Hi I have followed the steps of the tutorial, so I find the marker to buy, the menu works well, the same for the money that is deducted but the problem is that when we buy any weapon it We did not give.
Then there would be a way to adjust your script and put them in the Ammu Nation instead of putting them in a neighborhood?

Thank you so much <3

1 Like

You can change the shop where you want in weashop.lua
line :
{entering = {74.504,-1971.366,19.788}, inside = {70.529,-1975.843,50.837}, outside = {74.504,-1971.366,19.788}},

Also the weapons are given to the player like it should be :

I start with only the knife :

I start to buy weapons (sniper in action) :

Once you exit the store, all the weapons are there and can be used:

Please, note that some weapons are in the list, but doesn’t work. These are DLC weapons and are probably not included in FiveM yet.
I will update the mod tomorow to remove these weapons. And add the heavy ones also.

Doesn’t work. :smile: When i buy a weapon.

are you going to add these weapon shops on every store eventually or just one?

Salut, et bien j’ai bien suivis ton tuto mais sa ne marche toujours pas, l’arme s’achùte bien mais dans la roue des armes elle n’y est pas !

Hello, well I followed your tuto but it still does not work, the weapon is buying well but in the wheel of arms it is not there!

We only plan to have 1 shop in a remote location. But the code allows multiple locations.
You can add them if you want.

and how would u do that?

1 Like

Find

local weashop_locations = {
{entering = {74.504,-1971.366,19.788}, inside = {70.529,-1975.843,50.837}, outside = {74.504,-1971.366,19.788}},
}

in weashop.lua
There you can add different locations. just get the x y z coords and there you go. (For those who are owner, you can use /pos the get the position ingame)

Do you get the same error as @FR_SkaaYz ?
I have seen other users having this problem with other mods
 I don’t know why :confused:
Have you tried to clear your cache ?

I will try. :slight_smile:

Fr: j’ai la meme error :slight_smile:
En: i have the same error :smiley:

Au pire tu es français non? J’ai le mĂȘme problĂšme en vidant mon cache.

Same problem when i have clear my cache. :confused:

mĂȘme problĂšme

same problem

C’est bon ca fonctionne un tres grand merci :slight_smile:

It is good ca works a very big thank you :slight_smile:

Moi sa ne marche toujours pas, l’argent est bien retirĂ© mais l’arme n’apparait pas dans la roue 


I still do not work, the money is well removed but the weapon does not appear in the wheel 


1 Like