Skip to content

Commit 32ac5bb

Browse files
committed
Add guide to add ps-dispatch
1 parent 43ac45e commit 32ac5bb

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

pages/it-drugs/tipps-and-tricks/_meta.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"footer": false
66
}
77
},
8+
"add-custom-dispatch": {
9+
"title": "Change Dispatch",
10+
"theme": {
11+
"footer": false
12+
}
13+
},
814
"webhook-setup": {
915
"title": "Webhook Setup",
1016
"theme": {
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: it-drugs - Change Dispatch System
3+
description: A guide explaining how to change the disptach System to it-drugs.
4+
---
5+
6+
import { Tabs, Steps } from 'nextra/components'
7+
8+
# Change Dispatch System
9+
10+
<Tabs items = {["ps-disptach"]}>
11+
<Tabs.Tab>
12+
13+
## Connect it-drugs with ps-dispatch
14+
15+
<Steps>
16+
17+
### Create new Alert
18+
Add this to the `alerts.lua` in the ps-dispatch resource:
19+
20+
```lua copy
21+
local function itDrugsAlert()
22+
local coords = GetEntityCoords(cache.ped)
23+
24+
local dispatchData = {
25+
message = "The Message you want to display", -- Edit this!
26+
codeName = 'itDrugsAlert',
27+
code = 'Your Code', -- - Edit this!
28+
icon = 'fas fa-joint',
29+
priority = 2,
30+
coords = coords,
31+
street = GetStreetAndZone(coords),
32+
gender = GetPlayerGender(),
33+
jobs = { 'leo' } -- Add all jobs you want to notify
34+
}
35+
36+
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
37+
end
38+
exports('itDrugsAlert', itDrugsAlert)
39+
```
40+
41+
### Register Blip Data
42+
Add codeName in `config.lua` for the particular robbery to display the blip ["itDrugsAlert"] is the codename you passed with the TriggerServerEvent in step 1
43+
You can change every parameter to your liking
44+
```lua copy
45+
['itDrugsAlert'] = {
46+
radius = 0,
47+
sprite = 119,
48+
color = 1,
49+
scale = 1.5,
50+
length = 2,
51+
sound = 'Lose_1st',
52+
sound2 = 'GTAO_FM_Events_Soundset',
53+
offset = false,
54+
flash = false
55+
},
56+
```
57+
58+
### Edit SendPoliceAlert function
59+
Change the `SendPoliceAlert` function in it-drugs to following:
60+
```lua copy
61+
function SendPoliceAlert(coords)
62+
-- Add You own police alert system here
63+
exports['ps-dispatch']:itDrugsAlert()
64+
end
65+
```
66+
67+
### Restart
68+
Restart ps-dispatch and it-drugs to make the changes work.
69+
</Steps>
70+
</Tabs.Tab>
71+
</Tabs>

0 commit comments

Comments
 (0)