ID:144840
 
Code:
Mailing
mob/NPC/Monstro_Village_Post
name = "Monstro Village Post Office"
icon = 'Players.dmi'
icon_state = "shadow"
density = 1
New()
src.CreateName()
..()

verb/Talk()
set src in oview(2)
set category = null
var/mob/M = usr

switch(input("Welcome to the Village post office, what do you need today?","Talking to Post Master", text) in list ("Buy A Letter: 10G","Mail A Letter: 5G","Never Mind"))

if("Buy A Letter: 10G")
if(M.gold >= 10)
alert("Here is your letter, please come again!","Talking to Post Master")
M.contents += new/obj/Inventory/Letter
M.gold -= 10
return
alert("You don't have enough money to buy that.","Talking to Post Master")
return

if("Mail A Letter: 5G")

var/list/letters=list()
for(var/obj/Inventory/Letter/L in M.contents)
letters.Add(L)
letters += "Cancel"

if(letters.len<=1)
alert("You need a letter to mail first!","Talking to Post Master")
return

var/obj/L = input(M,"Mail which letter?")in letters

if("Cancel")
alert("Alright if you change your mind come back please!","Talking to Post Master")
return


var/list/boxes=list()
for(var/obj/Furniture/Mailbox/B in world)
boxes.Add(B)
boxes += "Cancel"

if(boxes.len<=1)
alert("Sorry there are no acitve mailboxes,,","Talking to Post Master")
return

var/obj/B = input(M,"Mail [L] to where?")in boxes

if("Cancel")
alert("Alright if you change your mind come back please!","Talking to Post Master")
return


switch(input("So you want to mail [L] to [B]?","Talking to Post Master", text) in list ("Correct","Wrong"))
if("Wrong")
alert("Ok lets start from the beginning then..","Talking to Post Master")
return

if("Correct")
if(M.gold >= 5)
L.loc = B.contents
M.gold -= 5
alert("Ok [L] was mailed to [B], please come again!","Talking to Post Master")
return
else
alert("You need more money before you can mail anything!","Talking to Post Master")
return


Problem description:
The first part, where if you want to mail a letter works just fine. It checks for letters in the players inventory, ect, does what I want.

When it gets to the next part, the part about the mailboxes in the world. It just skips to the cancel part. I added a mailbox in the world to see if that changes anything, but it still just skips to the cancle part, as if the mailbox never exists or something. It is spelt right, I have checked it a few times, and for the life of me I can't understand what is wrong.

I reposted this because the problem is now different then the last one and no one was even bothering to look at my last post. =(

if (b == "Cancel")
alert("Alright if you change your mind come back please!","Talking to Post Master")
return

You just forget to put the b ==.