# visualz\_selldrugs

{% stepper %}
{% step %}

### Find Server-Side folder

Go to `visualz_selldrugs/server/functions.lua`
{% endstep %}

{% step %}

### Add Code Snippet

You have to replace function `SellDrugEvent` with our:

```lua
function SellDrugEvent(source, drug, price, amount, zone)
  --local xPlayer = ESX.GetPlayerFromId(source)
  --exports["visualz_zones"]:AddPoints(xPlayer, zone, price * amount, drug)
  local turfId = exports['op-crime']:getPlayerTurfZone(source)
  if turfId then 
      TriggerEvent('op-crime:drugSold', source, turfId, price * amount)
  end
end
```

{% endstep %}

{% step %}

### File After Editing

File should look like this:\
![](https://36113860-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1vEl4u37HzsUUsBP0oWM%2Fuploads%2Fe7iPmFV8qTYt5A3kEi11%2Fimage.png?alt=media\&token=6764086d-9046-43d0-b3f9-45173e781a5b)
{% endstep %}
{% endstepper %}


---

# 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.otherplanet.dev/scripts/op-gangs/integrations/visualz_selldrugs.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.
