ID:176332
 
Can someone please tell me what's wrong with this? I basically want the code to check if the character has a logged var of 0 or 1. Initially, there is no value to var/logged, but at the end of the proc/creator, it changes the characters var/logged to 1. Then, when they log in again, its not supposed to run creator.

Login()
..()
if(!src.logged)
creator()
Krosse wrote:
Can someone please tell me what's wrong with this? I basically want the code to check if the character has a logged var of 0 or 1. Initially, there is no value to var/logged, but at the end of the proc/creator, it changes the characters var/logged to 1. Then, when they log in again, its not supposed to run creator.

Login()
..()
if(!src.logged)
creator()

I am not very confident about my suggestion but, based on what I have learned so far:

mob/Login()
if(!src.logged)
creator()
else
return

~Cable
Krosse wrote:
Can someone please tell me what's wrong with this? I basically want the code to check if the character has a logged var of 0 or 1. Initially, there is no value to var/logged, but at the end of the proc/creator, it changes the characters var/logged to 1. Then, when they log in again, its not supposed to run creator.

Login()
..()
if(!src.logged)
creator()

I think you can make it a variable like this:

Login()
..()
if(newguy = 0)
creator()
newguy = 1

I'm new at this too so it may not help.
In response to Cable
Okay, well, I've been working with DM for a while. Both of you were correct in your suggestions, so thank you, that code should work. Unfortunately, its not working in my code, which suggests that I've made some simple mistake somewhere that's screwing everything up. Anyone else got any ideas?
In response to Krosse
How 'bout showing us the whole login?


~Cable
In response to Cable
Are you using any libs?
In response to Jnco904
Uh, the var kinda has to be stored in a savefile. Thus, do something like this..
mob/Login()
..()
var/savefile/F = new("players/[src.ckey].sav")
Read(F)
if(src.logged == 0)
creator()