Mail Code
if("Mail A Letter: 5G")
if(M.gold >= 5)
var/list/letters=list()
for(var/obj/Inventory/Letter/L in M)
letters.Add(L)
letters.Add("Cancel")
var/obj/O=input(src,"Mail which letter?")in letters
if(O == "Cancel")
alert("Alright, if you change your mind, come back!","Talking to [src]")
return
var/list/mailboxes=list()
for(var/obj/Furniture/Mailbox/MB in world)
if(istype(M,/obj/Furniture/Mailbox)) mailboxes.Add(M)
mailboxes.Add(MB)
mailboxes.Add("Cancel")
var/obj/O2=input(src,"Mail the letter to which mailbox?")in letters
if(O2 == "Cancel")
alert("Alright, if you change your mind, come back!","Talking to [src]")
return
switch(input("Let me make sure: You want [O] sent to [O2]?","Talking to [src]", text) in list ("Corrent","Wrong"))
if("Wrong")
alert("Alright, lets start from the beginning..","Talking to [src]")
return
if("Correct")
if(M.gold >= 5)
M.gold -= 5
O2.contents += O
alert("Your mail was sent to [O2], thank you!","Talking to [src]")
return
else
alert("You don't have enough money to do that.","Talking to [src]")
return
alert("You don't have enough money to buy that.","Talking to [src]")
return
Problem description:
Bascilly players can go to the post office and buy a letter, fill it out, and then mail it through the post mob to any active mailbox objs in the game.
It compiles fine, but when I go to try it in game, I get a bunch of run time errors.
-Exophus