ID:263187
 
Code:This is a login code, it should give you the stats stated
mob/var
HP = 0
MHP = 0
MP = 0
MMP = 0
Str = 0
Mana_Power = 0
Class = ""
Exp = 0
Mexp = 0
Level = 1
host = ""
mob/create_character/Login()
if(client.CheckPassport("14c847b7157ec746"))
var/mob/character
full_access = 1
usr<<sound('opening.mid',1)
var/charactername = input("Hello, Pick a name for your character, something you wish for people to call you in the game.","Character Name?")
switch(input("Below pick one of the following backgrounds you wish for your character to be. It determines what you look like in the game.","Character Background?") in list("Frog-Woman","Frog-Man","Human(Male)","Human(Female)"))
if ("Frog-Man")
character = new /mob/You/Warrior()
if ("Frog-Woman")
character = new /mob/You/Warrior2()
if ("Human(Male)")
character = new /mob/You/Cleric()
if ("Human(Female)")
character = new /mob/You/Magician()
switch(input("What class do you want?")in list("Monk","Sorcerer","Knight"))
if("Monk")
usr.HP += 25
usr.MHP += 25
usr.MP += 5
usr.MMP += 5
usr.Mana_Power += 10
usr.Str += 15
usr.Class += "Monk"
usr.Exp += 0
usr.Mexp += 20
if("Sorcerer")
usr.HP += 14
usr.MHP += 14
usr.MP += 25
usr.MMP += 25
usr.Mana_Power += rand(10,20)
usr.Str += 7
usr.Class += "Sorcerer"
usr.Exp += 0
usr.Mexp += 13
if("Knight")
usr.HP += 20
usr.MHP += 20
usr.MP += 0
usr.MMP += 0
usr.Mana_Power += 0
usr.Str += 25
usr.Class += "Knight"
usr.Exp += 0
usr.Mexp += 27
character.name = charactername
src.client.mob = character
character.loc=locate (2,2,1)
world<<"<B>[character] has logged in!"
del(src)
..()
else
var/mob/character
full_access = 0
usr<<sound('opening.mid',1)
usr.loc=locate(8,7,2)
var/charactername = input("Hello, Pick a name for your character, something you wish for people to call you in the game.","Character Name?")
switch(input("Below pick one of the following backgrounds you wish for your character to be. It determines what skills you get in the game.","Character Background?") in list("Frog-Woman","Frog-Man","Human(Male)","Human(Female)"))
if ("Frog-Man")
character = new /mob/You/Warrior()
if ("Frog-Woman")
character = new /mob/You/Warrior2()
if ("Human(Male)")
character = new /mob/You/Cleric()
if ("Human(Female)")
character = new /mob/You/Magician()
switch(input("What class do you want? this decides your stats.")in list("Monk","Sorcerer","Knight"))
if("Monk")
usr.HP += 25
usr.MHP += 25
usr.MP += 5
usr.MMP += 5
usr.Mana_Power += 10
usr.Str += 15
usr.Class += "Monk"
usr.Exp += 0
usr.Mexp += 20
if("Sorcerer")
usr.HP += 14
usr.MHP += 14
usr.MP += 25
usr.MMP += 25
usr.Mana_Power += rand(10,20)
usr.Str += 7
usr.Class += "Sorcerer"
usr.Exp += 0
usr.Mexp += 13
if("Knight")
usr.HP += 20
usr.MHP += 20
usr.MP += 0
usr.MMP += 0
usr.Mana_Power += 0
usr.Str += 25
usr.Class += "Knight"
usr.Exp += 0
usr.Mexp += 27
character.name = charactername
src.client.mob = character
character.loc=locate (2,2,1)
world<<"<B>[character] has logged in!"
del(src)
..()


Problem description:When I log in, all my stats are 0 instead of what the login says they should be

You're changing usr's stats then connecting the client to a new mob (character). You should be changing characters stats instead of usrs. A few more things to address:
  • src is a much better choice here than usr when you do want to referrence the players current mob (like in the inputs).
  • All of the += 0 stuff is ridiculous (just get rid of it).
  • The only difference I see between the two if blocks is the setting of full_access, but if blocks should only contain the differences. Anything else can be set outside of the if statement.
In response to YMIHere
so I should make all the usrs src, and make the [stat] = [num] instead of [stat] += [num]?
In response to Dragon warrior2662
Every instance of usr should be changed, but what it's changed to depends on what you want to do. You should play the sound at the beginning to src (the current mob of the player), but change characters (the mob that the player will control later) HP stat. About the stats, just get rid of the ones that say += 0. There's no point in adding 0 to a stat. =P
In response to YMIHere
the code still doesn;t work,all my stats are 0, the code is now
mob/var
full_access
mob/var
HP
MHP
MP
MMP
Str
Mana_Power
Class = ""
Exp
Mexp
Level = 1
host = ""

mob/create_character/Login()
if(client.CheckPassport("14c847b7157ec746"))
var/mob/character
full_access = 1
usr<<sound('opening.mid',1)
var/charactername = input("Hello, Pick a name for your character, something you wish for people to call you in the game.","Character Name?")
switch(input("Below pick one of the following backgrounds you wish for your character to be. It determines what you look like in the game.","Character Background?") in list("Frog-Woman","Frog-Man","Human(Male)","Human(Female)"))
if ("Frog-Man")
character = new /mob/You/Warrior()
if ("Frog-Woman")
character = new /mob/You/Warrior2()
if ("Human(Male)")
character = new /mob/You/Cleric()
if ("Human(Female)")
character = new /mob/You/Magician()
switch(input("What class do you want?")in list("Monk","Sorcerer","Knight"))
if("Monk")
src.HP = 25
src.MHP = 25
src.MP = 5
src.MMP = 5
src.Mana_Power = 10
src.Str = 15
src.Class = "Monk"
src.Exp = 0
src.Mexp = 20
if("Sorcerer")
src.HP = 14
src.MHP = 14
src.MP = 25
src.MMP = 25
src.Mana_Power = rand(10,20)
src.Str = 7
src.Class = "Sorcerer"
src.Exp = 0
src.Mexp = 13
if("Knight")
src.HP = 20
src.MHP = 20
src.MP = 0
src.MMP = 0
src.Mana_Power = 0
src.Str = 25
src.Class = "Knight"
src.Exp = 0
src.Mexp = 27
character.name = charactername
src.client.mob = character
character.loc=locate (2,2,1)
world<<"<B>[character] has logged in!"
del(src)
..()
else
var/mob/character
full_access = 0
usr<<sound('opening.mid',1)
usr.loc=locate(8,7,2)
var/charactername = input("Hello, Pick a name for your character, something you wish for people to call you in the game.","Character Name?")
switch(input("Below pick one of the following backgrounds you wish for your character to be. It determines what skills you get in the game.","Character Background?") in list("Frog-Woman","Frog-Man","Human(Male)","Human(Female)"))
if ("Frog-Man")
character = new /mob/You/Warrior()
if ("Frog-Woman")
character = new /mob/You/Warrior2()
if ("Human(Male)")
character = new /mob/You/Cleric()
if ("Human(Female)")
character = new /mob/You/Magician()
switch(input("What class do you want? this decides your stats.")in list("Monk","Sorcerer","Knight"))
if("Monk")
src.HP = 25
src.MHP = 25
src.MP = 5
src.MMP = 5
src.Mana_Power = 10
src.Str = 15
src.Class = "Monk"
src.Exp = 0
src.Mexp = 20
if("Sorcerer")
src.HP = 14
src.MHP = 14
src.MP = 25
src.MMP = 25
src.Mana_Power = rand(10,20)
src.Str = 7
src.Class = "Sorcerer"
src.Exp = 0
src.Mexp = 13
if("Knight")
src.HP = 20
src.MHP = 20
src.MP = 0
src.MMP = 0
src.Mana_Power = 0
src.Str = 25
src.Class = "Knight"
src.Exp = 0
src.Mexp = 27
character.name = charactername
src.client.mob = character
character.loc=locate (2,2,1)
world<<"<B>[character] has logged in!"
del(src)
..()
In response to Dragon warrior2662
Every instance of usr should be changed, but what it's changed to depends on what you want to do. You should play the sound at the beginning to src (the current mob of the player), but change characters (the mob that the player will control later) HP stat.

You're changing the stats for the src mob, use character.
In response to YMIHere
Thanks a ton, it works now.
In response to Dragon warrior2662
I still see some usrs in there.