# Events & Exports

## Server Events <a href="#server-events" id="server-events"></a>

**rm\_decalv2:server:onDecalAdded**

```lua
AddEventHandler('rm_decalv2:server:onDecalAdded', function(data)
    if data.type == 'graffiti' then
        -- print(data.source)
        -- print(data.fileName)
        -- print(vec3(data.posX, data.posY, data.posZ))
    elseif data.type == 'sticker' then
        -- print(data.source)
        -- print(data.fileName)
        -- print(data.plate)
    end
end)
```

| Key      | Type   | Description                                                     |
| -------- | ------ | --------------------------------------------------------------- |
| source   | number | Source of the person who created the decal                      |
| fileName | string | File name of the decal                                          |
| posX     | number | X coordinates of the place of decal                             |
| posY     | number | Y coordinates of the place of decal                             |
| posZ     | number | Z coordinates of the place of decal                             |
| plate    | string | The number plate of the vehicle to which the sticker is affixed |

**rm\_decalv2:server:onDecalRemoved**

```lua
AddEventHandler('rm_decalv2:server:onDecalRemoved', function(data)
    if data.type == 'graffiti' then
        -- print(data.source)
        -- print(data.fileName)
        -- print(vec3(data.posX, data.posY, data.posZ))
    elseif data.type == 'sticker' then
        -- print(data.source)
        -- print(data.fileName)
        -- print(data.plate)
    end
end)
```

| Key      | Type   | Description                                                     |
| -------- | ------ | --------------------------------------------------------------- |
| source   | number | Source of the person who created the decal                      |
| fileName | string | File name of the decal                                          |
| posX     | number | X coordinates of the place of decal                             |
| posY     | number | Y coordinates of the place of decal                             |
| posZ     | number | Z coordinates of the place of decal                             |
| plate    | string | The number plate of the vehicle to which the sticker is affixed |


---

# 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://docs.rainmad.com/resources/decal-v-graffiti-and-vehicle-sticker/events-and-exports.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.
