Advertisement
tree_

Untitled

Sep 11th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. function getData() -- This function gets the data to display in 'memo' (display all on duty people, with their info)
  2. local peopleOnDispatch = { }
  3. for k, v in ipairs(getElementsByType("player")) do
  4. if exports.factions:isPlayerInFaction(v, 59) then
  5. local officerStatus = getElementData(v, "dispatch:status")
  6. if officerStatus ~= nil and officerStatus ~= "Off duty" then
  7. local officerAvailability = getElementData(v, "dispatch:availability") or "Not set"
  8. local officerCallsign = getElementData(v, "dispatch:callsign") or "Not set"
  9. local streetlocation = getElementData(localPlayer, "speedo:street") or false
  10. if streetlocation then
  11. table.insert(peopleOnDispatch[officerCallsign], string.gsub(getPlayerName(localPlayer), "_", " ").." - "..officerAvailability.." at "..streetlocation)
  12. else
  13. table.insert(peopleOnDispatch[officerCallsign], string.gsub(getPlayerName(localPlayer), "_", " ").." - "..officerAvailability)
  14. end
  15. elseif officerStatus == "Off duty" then
  16. return ""
  17. end
  18. end
  19. end
  20.  
  21. local content = ""
  22. for key, value in pairs(peopleOnDispatch) do
  23. content = content..""..tostring(key).."\n"..value.." \n \n "
  24. end
  25. return content
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement