ID:271672
 
turf/LoginScreen
density = 1
layer = 999
icon = 'login.png'

turf/newchar
density = 1
layer = 999
Click()
usr.newchar()

turf/loadchar
density = 1
layer = 999
Click()
usr.load()

turf/deletechar
density = 1
layer = 999
Click()
usr.delchar()

mob
proc
newchar()
if(fexists("players/[src.key]"))
switch(alert(usr, "Are you sure that you want to overwrite your old Character?", "Character Creation", "Yes","No"))
if("Yes")
sleep(0)
fdel("players/[usr.key].sav")
if("No")
return
var/name = input("","What is your name?") as text|null
if(length(name) < 2)
alert("Minimum of 2 characters")
return
if(length(name) > 20)
alert("Your name can not be longer than twenty chars")
return
if(name == src.key)
alert("Cant use your Key name.")
return
if(!usr)
return
usr.loc = locate(5,5,2)
usr.name="[name]"
usr.icon='ghost.dmi'
world<<"<b><small><font color = red>Server AI: <font color = white>Welcome our Newest player, [usr]!"

mob
proc
delchar()
if(fexists("players/[src.key].sav"))
var/sure=alert(src,"Are you sure you wish to delete your savefile?","Server","Yes","No")
if(sure=="Yes")
sleep(0)
fdel("players/[src.key].sav")
src << "<b><small><font color = red>Server AI: <font color = white>Your character has been deleted."
else
return
else
return


mob
proc
save()
if(usr.cansave == 1)
var/savefile/save
save = new ("players/[src.key]")
src.V = src.verbs
src.xco = src.x
src.yco = src.y
src.zco = src.z
Write(save)
usr<<"<B><small><font color = red>Server AI: <font color = white>Your progress has been saved."
else
return

atom/movable/var
xco=0
yco=0
zco=0

mob
proc
load()
if(fexists("players/[usr.key]"))
var/savefile/load
load = new ("players/[usr.key]")
Read(load)
src.loc = locate(xco,yco,zco)
usr.doing = 0
else
usr<<"<b><small><font color = red>Server AI: <font color = white>You dont have a saved character on this server."
usr.newchar()

mob/var/doing = 0

mob/var/list
V




My login screen has a problem, whenever you load the game it starts you off beside the screen as a player already, w/o you even creating a character. Can someone please tell me what is wrong. Any help is greatly appreciated.
Bump
in your code there is probably something like:
mob
icon='iconname.dmi'

This sets a default icon for mobs, so when the player logs in they already have the icon no matter what. either delete that line of code or change the player's icon to null on login. (Then, of course during character creation, set their icon)
In response to Naokohiro
Thank you very much
In response to Blagh Nabbit
Also, you used usr in a lot of places where we suggest using src. Specifically within mob procs or verbs.