obj/var
open=0
password = null
mob
var
build[] = list(new/obj/buildobjs/PasswordFence,
new/obj/buildobjs/Grass,
new/obj/buildobjs/Wall,
new/obj/buildobjs/Wall2,
new/obj/buildobjs/Wall3,
new/obj/buildobjs/Wall4,
new/obj/buildobjs/Floor,
new/obj/buildobjs/Floor1,
new/obj/buildobjs/Floor2,
new/obj/buildobjs/Floor3,
new/obj/buildobjs/Floor4,
new/obj/buildobjs/Floor5,
new/obj/buildobjs/Flower,
new/obj/buildobjs/Flower1,
new/obj/buildobjs/Flower2,
new/obj/buildobjs/DirtPatch,
new/obj/buildobjs/Mud,
new/obj/buildobjs/Piano,
new/obj/buildobjs/Bucket,
new/obj/buildobjs/Hay,
new/obj/buildobjs/Dresser,
new/obj/buildobjs/Dresser1,
new/obj/buildobjs/Dresser2,
new/obj/buildobjs/Pole,
new/obj/buildobjs/Bookshelf,
new/obj/buildobjs/Bookshelf2,
new/obj/buildobjs/Bookshelf3,
new/obj/buildobjs/Matt,
new/obj/buildobjs/Stove,
new/obj/buildobjs/Stove1,
new/obj/buildobjs/Stove2,
new/obj/buildobjs/Candles,
new/obj/buildobjs/Light,
new/obj/buildobjs/Table,
new/obj/buildobjs/Table1,
new/obj/buildobjs/Chair1,
new/obj/buildobjs/Chair2,
new/obj/buildobjs/Chair3,
new/obj/buildobjs/Chair4,
new/obj/buildobjs/Stairs,
new/obj/buildobjs/BedTop,
new/obj/buildobjs/BedBottom)
Stat()
statpanel("Build")
for(var/s in src.build)
stat(s)
obj
buildobjs
icon='BuildingTurfs1.dmi'
PasswordFence
icon_state="fencinggate"
naturalsuffix = "Purchase to Build/Make Fence Gates to protect your plot of land with a password!"
buyprice = 2500
Click()
if(usr.NoBuild==1)
usr<<output("You cannot build this here","chatoutput")
return
if(usr.NoBuild==0)
if(usr.zenni>=buyprice)
usr<<output("You have made [src]","chatoutput")
usr.zenni-=buyprice
var/o=new/obj/Build/PasswordFence1(usr.loc)
o:ownerof = "[usr.ckey]"
switch(alert(usr,"Would you like to set a password for your door?","Building","Yes","No"))
if("Yes")
o:password = input("What should it's password be?","Building")as text
if("No")
usr<<output("Just a warning, if you do this and someone clicks on your door, they will be able to get on your land!","chatoutput")
return
if(usr.zenni<=buyprice)
usr<<output("You do not have enough zenni for this. You may be able to build more grass when you have [buyprice] zenni.","chatoutput")
return
proc
tryit()
for(var/mob/m)
set background = 1
if(src.open == 1)
return 0
if(usr.owner == "[usr.ckey]")
if(!src.password)
src.open()
return 0
else
m <<output( {"<font color=#C0FFC0>Remember, the password for your door is "[src.password]"."},"chatoutput")
src.open()
return 0
if(!src.password)
src.open()
return 0
else
var/choice = input("What is the password?","Fencing Gate")as null|text
if(choice == src.password)
src.open()
return 0
else
m <<output( "<font color=#C0FFC0><I><B>Access Denied","chatoutput")
return 0
proc/open()
set background = 1
src.density = 0
src.opacity = 0
src.open = 1
flick("fencinggateopen",src)
src.icon_state = "fencinggate"
sleep(40)
src.density = 1
src.open = 0
flick("fencinggateopen",src)
src.icon_state = "fencinggate"
Second Part of Coding:
PasswordFence1
Click()
switch(alert("Enter Password","Password","Yes","No"))
if("Yes")
src.tryit()
if("No")
usr<<output("Ok","chatoutput")
return
icon_state="fencinggate"
density=1
Problem description:
Ok, so i gave you all two snippets of the fencing gate that im having trouble finishing. I am currently using a statpanel to give a description, and image of the item before you build it. I have it so that if you click it, you set it on your usr loc, etc. Well, I get that perfectly fine for the fence. But with map saving, i am trying to make it so that each plot of land, a person can set a password for their gate, and when they click on the gate on the map, it sends them to an alert to enter their password. if the password is correct, then it turns the density to 0 and allows you to walk through (also enabling a icon state of the gate opening and closing) well i keep getting an undefined proc error and im a little confused as to why. If anyone could help me out or needs more of the code, let me know. NOTE: I tried to do a bump proc and for some reason, i received no response in game. If someone could explain to me or contact me over skype on the bump proc let me know. Thanks so much in advance for your help!