Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i, ply in ipairs(members) do
- ply.online = IsMemberOnline(ply.name)
- ply.playtime = ply.online and (ply.playtime + RefreshTime) or 0
- ply.offline_time = ply.online and 0 or (ply.offline_time + RefreshTime)
- end
- table.sort(members, function(ply1, ply2)
- if ply1.online and not ply2.online then
- return true
- end
- if ply1.online and ply2.online then
- return ply1.playtime > ply2.playtime
- else
- return ply1.offline_time > ply2.offline_time
- end
- return false
- end)
Add Comment
Please, Sign In to add comment