ID:2312672
 
(See the best response by FKI.)
Code:
world
name = "Stargate: BYOND" //Change this to your games name.

mob
var
motd = ""
race = ""
rank = ""
Logins = 0
banned = 0
CanHearUni = 1
hear = 0
chat_font="#FFFFFF"
status = "Player"
muted = 0
debug = ""
chat = 0
backw
Logins = 0
owner = "MatthewFiltness" //Insert your Key here


mob
Login()
usr.Logins += 1
if(usr.Logins >= 2)
usr.Load()
usr<<"Welcome Back To -<b>[world.name]</b>-"
world<<"[usr] Logged Back In!"

//usr.newlogin = "No"
else
usr<<"Welcome To -<b>[world.name]</b>-"
world<<"[usr] Logged In For The First Time!"
usr.Move(locate(14,31,1))
// usr.newlogin = 0

//newlogin += 1
//client.Load()
//Change this to where you want them to start

//New Save System





proc
SaveMob()
fdel("savefile/[usr.ckey].sav") // deletes the old save file
var/savefile/F=new("savefile/[src.ckey].sav") // creates a new save file
src.Write(F) // writes your variables/lists onto it
F["lastx"] << src.x //saves your x coord
F["lasty"] << src.y //saves your y coord
F["lastz"] << src.z //saves your z coord





Load()
if(fexists("savefile/[usr.ckey].sav"))//if an existing save file exists in the folder located in the game folder
var/savefile/F=new("savefile/[src.ckey].sav") // it creates a new save file
src.Read(F) //it reads it
var/newX
var/newY
var/newZ
F["lastx"] >> newX//it takes the lastx variable in the save and puts it into the newx variable
F["lasty"] >> newY//same as above with a new variable
F["lastz"] >> newZ//same as above with a new variable
src.loc=locate(newX,newY,newZ)//makes the player located in those locations
else //if no save file was found
usr << "No Save File" //outputs message to the user
return//returns
Delete()
fdel("savefile/[usr.ckey].sav")//deletes the save file, plain and simple lol
usr << "DELETED"

//now many ppl have had troubles making auto saving in their game, ITS SO EASY!

client
Del()//when the client is deleted
..()
mob.SaveMob()//save the mob

del (mob)//delete the mob *NOTE* always make sure to delete the mob AFTER you saved it
mob
proc
OwnerVerbs() //Insert all the verbs and stuff here!
usr.verbs+=/mob/Owner/verb/Warp

mob
Owner
verb //You can add heaps more verbs here! n_n
Warp(mob/M in world, mob/T as mob in world)
set category = "Owner"
if(M.x)
M.loc=locate(T.x,T.y-1,T.z)
usr << "You warped [M] to [T]!"
else
M.loc=locate(1,1,1)
if(M.x)
M.loc=locate(T.x,T.y-1,T.z)
usr << "You warped [M] to [T]!"
else
M.loc=locate(1,1,1)


Problem description:
loading New.dme
Code\Core Files\Login.dm:48:error: bad argument definition
New.dmb - 1 error, 0 warnings (11/7/17 3:27 pm)

Literally have no idea what is wrong here!? Its saying that proc is a bad definition...


Your indentation is wrong here:

mob
Login()
usr.Logins += 1
if(usr.Logins >= 2)
usr.Load()
usr<<"Welcome Back To -<b>[world.name]</b>-"
world<<"[usr] Logged Back In!"

//usr.newlogin = "No"
else
usr<<"Welcome To -<b>[world.name]</b>-"
world<<"[usr] Logged In For The First Time!"
usr.Move(locate(14,31,1))
// usr.newlogin = 0
In response to FKI
Thank you for the help.

I now have the error
loading New.dme
Code\Core Files\Login.dm:44:error: inconsistent indentation
Code\Core Files\Login.dm:44:error: bad argument definition
Code\Core Files\Login.dm:46:error: inconsistent indentation
Code\Core Files\Login.dm:47:error: inconsistent indentation
Code\Core Files\Login.dm:48:error: inconsistent indentation
Code\Core Files\Login.dm:49:error: inconsistent indentation
Code\Core Files\Login.dm:50:error: inconsistent indentation
Code\Core Files\Login.dm:51:error: inconsistent indentation
Code\Core Files\Login.dm:58:error: inconsistent indentation
Code\Core Files\Login.dm:68:error: inconsistent indentation
Code\Core Files\Login.dm:72:error: inconsistent indentation
Code\Core Files\Login.dm:73:error: inconsistent indentation
Something is still incorrect then. Post your edited code and let's see.
@FKI. Spaces and tabs. Quick protip. Don't have the energy to explain. You explain the problem, you get my vote.
In response to Ter13
Best response
Ter13 wrote:
@FKI. Spaces and tabs. Quick protip. Don't have the energy to explain. You explain the problem, you get my vote.

Snippet from the DM Guide:
You may use either tabs or spaces in any number to indent your code. The only requirement is that you be consistent. Each block of code must use the same type of indentation throughout. In general, DM provides enough freedom to format your code the way you like without so much freedom that mistakes are likely to slip through unnoticed.



I was wondering if the guide explicitly explained the rules of indentation though and I didn't see anything. Thinking I may write a short post at some point explaining when and when not to indent, that way people are doing more than just copying what they see and wondering why their own code doesn't work.