In response to Xooxer
Probably :p

From what I've seen he should be able to do all this fairly easily.
In response to Xooxer
Xooxer wrote:
for(var/T in list)
if(T == "something")
list-=T

or...

for(var/T in list)
if(T == "something")
list.Remove(T)

Ok I tried these.. They compiled ok, but still don't work :( And I've had sleep now.. I wonder whats going on wrong? The add code is same as before it gets the name there. The reason behind why I'm doing this is I want to show a listing of all the players currently on the planet. Also later in combat mode it will allow you to choose who you wish to attack while on the planet. I just need to make sure it removes the names when they leave so someone can't later get attacked while they are not actually on the planet. Below is my remove code for the test thats not working.

LJR


if(C == "Launch Ship")
M.loc = M.lastloc
M.icon_state = M.lasticon
usr << "You launch into space."
for(var/T in players)
if(T == "[M.name]
")
players.Remove(T)
In response to LordJR
Anyone know how to fix the problem above? I keep hearing how easy it should be, but no one has shown me anything that will actually work.. All the code from looks sounds good but when I try it even though it compiles, it won't remove the text from my LIST!!!

Ok the code is there, everything is working but I have 1 problem. It won't remove the player's names from the list. Now for the contest. If anyone can recommend some the right code for this job and I can get it to work. Then I'm awarding a free 1 month's subscribtion to Star Traders(Normally 5DIMES).

Congrats go to Gazoot!!! It took a combonation and then some of a lot of stuff posted here, and finally I was able to get this code to work. Gazoot was awarded a 1 month's subscription to Star Traders.

LJR
In response to LordJR
I've been meaning to ask, but where is the players list defined, and are you ure you have new() in it's definition, or anywhere? Before you go placing player's names in the list, it has to be new()ed ... heh

turf/planet
var/list/planet = new()

~X
In response to Xooxer
hmmm no
I have this

var/list/players

If I need = new()
then why does adding a name work just fine???

LJR
In response to LordJR
becuase you're probably only adding in one name. without new() it treats players as a variable, so you can add a name to it, which sets the variable. I found this out a short while ago while helping someone else out. They too forgot new() and couldn't understand why their lists were acting like variables.... try this:

usr << "[players]"

after you add somthing to it. If it returns "/list" it's a litst, if not, it will return what you added, ie: "your name".

~X
In response to Xooxer
ok it now returns /list and doesn't work at all now that I added = new() whats this suppose to do???

LJR
Page: 1 2