-
Notifications
You must be signed in to change notification settings - Fork 2
Adding a weapon to Jacob's store
- Basic JSON format knowledge
- A text editor
In this folder, the weapons.json file is stored. This file holds the information for all the weapons shown in Jacob's store.
The weapons.json contains a list of weapon objects, the structure of a weapon object is as follow
{
"Name": "Weapon Name",
"Price": 123456,
"Hash": 778899,
"Group": "Nuclear bombs",
"Tints": [
{
"Name": "Tint Name",
"Price": 112233
},
{
"Name": "Another tint",
"Price": 112233
}
],
"Camo": {
"Colors": [
{
"Name": "Color 1",
"Price": 5000
},
{
"Name": "Color 2",
"Price": 5000
}
],
"Styles": [
{
"Name": "None",
"Price": 199,
"Hash": 4294967295
},
{
"Name": "Digital",
"Price": 50000,
"Hash": 1249283253
}
],
"Attachments": [
{
"Name": "Default",
"Price": 199,
"Hash": 3791631178,
"Group": "Clip"
},
{
"Name": "Extended",
"Price": 8000,
"Hash": 3603274966,
"Group": "Clip"
}
]
}
}
- Name: The weapon name displayed in the in-game menu.
- Price: The price of the weapon.
- Hash: The hash of the weapon (type Uint32).
- Group: This is the submenu where the weapon will be located in the store. For example, if a weapon is in the "Pistols" group, then it will show up in the Pistols submenu. This allows for the creation of any number of groups, if a weapon is in set to be in the "keyboards" group, then it will show up in the keyboards submenu in the store.
These properties are the only ones required by the script, if a weapon object is missing one of these properties, it will most likely crash the script.
The "Tints" property is a list of objects that contain both the name and the price of each tint. If the weapon doesn't have any tints, then this property can be deleted from the file.
Tints in GTA are managed with index numbers instead of hashes, so the Tint objects must be ordered according to their index number in GTA. You can check the already created files for normal and MK2 weapons to see the correct tint order.
The property Attachments is another list of objects, these objects contain the name of the attachment, the price, the hash and the group. Like with weapons, the group property of the attachment object tells the script in which submenu this attachment should be placed. So, all the attachment in the "Clip" group will show up in the "Clip" submenu.
If the weapon doesn't have any attachments, the attachments property can be deleted from the file.
This property contains two list of objects, styles and colors. The objects in the styles list are like those found in the attachment list, except these don't have a group property.
Like with tints, the color list in the camos object are managed by index numbers, so the colors must be added according to their corresponding index number. You can check the already created files for MK2 weapons if you wish to see the correct order for livery colors.
Let's say you purchased a suppressor but now you want to remove it, that's what the "none element" is for. It must be added for each component type where it's possible to entirely remove attachments, otherwise, you won't be able to remove attachments... at least not via Jacob's store. To add a none element you simply add the object
{
"Name": "None",
"Price": 199,
"Hash": 4294967295
}
In some component types like the Clip, the none element is not valid since it's not possible to entirely remove the clip component. For the Scope the none element is valid on most weapons except snipers, snipers can't have their scope completely removed (I think), they use a default scope instead.
If you don't have the hashes for the weapon or its attachments, you must be wondering "How the fuck do I get the hashes?", that's simple, you can use this calculator, the value you need is the Uint32 one. To get the hash you need at least the weapon/attachment name. Some examples of valid names are WEAPON_KNIFE
, WEAPON_MICROSMG
, COMPONENT_AT_SCOPE_MACRO
, COMPONENT_SMG_CLIP_02
.