ID:931005
 
(See the best response by Boubi.)
Problem description:
Hi been playing some RP game like Comics and i wanted to know how do i Click a player and make it show there stats like in HTML

You must first learn HTML. Then it's just a simple call to browse().
mob
Click(mob/M in oview(src))
if(M.client)
usr << browse("user's key:[usr.key] user's Health: [usr.HP]")

so i did this it came out to have a runtime error

i think it has something to do with the grass and M.client

runtime error: undefined variable /turf/Grass/var/client
proc name: Click (/mob/Click)
usr: DarkW0lf (/mob)
src: DarkW0lf (/mob)
call stack:
DarkW0lf (/mob): Click(Grass (1,1,1) (/turf/Grass), "mapwindow.map", "icon-x=19;icon-y=18;left=1;scr...")


it happens when i click myself
In response to DarkW0lf (#2)
Remove your if() check and change it to world << M and see what you're actually clicking. Just a little debugging, you might figure something out.
It says am clicking the Grass

runtime error: undefined variable /turf/Grass/var/key
proc name: Click (/mob/Click)
usr: DarkW0lf (/mob)
src: DarkW0lf (/mob)
call stack:
DarkW0lf (/mob): Click(Grass (1,1,1) (/turf/Grass), "mapwindow.map", "icon-x=15;icon-y=21;left=1;scr...")
Grass

but when i click the grass not myself nothing happens
In response to DarkW0lf (#4)
Best response
I guess you completely disregarded what I hoped you would figure out. You're checking for a variable that the grass doesn't have, the grass is a turf and turfs don't have a client/key variable.
Thank u
Now when i click the grass this appears

runtime error: undefined variable /turf/Grass/var/key
proc name: Click (/client/Click)
usr: DarkW0lf (/mob)
src: DarkW0lf (/client)
call stack:
DarkW0lf (/client): Click(Grass (2,1,1) (/turf/Grass), Grass (2,1,1) (/turf/Grass), "mapwindow.map", "icon-x=26;icon-y=21;left=1;scr...")
Using an if() statement along with the ismob() proc would be beneficial here.
Click() is a process, not a verb. It doesn't use verb arguments that the user can fill out. The first argument is actually the location of the object that was clicked.

For atom/Click(), src is the atom being clicked, and usr is the mob of the client that clicked it.
I don't really understand sir what you mean?
client
Click(location,contro,DblClick())
for(var/mob/M)
if(M.client)
usr << browse("<backgroundcolor = red><center>User's key: <b>[M.key]</b> <p>User's MaxHealth: <b>[M.MaxHP]</b></p><p>User's Health: <b>[M.HP]</b></p> <p>User's Story</p> <p><b>[M.Story]</b><p>")

This stops the runtime error and works but when you click the grass the mouse goes to loading icon
In response to Boubi (#8)
Boubi wrote:
Using an if() statement along with the ismob() proc would be beneficial here.

Yeah thanks to Boubi i managed to fix this Thank You all for your help :D.