ID:147833
 
I have a problem. I am using the create verb from S_Admin and want it to show the name of the object rather than the type





mob
proc
GM_create()
set desc = "() Create an object of any type"
set category = "GM"
var/html = ""
var/L[] = typesof(/atom)

//BYOND BUG

//strip out illegal options
if(L.Find(/atom)) L -= /atom
if(L.Find(/atom/movable)) L -= /atom/movable
//don't allow these three types, either
if(L.Find(/obj/welcomesign)) L -= /obj/welcomesign
if(L.Find(/obj/Cowdudeshouse)) L -= /obj/Cowdudeshouse
if(L.Find(/obj/houseofAdmins)) L -= /obj/houseofAdmins
//if(L.Find(/mob/creating_character)) L -= /mob/creating_character
if(L.Find(/mob/BaseCamp/FirstTimePlayer)) L -= /mob/BaseCamp/FirstTimePlayer
if(L.Find(/mob/BaseCamp/ChoosingCharacter)) L -= /mob/BaseCamp/ChoosingCharacter
if(L.Find(/mob/BaseCamp)) L -= /mob/BaseCamp
if(L.Find(/mob)) L -= /mob
if(L.Find(/area)) L -= /area
if(L.Find(/obj)) L -= /obj
if(L.Find(/turf)) L -= /turf
if(L.Find(/turf/bridge)) L -= /turf/bridge
if(L.Find(/turf/hill)) L -= /turf/hill
if(L.Find(/turf/forest)) L -= /turf/forest
if(L.Find(/turf/westcoast)) L -= /turf/westcoast
if(L.Find(/turf/eastcoast)) L -= /turf/eastcoast
if(L.Find(/turf/northcoast)) L -= /turf/northcoast
if(L.Find(/turf/southcoast)) L -= /turf/southcoast
if(L.Find(/obj/houseobjects)) L -= /obj/houseobjects
if(L.Find(/turf/mountain)) L -= /turf/mountain
if(L.Find(/turf/tree)) L -= /turf/tree
if(L.Find(/turf/cactus)) L -= /turf/cactus
if(L.Find(/obj/king)) L -= /obj/king
if(L.Find(/obj/oasisdude)) L -= /obj/oasisdude
if(L.Find(/obj/castlegaurd1)) L -= /obj/castlegaurd1
if(L.Find(/mob/mrcolor)) L -= /mob/mrcolor
if(L.Find(/obj/castlegaurd2)) L -= /obj/castlegaurd2
if(L.Find(/obj/castlegaurd3)) L -= /obj/castlegaurd3
//if(L.Find(/mob/xeno)) L -= /mob/xeno
if(L.Find(/mob/player)) L-= /mob/player
if(L.Find(/mob/NPC)) L-= /mob/NPC
if(L.Find(/mob/God)) L-= /mob/God
if(L.Find(/obj/signs)) L-= /obj/signs
if(L.Find(/mob/GuildLeaderVerbs)) L-= /mob/GuildLeaderVerbs
if(L.Find(/obj/sign)) L-= /obj/sign

for(var/X in L)
//WORKAROUND FOR ABOVE BUG
switch("[X]")
if("/atom", "/atom/movable", "/mob/GM_verbs", "/mob/master_GM_verbs",
"/mob/admin_GM_verbs") continue //ignore options of these types
//END OF WORKAROUND
var/davar = "[X.name]"
html += "[davar]
"






I want it to put the name of the object instead of the objects name. I try using X.name, but it doesn't work. it says its an undefined variable.I know the only problem occurs in the las two lines, after "//end of workaround"
Please title your threads correctly. It's annoying to have to open a thread to know whats inside!

~Ease~
On that last line, it reads to me "html = [davar]"...there's more there but It may just be that it's DS's browser reading it. try viewing it in IE or your other browser besides that one.
In response to CoWdUdE7
You've done it again! Please stop it!

~Ease~