mob/verb/dude() var/mobkey = list() for(var/mob/M in world) if(M.client) mobkey += M.key var/who = input("Uhhh who do you want to look at","") in mobkey+list("Cancel") if(who=="Cancel") return for(var/mob/M2 in world) if(who == M2.key) alert("You looked at [M2] key:[who]")
proc/selectClient(mob/M=usr,filter_mob=0) var list/clients[0] client/C for(C) if(!filter_mob || C.mob) clients+=C.key var/key= input(M,"Select a player out of the list below.") as null|anything in clients if(key) for(C) if(C.key==key) break if(C) return C
...
Edit() var/client/C= selectClient(usr,1) //allows the player to select a client and filters the list for clients that don't have a mob if(!C) return//no client was selected, so abort. var/mob/M= C.mob //M = the mob of the player if(!M) return//sanity check: what if? ... //perform you own actions here
something like this?