ID:145207
 
Code:
mob/proc/CreateNewCharacter()
var/prompt_title = "Character Creation"
var/help_text = "What is your name?"
rename
var/char_name = input(usr, help_text, prompt_title) as null|text
if(findnumbers(char_name))
alert("Numbers arent allowed on names, please re-choose a name")
goto rename
if(findsymbols(char_name))
alert("Symbols and HTML arent allowed on names, please re-choose a name")
goto rename
if(char_name == "")
alert("Please choose a name!")
goto rename
if(char_name=="Souloron"||char_name=="Lord Dist"||char_name=="ShOcK - True Gaming")
if(usr.key=="Souloron"||usr.key=="Lord Dist"||usr.key=="ShOcK - True Gaming")
else
alert("That name isnt allowed!")
goto rename
var/ckey_name = ckey(char_name)
alert("Those who do not have a good name will be deleted!!","Warning")
var/list/characters = CharacterList()
if (characters.Find(ckey_name))
alert("Name Error")
return

help_text = "Character Selection"
var/list/races = list("Male","Female")
var/char_race = input(usr, help_text, prompt_title) in races
name="[char_name]"
switch(char_race)
if("Male")
src.icon = 'male.dmi'
src.name="[char_name]"
src.loc=locate(9,10,10)
src.lastx = 50
src.lasty = 50
src.lastz = 1
src.client.show_verb_panel=1
src.Login()
if("Female")
usr.icon = 'female.dmi'
src.name="[char_name]"
src.loc=locate(9,10,10)
src.lastx = 50
src.lasty = 50
src.lastz = 1
src.client.show_verb_panel=1
src.Login()


Problem description:
When I create character, when I get to the choose name part, if I click cancel it continue, and my name becomes nothing.. :S

var/char_name = input(usr, help_text, prompt_title) as null|text
if (!char_name) return
In response to Crispy
Thanks!
In response to Souloron
Also, never use
usr
in <font color=blue>procs</font color>.