From c0065bc67cc7d206fab53ac5dd164c2cdbba2a14 Mon Sep 17 00:00:00 2001 From: Beelzebub <34854689+Be1zebub@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:02:10 +0700 Subject: [PATCH] lua condition > sql condition --- gamemode/modules/base/cl_jobmodels.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gamemode/modules/base/cl_jobmodels.lua b/gamemode/modules/base/cl_jobmodels.lua index 5dd6ebaa3..7bcc07861 100644 --- a/gamemode/modules/base/cl_jobmodels.lua +++ b/gamemode/modules/base/cl_jobmodels.lua @@ -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