ID:271265
 
ok heres what i got

var/owner

mob/verb/buildwall()
new/obj/wall/ = usr.loc //just an example, dunno if right cant check rite now


obj
wall


as you can see i only want the verb to work on a area called "buildable" and i want you to be able to delete it, and like own your own wall or something
A delete verb
        verb
delete()
set src in oview(10)
set category = null
if(src.owner == usr.key)
del src
else if (src.owner != usr.key)
usr<<"Can't delete that!"
For that we can assume the object needs an owner variable which contains the Key of the person who built it.

For the buildable area, you would basically assign a variable to the player called CanBuild and have it set to true when they enter the area and have it set to false when they leave then in your build verb you'd have an if() statment checking if their CanBuild is true or not.
Quite simple :D
Neo Shinryu wrote:
as you can see i only want the verb to work on a area called "buildable" and i want you to be able to delete it, and like own your own wall or something

No, we CAN'T see it by your code, which implies nothing like that.
Really, learn to code, read resources and the DM Guide. This isn't a code request forum.
In response to Lyndonarmitage1
Lyndonarmitage1 wrote:
A delete verb
        verb
> delete()
> set src in oview(10)
> set category = null
> if(src.owner == usr.key)
> del src
> else if (src.owner != usr.key)
> usr<<"Can't delete that!"


Whats up with that else-if?! If you had an else, why are you re-checking for the reverse condition? That second if() is unneeded.
The 'else' isn't needed either, as 'del src' will stop the verb anyway.


For the buildable area, you would basically assign a variable to the player called CanBuild and have it set to true when they enter the area and have it set to false when they leave then in your build verb you'd have an if() statment checking if their CanBuild is true or not.

Thats not a very good method. You're much better off checking in realtime if the player is currently in that area, or not, by using the loc var. Typically to get the area, you loop, continually setting a var referring to your base atom to it's loc as long as there IS a loc, since areas have none.
area/buildable

mob/verb/buildwall()
var/area/A=src.loc.loc //The location of the player's turf location is an area
if(!istype(A,/area/buildable)) return //If the area is not a buildable area, stop!
var/obj/O=new/obj/wall/(usr.loc) //create new wall at player's location
O.owner=src.key //set the wall's owner to the player's key

obj
var/owner
wall

mob/verb/delete(obj/O in view())
if(O.owner==src.key) del O //If the player is the owner, deleted it.

This should work.
In response to LastTroubadour
Thats a better demonstration, but you shouldn't really have specificish/ungeneric vars on the base types such as /obj, that 'owner' var should be specific for something as /obj/buildable, or for the sake of your example just /obj/wall.
This means you need to typecast the obj's var properly when you create it, but then just use the 'new' shorthand (actually even if you're not fully typecasting still no reason not to use it, unless you feel like typing more or somethin), like:
var/obj/wall/O = new(src.loc)


Also, true that mostly they can be considered equivalent in mob/verb's, but don't interchangeably use both 'src' and 'usr' there - just one of them for uniformity.