# Server Exports

{% hint style="info" %}
Here you will find the list of usable exports for Weed Plants, you can use them if you have basic or advanced programming knowledge, we do not recommend using these if you do not have such knowledge.
{% endhint %}

{% hint style="warning" %}
REMEMBER ABOUT CLIENT SIDE AND SERVER SIDE IN CHOOSING EXPORT!
{% endhint %}

***

## getPlayerStats

With following export you can get player statistics and use some functions.

```lua
exports['p_plants']:getPlayerStats(identifier)
```

* identifier: `string`
  * Identifier of existing player

Return:

* identifier: string
* reputation: table\<zoneName, {exp: number,  level: number}>
* sellAbility: {exp: number, level: number}
* drugsSold: number
* earnings: number
* addReputation: function
* removeReputation: function
* getReputation: function
* addSellAbility: function
* removeSellAbility: function

***

### addReputation

Example of usage

<pre class="language-lua"><code class="lang-lua"><strong>local identifier = 'char:123456789' -- replace with existing player identifier
</strong><strong>local player = exports['p_plants']:getPlayerStats(identifier)
</strong>if player then
   local zoneName = 'GroveStreet'
   local amount = 10
   player.addReputation(zoneName, amount)
end
</code></pre>

***

### removeReputation

Example of usage

<pre class="language-lua"><code class="lang-lua"><strong>local identifier = 'char:123456789' -- replace with existing player identifier
</strong><strong>local player = exports['p_plants']:getPlayerStats(identifier)
</strong>if player then
   local zoneName = 'GroveStreet'
   local amount = 10
   player.removeReputation(zoneName, amount)
end
</code></pre>

***

### getReputation

Example of usage

<pre class="language-lua"><code class="lang-lua"><strong>local identifier = 'char:123456789' -- replace with existing player identifier
</strong><strong>local player = exports['p_plants']:getPlayerStats(identifier)
</strong>if player then
   local zoneName = 'GroveStreet'
   local reputation = player.getReputation(zoneName)
   print(reputation.level, reputation.exp)
end
</code></pre>

***

### addSellAbility

Example of usage

```lua
local identifier = 'char:123456789' -- replace with existing player identifier
local player = exports['p_plants']:getPlayerStats(identifier)
if player then
   local amount = 10
   player.addSellAbility(amount)
end
```

***

### removeSellAbility

Example of usage

```lua
local identifier = 'char:123456789' -- replace with existing player identifier
local player = exports['p_plants']:getPlayerStats(identifier)
if player then
   local amount = 10
   player.removeSellAbility(amount)
end
```


---

# 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://piotreq-scripts.gitbook.io/piotreq-scripts/assets-and-guides/weed-plants/server-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.
