ID:267204
 
I have a code where when you log into the game you choose either a commando or a spy, does anybody know a way to have an icon of the spy or commando beside their name? Here is the code.

world
mob = /mob/create_character
turf = /turf/grass
mob/Spy
icon ='Spy.dmi'
mob/Commando
icon = 'Commando.dmi'
mob/create_character
var/mob/character
Login()
var/charactername = input("Please Enter a name below.","Name",src.key)
switch(input("Please select a character","Character Selection","Spy")in list("Spy","Commando"))
if("Spy")
character = new /mob/Spy()

if("Commando")
character = new /mob/Commando()
character.name = charactername
src.client.mob = character
del(src)

//Thanks for any help.
The Conjuror

well it depends where you want to put it, i woul think you would want it in a chat command. to do things liek this, you use the \icon macro thing. Somethign like this
mob/verb/say(t as text)
world<<"\icon[usr][usr]says: [t]"//the [usr] is which icon you want to show, the icon of the usr's in this place
You can't have an icon in that popup window. You could use a browser window instead if you really wanted to, though; look up browse(), browse_rsc(), and client/Topic().