mob
verb
Trade(mob/M in oview (6))
set category = "Communication"
var/obj/O = input("Which item do you want to trade?")in usr.contents
switch(input(M,"[usr] wants to trade his [O]!","Trade","No") in list("Yes","No"))
if("Yes")
switch(input(M,"What will you trade for [usr]'s [O]?","Zenni","Item") in list("Zenni","Item"))
if("Zenni")
var/obj/Z = input("How much zennie do you wish to trade for [O]?") as num|null
if(Z < 0)
M << "You cheapskate! You need to put more than 0"
return
if(Z > 0)
switch(input(usr,"[M] has offered you [Z] Zenni, Do you accept?","Yes","No") in list("Yes","No"))
if("Yes")
O.loc = M
M.zenni -= Z//M looses the Cash he bought the item with
usr.zenni += Z//usr gains the Cash that M lost
if("No")
usr << "[M] decided not to."
if("Item")
var/obj/O2 = input("Which item do you want to trade?")in M.contents
switch(input(usr,"[M] wants to trade his [O2]for your [O]!","Trade","No") in list("Yes","No"))
if("Yes")
O.loc = M
O2.loc = usr
usr << "Trade finished"
M << "Trade finished"
if("No")
usr << "[M] doesnt want to trade at all."
In the line var/obj/Z = input("How much zennie do you wish to trade for [O]?") as num|null i need that to be asked to M, not usr.
Also in var/obj/O = input("Which item do you want to trade?")in usr.contents - is there a way to not make certain things in the list show up? Help would be appriciated.
James</0>
ID:148159
![]() Jun 19 2003, 9:13 pm
|
|
There ya go