ID:142021
 
Code:
obj
Pokeball
name = "Pokeball"
icon = 'items.dmi'
icon_state = "pokeball"
density = 1
// verb
// Throw()
// usr << "Go Pokeball!"
Bump(var/mob/M in oview(12))
var/D = src.owner
if(M.istype == "Pokemon")
M.loc = locate(D.contents)
usr << "<b>You caught [M.israce]"
del(src)
if(istype(M,/mob))
del(src)
if(istype(M,/turf))
del(src)
if(istype(M,/obj))
del(src)
mob
verb
Throw_Pokeball()
usr.ballininvo = 6
if(usr.ballininvo <= 0)
usr << "<b>Your out of pokeballs!"
else
var/C = new/obj/Pokeball
oview(8) << "<b>[usr]: Go Pokeball!"
C:loc = locate(usr.x,usr.y,usr.z)
C:owner = usr
usr.ballininvo -= 1
C:dir = usr.dir
walk(C,dir)
obj
var
owner = "Noone"


mob
var
istype = "Trainer"
ballininvo = 4
israce = "----"
mob/Stat()
.=..()
statpanel("Stats")
stat("------Inventory------")
stat(src.contents)


Problem description: as you probably noticed D.contents is undefined stat(src.contents) made me think that contents was an already defined variable so that i could make the location of the pokemon the contents but i cant so can someone tell me how to get this to do what its supposed to do and that is catch and send a pokemon to my inventory?

You haven't typecast D, so the compiler doesn't know where to look to verify that contents is a variable of it. It assumes it doesn't exist.
In response to Popisfizzy (#1)
so what do i do to fix it
In response to SadoSoldier (#2)
...you typecast it.
var/m //Not typecast.
world << m.density //Produces an error.

var/mob/m //Typecast.
world << m.density //This is fine.