ID:174667
 
how would i make a list which kept the name of everyone in the world, and then give all the ppl in that list a verb?
mob/verb/GiveaVerb()
for(var/mob/M in world)
if(M.client)
M.verbs += /mob/verb/Givinverb
In response to Kunark
is that a list? im almost positive what i need is a list, not a verb... sorry if this sounds kinda... stubborn but i really need a list.
In response to Redslash
Well, what are you asking? Are you asking how to give players a verb, or asking how to keep a list of players?
In response to Redslash
This is what I would do, pretend List is a list I declared earlyer

mob/Player
Login()
List+=usr.key
Logout()
List-=usr.key

Or something like that, I dont know if it works, but I would use Login and Logout to keep track. If you want, make a loop and every time check each keys to see if the user is still there, just in case
In response to FranquiBoy
If you want to see/do something to all people connected to the world, simply loop through them with a for() statement and display/add them to a temperary list if they have a client, which only players have.
In response to FranquiBoy
thanks, that works!
In response to Kunark
I never thought of that, loop trew all mobs in world and taking the ones with clients
In response to Kunark
Even better; loop through all the clients in the world and add the actual clients to a list. =)