diff --git a/server/storage/players.lua b/server/storage/players.lua index 7d302453a..21c970bc7 100644 --- a/server/storage/players.lua +++ b/server/storage/players.lua @@ -326,7 +326,7 @@ local function fetchPlayerGroups(citizenid) local validGroup = group.type == GroupType.JOB and GetJob(group.group) or GetGang(group.group) if not validGroup then lib.print.warn(('Invalid group %s found in player_groups table, Does it exist in shared/%ss.lua?'):format(group.group, group.type)) - elseif not validGroup[group.grade] then + elseif not validGroup.grades?[group.grade] then lib.print.warn(('Invalid grade %s found in player_groups table for %s %s, Does it exist in shared/%ss.lua?'):format(group.grade, group.type, group.group, group.type)) elseif group.type == GroupType.JOB then jobs[group.group] = group.grade @@ -383,7 +383,7 @@ local function cleanPlayerGroups() if not validGroup then MySQL.query.await('DELETE FROM player_groups WHERE `group` = ? AND type = ?', {group.group, group.type}) lib.print.info(('Remove invalid %s %s from player_groups table'):format(group.type, group.group)) - elseif not validGroup[group.grade] then + elseif not validGroup.grades?[group.grade] then MySQL.query.await('DELETE FROM player_groups WHERE `group` = ? AND type = ? AND grade = ?', {group.group, group.type, group.grade}) lib.print.info(('Remove invalid %s %s grade %s from player_groups table'):format(group.type, group.group, group.grade)) end