How would I switch text into a mob so I could use a mob var in Developer Help
|
|
My answer is simple, lets say I had a verb that allows you to edit an offline mobs variables, by inputting their key and checking to see if they have a savefile, if they do how could I make it to where var/d = input("Insert Key") as text and then make it so d.gold += 100, so to speak.
If you did not understand that(I am horrible at explaining things) try this makeshift code I just coded that I know will not work because it would say d.goldcoins is undefined.
mob/Owner verb Send_Gold_Coins() set category = "GM" if(usr.key != "SadoSoldier") alert("Sending players coins, without my permission, WILL result in a ban no matter who you are!") var/d = input("Please input their key:") as text if(fexists("players/[d]")) var/c = input("How many Gold Coins?") as num d.goldcoins += c else usr<<"<b>There is noone by that key!" return <dm> That is just an example, so how would I go about this?
|
|
<dm>
var/list/Players
for(var/client/C)
Players += C.mob
var/p = input("Whowould you like to give coins to?","Give Coins") as null|anything in Players
if(!p) return
//...