Files
red-valley/docs/wasabi_police_reference.md

217 lines
8.8 KiB
Markdown
Raw Normal View History

2026-03-29 21:41:17 +03:00
# Wasabi Police V1 — Referință completă (2nd Brain)
> **Versiune:** 1.10.8 | **Autor:** wasabirobby
> **Docs oficiale:** https://docs.wasabiscripts.com/wasabi-scripts/advanced-series/wasabi_police
> **Instalat la:** `resources/[framework]/[base]/[jobs]/[legal]/[police]/wasabi_police/`
> **Provides:** `esx_policejob`, `qb-policejob` (bridge — înlocuiește ambele)
> **Status:** ✅ INSTALAT (2026-03-29)
---
## Dependențe
| Resursă | Tip | Notă |
|---|---|---|
| `wasabi_bridge` | Hard dependency | Framework bridge (ESX/QB), notificări, inventar |
| `oxmysql` | Hard dependency | `@oxmysql/lib/MySQL.lua` — DB queries |
| `qb-core` | Framework | GetCoreObject, PlayerData, metadata |
| `qb-target` / `ox_target` | Optional | `Config.useTarget = true` |
| `qs-inventory` | Inventory | `setInventoryDisabled(bool)`, stash, player search |
| `ox_lib` | Optional | Radial menu (`Config.UseRadialMenu`), skill check |
| `rcore_prison` | Jail integration | `exports['rcore_prison']:Jail(target, time)` |
| `codem-dispatch` | Dispatch alerts | Police alerts via events |
| `17mov_CharacterSystem` | Clothing bridge | `TriggerEvent('qb-clothing:client:openMenu')` pentru cloakroom |
| `17mov_Hud` | Notifications | Via `wasabi_bridge:notify` event |
| `qb-management` / `qb-banking` | Society billing | `exports[qbBill]:AddMoney(job, amount)` |
---
## Exports (Client)
| Export | Returnează | Descriere |
|---|---|---|
| `exports['wasabi_police']:IsHandcuffed()` | `false` / `'soft'` / `'hard'` | Verifică dacă player-ul e încătușat |
| `exports['wasabi_police']:openOutfits(station)` | void | Deschide meniul de uniformă la stație |
| `exports['wasabi_police']:escortPlayer(targetId)` | void | Escortează un player încătușat |
| `exports['wasabi_police']:searchPlayer(player)` | void | Percheziționează inventarul unui player |
## QB-policeJob bridge exports
> Script-ul `provides 'qb-policejob'`, deci exporturile standard qb-policejob sunt disponibile:
> `exports['qb-policejob']:IsHandcuffed()` — funcționează prin bridge
## Exports (Server)
| Export | Returnează | Descriere |
|---|---|---|
| `exports['wasabi_police']:getPoliceOnline()` | `number` | Numărul de polițiști on-duty |
| `exports['wasabi_police']:IsPlayerInJail(target)` | `boolean` | Verifică dacă player-ul e în închisoare |
---
## Events triggerabile din alte resurse
> **IMPORTANT:** Config.AllowedResources controlează cine poate triggera:
```lua
-- Events pe care alte resurse le pot triggera:
wasabi_police:handcuffPlayer -- încătușare
wasabi_police:escortPlayer -- escortare
wasabi_police:inVehiclePlayer -- pune în vehicul
wasabi_police:outVehiclePlayer -- scoate din vehicul
```
### Events ascultate:
```lua
-- Notifications (via wasabi_bridge)
TriggerEvent('wasabi_bridge:notify', title, desc, type)
-- CopCount (compatibilitate qb-core)
TriggerEvent('police:SetCopCount', -1, CopCount)
-- Duty toggle
TriggerServerEvent('wasabi_police:svToggleDuty', stationId)
-- Jail via built-in
TriggerServerEvent('wasabi_police:server:sendToJail', target, time)
```
---
## Config critice (config.lua — 861 linii)
### General
- `Config.Language = 'en'` — 15 limbi disponibile
- `Config.jobMenu = 'F6'` — tasta menu job
- `Config.useTarget = true` — qb-target / ox_target
- `Config.MobileMenu.enabled = true` — menu cu arrow keys vs context
- `Config.UseRadialMenu = false` — ox_lib radial
- `Config.customCarlock = false` — set true pt wasabi_carlock/qb-carlock
### Billing
- `Config.billingSystem = 'default'` — opțiuni: `false`, `'default'`, `'esx'`, `'qb'`, `'okok'`, `'pefcl'`
- `Config.billingData.chargeAccount = 'bank'` — bank/cash
- `Config.billingData.creditSociety = true` — banii din amenzi merg în society
- `Config.billingData.fines` — preseturi amenzi cu label + amount
### Jail
- `Config.Jail.enabled = true`
- `Config.Jail.BuiltInPrison.enabled = true` — sistem de închisoare built-in
- `Config.Jail.jail = 'rcore'`**SETAT** pe rcore_prison (configurat la install)
- `Config.Jail.BuiltInPrison.enabled = true` — sistem de închisoare built-in
- `Config.Jail.BuiltInPrison.persistentJail = true` — persistent la restart
- Jail outfit: male/female cu clothing components
### Handcuff
- `Config.handcuff.defaultCuff = 'hard'` — soft/hard
- `Config.handcuff.persistentCuff = true` — rămâne cuffed la reconnect
- `Config.handcuff.timer = 20 * minutes` — auto-uncuff
- `Config.handcuff.hotkey = 'J'`
- `Config.handcuff.skilledEscape` — skill check pt a scăpa din cătușe
- `Config.handcuff.cuffItem` — item fizic de cătușe (optional)
- `Config.handcuff.lockpicking` — bobby_pin pentru a sparge cătușele
### Tackle
- `Config.tackle.enabled = true`
- `Config.tackle.policeOnly = true`
- `Config.tackle.hotkey = 'G'` — când sprintezi
### CCTV Cameras
- `Config.CCTVCameras.enabled = true`
- `Config.CCTVCameras.saveToDatabase = true` — tabel: `wsb_cctvcameras`
- `Config.CCTVCameras.destoryable = true` — civilian pot distruge camere
- Locații preset (14 magazine)
- Props: `prop_cctv_cam_01a/b`, `prop_cctv_cam_06a`, `prop_cctv_cam_05a`
### Radar Posts (Speed Traps)
- `Config.RadarPosts.enabled = true`
- `Config.RadarPosts.saveToDatabase = true` — tabel: `wsb_speedtraps`
- `Config.RadarPosts.measurement = 'mph'` — mph/kmh
- Thresholds: 5→$50, 10→$100, 20→$500, 30→$1000, 40→$2000, 50→$5000
- `Config.RadarPosts.whitelistJobs = {'ambulance'}` — ambulanța nu primește amenzi
### Tracking Bracelet
- `Config.TrackingBracelet.enabled = true`
- Item: `tracking_bracelet`
- Timer auto-remove: 20 minute
### GSR (Gunshot Residue)
- `Config.GSR.enabled = false`
- Comanda: `/gsr`
- Auto clean: 600 secunde
- Se poate spăla în apă
### Police Jobs
```lua
Config.policeJobs = { 'police', 'reporter' }
```
### Locații (Config.Locations.LSPD)
- **Blip:** Mission Row PD (sprite 60, color 29)
- **Clock In/Out:** `vec3(464.87, -977.37, 30.69)` — jobLock 'police'
- **Boss Menu:** `vec3(460.64, -985.64, 30.73)` — society management
- **Armoury:** `vec3(480.32, -996.67, 30.69)` — NPC `s_f_y_cop_01`
- Grade 0: Pistol ($75), Night Stick ($50)
- Grade 1: Combat Pistol ($150), Night Stick ($50)
- Grade 2+: + Assault Rifle ($1100)
- **Cloakroom:** `vec3(462.36, -999.62, 30.69)` — uniforme Patrol/Chief
- **Personal Locker:** `vec3(462.64, -995.88, 30.69)` — stash (30 slots, 50kg)
- **Evidence Locker:** `vec3(472.5, -991.21, 26.27)` — stash (100 slots, 500kg)
- **Vehicle Garage:** `vec3(463.69, -1019.72, 28.1)`
- Land spawn: `vec3(449.37, -1025.46, 28.59)`
- Air spawn: `vec3(449.29, -981.76, 43.69)`
- Vehicule: `police`, `police2`, `polmav` (Maverick)
---
## DB Tables
| Tabel | Scop |
|---|---|
| `wsb_speedtraps` | Radar posts persistente |
| `wsb_cctvcameras` | CCTV cameras persistente |
| `users.ishandcuffed` | Persistent cuffs (ESX only, auto-created) |
| `users.injail` | Persistent jail (ESX only, auto-created) |
---
## Items necesare (QBCore)
```lua
-- Adăugat în qb-core/shared/items.lua:
bobby_pin = { name = 'bobby_pin', label = 'Bobby Pin', weight = 2500, ... }
tracking_bracelet = { name = 'tracking_bracelet', label = 'Tracking Bracelet', weight = 2500, ... }
```
---
## Cross-resource impact (cu serverul nostru)
| Resursă server | Cum se leagă | Detalii |
|---|---|---|
| `wasabi_bridge` | HARD DEP | Toate funcțiile trec prin bridge |
| `oxmysql` | HARD DEP | DB queries server-side |
| `qb-core` | Framework | PlayerData, metadata.ishandcuffed, job grades |
| `qs-inventory` | Inventory | `setInventoryDisabled(bool)` la cuff, stash, search |
| `rcore_prison` | Jail | `exports['rcore_prison']:Jail(target, time)` |
| `codem-dispatch` | Alerts | Police alerts trigger |
| `17mov_CharacterSystem` | Cloakroom | `TriggerEvent('qb-clothing:client:openMenu')` pentru uniformă |
| `qb-target` | Interact | Target zones la stații (duty, boss, armory, etc) |
| `qb-management` | Boss menu | Society billing, hire/fire |
| `17mov_Hud` | Notify | `TriggerEvent('wasabi_bridge:notify', ...)` |
| `qs-vehiclekeys` | Vehicle lockpick | Doar unlock manual, nu prin keys export |
| `ox_lib` | Radial | Optional radial menu integration |
---
## Workflow instalare pe server — **COMPLETAT ✅**
1. ✅ Copiat `wasabi-police/``[framework]/[base]/[jobs]/[legal]/[police]/wasabi_police`
2. ✅ Items deja existau în `qb-core/shared/items.lua` (bobby_pin, tracking_bracelet)
3. ✅ Items adăugate în `qs-inventory/shared/items.lua` (bobby_pin, tracking_bracelet)
4. ✅ Imagini copiate în `qs-inventory/html/images/` (bobby_pin.png, handcuffs.png, tracking_bracelet.png)
5. ✅ Config: `Config.Jail.jail = 'rcore'` (avem rcore_prison)
6. ⚠️ Config: verificare `Config.policeJobs` = `{'police', 'reporter'}`**REVIEW NECESAR** (scoatem reporter?)
7. ⚠️ Config: `Config.billingSystem = 'default'` — de verificat dacă merge cu qb-management
8.**Ensure automat** via `ensure [jobs]` din resources.cfg