Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion server/sv_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,15 @@ function ServerDataInit()
local tags_table = MySQL.Sync.fetchAll('SELECT * FROM kf_police_tags', {})
local penalcode_table = MySQL.Sync.fetchAll('SELECT * FROM kf_police_penalcode', {})

local identifierToCitizenId = {}

for k, v in pairs(server_players) do
if not v.citizenid then
goto skipUser
end

identifierToCitizenId[v.identifier] = v.citizenid

citizens[v.citizenid] = {
citizenId = v.citizenid,
firstname = v.firstname,
Expand Down Expand Up @@ -109,7 +113,7 @@ function ServerDataInit()
for k, v in pairs(vehicles_table) do
vehicles[v.plate] = {
plate = v.plate,
owner = FindCitizenIdByIdentifier(v.owner),
owner = identifierToCitizenId[v.owner],
model = v.model,
buyDate = 'N/A',
}
Expand Down