Shadow Cigarette
A complete and immersive cigarette system, from the pack to hand-rolling.
- Version
- 1.3.1
- Resource
- SF-Smoke
Overview#
SF-Smoke adds the whole chain around cigarettes: singles, packs, cartons, rolling tobacco, papers, filters and a lighter. You cannot light a cigarette without a lighter in your inventory, and the lighter can break. Animations work on foot and inside a vehicle, where the cigarette prop is attached to the mouth.
Full item chain
Cigarette, pack, carton and hand-rolled cigarette, each with its own behaviour.
Lighter required
Without a lighter in the inventory, the cigarette cannot be lit.
Lighter wear
A five percent chance the lighter breaks after each cigarette smoked.
Contextual animations
A smoking emote on foot, and the cigarette prop attached to the mouth while driving.
Opening packs and cartons
A pack gives twenty cigarettes, a carton gives ten packs, each behind a progress bar.
Hand-rolling
Combine papers, filters and tobacco to roll your own, in eight seconds.
Simple control
Press X to stop smoking at any time.
Lightweight
No permanent loop: the resource only runs while a cigarette is lit.
Dependencies#
| Resource | Required | Why |
|---|---|---|
ox_lib | Yes | Progress circles and notifications, declared in the manifest. |
es_extended | Yes | Framework used by the client and server sides. |
ox_inventory | Yes | Holds the item definitions and their images. |
dpemote / rpemotes | Yes | Provides the smoke emote used on foot. |
Installation#
- Drop the SF-Smoke folder into your server resources directory.
- Add the eight items listed below to the data/items.lua file of ox_inventory, keeping the names exactly as they are.
- Copy the item images into the ox_inventory web images folder.
- Add the ensure lines below to your server.cfg.
- Restart the server, then ox_inventory so it picks up the new items.
ensure ox_lib ensure ox_inventory ensure SF-Smoke
Configuration#
| Key | Default | What it does |
|---|---|---|
Config.SmokeTime | โ | How long a cigarette lasts. |
Config.LighterBreakChance | 5 | Percentage chance the lighter breaks after a cigarette. |
Config.PackAmount | 20 | Number of cigarettes obtained by opening a pack. |
Config.CartonAmount | 10 | Number of packs obtained by opening a carton. |
Items#
Declare these in your inventory using exactly these names: they are hard-coded in the resource.
| Item name | Description |
|---|---|
cigarette | A single cigarette. Needs a lighter to be lit. |
paquetcigarette | A pack, gives twenty cigarettes when opened. |
cartouche | A carton, gives ten packs when opened. |
cigarette_roulee | A hand-rolled cigarette, made from tobacco, papers and a filter. |
tabac_rouler | Rolling tobacco, a rolling ingredient. |
feuilles_rouler | Rolling papers, a rolling ingredient. |
filtres | Filters, a rolling ingredient. |
briquet | The lighter, required to light any cigarette. |