HasPlayerGotGroup
Checks if a player has a specific job, gang, group, or citizenid.Parameters
filter(string | string[] | table<string, number>) - The filter to check against- String: Job name, gang name, group name, or citizenid
- Array: List of job/gang/group names or citizenids
- Hash table: Map of job/gang/group names to minimum grade levels
playerData(table) - The player data object to checkprimary(boolean) - Optional. If true, only checks primary job/gang
Returns
boolean- True if the player matches the filter
Examples
Notes
- Function borrowed from ox_target with MIT License
- When checking grades, the player must have that grade level or higher
- Can check jobs, gangs, groups, and citizenids simultaneously
- Setting
primaryto true ignores secondary jobs/gangs
GetPlayerGroups
Returns all jobs and gangs a player has as a combined table.Parameters
playerData(PlayerData) - The player data object
Returns
table<string, integer>- Map of group names to grade levels
Example
Notes
- Combines both
playerData.jobsandplayerData.gangsinto one table - Warns if duplicate group names are found between jobs and gangs
- Used internally by
HasPlayerGotGroupwhenprimaryis false