ID:148595
 
Hi there is my code For my game a rpg i cant i keep geting thes error: proc definition not allowed in side another proc
:can you helpme the Problem with the cod Wander() thank you



world
mob=/mob/person

mob
person
icon='person.dmi'
verb
say(msg as text)
view(src)<<"[usr] says:[msg]"
Login()
icon_state=gender
usr.loc=locate(3,2,1)

mob/pc
var
HP=30
Max_HP=30
strength=3
exp=0
exp_give=0

verb
attack(mob/M in oview(1))
var/damage=rand(1,strength)
usr<<"you attack [M]!"
usr<<"[damage] damage!"
M<<"usr attacks you!"
M<<"[damage] damage!"
M.HP-=damage
M.DeathCheck()


mob
var
HP
Max_HP
strength
exp
exp_give

proc
DeathCheck(mob/M)
if(src.type==/mob/pc)
PCDeathCheck()
else
if(src.HP<=0)
usr.exp+=src.exp_give
del(src)
PCDeathCheck(mob/M)
if(src.HP<=0)
src.loc=locate(3,2,1)
src.HP=Max_HP
NPC
Bug
name="bug"
icon='bug.dmi'
HP=20
Max_HP=20
strength=3
exp_give=5
var/mob/pc/p

New()
.=..()
spawn(1)
Wander()
proc/Wander()
while(src)
if(P in oview(5))
step_towards(src,P)
else
step_rand(src)
for(P in view(src))
break
sleep(5)
Spawn(40)
Wander()
bump(mob/M)
if(istype(M,/mob/pc))
attack(M)
proc/attack(mob/M)
flick("bug",src)
sleep(2)
var/damage=rand(1,strength)
M.HP-=damage
view(src)<<"[src} attacks[M]!"
view(src)<<"[damage] damage!"
M.PCDeathCheck()


mob/stat()
stat("stats;",src.desc)
if(src==usr)statpanel("inventory",src.contents)
stat(" HP:",HP)
stat(" strength:",strength)
stat(" Experience:",exp)








for the login you gotta make it say
mob
Login() again

if thats not the prob tell me
world
mob=/mob/person
mob
var
HP=30
Max_HP=30
strength=3
exp=0
exp_give=0
verb
Say(msg as text)
view(usr)<<"[usr] says:[msg]"
attack1(mob/M in oview(1))
set name="Attack"
var/damage=rand(1,usr.strength)
usr<<"you attack [M]!"
usr<<"[damage] damage!"
M<<"usr attacks you!"
M<<"[damage] damage!"
M.HP-=damage
M.DeathCheck()
proc
DeathCheck(mob/M)
if(istype(src,/mob/pc))
if(src.HP<=0)
src.loc=locate(3,2,1)
src.HP=Max_HP
else
if(src.HP<=0)
usr.exp+=src.exp_give
del(src)
person
icon='person.dmi'
Login()
icon_state=gender
usr.loc=locate(3,2,1)
NPC
Bug
name="bug"
icon='bug.dmi'
HP=20
Max_HP=20
strength=3
exp_give=5
var/mob/pc/p
New()
.=..()
spawn(1)
Wander()
proc/Wander()
while(src)
if (P in oview(5))
step_towards(src,P)
else
step_rand(src)
for(P in view(src))
break
sleep(5)
spawn(40)
Wander()
Bump(mob/M)
if(istype(M,/mob/pc))
attack(M)
proc/attack(mob/M)
var/damage=rand(1,strength)
flick("bug",src)
sleep(2)
M.HP-=damage
view(src)<<"[src} attacks[M]!"
view(src)<<"[damage] damage!"
M.PCDeathCheck()
Stat()
statpanel("Stats")
stat("stats;",src.desc)
stat(" HP:",HP)
stat(" strength:",strength)
stat(" Experience:",exp)
statpanel("inventory",src.contents)


Something like this, I fixed the code up a bit more. Hopefully it works now.

RaeKwon
In response to Koolguy900095
Both thouwa dont work and the Code you gave me makes more proplems
In response to RaeKwon
The P variable in Wander() is still not the same as the mob variable p.