mob
proc
SaveChar()
src.last_x=src.x
src.last_y=src.y
src.last_z=src.z
src.saveverbs=src.verbs
var/theFolder=uppertext(copytext(src.key,1,2))
var/savefile/s=new("savefiles/players/[theFolder]/[src.key]/[text2ascii_string(src.name)]")
Write(s)
proc
count_chars()
var/totalSaves=0
var/theFolder=uppertext(copytext(src.key,1,2))
var/list/saveFiles=flist("savefiles/players/[theFolder]/[src.key]/")
for(var/v in saveFiles)
totalSaves++
return totalSaves
get_char_list()
var/theFolder=uppertext(copytext(src.key,1,2))
var/list/saveFiles=flist("savefiles/players/[theFolder]/[src.key]/")
var/list/save_display=list()
for(var/v in saveFiles)
save_display+=ascii_string2text("[v]")
return save_display
mob
proc
LoadChar()
var/theFolder=uppertext(copytext(src.key,1,2))
var/list/saveFiles=src.get_char_list()
var/theName=input("Which character do you wish to load?","Load")as null|anything in saveFiles
var/savefile/s=new("savefiles/players/[theFolder]/[src.key]/[text2ascii_string(theName)]")
Read(s)
src.loggedIn=1
src.loc=locate(src.last_x,src.last_y,src.last_z)
for(var/stuff in src.V)
src.verbs += stuff
src.CheckBan()
src.CheckPermaBan()
world<<"<font size=1><font color=red><B>Naruto Lost Shinobi:<font color=white>[src]([src.key]) has logged in..."
verb
Save()
usr.SaveChar() // Make a call to the character's saving proc
usr << "Your character has been saved." // Inform the player that he's been saved.
mob
proc
DeleteCharacter() // The load character proc
var/theFolder=uppertext(copytext(src.key,1,2))
var/list/saveFiles=src.get_char_list()
var/theName=input("Are you sure you want to delete this character ?","Delete")as null|anything in saveFiles
var/confirmDelete=input("Are you sure you want to delete \'[theName]\'?","Delete [theName]")in list("Yes","No")
if(confirmDelete == "Yes")
fdel("savefiles/players/[theFolder]/[src.key]/[text2ascii_string(theName)]")
alert("\'[theName]\' has been succesfully deleted.","Delete","Ok")
else
proc
text2ascii_string(string)
var/ascii_string
for(var/i=1,i <= length(string),i++)
ascii_string+=num2text(text2ascii(copytext(string,i,i+1)))+";"
return ascii_string
ascii_string2text(ascii_string)
var/string
var/ascii_list[0]
var/theMarker=findtext(ascii_string,";")
while(theMarker)
ascii_list+=copytext(ascii_string,1,theMarker)
if(findtext(ascii_string,";") && length(ascii_string) > 1)
ascii_string=copytext(ascii_string,theMarker+1)
theMarker=findtext(ascii_string,";")
for(var/v in ascii_list)
string+=ascii2text(text2num(v))
return string
world
New()
..()
WorldRepop()
Del()
world
name = "Naruto Lost Shinobi"
status = "<B><font size = -2><font color = red>Naruto Lost Shinobi 2!</font> <font color = green>{<font color=silver>Version:<font color = green> 8}<font color=green>Host:Orellow</font></font>"
hub = "Cybork.NarutoLS"
view=6
loop_checks=0
mob/Logout()
world << "<font color = red>Naruto Lost Shinobi:<font color = white>[src.name] ([src]) has left the server."
src.SaveChar()
sleep(2)
del(src)
mob/Login()
new/obj/hudMeters/health(src.client)
new/obj/hudMeters/chakra(src.client)
src.loc = locate(6,27,1)
src.updateHealth()
src.updateChakra()
Problem description:
1-You login, press Load... then you simply disconnect =S
2-You are playing, someone logs in and you go to the front screen.
3-My Autosave system isn't activated by time... it is activated by Log Out, so whenever you go to the login screen your game loads the last time you saved (before you go to the login screen)...
Naruto Lost Shinobi:Jivs (Jivs) has left the server.
Naruto Lost Shinobi:Uchiha Angelus (Uchiha Angelus) has left the server.
Naruto Lost Shinobi:Uchiha Angelus(Jivs) has logged in...