> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaksam-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sold to narcos

> Se déclenche côté serveur après qu'un joueur vend de la drogue aux narcos.

Se déclenche après qu'un joueur vend aux narcos.

```lua Event theme={null}
RegisterNetEvent("drugs_creator:narcos:itemSold", function(playerId, drugName, drugQuantity, totalDrugPrice, accountName)

end)
```

### Paramètres

| Nom | Type de donnée | Description |
| - | - | - |
| `playerId` | integer | Server ID du joueur |
| `drugName` | string | ID de l'item de la drogue vendue |
| `drugQuantity` | integer | Quantité de l'item vendue |
| `totalDrugPrice` | integer | Argent total reçu par le joueur |
| `accountName` | string | Type de compte utilisé pour la récompense (money, black\_money, etc.) |

## Exemple

```lua theme={null}
RegisterNetEvent("drugs_creator:narcos:itemSold", function(playerId, drugName, drugQuantity, totalDrugPrice, accountName)
    local xPlayer = ESX.GetPlayerFromId(playerId)

    local random = math.random(1, 2)

    if(drugName == "weed" and random == 1) then
        xPlayer.addInventoryItem("weed", 3)

        xPlayer.showNotification("Here you have 3 bonus weed")
    end

    print("Player received " .. totalDrugPrice .. " in " .. accountName)
end)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.