Commands#
Every command Drugs Creator registers. The names of the lab menu, decoration and furniture creator commands can be changed in config/main.lua.
Command | Who | Description |
|---|---|---|
| Admin | Opens the creator: farms, laboratories and dealers. |
| Admin | Opens the furniture creator. |
| Admin | Sets a lab's level. Without a lab name, it sets the lab you are standing in. |
Client Exports#
For HUDs, phones and other scripts that need to know where the player is.
EnteredLab
Returns the name of the lab the player is in (a shell or an MLO zone), or nil outside.
local lab = exports['qs-drugs-creator']:EnteredLab()
if lab then
print('Inside lab: ' .. lab)
endinDecorate
Returns true while the player is in decoration mode. Useful to block a phone, a radial menu or an inventory key while decorating.
Server Exports#
AddExpToLab
Gives a lab experience, for example as a quest reward. At 100 EXP the lab goes up a level. The change is saved and sent to every player.
-- labName: the lab's id, as shown in the creator
-- exp: the amount to add
exports['qs-drugs-creator']:AddExpToLab('my_lab', 25)Events#
Start corner selling
Client event. The same as typing /selldrug, for a radial menu or a phone app.
TriggerEvent('drugs:cornerselling')Play drug effects
Client event. Plays an animation and effects on a player, from any item or script. The duration is in seconds. The types and effects are listed in Usage → Drug Effects.
-- server side
TriggerClientEvent('drugs:drugEffects', source, 'needle', { 'green_visual', 'armor50' }, 30)

