ID:166691
 
i have a selling system but i want to change it to a click to sell system how would i do this? You need to only be able to sell to a shop owner right now.
Click() ...well, guess what it is for ... get_step() for locating someone ahead of you, locate() or istype() for identifying that the person that is ahead of you (and if you want, maybe set up a variable or two)... the rest should be selling procedures... or if you have another proc for selling, call that

- GhostAnime

PS: Try to make it using the info above. after you are done and have problems with the code, post the snippet and we'll help :)
In response to GhostAnime
GhostAnime wrote:
Click() ...well, guess what it is for ... get_step() for locating someone ahead of you, locate() or istype() for identifying that the person that is ahead of you (and if you want, maybe set up a variable or two)... the rest should be selling procedures... or if you have another proc for selling, call that

- GhostAnime

PS: Try to make it using the info above. after you are done and have problems with the code, post the snippet and we'll help :)

                if("Sell")
usr<<"Click on the items to sell them"
Click()

I have no clue where to begin. Did I mention this is my first game, and my first time coding one? I have NO clue how to make the actual proc for selling by clicking, and wouldn't know were to put the checking for the shop owner besides at the top of the proc >_>
In response to FriesOfDoom
Are you talking about puting the names of the items ina browser and make a href out of them?
In response to FriesOfDoom
It is wisee to look up procs you don't know prior of. If you did, you would of found this in F1: Click proc (atom)

Meaning: atom/Click()


There is many ways to implant the selling system but here's a corrupted one:
Items
parent_type=/obj
Click()
if(!(locate(/mob/Shopkeeper) in get_step(src,dir)))return//if there's no shopkeeper directly in front of the person, this stops it from continuing. Generally it is good to add a bracket in front of !, ESPECIALLY if 'in' is being used.
if(src.sellable)
if((alert(usr,"Do you wish to sell [src] for [value]?",,"Yes","No")) != "Yes")return
usr.money+=value
usr<<"\green You sold [src] for [value]!"
del(src)


- GhostAnime
In response to National Guardsmen
National Guardsmen wrote:
Are you talking about puting the names of the items ina browser and make a href out of them?

no.....?
why would i want to link game items to web pages?

By the way, how would i make it so the browser showed a FAQ when the usr logged in? Ive been trying to figure that out too
In response to FriesOfDoom
also, i give up on the stupid selling system, for now players will just have to sell one item at a time.
You could probably edit the code found [link] there to do what you want.