ID:146004
 
Code:
                if("Restore")
var/list/L = new
for(var/mob/M in world)
L += M.name
var/namepick = input("Who do you pick?")in L
for(var/mob/M in world)
if(M.name == namepick)
M << "<b>A bright light shines from above as you feel regenerated!"
M.powerlevel = M.mpowerlevel
M.energy = M.menergy
M.strength = M.mstrength
M.defence = M.mdefence


Ok this code is used to restore the players. it brings up a list of all mobs in world and you select one to heal, it also brings up the NPC's so i was wondering if some one could please help me make it so only players appear in the list

mob/player/m in world


You should have a sub-type for players and NPC's/other mobs.
In response to N1ghtW1ng
ty works perfectly
                if("Restore")
var/list/L = new/list()
for(var/mob/M in world)
if(M.key) L += M.name
var/namepick = input("Who do you pick?")in L
for(var/mob/M in world)
if(M.name == namepick)
M << "<b>A bright light shines from above as you feel regenerated!"
M.powerlevel = M.mpowerlevel
M.energy = M.menergy
M.strength = M.mstrength
M.defence = M.mdefence


This code change may also help.
In response to Ryuo
ty
In response to N1ghtW1ng
Psh, says who? If it were me, I'd check each mob to see if they had a key defined, that way you'd know either if a player is connected to them, or WAS connected to them and might rejoin. There is no /mob/player in Maeva. All creatures share the same properties so basically, you can control anything from a human, to a dragon, to a shrieking purple mushroom (complete with the shrieking!). Of course, if you're making a system where you want efficiency over complexity, /mob/player and /mob/npc are probably the ways to go, as you can make a lot more npcs and still save resources by just making them less complex than players.