ID:266613
 
Ugghh I've been having some problems remember how to use input to it's fullest...

Ok what I did is I created a mob and told him to go to another town and ask him if the trade is ok...
Then when he's done it's supose to spawn ssage and go back to the original town but I can't get it to display the message to the other town...

mob/proc/essage(mob/M as mob in world)
if(get_dist(src,M) <=1)
if(istype(M,/mob/pc))
if(M.ownr!=src.owner)
M<<"[src.ownr] is offering you [src.amo] gold for [src.amo2] gold"
switch(input("Do you accept?","You accept?",M) in list("Yes","No"))
if("Yes")
src.amo3="Yes"
walk_towards(src,src.hometown,src.walkspeed)
spawn(100)
src.ssage()
return
if("No")
src.amo4="No"
walk_towards(src,src.hometown,src.walkspeed)
spawn(100)
src.ssage()
return







oooooooooo and does this work?

switch(input("Do you accept?","You accept?",M) in list("Yes","No"))
if("Yes")
or how would you make it so M recieves it instead of src?
just glancing and I saw this


if(M.ownr!=src.owner) the vars dont match :D
In response to Sariat
so? :)

I ment to put it that way ownr is a sub-version of owner that makes it so you can't become the mob but it still belongs to you...

but that's beside the point :)
Back to the good ol' Reference under input() we find:

input(Usr=usr,Message,Title,Default) as Type in List

The first option on that list is "usr=usr", meaning that it will by default be sent to the usr, or whoever intitiates the stuff that starts the input. If you want to change it, just change the first variable in the input proc to whoever you want it sent to.

<code>switch(input(M,"Whee!","WheeMessage","Okay") in list("Fun","No Fun"))</code>
In response to Foomer
ahhhh crap I should have looked a little closer in the ref... hahahah
thanks :)