ID:179067
 
How would I go about making an area where it only allows certain people through?

Say if I was to allow me and lets say Dan and Tom through an area that would normally block a player out but let us pass how would I do that?

Lee
area
noenter
icon = 'noenter.dmi'
Enter(mob/M)
if(M.key == "Dan" || M.key == "Tom")
return..()
else
return
I'd say Put the keys you want to be able to enter the area into a list then on entry check to see if the player key is in that list.

area
var/list/people = new list("mellifluous","dan","tom")
Entered(mob/M)
if(src.people.Find(M.ckey))
M << "Welcome"
..()
else
M << "you may not enter"
return 0

note *not sure if this code acually works but gives you somehting to work on*

*edit*
Nadrew you must be a faster typist than me
In response to Nadrew
Nadrew wrote:
> area
> noenter
> icon = 'noenter.dmi'
> Enter(mob/M)
> if(M.key == "Dan" || M.key == "Tom")
> return..()
> else
> return
>


Thank you Nadrew

The coding works, now its time to test it :-D

Lee