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 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
- if #players_here ~= 0 then
- for k,v in ipairs(players_here) do
- v = "<" .. ndb.getcolorp(v) .. ">" .. v
- echo(v)
- end
- end
- agui_people_tracker:clear()
- if #players_here== 0 then
- agui_people_tracker:cecho("<white>You are alone here.")
- elseif #players_here == 1 then
- agui_people_tracker:cecho("<orange>"..#players_here.."<white> other person here: "..table.concat(players_here, ", ")..".")
- else
- agui_people_tracker:cecho("<orange>"..#players_here.."<white> others here: \n"..table.concat(players_here, ", ")..".")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement