ID:142271
 
Code:
Enter(mob/A)
if(ismob(A))
if(A.enteredd == 2)
var/mob/M = A
if(A.client)
M.loc = locate(5,2,35)
M.enteredd=1
A.loc=locate(5,2,35)
A.enteredd=1

if(A.enteredd == 1)
var/mob/M = A
if(A.client)
M.loc = locate(21,8,1)
M.enteredd=2
A.loc=locate(21,8,1)
A.enteredd=2


else
if(istype(A,/obj/)) del(A)


Problem description:
The code works backwards instead of entered setting 2 to one 2 sets to 2 and instead of 1 setting to 2 it sets to 1
This code actually needs to be changed anyway, because Enter() is the wrong place to make those changes. Entered() is where you need to handle that.

The rest of the problem you're having is because you're not using else before that second if().

Lummox JR
In response to Lummox JR
To make what Lummox's second statement clearer, you need to put "else if(" instead of just an "if()", because you changed the conditions of the variable to match it. I've done this stupidly before also.
if(variable==1)variable=2 //Changes it to 2
if(variable==2)variable=1 //Checks if it's 2, which it always will.
In response to Kaiochao
<small>(The last code comment is inaccurate. variable won't always be 2, only if it was set to 1 (or 2 directly, obviously)</small>

Also worth mentioning: with only 2 conditions, you should use a simple else+if() (no else-ifs). And instead of multiple else-if() chains, switch() should be used, if they all check the same value.