ID:141388
 
Code:
mob/var
house = 0
house2 = 0
allow_into_house = 0
dont_allow_house = 0

atom
movable
var
bought=0
bought1 = 0
bought2 = 0
houseowner=null
houseguild=null
houseown = 0
turf
var
bought=0
houseowner=null
houseguild=null
mob/var/canenter = 0

mob
house
verb
Allow_Into_House()
set category = "Channels"
set name = "Allow/Disallow House"
for(var/client/M in world)
if(M.client)
if(M.canenter==0||null)
M << "<font color=green>[usr] allows you into their house!</font>"
M.canenter = 1
else
if(M.canenter==1)
M << "<font color=green>[usr] disallows your entrance into their house!</font>"
M.canenter = 0
else
return

// Dont_Allow_House()
// set category = "Channels"
// set name = "Don't Allow House"
// for(var/mob/M in world)
// if(M.client)
// if(M == src || src == M)
// return
// else
// M << "<font color=red>[src] does'nt allow you into their house!</font>"
// M.canenter = 0

/*House_Teleport()
set category = "Channels"
set name = "House Teleport"
//Re-do parts of this system if you want
//other people, teleporting to your house.
if(src.house == 1 || src.canenter == 1)
src.loc=locate(33,30,1)
src << "<b>Your House</b>"
src.dir = SOUTH
src.see_invisible = 0
if(src.house2 == 1 || src.canenter == 1)
src.loc=locate(33,18,1)
src << "<b>Your House</b>"
src.dir = SOUTH
src.see_invisible = 0*/



turf
Door
Door1a //Door 1.
Enter(mob/M) //If a mob enters.
if(istype(M,/client)) //If it is a mob.
if(src.houseowner==null||src.houseowner==""||src.bought==0||src.bought==null)
if(M.house==0||M.house==null)
var/c = input("Do you want to buy this house, it costs 50,000,000 Zenni to buy it, still want to buy it?","House") in list ("Yes","No") //Buy it or not?
if(c == "Yes") //If Yes..
if(M.zenni >= 50000000) //Do you have enough gold?
M.zenni -= 50000000 //Subtract 5,000 gold
M.house = 1 //You now own this house.
src.bought=1 //You bought this house.
src.houseowner="[M.name]" //You own this house.
src.houseguild="[M.guild_name]"
M.verbs += typesof(/mob/house/verb/) //Give the House Owner verbs.
else //Else..
M << "<font color=red>You need <font color=black>[50000000-M.zenni]</font><font color=red> more Zenni to buy this House.</font>" //You need more gold.
return //Return it..
if(c == "No") //If the answer is NO
M << "<font color=red>You decided not to buy the house.</font>" //You chose NOT to buy the house.
return //Return it..
else
if(src.bought==1) //If you can enter or not.
if(src.houseowner=="[M.name]"||src.houseguild="[M.guild_name]") //If you can enter or not.
M.loc=locate(241,243,5) //Bring the person inside.
else
M << "<font color=red>You cannot enter.</font>"
// M << "<font color=red>You cannot do that, you bought another house already.</font>" //You or someone else bought the house.
else
return


Problem description:

Care to give a problem description? >_>
I tried to fix it but i keep getting 58 errors all to do with the Vars >.>
In response to Mickmcgreevy
What are some of the errors saying? o.O
In response to Spunky_Girl
Buy House(2).dm:27:error:set :invalid proc definition
Buy House(2).dm:28:error:set :invalid proc definition
Buy House(2).dm:29:error:_block :invalid proc definition
Buy House(2).dm:242:error:bought1:undefined var
Buy House(2).dm:242:error:houseown:undefined var
In response to Mickmcgreevy
I didn't look through the whole thing, but I'm pretty sure you made Allow_Into_House() with incorrect indentations.
mob
house
verb
Allow_Into_House()
set category = "Channels"
set name = "Allow/Disallow House"
for(var/client/M in world)
if(M.client)
if(M.canenter==0||null)
M << "<font color=green>[usr] allows you into their house!</font>"
M.canenter = 1
else
if(M.canenter==1)
M << "<font color=green>[usr] disallows your entrance into their house!</font>"
M.canenter = 0
else
return
In response to Stupot
Or maybe given us a snippet of the wrong location?

Also, some things do not make sense:
                for(var/client/M in world)
if(M.client)

The above looks for /client, NOT /mob.
Therefore, M.client will give you an error about the variable not existing.

                        if(M.canenter==0||null)

null will never be evaluated because it is false... what you meant to say here is "||M.canenter==null".

Remember, M is a /client, not a /mob... and I doubt you assigned canenter to a /client variable

I suggest reading up boolean logic (or forum searching it), you could replace that whole thing above with "if(!M.canenter)", which will look if that variable is 0, null or "".
                    else
return


Not needed at all since the proc ends after that statement