ID:141785
 
Code:
    entergm
icon = 'turfs.dmi'
icon_state = "buildingtop"
density = 0
Enter()
if(usr.gm == 1)
usr << "You are a GM!"
usr.loc=locate(66,2,15)

return 1
else
usr << "You are not a GM!"
return 0


Problem description:loading Saga.dme

loading Macro.dms

turfs.dm:971:error:locate:undefined proc

turfs.dm:973:error::missing expression

turfs.dm:974:error:else :'else' clause without preceding 'if' statement

Saga.dmb - 3 errors, 0 warnings (double-click on an error to jump to it)


Enter(mob/A)
if(ismob(A)) //Make sure they are really a mob, because this code could be called on anything Entering it.
if(A.gm) //Checks if "gm" is a true value. As in not "null" or "0"
A<<"You are a GM"
return ..() //Return the default Enter() procedures, allowing them to enter. return 1 wont do that.
A.loc=locate(whatever)
else //If gm is 0 or null value.
A<<"You are not a GM"
return //Do not continue any further, if there is even anything else to continue to...


That is how I would do it. Dunno what others might do. You can't copy and paste this. Because I used spaces instead of tabs. So you'll have to fix that.
In response to Dragonn
Using the Enter() proc constitutes of using its return value to determine movement (namely if a current attempted movement should be allowed or blocked). Note it should not actually do actions that affect the game, such as do something, or move something; not that your setting of the loc var would ever execute though, because return stops the proc before it ever gets there.

If you want to do a specific action when an obj or mob enters a given location, you should override the Entered() proc - as its name suggests it's for doing something once the movable has really entered the location successfully. Enter() is used to determine whether or not it will enter it successfully.
Illustrative Example Code:
area/admin_area
Enter(mob/player/M)
if(istype(M) && M.IsAdmin())
//if what's trying to enter is a player, and he's an admin
return ..() //allow movement according to default/parent \
behaviors - basically being based on density

//otherwise ('else' is not needed because if the above\
if is true, the proc halts before it'd even reach \
an else statement anyway

return 0 //disallow the movement
//note the last line isn't mandatory, you can also \
let it return by default, which is false like 0
In response to Dragonn
That is quite ugly. First of all, you don't want to use a GM var. That's like begging for hex editor users to get you! Second of all, you're trying to do things after returning; returning ends the proc. Lastly, you returned at the end of the proc. That's unnecessary, BYOND automatically makes all procs return null.