ID:145953
 
mob/Login()
CheckBan()
if(usr.key in players)
guildcheck()
gmcheck()
usr.loc=locate(usr.lastx,usr.lasty,usr.lastz)
usr<<"<font color = red><B><CENTER>~Welcome to §ouloron~<BR><font color = white><BR>~~~~~Rules~~~~~</B></center><font color = blue><br>1.AFK/EZ Macroing/Training is NOT allowed. If you are caught doing that your character will be permanently deleted.<BR>2.Killing/Attacking players under level 5 is illegal.<BR>3.Be nice to people and GMs, and listen to all what GMs say.<BR>4.DO NOT rip from the game (Souloron).<BR>5.Execssive mass player killing is bannable offense. <BR>6.If you know about a bug/exploit and either abuse it or not report it, you can get banned.<BR><font color = yellow><B><CENTER>Enjoy playing §ouloron!</CENTER></b></font>"
world<<"<<B><font size = 1>System Message: <font color = red>[usr.name] has entered!</b>"
usr.client.AutoSave()
else
players+=usr.key
world<<"<B><font size = 1>System Message: <font color = blue>[usr.name] has been connected!"
usr<<sound('enter.wav')
var/random = rand(1,3)
if(random >= 1)
usr.loc = locate(7,7,20)
if(random >= 2)
usr.loc = locate(7,50,20)
if(random >= 3)
usr.loc = locate(7,94,20)


Okay so that is the LogIn code....

And as you seen, when you connect before you enter it just say you connected... but when I try load, it supposed to know your key is in players... but it doesnt know it, and re-say u connected, and re-does the random thing, instand taking me to my last x/y/z... anyone know wtf goingon? xD

Ok I found the problem.... It cant find my key... look:

runtime error: Cannot read null.key
proc name: CheckBan (/mob/proc/CheckBan)
usr: Souloron (/mob)
src: Souloron (/mob)
call stack:
Souloron (/mob): CheckBan(null)
Souloron (/mob): Login()
Souloron (/client): New()


I wonder why it dont know my key, if it know my use.name... btw, if I make it to only usr it still dun work xD
In response to Souloron
Well if you want help with the CheckBan() proc, obviously you'll have to post the code for it. Knowing how you called it is helpful, but we haven't seen the code for the proc itself.

Lummox JR
In response to Lummox JR
The code is fine... thats not problem, it dunno usr.key... that y it dunno his in players as well, and dun even add him...
Well here it is anyways,

mob/proc/CheckBan(mob/M as mob)
var/savefile/F = new("cr_full.ban")
var/checking
F["[M.key]"] >> checking
if(M.key == checking)
M << "You have been banned!"
del( M )
In response to Souloron
I also tried take off Ban and still didnt work... anyways:

mob/proc/CheckBan(mob/M as mob)
var/savefile/F = new("cr_full.ban")
var/checking
F["[M.key]"] >> checking
if(M.key == checking)
M << "You have been banned!"
del( M )
In response to Souloron
Souloron wrote:
The code is fine...

What has gotten into you? The code isn't fine. If the code was fine it wouldn't show you that runtime error.

O-matic
In response to O-matic
I am talking about ban... cuz its not the ban's code fault... it dunno usr.key for some reason, and im asking what to do.
In response to Souloron
Souloron wrote:
Well here it is anyways,

mob/proc/CheckBan(mob/M as mob)
var/savefile/F = new("cr_full.ban")
var/checking
F["[M.key]"] >> checking
if(M.key == checking)
M << "You have been banned!"
del( M )

Well, here's the problem then. You're calling it as CheckBan(), not as CheckBan(mob), so you're not giving it a value for M. Thus M is null.

But you don't need M at all anyway. Just take the M argument out of that proc and change all M's here to src.

Lummox JR
In response to Lummox JR
I did that few mins after I posted it :P, but hey the main problem, and only problem now is the usr.key in players... it dunno his in players, and cuz of that it doesnt take him to last x/y/z... it suppose do it, then when u click load his allready in so it wont re-say he connected, it will take him to last x/y/z and say he entered..... =/
In response to Souloron
Not one bit of that made any sense. Can you explain in more detail please, preferably with code attached?

Lummox JR
In response to Lummox JR
mob/Login()
if(usr!=null)
var/hostcheck=0
for(var/mob/M in world)
if(M.key)
hostcheck+=1
if(hostcheck==1)
world.status="Souloron -- Version Alpha 1.00 | Host: [usr]"
for(var/mob/M in world)
if(M.name==src.key)
if(M.key)
sleep(1)
else
del M
CheckBan(src)
var/random = rand(1,3)
if(random >= 1)
src.loc = locate(7,7,20)
if(random >= 2)
src.loc = locate(7,50,20)
if(random >= 3)
src.loc = locate(7,94,20)
if(usr.key in players)
guildcheck()
gmcheck()
usr.loc=locate(usr.lastx,usr.lasty,usr.lastz)
usr<<"<font color = red><B><CENTER>~Welcome to §ouloron~<BR><font color = white><BR>~~~~~Rules~~~~~</B></center><font color = blue><br>1.AFK/EZ Macroing/Training is NOT allowed. If you are caught doing that your character will be permanently deleted.<BR>2.Killing/Attacking players under level 5 is illegal.<BR>3.Be nice to people and GMs, and listen to all what GMs say.<BR>4.DO NOT rip from the game (Souloron).<BR>5.Execssive mass player killing is bannable offense. <BR>6.If you know about a bug/exploit and either abuse it or not report it, you can get banned.<BR><font color = yellow><B><CENTER>Enjoy playing §ouloron!</CENTER></b></font>"
world<<"<<B><font size = 1>System Message: <font color = red>[usr.name] has entered!</b>"
usr.client.AutoSave()
else
players+=usr.key
world<<"<B><font size = 1>System Message: <font color = blue>[usr.name] has been connected!"
usr<<sound('enter.wav')


mob/proc/CheckBan(mob/M as mob)
var/savefile/F = new("cr_full.ban")
var/checking
F["[M.key]"] >> checking
if(M.key == checking)
M << "<B><font color = yellow><font size = 1>System Message: <font color = red>You have been banned from Souloron!!"
del( M )
Found my problem thx for who ever at least tired.