# Server Events

### Generating dirt

Creating dirt for the house.

You can use this in your eating / drinking system when a player eats, they may leave a stain or crumbs.

```lua
---@param {propertyId: number | string}
---@param {model: string}: Dirt object model from VMS Housing files
---@param {position: vector3}
---@param {heading: number}
TriggerServerEvent('vms_housing:sv:spawnDirt', propertyId, model, position, heading)
```

<details>

<summary>Dirt Models</summary>

<kbd>vms\_blood1</kbd>\ <kbd>vms\_blood1small</kbd>\ <kbd>vms\_blood2</kbd>\ <kbd>vms\_blood2small</kbd>\ <kbd>vms\_dirtfootsteps</kbd>\ <kbd>vms\_coffeestain1</kbd>\ <kbd>vms\_coffeestain2</kbd>\ <kbd>vms\_crumbs1</kbd>\ <kbd>vms\_crumbs2</kbd>\ <kbd>vms\_dirtmud1</kbd>\ <kbd>vms\_dirtmud2</kbd>\ <kbd>vms\_dirtmud3</kbd>\ <kbd>vms\_dirtmud4</kbd>\ <kbd>vms\_ketchupspill</kbd>\ <kbd>vms\_liquidspill1</kbd>\ <kbd>vms\_liquidspill2</kbd>\ <kbd>vms\_liquidspill3</kbd>\ <kbd>vms\_liquidspill4</kbd>\ <kbd>vms\_mustardspill</kbd>\ <kbd>vms\_oilspill1</kbd>\ <kbd>vms\_oilspill2</kbd>\ <kbd>vms\_sodaspill1</kbd>\ <kbd>vms\_winestain1</kbd>

</details>

<details>

<summary><strong>Example</strong></summary>

```lua
local myPed = PlayerPedId()
local myCoords = GetEntityCoords(myPed)
local heading = GetEntityHeading(myPed)

local propertyId, propertyData = exports['vms_housing']:IsPlayerInsideProperty()
if not propertyId then
    return
end

local model = 'vms_crumbs1'
local position = vector3(myCoords.x, myCoords.y, myCoords.z - 0.99) -- Setting foot coordinates

TriggerServerEvent('vms_housing:sv:spawnDirt', propertyId, model, position, heading)
```

</details>

***


---

# 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.vames-store.com/assets/vms_housing/developer-api/server-events.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.
