ID:144264
 
Code:
mob/characters/
Click(location)
src.check_info()

mob/characters/verb/check_info()
set hidden = 1
var/Browse
var/savefile/F = new()
var/txtfile = file("playerinfo/[src.name].txt")
F.ImportText("/",txtfile)
F[usr.name] >> Browse
src<<browse(Browse)


Problem description:

I think I am having a difficult time determining where to place usr & src. I am trying to make it so that when a person gets clicked there info shows up; for some reason its only working on myself.
In a verb src = usr. When you Click() src is the object Clicked() and usr is the clicker. Just make that a proc and do
mob
Click()
usr.PlayerInfo(src)
mob
proc
PlayerInfo(mob/M)
...
// make src the viewer and M the person viewed.
In response to Xx Dark Wizard xX (#1)
Xx Dark Wizard xX wrote:
In a verb src = usr.

Hell no - only in regular /mob/verb's - that's the default src setting for them. For /obj/verb's, for example, the 'src' and 'usr' are different, src is the obj and usr is the player who clicked/used the verb on it.
In response to Kaioken (#2)
Also you shouldn't do that with a savefile.
#define islist(L) (istype(L,/list))
mob
var/html
proc
PlayerInfo(mob/M)
html = "<title>[M]'s stats</title>"
for(var/V in M.vars)
if(isnull(M.vars[V]) || islist(M.vars[V])continue
html+="[V] = [M.vars[V]]"
for(var/T in M.verbs)
html+="[V]"
for(var/S in M.contents)
html+="[S]"
src<<browse(html,"window=playerinfo[M]")

That would probably be better.
In response to Xx Dark Wizard xX (#3)
Who said what he wants/whats stored in the savefile is var dumps? Also, that code has some problems.
In response to Kaioken (#4)
Kaioken wrote:
Who said what he wants/whats stored in the savefile is var dumps? Also, that code has some problems.


Look at his post, he was using a savefile. That code probably doesent work. It was just an idea.


Better yet, use var_dump.
In response to Xx Dark Wizard xX (#5)
Xx Dark Wizard xX wrote:
Look at his post, he was using a savefile.

Yes, apparently. He used 'file("playerinfo/[src.name].txt")'
Which may contain text descriptions and whatnot, not var dumps. Like my previous post implied.