ID:167037
 
Well I've stared to work with areas now, and I was wondering how to make it so that if a player somehow teleports to an area where he shouldnt be, if he moves he gets sent out.

Lets say for example the area is the 'Admin_Room' and in order to move in there your var must be 'Admin = 1'. How would I make it so that only people with that var can walk aout in the area, and anyone else gets sent back to location(1,1,1)?

Thanks alot, .:: Jester ::.
turf
admin_section
Entered(O)
if(ismob(O))
var/mob/M = O
M.loc=locate(1,1,1)


That should help.
In response to Justin B
Justin B wrote:
> turf
> admin_section
> Entered(O)
> if(ismob(O))
> var/mob/M = O
> M.loc=locate(1,1,1)
>

That should help.


I'm not even going to begin with what's wrong about this.

turf //you could also make this an area, if you want.
adminarea
Entered(mob/o)
if(istype(o)&&o.moderator).=..(o) //if you want to let the moderator enter \
even if the turf has density, just change .=..(o) to .=1

else .=0


If you want him to return him to a certain area, replace .=0 with o.loc=locate(number,number,number)
In response to DivineO'peanut
Haha, whoops. I knew I forgot something :-/

Also, he wasn't asking for that.
In response to Justin B
yes, it seems better in my eyes. Plus I posted below on how to make it work the way he wanted.
In response to DivineO'peanut
An area would not work for this example. The reason being that areas are just that. They cover a large area, and are considered 1 object. So if they are teleported into the wrong area somehow, they never call enter/ed(), as they move around, they will not call it, unless it is a turf.

Another idea is to have an object in the middle of the floor(A table or something), that runs a check for players within X ammount a space. I am not sure which is more effecent though.
In response to DivineO'peanut
Thanks DivineO'peanut, I got it going now and it works fine. And yeah Scoobert I see what you mean about not using area for this, thanks.

.:: Jester ::.