Card Collection
Steps to Add a New Card to the System and to use /collection command.
First start :
Add a new card or collection
1. Define the New Card in the Config.Cards
Table
Config.Cards
TableOpen the script configuration file.
Add the new card identifier to the desired collection in the
Config.Cards
table.Each collection can contain up to 6 cards.
Example:
If you're adding a card bt_6.png
to the new Botilus
collection:
2. Add the Card Image
You must provide a visual representation of the card by placing its image in the appropriate folders.
Image Requirements:
Dimensions: The card image must be 150x220 pixels.
Image Format: Supported format is
.png
File Locations:
Place the card image in the following folder:
html/collections
Copy the same card image into this folder for inventory use:
vorp_inventory/html/img/items
3. Enable Automatic Database Insertion (Optional)
If you want the script to automatically add the new card to the database:
Ensure
Config.AllowAutoInsertInDB
is set totrue
in the configuration file.
4. Test the Card
Once the above steps are complete:
Restart the server.
Check that the card appears in the correct collection in the system.
Ensure the inventory displays the correct image for the card.
Description of the /collection
Admin Command
The /collection
command is an administrative tool that allows authorized users to manage card locations in the game world. This command can be used to place a card from a specific collection at the admin's current position.
Command Syntax
Parameters:
<collection_name>
: The name of the card collection (e.g.,Far West
,Indian
, etc.).<card_name>
: The specific card identifier within the selected collection (e.g.,fw_1
,volcae_2
, etc.).
Displays Available Collections and Cards:
If no arguments are provided, the command will display all available collection names.
If only a collection name is provided, the command will list all cards within that collection.
Places a Card in the Game World:
When both
collection_name
andcard_name
are provided, the command places the specified card at the admin's current location.The card's position is saved to the database, including its coordinates (
x
,y
,z
).
Automatic Update of Spawned Cards:
After placing a card, the list of spawned cards is updated and synchronized with all connected clients.
Database Insertion:
The command ensures that the card's location is recorded in the
collections
table in the database. This includes:The name of the collection.
The name of the card.
The card's exact coordinates in JSON format.
Validation:
Checks if the card and collection exist in the configuration (
Config.Cards
) before attempting to place the card.Prevents duplication by ensuring that the card does not already exist at the specified location.
Last updated