Events
What's resource:
?
resource:
?resource
is the name of the resource to which the group belongs. In other words, if your resource is called "av_boosting", then the event name will be "av_boosting:groupDeleted", for example.
resource:groupDeleted
This client event is triggered when the export deleteGroup() wipes a group, it is triggered to every member of the group, the event doesn't contain any parameter.
RegisterNetEvent("av_boosting:groupDeleted", function() print("oops your group got deleted") end
resource:updateGroups
This client event is triggered only if one of the following exports are successful:
createGroups(): If the group is created, the script will update all players in server.
removeMember(): If a member is removed from a group, this will update the removed player and all members from the same group.
leaveGroup(): If a member leaves a group it will update the group members only, BUT if the group doesn't have any members left it will update all players in server.
-- The event receives all existing groups that belong to that resource RegisterNetEvent("av_boosting:updateGroups", function(allGroups) print(json.encode(allGroups, {indent = true})) end
resource:leaveGroup
This is a server event and it gets triggered after one of the following exports are successful:
removeMember(): If member is removed from a group.
leaveGroup(): If a member leaves a group.
deleteGroup(): When a group is deleted.
RegisterServerEvent("av_boosting:leaveGroup", function(identifier) local playerSource = exports['av_laptop']:getSourceByIdentifier(identifier) if playerSource then -- Trigger something to client if you want (or not) end end)
Last updated