Skip to content

Commit 9acd263

Browse files
authored
Merge pull request #235 from Rhydium/main
Clarify permission prefix usage in function documentation for OxPlayer.hasPermission
2 parents 5fb5309 + 715e669 commit 9acd263

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

Diff for: pages/ox_core/Classes/Client/OxPlayer.mdx

+12
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@ player.hasPermission(permission)
128128
**Returns**
129129
- `boolean`
130130

131+
**Example**
132+
133+
```lua
134+
-- Adding a permission to a group (server side)
135+
Ox.SetGroupPermission('police', 1, 'handcuff', 'allow')
136+
137+
-- Checking if a player has the 'handcuff' permission
138+
if player.hasPermission('group.police.handcuff') then
139+
-- Do something
140+
end
141+
```
142+
131143
## OxPlayer.removeStatus
132144

133145
Reduces the value of a status.

Diff for: pages/ox_core/Classes/Server/OxPlayer.mdx

+12
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,18 @@ player.hasPermission(permission)
276276

277277
- `boolean`
278278

279+
**Example**
280+
281+
```lua
282+
-- Adding a permission to a group
283+
Ox.SetGroupPermission('police', 1, 'handcuff', 'allow')
284+
285+
-- Checking if a player has the 'handcuff' permission
286+
if player.hasPermission('group.police.handcuff') then
287+
-- Do something
288+
end
289+
```
290+
279291

280292
## OxPlayer.logout
281293

Diff for: pages/ox_core/Functions/server.mdx

+12
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,18 @@ Ox.SetGroupPermission(groupName, grade, permission, value)
376376
- permission: `string`
377377
- value: `allow` | `deny`
378378

379+
**Example**
380+
381+
```lua
382+
-- Adding a permission to a group (server side)
383+
Ox.SetGroupPermission('police', 1, 'handcuff', 'allow')
384+
385+
-- Checking if a player has the 'handcuff' permission
386+
if player.hasPermission('group.police.handcuff') then
387+
-- Do something
388+
end
389+
```
390+
379391
## Ox.SpawnVehicle
380392

381393
Spawns an `OxVehicle` with the given dbId, if it hasn't already been spawned.

0 commit comments

Comments
 (0)