ID:139199
 
Code:
if(src.Friends.len>0)
statpanel("Friends")
stat("Total Friends",src.Friends.len)
for(var/X in src.Friends)
var/client/M=locate(X)
if(M)
stat(M)


Problem description: I can make it show friends who are online

I would revise the code like so:

mob/Stat()
statpanel("Friends")
stat("Total Friends",length(src.Friends))
if(src.Friends)
for(var/client/C in src.Friends)
if(C) stat(C)


That last if(C) might not be necessary, I forget how it checks through lists regarding logging situations.
In response to Nal_rA
still not showing in statpanel
In response to Hassanjalil
if(src.Friends.len>0)
statpanel("Friends")
stat("Total Friends",src.Friends.len)
for(var/src.Friends/F in world)
stat(F)


Try that, not sure if it will work. I didnt test it or anything but meh.