client/proc/SaveMob()
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
var/char_ckey = cKey(src.mob.name)
F["/[src.ckey]/[char_ckey]"]<<src.mob
client/proc/LoadMob(char_ckey)
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
F["/[src.ckey]/[char_ckey]"] >> src.mob
spawn()
src.AutoSave()
client/verb/Save()
src.SaveMob()
client/proc/AutoSave()
src.SaveMob()
spawn(450)
AutoSave()
return
mob
Write(savefile/F)
..()
F["last_x"] << x
F["last_y"] << y
F["last_z"] << z
Read(savefile/F)
..()
var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_z"] >> last_z
loc = locate(last_x, last_y, last_z)
var/skip = 0
mob
other/login
black
icon = 'login.png'
layer = 9999999999999999999999999999999999999
Login()
spawn(1)
src.name = ""
if(skip == 0)
src.host = 1
world.name = "[world.name] Hosted by: [src.key]"
skip = 1
src.move = 0
src.loc = locate(7,7,10)
newc
icon = 'login.dmi'
icon_state = "New"
name = ""
layer = 99999999999999999999999999999999999999
Click()
spawn()
CreateNewCharacter()
load
name = ""
icon = 'login.dmi'
icon_state = "Load"
layer = 99999999999999999999999999999999999999
Click()
spawn(1)
if(usr.key == "Guest")
usr << "Can not use Guest account, please log into your BYOND user-key"
return
for(var/mob/host in world)
if(usr.key in host.keybanlist)
usr << "You were Key Banned."
return
if(usr.client.address in host.ipbanlist)
usr << "You were IP Banned"
return
var/list/characters = CharacterList(usr)
var/nothing = "Nothing"
var/delete = "Delete Character"
var/list/menu = new()
menu += characters
menu += delete
menu += nothing
var/result = input(usr,"Which Character?","Loging In") in menu
if(result == nothing)
return
if(result == delete)
spawn()
DeleteCharacter()
else
usr.client.LoadMob(result)
proc
CharacterList(client/M)
var/firstletter=copytext(M.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[M.ckey].sav")
F.cd = "/[M.ckey]"
var/list/characters = F.dir
return characters
DeleteCharacter()
var/firstletter=copytext(usr.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[usr.ckey].sav")
F.cd = "/[usr.ckey]"
var/list/characters = F.dir
var/CancelCharacterDeletion = "Decline"
var/list/menu2 = new()
menu2 += characters
menu2 += CancelCharacterDeletion
var/result = input("Delete character", "Character Creation") in menu2
if (result)
F.cd = "/[usr.ckey]"
F.dir.Remove(result)
if (result == CancelCharacterDeletion)
return
CreateNewCharacter()
if(usr.key == "Guest")
usr << "Can not use Guest account, please log into your BYOND user-key"
return
for(var/mob/host in world)
if(usr.key in host.keybanlist)
usr << "You were Key Banned."
return
if(usr.client.address in host.ipbanlist)
usr << "You were IP Banned"
return
var/prompt_title = "Character Creation"
var/help_text = "What is your name? (Please use appropriate, RP names.)You characters name can only be 15 letters long"
var/default_value = ""
var/char_name1 = input(usr, help_text, prompt_title, default_value) as null|text
if(!char_name1)
return
if(findText(char_name1,"<")==1)
alert("No HTML")
return
var/letter1 = copytext(char_name1,1,2)
var/lettera = uppertext(letter1)
var/endname = copytext(char_name1,2,15)
var/char_name = "[lettera][endname]"
for(var/mob/M in world)
if(char_name == M.name)
if(M.name == usr.key)
char_name = usr.key
else
alert("Name already taken.")
return
if (!char_name)
return
var/ckey_name = ckey(char_name)
var/list/characters = CharacterList(usr)
if (characters.Find(ckey_name))
alert("You already have someone with this name.")
CreateNewCharacter()
return
usr.icon = 'Startchars.dmi'
usr.class = input("Chose your class","Creating [char_name]") in list("Shifter","Warrior","Magician")
usr.icon_state = usr.class
usr.gender = input("What is your gender?","Creating [char_name] the [usr.class]") in list("male","female")
usr.icon_state += copytext(usr.gender,1,2)
usr.name = char_name
world << "[usr] has joined the world."
usr << "Welcome, [usr], to Mystical Adventures"
usr.loc = locate(95,70,1)
usr.move = 1
spawn()
usr.client.AutoSave()
This is my code... I need to know a few things...
1. How do I make it so my login.png pic is not a million of them little ones and is just one bg image.
2. How do I get it to work so you can load a char when I click load nothing happens...
3. Thank you for anyhelp (okay that wasnt a question but I said a few)</<></<></<></<src>
Copyright © 2024 BYOND Software.
All rights reserved.
click reply with quote and youll see the tags