Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getData() -- This function gets the data to display in 'memo' (display all on duty people, with their info)
- local peopleOnDispatch = { }
- for k, v in ipairs(getElementsByType("player")) do
- if exports.factions:isPlayerInFaction(v, 59) then
- local officerStatus = getElementData(v, "dispatch:status")
- if officerStatus ~= nil and officerStatus ~= "Off duty" then
- local officerAvailability = getElementData(v, "dispatch:availability") or "Not set"
- local officerCallsign = getElementData(v, "dispatch:callsign") or "Not set"
- local streetlocation = getElementData(localPlayer, "speedo:street") or false
- if streetlocation then
- table.insert(peopleOnDispatch[officerCallsign], string.gsub(getPlayerName(localPlayer), "_", " ").." - "..officerAvailability.." at "..streetlocation)
- else
- table.insert(peopleOnDispatch[officerCallsign], string.gsub(getPlayerName(localPlayer), "_", " ").." - "..officerAvailability)
- end
- elseif officerStatus == "Off duty" then
- return ""
- end
- end
- end
- local content = ""
- for key, value in pairs(peopleOnDispatch) do
- content = content..""..tostring(key).."\n"..value.." \n \n "
- end
- return content
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement