Compare commits

..

2 Commits

Author SHA1 Message Date
redvalley e2b6726108 Create README.md 2026-04-02 00:24:12 +03:00
redvalley cefe558c9a update inventar+phone+map
phone props
- Adăugat global CreateUsableItem alias în qb-core/server/functions.lua
  (qs-inventory apelează CreateUsableItem ca funcție globală, nu QBCore.Functions)
- Fixat 16 stringuri sparte în qb-core/shared/items.lua (descrieri cu apostrofuri
  neînchise care blocau parsarea și împiedicau boot-ul qb-core)
- Adăugat USE action pe itemul 'map' în rv-maphold: deschide pause menu cu
  animație hartă în mână din inventar
2026-04-02 00:18:57 +03:00
10 changed files with 113 additions and 3 deletions
@@ -0,0 +1,92 @@
# 🗺️ rv-maphold — Physical Map System
A standalone FiveM resource for QBCore that adds a **physical map item** to the game. Players must own a `map` item to see blips on the pause menu map. Using the item from inventory opens the map with a realistic map-holding animation.
## ✨ Features
- **Blip Visibility Control** — Without the `map` item, all map blips are hidden (empty map)
- **Map Animation** — When opening the pause menu with the map item, the player holds a physical map in their hands (`WORLD_HUMAN_TOURIST_MAP`)
- **Inventory USE Action** — Players can USE the map item from inventory to open the pause menu map directly
- **Starter Item** — Map is given automatically to new characters via `QBShared.StarterItems`
- **Standalone** — No dependencies other than `qb-core` and `qs-inventory`
## 📦 Installation
### 1. Copy Resource
Place the `rv-maphold` folder in your server's resources directory:
```
resources/[framework]/[addons]/rv-maphold/
```
### 2. Add Item to `qb-core/shared/items.lua`
```lua
['map'] = {['name'] = 'map', ['label'] = 'Map', ['weight'] = 100, ['type'] = 'item', ['image'] = 'map.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A physical map of Los Santos and Blaine County'},
```
### 3. Add as Starter Item (optional)
In `qb-core/shared/main.lua`, add `map` to `QBShared.StarterItems`:
```lua
QBShared.StarterItems = {
-- ... existing items ...
['map'] = { amount = 1, item = 'map' },
}
```
### 4. Add Item Image
Place a `map.png` icon (128x128 recommended) in your inventory's image folder:
```
qs-inventory/html/images/map.png
```
### 5. Ensure Resource
Add to your `resources.cfg` (after `qb-core` and `qs-inventory`):
```cfg
ensure rv-maphold
```
### 6. Restart Server
```
ensure rv-maphold
```
## ⚙️ How It Works
| Scenario | Behavior |
|---|---|
| Player **has** `map` item | Blips visible on pause menu, animation plays when opening map |
| Player **doesn't have** `map` item | Blips hidden, pause menu still works but map is empty |
| Player **USEs** map from inventory | Pause menu opens on MAP tab + map animation |
## 🔧 Configuration
No configuration needed. The resource works out of the box.
To disable the blip hiding feature, comment out the `SwitchBlips` loop in `client.lua`.
## 📁 File Structure
```
rv-maphold/
├── fxmanifest.lua # Resource manifest
├── client.lua # Blip control, animation, USE handler
├── server.lua # RegisterUsableItem for 'map'
└── README.md # This file
```
## 🔗 Dependencies
| Resource | Required | Notes |
|---|---|---|
| `qb-core` | ✅ Yes | Framework — provides `QBCore`, `CreateUseableItem` |
| `qs-inventory` | ✅ Yes | Inventory system — handles item USE action |
## 📝 Credits
- **Red Valley Community** — Original development
- Inspired by `sm_map` (ScriptsM) for the animation concept
## 📋 Version History
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2026-04-01 | Initial release — blip hiding + map animation + inventory USE |
@@ -127,3 +127,17 @@ CreateThread(function()
SwitchBlips(not hasMap)
end
end)
-----------------------------------------
-- USE din inventar → deschide harta
-----------------------------------------
RegisterNetEvent('rv-maphold:client:useMap', function()
-- Deschide meniul pause pe tab-ul MAP
ActivateFrontendMenu(GetHashKey('FE_MENU_VERSION_MP_PAUSE'), false, -1)
-- Așteaptă să se deschidă meniul
Wait(300)
-- Pornește animația cu harta
ActivateMap()
end)
@@ -1,8 +1,12 @@
--[[
rv-maphold — Server
Harta se dă prin QBShared.StarterItems (qb-core/shared/main.lua)
Acest fișier e păstrat pentru eventuale comenzi admin sau shop
RegisterUsableItem: permite USE din inventar → deschide harta
]]
-- Nimic de făcut aici — harta se dă la crearea personajului prin StarterItems
-- Fișierul poate fi extins mai târziu cu shop/comenzi admin
local QBCore = exports['qb-core']:GetCoreObject()
-- Înregistrează itemul 'map' ca usable
QBCore.Functions.CreateUseableItem('map', function(source, item)
TriggerClientEvent('rv-maphold:client:useMap', source)
end)
Binary file not shown.