ID:165229
 
Hey,

I've made houses in my game for the new update coming,
And its working great, People can buy them, Only enter if they are the owner, Or if the owner has given them a key to it.

BUT!

I want to make a shop..
To sell players stuff for there houses,
I know how to do that but heres the big problem,
If someone gets into their house, They will be able to pic up their obj's they have placed down (Chairs, tables etc)

Is there a way only the OWNER of that obj can pic it up?

Please help me with this!
And reply ASAP.

Thanks,

- Bevan
Basically under the pickup verb that you have, use the same method you used in not allowing people to enter other people's house.
In response to Mecha Destroyer JD
heres the code...

turf
Door2
Door2a //door number 2
icon = 'door.dmi' //the icon for the door
icon_state = "closed"
name="House_Door" //there is no name for it
opacity = 1 //this will allow so you can't see through the door
Enter(mob/M) //bump into the door to get the list of questions to buy the house or not
if (istype(M,/mob)) //you can change this to something like /mob/player to allow that only players can enter
if(M.house2 == 1||M.canenter == 1) // telling byond to let you in if you own the house or have a "key" to the house...
M.loc=locate(28,16,1) //locate the person to the house
M.see_invisible=0 //you'll need this no matter what

else
if(bought2==0 && houseown==0) // if the house is unowned ask you if you wanna buy it
var/c = input("Do you want to buy this house, it costs 5,000 gold to buy it, still want to buy it?","House") in list ("Yes","No") //the switch alert to buy the system
if(c == "Yes") //if the answer is yes
if(usr.gold >= 5000) //check the gold amount.
M.gold -= 5000 //subtract the gold from your total gold
M.house2 = 1 //if you already own a house
bought2=1 //if you bought it already
houseown=1 //you own that house
M.verbs += /mob/house/verb/House_Key //this verb makes it so you can give them easy access to your house
M.verbs += /mob/house/verb/Take_Key //this verb makes it so you can get rid of the allowed access to your house

else
alert("Sorry, but you dont have enough gold.") //you need more gold sorry!

if(c == "No") //if the answer is no
alert("You chose not to buy this house!!!") //you chose not to buy the house
else
alert("Sorry, someone already owns this house or you already bought one.") //you already bought a house already don't try to cheat the system!


I dont se how i can change my get verb to something like that..

EDIT: Put it in code.
In response to BEVAN
First, put your code in DM tags (<dm> and </dm>).
In response to Popisfizzy
It's really pretty simple to do:

Make a new variable for obj's called "Owner". When they buy the item, have it set the item's owner to the user's key.

Then...for the pickup..

obj
furniture
verb/Get()
if(src in view(1))
if(src.Owner = usr.key)
src.loc = usr
else
usr << "This is not yours."
In response to Cliff Hatomi
Thank you so very much!

Been hours to work out how to do that,

=]

- Bevan

~Keep Your Hands Off My Gurl~
In response to BEVAN
Glad to help.




- Cliff H.