area
house
var/owner
var/occupied
Entered(atom/A)
if(ismob(A))
var/mob/M = A
if(!src.occupied)
owner = M.key
occupied = 1
else
if(M.key == owner)
M << "Welcome to your home!"
M.houseX = src.x
M.houseY = src.y
M.houseZ = src.z
M.homeless = 1
else
M << "This house is already occupied!"
else
return
houseenter
Enter(atom/A)
if(ismob(A))
var/mob/M = A
for(var/area/house/H in world)
if(H.occupied == 1)
if(H.owner == M.key)
M.loc = locate(M.houseX,M.houseY,M.houseZ)
else
M.loc = locate(H.x, H.y, H.z)
M << "[usr.x],[usr.y],[usr.z]"
else
return
houseexit
Enter()
usr.loc = locate(6,25,1)
This locates them in one of the houses but thats the problem it locates the everyone that enters the area in the same house when only the owner should be able to enter. See anything wrong with this?