client/proc/SaveMob()
world << "<b><small><font color=yellow>Info: <font color=white>[usr.name] has logged out!"
var/savefile/F = new("players.sav")
var/char_ckey = cKey(src.mob.name)
F["/[ckey]/[char_ckey]"] << src.mob
del(src.mob)
client/proc/LoadMob(char_ckey)
var/mob/new_mob
var/savefile/F = new("players.sav")
F["/[ckey]/[char_ckey]"] >> new_mob
if (!new_mob)
return 0
else
src << "<B><center>Welcome to Dragonball Supremacy: Rebirth"
src<<{"<B><font color=silver>Current Staff Is: Gotan, Hoverbeast and Howie"}
world << "<small><B><font color=yellow>Info: <font color=white>[usr] has logged in!"
return 1
client/Del()
if (istype(src.mob, /mob/other/choosing_character))
return ..()
src.SaveMob()
return ..()
mob/other/choosing_character
Login()
spawn()
src.ChooseCharacter()
proc
ChooseCharacter()
src.loc = locate(7,7,3)
var/list/characters = src.CharacterList()
var/newCharacterChoice = "Create New Character"
var/DeleteCharacterChoice = "Delete Character"
var/Logout = "Leave"
var/list/menu = new()
menu += characters
menu += newCharacterChoice
menu += DeleteCharacterChoice
menu += Logout
var/result = input("Hello [usr]","Logging in..") in menu
if (result == newCharacterChoice)
src.CreateNewCharacter()
if (result == DeleteCharacterChoice)
src.DeleteCharacter()
src.ChooseCharacter()
if (result == Logout)
del client
else
var/success = src.client.LoadMob(result)
if (success)
del(src)
else
alert("Cannot Load Character!")
src.ChooseCharacter()
CharacterList()
var/savefile/F = new("players.sav")
F.cd = "/[ckey]"
var/list/characters = F.dir
return characters
proc/DeleteCharacter()
var/savefile/F = new("players.sav")
F.cd = "/[ckey]"
var/list/characters = F.dir
var/CancelCharacterDeletion = "Cancel"
var/list/menu = new()
menu += characters
menu += CancelCharacterDeletion
var/result = input("Delete Which Character?","New Character") in menu
if (result)
F.cd = "/[ckey]"
F.dir.Remove(result)
if (result == CancelCharacterDeletion)
src.ChooseCharacter()
else
src.ChooseCharacter()
mob/other/choosing_character/proc/CreateNewCharacter()
var/prompt_title = "New Character"
var/help_text = "What would you like to name your character? Remember do not add html in your name, and make it an RP type name, do not make a name that you might think is offensive to others. Do not name yourself by the name of an NPC, if you do then you will be banned or booted."
var/default_value = "Input Name"
var/char_name = input(src, help_text, prompt_title, default_value) as null|text
var/T = copytext(char_name,1,30)
if (!T)
src.ChooseCharacter()
return
var/ckey_name = ckey(T)
var/list/characters = CharacterList()
if (characters.Find(ckey_name))
alert("You already have a character named that. Please choose another name.")
src.CreateNewCharacter()
return
var/list/races = list("Human","Sayain","Namek")
help_text = "Choose Race"
default_value = "Human"
var/char_race = input(src, help_text, prompt_title, default_value) in races
var/mob/new_mob
switch(char_race)
if("Sayain")
src.icon = "Saiyan.dmi"
race = "Sayian"
hp = 30
if("Namek")
src.icon = "Namek.dmi"
race = "Namek"
hp = 30
if ("Human")
src.icon = "Human.dmi"
icon_state = "Human"
race = "Human"
hp = 30
src << "<center><B>Welcome to Dragonball Supremacy : Rebirth"
src<<{"<B><font color=silver>Current Staff Are: Gotan, Hoverbeast, and Howie"}
world << "<B><small><font color=yellow>World Info: <font color=white>[usr] has logged in!"
src.client.mob = new_mob
new_mob.loc = locate(20,20,1)
del(src)
it was suppose 2 do a login sequence and then after that you go to the designated area, it does that but then no icon shows up...so if anyone could help me out and tell me whats rong wit it or something
src.icon = 'Saiyan.dmi'<< get rid of the quotations.