ID:174201
 
Is there a way to exclude certain mobs from commands that involve them? IE:

Hi(mob/M in world)
M << "[src] says: Hi!"

Cause I have a lot of verbs that work this way, and I also have cars, which are defined as mobs. I dont wanna put the line:

if(istype(M,/mob/Car))
return

in every verb.
Enigmaster2002 wrote:
Is there a way to exclude certain mobs from commands that involve them? IE:

Hi(mob/M in world)
M << "[src] says: Hi!"

Cause I have a lot of verbs that work this way, and I also have cars, which are defined as mobs. I dont wanna put the line:

if(istype(M,/mob/Car))
return

in every verb.

Create a new list like this:
var/list/whatever= new//creates a new list called 'whatever'

then add people to the list
            for(var/mob/K in world)//does a for loop for every mob
if(K.client)//if the mob has a client
whatever+=K//add

then of course add cancel, get rid of your self and do the rest
            whatever+="Cancel"//add cancel to the list
whatever-=src//dont want your self in it do you?
var/mob/T=input ("Who to say hi to?")in whatever //asks who to say hi to, in a list
if(T=="Cancel") return// if its cancel return
T<<"[src] says: hi"//if not give the message

so it should look like this:
mob/verb/Hi()
var/list/whatever= new//creates a new list
var/howmanypeople=0//how many people there are
for(var/mob/K in world)//does a for loop for every mob
if(K.client)//if the mob has a client
whatever+=K//add the mob to the list
howmanypeople+=1//puts it up by one
whatever+="Cancel"//add cancel to the list
whatever-=src//dont want your self in it do you?
howmanypeople+=1//puts it up by one (removing the player thats actully pressing it)
if(howmanypeople<=0)
src<<"Theres no one to say hi to"
return
var/mob/T=input ("Who to say hi to?")in whatever //asks who to say hi to, in a list
if(T=="Cancel") return// if its cancel return
T<<"[src] says: hi"//if not give the message


well at least it should there are other methods, but i cannot think of one since it is sort of late and i havnt done any thing with byond in a month or two, Oh and instead of manually removing the stuff to do with the person clicking it, look up the Continue proc (open dream maker, press f1 click on topic then type in Continue)
In response to Wanabe
Instead of adding Cancel, just set the input() to be "as anything|null":

var/mob/T=input("Who to say hi to?") as anything|null in whatever

Then you'll get a Cancel button, and you'll be able to press Escape to cancel the dialog box.