Camping Store
The camping store is a shop NPC where players browse props on a rotating display and buy them. It is configured in CampingPreview in shared/config.lua.
How it works
- The player walks up to the store NPC and holds the prompt.
- A menu lists every prop with its price.
- Highlighting an item spawns it on a rotating display and moves the camera to it.
- Selecting an item asks for an amount and buys it. The item goes to the player's inventory.
- Backspace closes the menu and removes the display.
Prices and the payment type are checked on the server and never trusted from the client. The server also refuses the purchase if the player cannot carry the item or cannot afford it.
Options
| Option | Meaning |
|---|---|
PaymentType |
"cash" or "gold" |
promptData |
promptLabel, promptTime (hold time in ms), promptDistance, promptKey (a string such as "INPUT_INTERACT_LOCKON_ANIMAL") |
blipData |
blipName, blipSprite, blipStyle |
CampingPreviewLocations |
The store locations |
itemsForPreview |
The items for sale |
Locations
stawberry = {
name = 'Camping Equipment',
coords = vec(-1763.35, -402.01, 155.58), -- where the player stands
itemPreviewLoc = vec(-1753.73, -410.84, 156.38), -- where the prop is shown
cameraPosition = vec(-1756.96, -416.75, 158.24, 337.15), -- x, y, z, heading
showBlip = true,
PedData = {
model = "mp_fm_stakeout_poker_males_01",
coords = vec(-1763.35, -402.01, 155.58, 335.72),
}
}
You can add more locations. Each one gets its own NPC, blip and prompt.
Items
p_table11x = {label = "Wooden Table", price = 7.5},
The key is the item name, which must exist as an item. To add an item to the store, add a line here.
Logging
Every purchase can be logged to Discord through the Item Purchased webhook in server/webhooks.lua.