Skip to content

Commit

Permalink
chore(readme): improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
solareon committed Jun 10, 2024
1 parent 537255a commit dd92930
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 23 deletions.
67 changes: 46 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# slrn_groups
A qb-phone compatible group app for [lb-phone](https://lbphone.com/)
A qb-phone compatible group app for [lb-phone](https://lbphone.com/). This isn't great code but it works.

**QB/QBOX supported with bridge**

Expand All @@ -18,41 +18,66 @@ Download the [release version](https://github.com/solareon/slrn_groups/release)

# Exports (server side only)

```lua
exports['qb-phone']:NotifyGroup(groupID, msg, type)
Both `export.slrn_groups` and `exports['qb-phone']` are supported.

exports['qb-phone']:pNotifyGroup(groupID, header, msg)

exports['qb-phone']:CreateBlipForGroup(groupID, name, data)

exports['qb-phone']:RemoveBlipForGroup(groupID, name)
```lua copy
exports.slrn_groups:NotifyGroup(groupID, msg, type)
```

exports['qb-phone']:GetGroupByMembers(src)
```lua copy
exports.slrn_groups:pNotifyGroup(groupID, header, msg)
```

exports['qb-phone']:getGroupMembers(groupID)
```lua copy
exports.slrn_groups:CreateBlipForGroup(groupID, name, data)
```

exports['qb-phone']:getGroupSize(groupID)
```lua copy
exports.slrn_groups:RemoveBlipForGroup(groupID, name)
```

exports['qb-phone']:GetGroupLeader(groupID)
```lua copy
exports.slrn_groups:GetGroupByMembers(src)
```

exports['qb-phone']:DestroyGroup(groupID)
```lua copy
exports.slrn_groups:getGroupMembers(groupID)
```

exports['qb-phone']:isGroupLeader(src, groupID)
```lua copy
exports.slrn_groups:getGroupSize(groupID)
```

--------------------------------------------------
```lua copy
exports.slrn_groups:GetGroupLeader(groupID)
```

exports['qb-phone']:setJobStatus(groupID, status, stages)
```lua copy
exports.slrn_groups:DestroyGroup(groupID)
```

exports['qb-phone']:getJobStatus(groupID)
```lua copy
exports.slrn_groups:isGroupLeader(src, groupID)
```

exports['qb-phone']:resetJobStatus(groupID)
```lua copy
exports.slrn_groups:setJobStatus(groupID, status, stages)
```

--------------------------------------------------
```lua copy
exports.slrn_groups:getJobStatus(groupID)
```

exports['qb-phone']:isGroupTemp(groupID)
```lua copy
exports.slrn_groups:resetJobStatus(groupID)
```

exports['qb-phone']:CreateGroup(src, name, password)
```lua copy
exports.slrn_groups:isGroupTemp(groupID)
```

```lua copy
exports.slrn_groups:CreateGroup(src, name, password)
```

# Copyright
Expand Down
5 changes: 3 additions & 2 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local function exportHandler(exportName, func)
AddEventHandler(('__cfx_export_qb-phone_%s'):format(exportName), function(setCB)
setCB(func)
end)
exports(exportName, func) -- support modern exports
end

-- Bridge
Expand Down Expand Up @@ -147,7 +148,7 @@ local function RemovePlayerFromGroup(src, groupID, disconnected)
table.remove(playerGroup[groupID].members, k)
playerGroup[groupID].Users -= 1
playerData[src] = false
pNotifyGroup(groupID, 'Job Center', v.name..' Has left the group', 'fas fa-users', '#FFBF00', 7500)
pNotifyGroup(groupID, 'Job Center', v.name..' Has left the group')
TriggerClientEvent('slrn_groups:client:RefreshGroupsApp', -1, playerGroup)
if not disconnected then doNotification(src, 'You have left the group', 'primary') end

Expand Down Expand Up @@ -292,7 +293,7 @@ RegisterNetEvent('slrn_groups:server:jobcenter_JoinTheGroup', function(data)
if playerData[src] then return doNotification(src, 'You are already a part of a group!', 'success') end

local name = GetPlayerCharName(src)
pNotifyGroup(data.id, 'Job Center', name..' Has joined the group', 'fas fa-users', '#FFBF00', 7500)
pNotifyGroup(data.id, 'Job Center', name..' Has joined the group')
playerGroup[data.id].members[#playerGroup[data.id].members+1] = {name = name, CID = player.PlayerData.citizenid, Player = src}
playerGroup[data.id].Users += 1
playerData[src] = true
Expand Down

0 comments on commit dd92930

Please sign in to comment.