Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Index to access values from a table instead of 2 for #491

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
22 changes: 10 additions & 12 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,16 @@ local function GetActiveData(cid)
end

local function IsPoliceOrEms(job)
for k, v in pairs(Config.PoliceJobs) do
if job == k then
return true
end
end

for k, v in pairs(Config.AmbulanceJobs) do
if job == k then
return true
end
end
return false
local s,r = pcall(function()
local _job = type(job) == "string" and job or tostring(job)
if _job and Config.PoliceJobs[_job] or _job and Config.AmbulanceJobs[_job] then
return true
else
return false
end
end)
if not s then return false end
return r
end

RegisterServerEvent("ps-mdt:dispatchStatus", function(bool)
Expand Down