ID:172160
 
Im trying to stop people from building certain places help please and this doesnt work why?
area/nobuild

mob/proc/CreateTurret()
if((locate(/area/nobuild) in get_step(src,src.dir)))
src<<"you can not build here"
return
else
new /mob/Turrets(get_step(src,src.dir), src)

<edit> changed few things still dont work
what doesn't work about it?
In response to Airjoe
i can still build even if theres area/nobuild in front of me
In response to Brokenleg
get_step is a turf. Areas are not located in turfs. Turfs are located in areas.
In response to Garthor
well what can i do beside get step to check for a area right in front of me?
In response to Brokenleg
You can use get_step, but you do not want to search for areas in that spot. Set a variable to reference the turf at the spot and then set a variable to reference the area that turf is in.
mob/verb/MyVerb()
var/turf/T=get_step(src,dir)
var/area/A=T.loc
if(istype(A,/area/MyVerbDisable))
src<<"You can't use MyVerb on that spot."
else
src<<"You used MyVerb."
In response to Loduwijk
^_^ it works perfect thank you for the help and the lesson on turfs/areas gaining knowledge is far better then fixing the code for me thanks