Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function update_players_here(event)
- if not gmcp.Room then return end
- if not players_here then players_here = {} end
- if not players_heref then players_heref = {} end
- if event == "gmcp.Room.Players" then
- players_here = {}
- for i,v in pairs(gmcp.Room.Players) do
- if v.name ~= gmcp.Char.Name.name then
- table.insert(players_here, v.name)
- end
- end
- elseif event == "gmcp.Room.AddPlayer" then
- if not table.contains(players_here, gmcp.Room.AddPlayer.name) then
- table.insert(players_here, gmcp.Room.AddPlayer.name)
- end
- else
- for i,v in pairs(players_here) do
- if v == gmcp.Room.RemovePlayer then
- table.remove(players_here, i)
- end
- end
- end
- players_heref = table.deepcopy(players_here)
- if #players_heref ~= 0 then
- for k,v in ipairs(players_heref) do
- if not v:find("<") then
- players_heref[k] = "<" .. ndb.getcolorp(v) .. ">" .. v
- end
- end
- end
- agui_people_tracker:clear()
- if #players_heref == 0 then
- agui_people_tracker:cecho("<white>You are alone here.")
- elseif #players_heref == 1 then
- agui_people_tracker:cecho("<orange>"..#players_heref.."<white> other person here: ".. ndb.getcolorp(players_heref[1]) .. players_heref[1] .. "<white>.")
- else
- agui_people_tracker:cecho("<orange>"..#players_heref.."<white> others here: \n"..table.concat(players_heref, "<white>, ").."<white>.")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement