Skip to content

Commit fe3a5eb

Browse files
committed
Updated the docs again
1 parent c1ec450 commit fe3a5eb

File tree

13 files changed

+317
-32
lines changed

13 files changed

+317
-32
lines changed

pages/it_bridge/_category_.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ collapsible: true
22
collapsed: true
33
link:
44
type: generated-index
5-
description: Easy to use advanced Crafting-System! Ready for every big FiveM framework
5+
description: "Bridge Resource for all IT scripts"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Callout } from '@components/Callout'
22

3+
# Client
4+
35
<Callout type="error">
46
Currently there are no client exports available for the framework. If you want to use the framework exports please use the server exports.
57
</Callout>

pages/it_bridge/exports/framework/server.mdx

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ exports.it_bridge:GetPlayers()
3434
```
3535
Returns a table containing all the players on the server.
3636

37-
### Example
37+
**Example**
3838
```lua
3939
local players = exports.it_bridge:GetPlayers()
4040
for _, player in ipairs(players) do
@@ -50,7 +50,7 @@ exports.it_bridge:GetPlayerName(player)
5050

5151
Returns the the player's ingame name.
5252

53-
### Example
53+
**Example**
5454
```lua
5555
local player = exports.it_bridge:GetPlayer(source)
5656
local playerName = exports.it_bridge:GetPlayerName(player)
@@ -65,7 +65,7 @@ exports.it_bridge:GetPlayerCitizenId(player)
6565

6666
Returns the the player's citizen ID. For every framework, the citizen ID is unique.
6767

68-
### Example
68+
**Example**
6969
```lua
7070
local player = exports.it_bridge:GetPlayer(source)
7171
local citizenId = exports.it_bridge:GetPlayerCitizenId(player)
@@ -91,7 +91,7 @@ Returns table containing the player's job information.
9191
}
9292
```
9393

94-
### Example
94+
**Example**
9595
```lua
9696
local player = exports.it_bridge:GetPlayer(source)
9797
local job = exports.it_bridge:GetPlayerJob(player)
@@ -107,7 +107,7 @@ exports.it_bridge:GetMoney(source, moneyType)
107107

108108
Returns the player's money amount.
109109

110-
### Example
110+
**Example**
111111
```lua
112112
local cash = exports.it_bridge:GetMoney(source, 'cash')
113113
print(cash)
@@ -124,7 +124,7 @@ exports.it_bridge:AddMoney(source, moneyType, amount, reason)
124124

125125
Adds money to the player's account. Will return `true` if the money was added successfully.
126126

127-
### Example
127+
**Example**
128128
```lua
129129
local success = exports.it_bridge:AddMoney(source, 'cash', 1000, 'Reward')
130130
print(success)
@@ -141,7 +141,7 @@ exports.it_bridge:RemoveMoney(source, moneyType, amount, reason)
141141

142142
Removes money from the player's account. Will return `true` if the money was removed successfully.
143143

144-
### Example
144+
**Example**
145145
```lua
146146
local success = exports.it_bridge:RemoveMoney(source, 'cash', 1000, 'Fine')
147147
print(success)
@@ -158,7 +158,7 @@ exports.it_bridge:SetMoney(source, moneyType, amount, reason)
158158

159159
Sets the player's money amount. Will return `true` if the money was set successfully.
160160

161-
### Example
161+
**Example**
162162
```lua
163163
local success = exports.it_bridge:SetMoney(source, 'cash', 1000, 'Set')
164164
print(success)
+280-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,282 @@
1+
---
2+
title: it_bridge | Client Exports - Interactions
3+
description: Learn how to use the client Interactions exports for the it_bridge resource.
4+
---
5+
16
import { Callout } from '@components/Callout'
27

3-
<Callout type="waring">
4-
Currently not available.
5-
</Callout>
8+
# Client
9+
<Callout type="warning">
10+
These exports can only be used on the client-side. Make sure to use them in your client-side script files.
11+
</Callout>
12+
13+
14+
### Interactions Options
15+
```lua
16+
{
17+
label = 'string', -- The label of the interaction.
18+
name = 'string', -- The name of the interaction.
19+
icon = 'string', -- The icon of the interaction.
20+
item = {}, -- List of item you need to have to use the interaction.
21+
groups = {}, -- List of groups you need to have to use the interaction.
22+
canInteract = function(entity, distance), -- Function to check if the player can interact with the entity.
23+
onSelect = function(entity), -- Function to execute when the player selects the interaction.
24+
distance = number, -- The distance the player needs to be to interact with the entity.
25+
}
26+
```
27+
28+
If you want your script to work with all Disptach systems that are integrated in it-brige please make sure that you enter all these data
29+
30+
## CreateBoxZone
31+
```lua
32+
exports.it_bridge:CreateBoxZone(options, boxData)
33+
```
34+
35+
- options: `table`: The options of the box zone.
36+
- boxData: `table`: The data of the box zone.
37+
38+
Creates a box zone with the specified data.
39+
40+
### BoxData
41+
```lua
42+
{
43+
coords = vector3, -- The coordinates of the box zone.
44+
size = vector3, -- The size of the box zone.
45+
rotation = number, -- The rotation of the box zone.
46+
debug = boolean, -- If the box zone should be debugged.
47+
drawSprite = boolean, -- If the box zone should draw a sprite.
48+
minZ = number, -- The minimum Z value of the box zone.
49+
maxZ = number, -- The maximum Z value of the box zone.
50+
interactDistance = number, -- The distance the player needs to be to interact with the box zone.
51+
}
52+
```
53+
54+
**Example**
55+
```lua
56+
exports.it_bridge:CreateBoxZone({
57+
label = 'Example Box Zone',
58+
name = 'example_box_zone',
59+
icon = 'fas fa-box',
60+
canInteract = function(entity, distance)
61+
return distance < 2.5
62+
end,
63+
onSelect = function(entity)
64+
print('You have interacted with the box zone.')
65+
end,
66+
distance = 2.5,
67+
}, {
68+
coords = vector3(0.0, 0.0, 0.0),
69+
size = vector3(2.5, 2.5, 2.5),
70+
rotation = 0.0,
71+
debug = true,
72+
drawSprite = true,
73+
minZ = 0.0,
74+
maxZ = 3.0,
75+
interactDistance = 2.5,
76+
})
77+
```
78+
79+
## AddTargetEntity
80+
```lua
81+
exports.it_bridge:AddTargetEntity(entities, options)
82+
```
83+
84+
- entities: `table | number`: The entities to add as target entities.
85+
- options: `table`: The options of the target entities.
86+
87+
Return all options that where added to the entities.
88+
89+
Adds the specified entities as target entities.
90+
91+
**Example**
92+
```lua
93+
local targetData = exports.it_bridge:AddTargetEntity(netId, {
94+
label = 'Example Entity',
95+
icon = 'fas fa-user',
96+
canInteract = function(entity, distance)
97+
return distance < 2.5
98+
end,
99+
onSelect = function(entity)
100+
print('You have interacted with the entity.')
101+
end,
102+
distance = 2.5,
103+
})
104+
```
105+
106+
## RemoveTargetEntity
107+
```lua
108+
exports.it_bridge:RemoveTargetEntity(entities, options)
109+
```
110+
111+
- entities: `table | number`: The entities to remove as target entities.
112+
- options: `table`: The options of the target entities.
113+
114+
Return all options that where removed from the entities.
115+
Removes the specified entities as target entities.
116+
117+
**Example**
118+
```lua
119+
local removed = exports.it_bridge:RemoveTargetEntity(netId, targetData)
120+
```
121+
122+
## AddGlobalPed
123+
```lua
124+
exports.it_bridge:AddGlobalPed(options)
125+
```
126+
127+
- options: `table`: The options of the global ped.
128+
129+
Return all options that where added to the peds.
130+
Adds a interaction for all peds in the world.
131+
132+
**Example**
133+
```lua
134+
local pedData = exports.it_bridge:AddGlobalPed({
135+
label = 'Example Ped',
136+
icon = 'fas fa-user',
137+
canInteract = function(entity, distance)
138+
return distance < 2.5
139+
end,
140+
onSelect = function(entity)
141+
print('You have interacted with the ped.')
142+
end,
143+
distance = 2.5,
144+
})
145+
```
146+
147+
## RemoveGlobalPed
148+
```lua
149+
exports.it_bridge:RemoveGlobalPed(options)
150+
```
151+
152+
- options: `table`: The options of the global ped.
153+
154+
Return `true` if the interactions was removed.
155+
Removes the interaction for all peds in the world.
156+
157+
**Example**
158+
```lua
159+
local removed = exports.it_bridge:RemoveGlobalPed(pedData)
160+
```
161+
162+
## AddGlobalPlayer
163+
```lua
164+
exports.it_bridge:AddGlobalPlayer(options)
165+
```
166+
167+
- options: `table`: The options of the global player.
168+
169+
Return all options that where added to the players.
170+
Adds a interaction for all players in the world.
171+
172+
**Example**
173+
```lua
174+
local playerData = exports.it_bridge:AddGlobalPlayer({
175+
label = 'Example Player',
176+
icon = 'fas fa-user',
177+
canInteract = function(entity, distance)
178+
return distance < 2.5
179+
end,
180+
onSelect = function(entity)
181+
print('You have interacted with the player.')
182+
end,
183+
distance = 2.5,
184+
})
185+
```
186+
187+
## RemoveGlobalPlayer
188+
```lua
189+
exports.it_bridge:RemoveGlobalPlayer(options)
190+
```
191+
192+
- options: `table`: The options of the global player.
193+
194+
Return `true` if the interactions was removed.
195+
Removes the interaction for all players in the world.
196+
197+
**Example**
198+
```lua
199+
local removed = exports.it_bridge:RemoveGlobalPlayer(playerData)
200+
```
201+
202+
## AddGlobalVehicle
203+
```lua
204+
exports.it_bridge:AddGlobalVehicle(options)
205+
```
206+
207+
- options: `table`: The options of the global vehicle.
208+
209+
Return all options that where added to the vehicles.
210+
Adds a interaction for all vehicles in the world.
211+
212+
**Example**
213+
```lua
214+
local vehicleData = exports.it_bridge:AddGlobalVehicle({
215+
label = 'Example Vehicle',
216+
icon = 'fas fa-car',
217+
canInteract = function(entity, distance)
218+
return distance < 2.5
219+
end,
220+
onSelect = function(entity)
221+
print('You have interacted with the vehicle.')
222+
end,
223+
distance = 2.5,
224+
})
225+
```
226+
227+
## RemoveGlobalVehicle
228+
```lua
229+
exports.it_bridge:RemoveGlobalVehicle(options)
230+
```
231+
232+
- options: `table`: The options of the global vehicle.
233+
234+
Return `true` if the interactions was removed.
235+
Removes the interaction for all vehicles in the world.
236+
237+
**Example**
238+
```lua
239+
local removed = exports.it_bridge:RemoveGlobalVehicle(vehicleData)
240+
```
241+
242+
## AddTargetModel
243+
```lua
244+
exports.it_bridge:AddTargetModel(models, options)
245+
```
246+
247+
- models: `table | string`: The models to add as target models.
248+
- options: `table`: The options of the target models.
249+
250+
Return all options that where added to the models.
251+
Adds the specified models as target models.
252+
253+
**Example**
254+
```lua
255+
local modelData = exports.it_bridge:AddTargetModel('a_m_m_skater_01', {
256+
label = 'Example Model',
257+
icon = 'fas fa-user',
258+
canInteract = function(entity, distance)
259+
return distance < 2.5
260+
end,
261+
onSelect = function(entity)
262+
print('You have interacted with the model.')
263+
end,
264+
distance = 2.5,
265+
})
266+
```
267+
268+
## RemoveTargetModel
269+
```lua
270+
exports.it_bridge:RemoveTargetModel(models, options)
271+
```
272+
273+
- models: `table | string`: The models to remove as target models.
274+
- options: `table`: The options of the target models.
275+
276+
Return all options that where removed from the models.
277+
Removes the specified models as target models.
278+
279+
**Example**
280+
```lua
281+
local removed = exports.it_bridge:RemoveTargetModel('a_m_m_skater_01', modelData)
282+
```
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Callout } from '@components/Callout'
22

3-
<Callout type="waring">
4-
Currently not available.
3+
# Server
4+
5+
<Callout type="error">
6+
The Interactions has no server exports available. If you want to use the Interactions exports please use the client exports.
57
</Callout>

0 commit comments

Comments
 (0)