Skip to content

Commit

Permalink
lua condition > sql condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Be1zebub authored and FPtje committed Sep 28, 2024
1 parent 49831f5 commit c0065bc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions gamemode/modules/base/cl_jobmodels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ end

timer.Simple(0, function()
-- run after the jobs have loaded
local models = sql.Query([[SELECT jobcmd, model, server FROM darkp_playermodels;]])
local models = sql.Query(string.format([[SELECT jobcmd, model FROM darkp_playermodels WHERE server IS NULL OR server = %s;]], sql.SQLStr(game.GetIPAddress())))

for _, v in ipairs(models or {}) do
if v.server and v.server ~= game.GetIPAddress() then continue end

local job = DarkRP.getJobByCommand(v.jobcmd)
if job == nil or not jobHasModel(job, v.model) then continue end

Expand Down

0 comments on commit c0065bc

Please sign in to comment.