ID:145700
 
Code:
area
PVP
density = 0
Enter(atom/movable/A)
if(ismob(A))
var/mob/M = A
if(M.PVP==0)
M.PVP=1
Exit(atom/movable/A)
if(ismob(A))
var/mob/M = A
if(M.PVP==1)
M.PVP=0


Problem description:
I can't enter the area for some reason. I just run into it. Probably something to do with the atom/movable/A
In the if(M.PVP==0) part, at the end of it return ..().

Also, you should be using boolean vars, if(!M.PVP) and if(M.PVP)
In response to Kalzar
tried still nothing
Actually you need.
return 1 // If you let them

return 0 // If you don't.
In response to Sniper Joe
still nothing
In response to CYN
Happy?
In response to CYN
area/Test
Ented(atom/M)
var/mob/P = M
if(P.PVP) return 1
else return 0
In response to Evidence
Dude, just stop helping. I know you mean well, but your telling him wrong. Entered() is after they enter, therefore not keeping them out.
In response to Sniper Joe
Sniper Joe wrote:
> area/Test
> Ented(atom/M)
> var/mob/P = M
> if(P.PVP) return 1
> else return 0
>


Well, aside from the typo of "Enter", you're assuming M is a mob, and will give out a runtime error if an object other than a mob entered it. The 'else' isn't needed, since if P.PVP is non-zero, then the proc will stop anyway.

CYN, if you don't need to stop the player from entering the area, you should use Entered(). That only gets called when they successfully enter the area. As Kalzar said, it easier and better to just check the PVP variable than comparing it to a constant.

area/test
Entered(mob/M)
if(ismob(M))
if(!M.PVP) M.PVP = 1
Exited(mob/M)
if(ismob(M))
if(M.PVP) M.PVP = 0


~~> Unknown Person
In response to Unknown Person
Sorry, I forgot that line. Thanks.
In response to Unknown Person
Unknown Person wrote:
CYN, if you don't need to stop the player from entering the area, you should use Entered(). That only gets called when they successfully enter the area. As Kalzar said, it easier and better to just check the PVP variable than comparing it to a constant.

> area/test
> Entered(mob/M)
> if(ismob(M))
> if(!M.PVP) M.PVP = 1
> Exited(mob/M)
> if(ismob(M))
> if(M.PVP) M.PVP = 0
>

~~> Unknown Person


Yea, thats what i said to begin with, but Sniper Joe flammed me.
In response to Unknown Person
Whoops. Totally misunderstood the author.
In response to Evidence
Oh really? I don't see any flaming. I see advice, but I see no flamming.
In response to Sniper Joe
It hurted my feelings though, Lol
In response to Evidence
doesn't matter guys. Unknown person prevailed again. Like always.