English Create a virtual item

I'm the Boss

Admin
2/1/20
378
2
43
1 100
Hello,

How to create a virtual item?

1 - Go to the root of your mission.
2 - See you in \config\Config_vItems.hpp.

The file Config_vItems.hpp is divided into two main classes:

The class VirtualShops { }; is used to declare all shops (market, cement seller, glass seller...)
The class VirtualItems { }; is used to declare all items (pick, lockpick, grape...)

3 - Go to the inside and at the end of the class VirtualItems { }; then create a new class.

Example :

S’il vous plaît, Connexion ou S'inscrire pour voir le code !

The name of the class and the variable don't have to be identical, but it's better to find your way around.

The variable is required, choose a single word or two Words. (remember, never accents or special characters)
The displayName corresponds to the stringtable of the name displayed in game
The weight corresponds to the weight of the item in the virtual inventory
The buyPrice corresponds to the purchase price of the item
The sellPrice corresponds to the selling price of the item
illegal = false; for the item to be legal
illegal = true; for the item to be illegal
edible is useful for consumable items. It helps to reduce the player's hunger. (20 will add 20 to the player's hunger bar)

icon corresponds to the path of the item image

5 - Look for "Life_Items" and add your STR at the end of this package.

Example :

S’il vous plaît, Connexion ou S'inscrire pour voir le code !

6 - Save the two modified files.

If you want to put your item on sale in a shop, you just have to add the variable of your item in the class of a shop, like that:

S’il vous plaît, Connexion ou S'inscrire pour voir le code !


If you want your item to be saved in the inventory and/or in the trunks of players' vehicles:
Go to \config\Config_Master.hpp
Then add your item in the following arrays:

S’il vous plaît, Connexion ou S'inscrire pour voir le code !

Otherwise, if you want your items to be automatically backed up in the players' inventory, follow my other tutorial : FR || Backup all virtual items without configuration

Your item is created!
 
Dernière édition par un modérateur:
Activité
Pour l'instant, il n'y a personne ici