ID:161798
 
As the topic states im trying to make a gate open for people who a specific race and make other people have to sneak in through a hidden route
Make a turf at the gate and use something like this:

turf/entergate
Enter(mob/M)
if(M.race)
return 1
else return 0
In response to Syltmunk
sweet thanx
In response to Wrath69
Eh, didn't you just snatch that code? You should learn how it works and look up the Enter() proc so you can do such things yourself; also, that code has flaws; it doesn't validate that M is actually a mob and could lead to runtime errors, if not seen now then in the future, and, since it causes Enter() to explicitly return 1 every time a mob of certain race attempts to enter, they will always be enter no matter what, regardless of density and whether there are already dense atoms blocking the gate.
In response to Syltmunk
That needs an if(ismob(M)) in there to ensure that M is a mob. Additionally, it needs to return ..() to allow entry rather than 1, or it bypasses normal movement rules (can't stand on top of other dense objects).
In response to Garthor
Hey Garthor when I put ..() in Enter() it doesnt do anything so Im forced to use return 1 instead, are you sure of that? I want to know just in case theres a few things I need to check.
This depends entirely on how you want the gate to work...
Personally I'd make it check when you bump into the gate if your race is in the list of allowed races, e.g.
obj/gate
var/list/Allowed_Races = list("Orcs","Gods","Martians")
Bumped(var/atom/movable/A)
if(!A) return
if(ismob(A))
var/mob/M = A
if(M.race in src.Allowed_Races)
src.open() // Your open procedure
else
return

Of course you'd need to define the proc Bumped() for all atoms but lots of people normally make it anyway.
In response to Dragonn
It'll do nothing if the mob can't enter the turf because it's dense, or its area is dense, or there's an atom/movable on it that is dense.

In other words: all the things you'd want to prevent movement.
In response to Kaioken
no i dident snatch the code im just trying to figure out how to do it if it coems down to it