ID:148039
 
hi, im trying to make a certain area force the player into pvp mode, and when the person enters, its fine, but when the person leaves, it gives me a runtime error

my code is
area
pvp
var
oldpvp
Entered(mob/PC/M)
oldpvp = M.pvptoggle
M.pvptoggle = 1
M.verbs -= /mob/PC/pvp/verb
M << "You are now entering a Player vs Player area"
Exited(mob/PC/M)
M.pvptoggle = oldpvp
M.verbs += /mob/PC/pvp/verb
M << "You are now leaving a Player vs Player area"


the runtime error is

runtime error: wrong type of value for list
proc name: Exited (/area/pvp/Exited)
usr: \[Master] Lazyboy (/mob/PC/male)
src: the pvp (/area/pvp)
call stack:
the pvp (/area/pvp): Exited(\[Master] Lazyboy (/mob/PC/male))


can someone plz help
/mob/PC/pvp/verb


I think it should be:
/mob/PC/verb/pvp


The first one is an undefined verb for /mob/PC/pvp, because verb is at the end.
In response to The mothball
/mob/PC/pvp/verb

the pvp verb code is
mob/PC/pvp/verb/pvp()
if(pvptoggle == 1)
usr << "You are now non attackable by human players"
pvptoggle = 0
else
usr << "You are now attackable by human players"
pvptoggle = 1
In response to Lazyboy
Lazyboy wrote:
area
> pvp
> var
> oldpvp
> Entered(mob/PC/M)
> oldpvp = M.pvptoggle
> M.pvptoggle = 1
> M.verbs -= /mob/PC/pvp/verb
> M << "You are now entering a Player vs Player area"
> Exited(mob/PC/M)
> M.pvptoggle = oldpvp
> M.verbs += /mob/PC/pvp/verb
> M << "You are now leaving a Player vs Player area"

the pvp verb code is
mob/PC/pvp/verb/pvp()
> if(pvptoggle == 1)
> usr << "You are now non attackable by human players"
> pvptoggle = 0
> else
> usr << "You are now attackable by human players"
> pvptoggle = 1

Ok, you didnt tell which verb to take away and add. you had
M.verbs (+=/-=) /mob/PC/pvp/verb

when you shoulda had
M.verbs (+=/-=) /mob/PC/pvp/verb/pvp

so try this:

area
pvp
var
oldpvp
Entered(mob/PC/M)
oldpvp = M.pvptoggle
M.pvptoggle = 1
M.verbs -= /mob/PC/pvp/verb/pvp
M << "You are now entering a Player vs Player area"
Exited(mob/PC/M)
M.pvptoggle = oldpvp
M.verbs += /mob/PC/pvp/verb/pvp
M << "You are now leaving a Player vs Player area"
In response to JackGuy
thank you, its fixed now