ID:142333
 
Code:
mob//Basicly this is you or another person.
Login()//Calls the login proc which is already built into dream seeker.
switch(input("What Would You Like to do?") in list("New Game", "Load Game", "Delete Game", "Quit"))//Calls a list and asks what you want to do New Game,Load Game Or quit
if("New Game")//If a user choose new game it goes to this
src.name = input("What would you like your name to be?", "Name:")//Asks a mob what they want their name to be.
switch(input("What sex do you want to be?") in list("Male","Female"))//A list asking what gender they want to be.
if("Male")//If the mob picks Male their mob is now a male
icon = 'Goodwitchs.dmi'//This becomes the mobs icons.
icon_state = "whitelighter"//chooses the icon state of the mob so they dont become another gender.
world << "<small><font color = red><b>Server: <font color=white>[src]/[key] is a first time player."//Says to the world that a mob has logged in for the first time.
loc = locate(/turf/Area/Earth)//Plants the mob in this location
newcomer=0
if("Female")//If the mob picks female their mob is now a female
icon = 'Goodwitchs.dmi'//This becomes the mobs icon.
icon_state = "goodwitch"//Choose the icon state of the mob so they dont become the wrong gender.
world << "<small><font color = red><b>Login info: <font color = white>[src]/[key] is a first time player."//Says to the world that a mob has logged in for the first time.
loc = locate(/turf/Area/Earth)//Puts the mob in this location.
src.Save()//Calls the save proc so the mob can load the next time they login.
newcomer=0
if("Load Game")//if a user chooses Load Game it comes to this
src.Load()//Calls the Load proc so a mob can load an old save
if("Delete Game")
del()
if("Quit")//This is basicly quit so it logs the mob out.
src.Logout()//Calls the logout proc which is already built in dream maker but it safe to have it in your code anyways.



proc/Load()//This is the Load proc so when a mob clicks load it gives them their old character.
var/savefile/F = new("saves/[src.ckey].sav")//Overwrites their last save file to show they logged in again.
cansave = 1//This a var show that the mob can save their game.
Read(F)//Read the mobs save file.
var/lx,ly,lz//vars to that we dont have to put last_x and so on making it much easier
F["last_x"] >> lx//This is a desplay of what i have done above. These means your last locations.
F["last_y"] >> ly
F["last_z"] >> lz
loc = locate(lx,ly,lz)//Puts the mob in their last location,
world << "<small><font color = red><b>Login info: <font color = white>[src]/[key] has logged in."//Show the world a mob has logged in with an old save file.
Save()//Calls the save proc so the mob can save.
proc/Save()//The Save proc is inuse when called.
var/savefile/F = new("saves/[src.ckey].sav")//Overwrites their file with another location now
Write(F)//Write over their save file
F["last_x"] << x//Writes over their last with their new one.
F["last_y"] << y
F["last_z"] << z
// src << "<small><font color = red><b>Save info: <font color = white>Your game has been saved. "//says to the mob their game has been save
sleep(900)//sleep for 1 minute and a half.
Save()//Calls the proc again so that it will save the mobs x,y,z.
..()//Calls the history.
Logout()//The logout proc which is inbuilt in dream maker but is always save to have
if(cansave)//if the mob can save save them also if you put !cansave it means the mob cant save so bare this in mind.
Save()//Call the save proc.
world << "<small><font color = red><b>[src] has logged out."//Tell the world a mob has logged out of the world
..()//Call all the histy before logging out
del(src)//Delete the mob from the world note their save file will not go lol.


Problem description:

loading Charmed Rebirth of Magic.dme
Login.dm:38:error: proc definition not allowed inside another proc
Monti wrote:
Code Sucks:
>       switch(input("What Would You Like to do?") in list("New Game", "Load Game", "Delete Game", "Quit"))//Calls a list and asks what you want to do New Game,Load Game Or quit
>



That code is wrong try this one

Code:
                switch(alert(usr,"What Would You Like to Do?","CHARMED","New Game","Load Game","Delete Game","Quit"))
In response to Souhyb32
k now this line has asame prob


var/savefile/F = new("saves/[src.ckey].sav")
In response to Souhyb32
alert() can only have a maximum of 3 buttons, so it won't work. Not that you really need a Quit option, though. Or his Delete Game option which at least currently does nothing.
In response to Monti
Read the error. Your problem is that you're trying to define procs (Load(), Save()) inside of another proc. Having procs indented under others is invalid syntax, so un-indent them until they are indented under only /mob.