ID:273883
 
I decided to make password login later but i got a problem when making clans


mob
Login()
src<<"[src] has logged in!"
while(!src.cansave)
switch(input("What do you want to do?")in list("Load","Delete","Create"))
if("Load")
src.LoadC()
if("Delete")
src.DelC()
if("Create")
src.Create()
..()


client
Del()
..()
src.verbs-=typesof(/mob/Tournament/verb)
src.mob.SaveC()




mob
Write(var/savefile/F)
..()
F["Level"] << Level
F["Exp"] << Exp
F["Nexp"] << Nexp
F["health"] << health
F["maxhealth"] << maxhealth
F["mana"] << mana
F["maxmana"] << maxmana
F["strenght"] << strenght
F["maxstrenght"] << maxstrenght
F["defence"] << defence
F["maxdefence"] << maxdefence
F["Gold"] << Gold
F["contents"] << contents
F["icon state"] << usr.icon_state
F["overlays"] << usr.overlays
F["Admin"] << Admin
F["GM"] << GM
F["x"] << x
F["y"] << y
F["z"] << z

Read(var/savefile/F)
..()
var/x
var/y
var/z
F["Level"] >> Level
F["Exp"] >> Exp
F["Nexp"] >> Nexp
F["health"] >> health
F["maxhealth"] >> maxhealth
F["mana"] >> mana
F["maxmana"] >> maxmana
F["strenght"] >> strenght
F["maxstrenght"] >> maxstrenght
F["defence"] >> defence
F["maxdefence"] >> maxdefence
F["Gold"] >> Gold
F["contents"] >> contents
F["icon state"] >> src.icon_state
F["overlays"] >> overlays
F["Admin"] >> Admin
F["GM"] >> GM
F["x"] >> x
F["y"] >> y
F["z"] >> z
loc = locate(x,y,z)

mob/var/tmp/cansave=0


mob
proc
SaveC()
if(src.cansave)
var/savefile/F=new("players/[src.key].sav")
Write(F)
LoadC()
if(fexists("players/[src.key].sav"))
var/savefile/F=new("players/[src.key].sav")
Read(F)
src<<"Savefile loaded, welcome back."
src.cansave=1
world<<"[usr] has returned"
else
src<<"You have no savefile"
DelC()
if(fexists("players/[src.key].sav"))
var/conf=input("Are you sure you want to delete your savefile?")in list("Yes","No")
if(conf=="Yes")
fdel("players/[src.key].sav")
src<<"Savefile deleted sucessfully"
else
src<<"Deleting cancelled."
else
src<<"You dont have a savefile!"
Create()
if(fexists("players/[src.key].sav"))
src<<"Delete your old savefile first!"
return
var/creating=0
while(!creating)
usr.name=input("Input a name please.")as text|null
creating=1
if(!usr.name) creating=0
src.cansave=1
world<<" [usr] has joined the game"
src.icon='Players.dmi'
usr.clan=input("Which clan would you like to be?","Clan")in list("Darkeness","fire")
switch(usr.clan)
if("Darkness")
usr.verbs+=new/mob/fire/verb/fire_blast()
else
usr.verbs+=typesof(/mob/fire/verb)
src.loc=locate(1,1,1)



I know theres only 2 clans and they have the same moves but I am waiting for the art to come in Tomarrow but still wanted to get the code done. Honestly I cant see a problem with the code.

The errors are
login.dm:121:error: switch: invalid proc definition
login.dm:122:error: : invalid proc definition

pls help
</<></<></<></<></< ></<></<></<></<></ <></<></<></<></<>& lt;/<></<></<></<></< ></<>
Your switch is not tabbed far enough.
I'm not sure if you posted it exactly the way it looks in DM, but if it is, your switch at the bottom isn't tabbed correctly. Try:

mob
var
clan
proc
ChooseClan()
var/clan=input("Which clan would you like to be?","Clan")in list("Darkness","Fire")
switch(clan)
if("Darkness")
src.clan =clan
//enter whatever you want to occur here
if("Fire")
src.clan =clan
//enter whatever you want to occur here


BTW I think this was supposed to go in code problems.
In response to Lugia319
well I tried moving the switch. This is what happened

atom
var
clan = 0


mob
Login()
src<<"[src] has logged in!"
while(!src.cansave)
switch(input("What do you want to do?")in list("Load","Delete","Create"))
if("Load")
src.LoadC()
if("Delete")
src.DelC()
if("Create")
src.Create()
..()


client
Del()
..()
src.verbs-=typesof(/mob/Tournament/verb)
src.mob.SaveC()




mob
Write(var/savefile/F)
..()
F["Level"] << Level
F["Exp"] << Exp
F["Nexp"] << Nexp
F["health"] << health
F["maxhealth"] << maxhealth
F["mana"] << mana
F["maxmana"] << maxmana
F["strenght"] << strenght
F["maxstrenght"] << maxstrenght
F["defence"] << defence
F["maxdefence"] << maxdefence
F["Gold"] << Gold
F["contents"] << contents
F["icon state"] << usr.icon_state
F["overlays"] << usr.overlays
F["Admin"] << Admin
F["GM"] << GM
F["x"] << x
F["y"] << y
F["z"] << z

Read(var/savefile/F)
..()
var/x
var/y
var/z
F["Level"] >> Level
F["Exp"] >> Exp
F["Nexp"] >> Nexp
F["health"] >> health
F["maxhealth"] >> maxhealth
F["mana"] >> mana
F["maxmana"] >> maxmana
F["strenght"] >> strenght
F["maxstrenght"] >> maxstrenght
F["defence"] >> defence
F["maxdefence"] >> maxdefence
F["Gold"] >> Gold
F["contents"] >> contents
F["icon state"] >> src.icon_state
F["overlays"] >> overlays
F["Admin"] >> Admin
F["GM"] >> GM
F["x"] >> x
F["y"] >> y
F["z"] >> z
loc = locate(x,y,z)

mob/var/tmp/cansave=0


mob
proc
SaveC()
if(src.cansave)
var/savefile/F=new("players/[src.key].sav")
Write(F)
LoadC()
if(fexists("players/[src.key].sav"))
var/savefile/F=new("players/[src.key].sav")
Read(F)
src<<"Savefile loaded, welcome back."
src.cansave=1
world<<"[usr] has returned"
else
src<<"You have no savefile"
DelC()
if(fexists("players/[src.key].sav"))
var/conf=input("Are you sure you want to delete your savefile?")in list("Yes","No")
if(conf=="Yes")
fdel("players/[src.key].sav")
src<<"Savefile deleted sucessfully"
else
src<<"Deleting cancelled."
else
src<<"You dont have a savefile!"
Create()
if(fexists("players/[src.key].sav"))
src<<"Delete your old savefile first!"
return
var/creating=0
while(!creating)
usr.name=input("Input a name please.")as text|null
creating=1
if(!usr.name) creating=0
src.cansave=1
world<<" [usr] has joined the game"
src.icon='Players.dmi'
usr.clan=input("Which clan would you like to be?","Clan")in list("Darkeness","fire")
switch(usr.clan)
if("Darkness")
usr.verbs+=new/mob/fire/verb/fire_blast()
else
usr.verbs+=typesof(/mob/fire/verb)
src.loc=locate(1,1,1)



1 warning:
login.dm:122:warning: : empty switch statement
In response to Dj dovis
Are your tabs 2 or 4? The switch should be aligned with the other code.
In response to Lugia319
what do you mean tabs 2 or 4?
In response to Dj dovis
Your tab length. Your switch doesn't look like it's aligned with the rest of the code. It should be aligned with the if() above it.
In response to Lugia319
you mean with this if?
if(!usr.name) creating=0
In response to Dj dovis
Anyone here have Teamviewer who could help me with this? I dont get it through the forum
In response to Dj dovis
        Create()
if(fexists("players/[src.key].sav"))
src<<"Delete your old savefile first!"
return
var/creating=0
while(!creating)
usr.name=input("Input a name please.")as text|null
creating=1
if(!usr.name) creating=0
src.cansave=1
world<<" [usr] has joined the game"
src.icon='Players.dmi'
usr.clan=input("Which clan would you like to be?","Clan")in list("Darkeness","fire")
switch(usr.clan)
if("Darkness")
usr.verbs+=new/mob/fire/verb/fire_blast()
else
usr.verbs+=typesof(/mob/fire/verb)
src.loc=locate(1,1,1)


The bottom switch() should be aligned with the if() above it. And you need to adjust the lines below it as well.
In response to Dj dovis
Still dont get it
In response to Dj dovis
I do. What can I do to make this easier. I can also help more if you have a mumble
In response to Dj dovis
What is your teamview information?