# Tutorials

[I am missing sql file how to add camping\_objects table to my database ?](#id-1)

[How to create a custom object in Config.CustomObjects ?](#id-2)

#### 1.

{% hint style="info" %}
**How to add camping\_objects table in your database:**
{% endhint %}

```sql
CREATE TABLE IF NOT EXISTS camping_objects (
    id INT AUTO_INCREMENT PRIMARY KEY,
    item VARCHAR(255) NOT NULL,
    codelock int(11) NOT NULL DEFAULT 0,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    `x` DOUBLE NOT NULL,
    `y` DOUBLE NOT NULL,
    `z` DOUBLE NOT NULL,
    `h` DOUBLE NOT NULL
)
```

#### 2.

{% hint style="info" %}
**How to create a custom object ?**
{% endhint %}

1. Create new object in Config.CustomObjects:<br>

   <pre class="language-lua" data-title="Example:"><code class="lang-lua">Config.CustomObjects = {
       {
           label = 'Example Item',
           item = 'exampleitem',
           prop = 'exampleprop',
           target = 'Interact with this example object',
           distance = 2.5,
           offset = 0.50,
           menu = {
               {
                   title = 'Test Label',
                   description = 'Test Text',
                   icon = 'fas fa-circle-dot',
                   event = 'fivecode_camping:testtest',
               },
               {
                   title = 'Test Label 2',
                   description = 'Test Text 2',
                   icon = 'fas fa-circle-dot',
                   event = 'fivecode_camping:testEvent2'
               },
           },
       },
   }
   </code></pre>

   <figure><img src="/files/X53eQBxlkx30ADERV4jq" alt=""><figcaption><p>Showcase of menu above</p></figcaption></figure>
2. Add the item from your new object into your inventory:\
   \- Look into [Installtion Guide](/docs/scripts/fivecode-camping/installation-guide.md) if you need help with creating items for your inventory.
3. Create custom event which will be triggered from the menu:\
   \- You can create it in any script on client side.<br>

   <pre class="language-lua" data-title="Example:"><code class="lang-lua">---@param args entity

   RegisterNetEvent('fivecode_camping:testtest')
   AddEventHandler('fivecode_camping:testtest', function(args)
       print('Very cool text message!')
       print('Shop at https://fivecode.tebex.io/')
   end)

   RegisterNetEvent('fivecode_camping:testtest2')
   AddEventHandler('fivecode_camping:testtest2', function(args)
       local entity = args.entity
       print('Very cool entity: '..entity)
   end)
   </code></pre>
4. Enjoy your new custom object!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fivecode.gitbook.io/docs/scripts/fivecode-camping/tutorials.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
