> For the complete documentation index, see [llms.txt](https://highqez.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://highqez.gitbook.io/docs/resources/cash-item/api/server.md).

# Server

Guide to use the script more advanced

## Server Events

{% hint style="success" %}
Developers can take your script to the next level by utilizing server events for integration
{% endhint %}

## AddMoney

Use this event when the player receives cash

Attribute:

* playerid:
  * `integer`: server id of the player
* monetype:
  * `string`: type of the money
* amount:
  * `integer`: amount of money
* currentbalance:
  * `integer`: the player's current balance of money
* reason:
  * `string`: any reason can be added for the transfer

{% code title="Usage" %}

```lua
TriggerEvent('highqez_cashitem:server:AddMoney', playerid, moneytype, amount, currentbalance, reason)
```

{% endcode %}

***

## RemoveMoney

Use this event when the player loses cash

Attribute:

* playerid:
  * `integer`: server id of the player
* monetype:
  * `string`: type of the money
* amount:
  * `integer`: amount of money
* currentbalance:
  * `integer`: the player's current balance of money
* reason:
  * `string`: any reason can be added for the transfer

{% code title="Usage" %}

```lua
TriggerEvent('highqez_cashitem:server:RemoveMoney', playerid, moneytype, amount, currentbalance, reason)
```

{% endcode %}

***

## SetMoney

Use this event when the player's cash is reset to certain value

Attribute:

* playerid:
  * `integer`: server id of the player
* monetype:
  * `string`: type of the money
* amount:
  * `integer`: amount of money
* reason:
  * `string`: any reason can be added for the transfer

{% code title="Usage" %}

```lua
TriggerEvent('highqez_cashitem:server:SetMoney', playerid, moneytype, amount, reason)
```

{% endcode %}

***

## AddItem

Use this event when an item is added to the player

Attribute:

* playerid:
  * `integer`: server id of the player
* item:
  * `string`: name of the item
* amount:
  * `integer`: amount of item

{% code title="Usage" %}

```lua
TriggerEvent('highqez_cashitem:server:AddItem', playerid, item, amount)
```

{% endcode %}

***

## RemoveItem

Use this event when an item is removed from the player

Attribute:

* playerid:
  * `integer`: server id of the player
* item:
  * `string`: name of the item
* amount:
  * `integer`: amount of item

{% code title="Usage" %}

```lua
TriggerEvent('highqez_cashitem:server:RemoveItem', playerid, item, amount)
```

{% endcode %}

***

## ClearInventory

Use this event when clearing the player's inventory

Attribute:

* playerid:
  * `integer`: server id of the player

{% code title="Usage" %}

```lua
TriggerEvent('highqez_cashitem:server:ClearInventory', playerid)
```

{% endcode %}

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://highqez.gitbook.io/docs/resources/cash-item/api/server.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
