ID:138744
 
Code:
        Edit2(var/O as mob in world)
set desc = "() Create an object of any type"
set hidden = 1
set name = "Edit2"
set category = "Staff"
if(usr.ADM == "OFF")
usr<<"Você não é ADM e nao pode usar o comando"
del(usr)
var/html = "<html><body bgcolor=black text=#CCCCCC link=white vlink=white alink=white>"
var/L[] = O:vars
for(var/X in L)
html += "<a href=byond://?src=\ref[src];action=edit;type=[X]>[X]</a><br>"
usr << browse(html,"window=info")

client/Topic(href,href_list[],hsrc)
switch(href_list["action"])
if("kick")
del(usr)
return
if("create")
var/new_type = href_list["type"]
var/atom/O = new new_type(usr.loc)
usr << "Criou um novo [O.name]."
return
if("edit")
if(usr.ADM == 1)
var/variable = href_list["type"]
var/class = input(usr,"Change [variable] to what?","Variable Type") in list("text","num","cancel")
if(class == "num")
usr:vars[variable] = input("Enter new number:","Num",usr:vars[variable]) as num
if(class == "text")
usr:vars[variable] = input("Enter new number:","text",usr:vars[variable]) as text
if(class == "cancel")
return
usr<<"[class]"

. = ..()


Problem description:

Hello, I'm with some dificulties here to do this edit verb...

With that code, I edit my vars and do not edit of who I choose to edit. How can I put this code to edit the people who I choosed in the first code?

Best Regards,
Luan
        Edit2(var/O as mob in world)
set desc = "() Create an object of any type"
set hidden = 1
set name = "Edit2"
set category = "Staff"
if(usr.ADM == "OFF")
usr<<"Você não é ADM e nao pode usar o comando"
del(usr)
var/html = "<html><body bgcolor=black text=#CCCCCC link=white vlink=white alink=white>"
var/L[] = O:vars
for(var/X in L)
html += "<a href=byond://?src=\ref[src];mob_edited=\ref[O];action=edit;type=[X]>[X]</a><br>"
usr << browse(html,"window=info")

client/Topic(href,href_list[],hsrc)
switch(href_list["action"])
if("kick")
del(usr)
return
if("create")
var/new_type = href_list["type"]
var/atom/O = new new_type(usr.loc)
usr << "Criou um novo [O.name]."
return
if("edit")
if(usr.ADM == 1)
var/mob/E = href_list["mob_edited"]
var/variable = href_list["type"]
var/class = input(usr,"Change [variable] to what?","Variable Type") in list("text","num","cancel")
if(class == "num")
E:vars[variable] = input("Enter new number:","Num",E:vars[variable]) as num
if(class == "text")
E:vars[variable] = input("Enter new number:","text",E:vars[variable]) as text
if(class == "cancel")
return
usr<<"[class]"

. = ..()


Was as simple as making a new reference to the selected /mob, and then making a new mob within the Topic() using that reference we used.
In response to Neo Rapes Everything
Man, when I click to edit with "Text" or "Num", in the game appears this:

proc name: Topic (/client/Topic)
usr: Luan (/mob/player)
src: Luan12 (/client)
call stack:
Luan12 (/client): Topic("src=\[0x3000007];mob_edited=\[...", /list (/list), Luan (/mob/player))
In response to Luan12
That's because you are trying to edit a string (the ref value of the /mob). You need to locate() that mob [var/mob/E = locate(hre...)]

I previously made an HTML create/edit system, based on an older editing system, and placed it as a library file. It already has a creation and edit system done, you can search for the variables you want to edit and you can modify the CSS to what you want...

http://www.byond.com/developer/GhostAnime/GA_html

If that doesn't work, you can access it at http://www.byond.com/members/GhostAnime/files/GA_HTML.zip
Just make sure you read the comment in IMPORTANT.DM
In response to GhostAnime
GhostAnime wrote:
That's because you are trying to edit a string (the ref value of the /mob). You need to locate() that mob [var/mob/E = locate(hre...)]

I previously made an HTML create/edit system, based on an older editing system, and placed it as a library file. It already has a creation and edit system done, you can search for the variables you want to edit and you can modify the CSS to what you want...

http://www.byond.com/developer/GhostAnime/GA_html

If that doesn't work, you can access it at http://www.byond.com/members/GhostAnime/files/GA_HTML.zip
Just make sure you read the comment in IMPORTANT.DM


Wow!!! That's amazing man! nice job!!!!!!!!!
So, appears one "warning here", do you what it is?

ADM.dm:551:warning: sortText: sortText is being phased out; replace with sorttextEx


Thanks,
Luan

Merry Xmas btw
In response to Luan12
Change all instances of sortText() to sorttext().
In response to Albro1
Oh, only it??

Ok, it's working now... thanks you all, you are great guys and helped me a lot...

Best Resgards,
Luan
In response to Luan12
No problem.
In response to Luan12
in the Topic() proc, before the edit proc goes into action, try adding something, like a buffer that will keep other from editing people. I've found that if you're not careful, the Topic() proc can be exploited for cheating.
In response to RageFury33
RageFury33 wrote:
in the Topic() proc, before the edit proc goes into action, try adding something, like a buffer that will keep other from editing people. I've found that if you're not careful, the Topic() proc can be exploited for cheating.

ok, i'll put it. thanks you