# Event and Exports

#### <mark style="color:orange;">START PUZZLE EVENT</mark>

```lua
TriggerEvent('bp_vehiclepuzzle:startPuzzle', puzzleData)
```

puzzleData = {

* type = 'middle' ---------------> 'small', 'middle', 'big' 3 map select
* point = 0 ---------------> Points that can be earned
* timer = second (example 120s) 2 munite
* level = Level 1 to 5
* callback = If it is true, a callback notification such as a progress bar or minigame will appear.

If you leave all information blank except for the type, everything will be generated randomly.

```lua
TriggerEvent('bp_vehiclepuzzle:startPuzzle', {type = "middle"}) 

```

In this example, it creates a random level on the middle map, and there is no time or score.

#### <mark style="color:orange;">PUZZLE CALLBACK</mark>

```lua
    TriggerEvent('bp_vehiclepuzzle:startPuzzle', {
        type = 'middle',
        timer = 120,
        point = 0,
        level = 1,
        callback = true  
    }, function(success)
        if success then
            TriggerEvent('bp_vehiclepuzzle:notify', "Congratulations on completing the minigame", 2000, 'base', "success")
            
         
        else
            TriggerEvent('bp_vehiclepuzzle:notify', "Sorry, the minigame failed.", 2000, 'base', "error")
        end
    end)
```

#### <mark style="color:orange;">ADMIN PART EVENT</mark>

```lua
TriggerEvent('bp_vehiclepuzzle:openAdoCreate')
```


---

# 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.0resmon.org/0resmon/bp-resources/bp-rush-hour-puzzle/event-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.
