ID:261486
 
How do I make it so that certain verbs can only be performed on certain z planes? (i.e. Users can drop objects on z=1, but not on z=2)
Well in the verb itself you can check with if statements such as,

if(src.z==1)
performs the code
else
return

DarkTitan
There is no default verb setting to make it only available on certain Z levels, but there are some things you can try.

As mentioned, you can tell the verb to only fuction if usr.z == the level you want, otherwise return the verb.

The other option is to only give the verb to players while they're on that Z level, and remove it when they leave that Z level.
Here's an example:

<code>mob/verb/MyVerb() //whatever mob/Move() ..() if(src.z == 5) // if on level 5 verbs += /mob/verb/MyVerb else verbs -= /mob/verb/MyVerb</code>
In response to Foomer
Foomer wrote:
There is no default verb setting to make it only available on certain Z levels, but there are some things you can try.

As mentioned, you can tell the verb to only fuction if usr.z == the level you want, otherwise return the verb.

The other option is to only give the verb to players while they're on that Z level, and remove it when they leave that Z level.
Here's an example:

<code>mob/verb/MyVerb() > //whatever > > mob/Move() > ..() > if(src.z == 5) // if on level 5 > verbs += /mob/verb/MyVerb > else > verbs -= /mob/verb/MyVerb</code>

Minor modification:

<code>
mob/Move()
   ..()
   if(src.z == 5) // if on level 5
      if(!verbs.Find(/mob/verb/MyVerb)) verbs += /mob/verb/MyVerb
   else
      if(verbs.Find(/mob/verb/MyVerb))  verbs -= /mob/verb/MyVerb
</code>


(Forum doesn't accept <SAMP> tags? Hrm... it doesn't even accept tags...)
One last thing. Please don't post the same question twice, on the same board or on another board. We'll see it anyway, and it consumes our time and forum space to have to read through the duplicates.

Also, don't post replies to your question to "bump" it to the top of the board. Same statement applies.
In response to DarkTitan
i think i know what he is saying but heres my idea,

obj/Bigthing
drop()
if(usr.z==1)
usr<<"Hey you droped something"//whatever code you want
else
usr<<"What are you stuped my mom is on this Z, she could have cought me!"//Tells them it cant be droped. This can be blank if you want.