ID:261580
 
ok i have a list that has peoples icon, description, age, gender and stuff but i cant remove it...this is my code

mob
Login()
..()
Players.Add(src,"Players Description: [desc]","Players Gender: [Gender]","Players Age: [Age]")
Logout()
Players.Remove(src,"Players Description: [desc]","Players Gender: [Gender]","Players Age: [Age]")


its in a stat for everyone and it wont delete... If you can plz help thx
Shy_guy197 wrote:
ok i have a list that has peoples icon, description, age, gender and stuff but i cant remove it...this is my code

mob
Login()
..()
Players.Add(src,"Players Description: [desc]","Players Gender: [Gender]","Players Age: [Age]")
Logout()
Players.Remove(src,"Players Description: [desc]","Players Gender: [Gender]","Players Age: [Age]")

its in a stat for everyone and it wont delete... If you can plz help thx

Uhh... why you're doing a stat list that way I have no idea. Add() is adding multiple items to the list for you, while I don't know if Remove() would even work that way.

What you should be doing instead is making a list with just the players listed (i.e., just add src), and in mob/Stat() do all the rest:
mob/Stat()
statpanel("Players")
for(var/mob/M in Players)
if(!M)
Players-=null
continue
stat(M,"[M.Gender], Age [M.Age]")
stat(M.desc)

That will produce a player list looking something like this:
Bob       Male, Age 32
          one big ugly thug
Samantha  Female, Age 28
          failed starlet
Ike       Male, Age 19
          boxer with more teeth than brain cells

Lummox JR
In response to Lummox JR
Yeah thx but it was kinda to late >_< figured it out about a hour ago ne way i need a little bit of help on displaying how many ppl are online >_<
In response to Shy_guy197
mob/Stat()
..()
statpanel("Stats")
var/people = 0
for(var/mob/M in world)
people++
stat("People logged in:", people)
In response to Shy_guy197
Shy_guy197 wrote:
Yeah thx but it was kinda to late >_< figured it out about a hour ago ne way i need a little bit of help on displaying how many ppl are online >_<

If you're still using a global Players list, just try this:
mob/Stat()
statpanel("Players")
stat("[Players.len] player\s:")
for(var/mob/M in Players)
...

Lummox JR
In response to Nadrew
the code works good thx alot ^_^