ID:169877
 
Problem: When my friend logs in, it doesn't change to his icon.

Login Code:
mob
Login()
var/firstletter=copytext(usr.ckey, 1, 2)
var/savefile/F = new("Players Save/[firstletter]/[usr.ckey].sav")
usr << sound('foreigners.mid',1)
switch(input("What would you like to do?","Login")in list("Continue","New Game"))
if("New Game")
switch(input("What race would you like to be?","Race")in list("Twin Blade","Long Blade","Wave Master"))
if("Twin Blade")
usr.icon = 'Kite.dmi'
usr.icon_state = "Gone"
if("Long Blade")
usr.icon = 'Bear.dmi'
usr.icon_state = "Gone"
if("Wave Master")
usr.icon = 'Elk.dmi'
usr.icon_state = "Gone"
Name
name = input("[usr.key]","Name")as text
if(name == "")
goto(Name)
else
usr.name = name
usr.loc = locate(11,4,1)
if("Continue")
Read(F)
Icon_Check()
usr.froze = 1
world << "<b>[src] has entered the .Hack Server"
flick("Return",usr)
sleep(5)
usr.icon_state = ""
view() << sound('gateout.wav',0)
sleep(20)
usr.froze = 0
GMLevel=0
usr.AdminLoad()
Write(F)

Icon_Check():
mob
proc
Icon_Check()
if(src.key == "Inuyasha187")
src.icon = 'Mike.dmi'
if(src.key == "Chwgt")
src.icon = 'Chris.dmi'


If you could help, thx, if not thx for looking =P.

~C
ok. just so you know for future reference the developers how-to section of the forums is where you ask for coding if you dont know how to do it and have none of the coding done. In the Code Problems section is where you put code that you have but isnt working right and you want people to look at it and find the problem. but o well... ill look at it anyway give me a sec.
In response to Odine (#1)
Yes, I know all that, but have never been corrected on the problem. So I just continued to post here, anyway back on subject. Thanks for correcting it, and now i'll put any code problems or questions on the "Code Problems" forum. And if you can help, thank you.
does this only affect your friend?
In response to Odine (#3)
Yes, it works fine for me, well I wouldn't know if it affected anyone but him, becouse he is the only other owner/moderator. So, when he logs in it won't put on his icon, its weird....
um... just 1 obvious question... did you spell his key right in the icon check proc???
In response to Odine (#5)
Yes, i've checked and re-checked that over and over thinking it was the problem, but it isn't. His key is Inuyasha187, and its spelled Inuyasha187.
In response to Chwgt (#6)
does that icon exist? and is its icon_state name = blank (Blank meaning nothing there)
In response to Odine (#7)
1: i'm not a noob, and 2: Yes the icon exits and yes its icon_state is blank.
sorry... i dont see the problem but then again im tired atm. the best i can think of is eather he has a space somewhere in his name or the icon doesnt exist... try making it check ckey format instead of just key.
If you look up the key, it's has a capital Y. =)

InuYasha187
In response to YMIHere (#10)
well... there is the problem. thats why i always suggest making it check ckey format instead of key. that way you dont have to worry about little errors like that.
In response to Odine (#11)
I agree! I always use something like if(ckey(KEY_IN_QUESTION) == MOB_IN_QUESTION.ckey) when checking for certain keys, even my own, strangely enough. =)
In response to YMIHere (#12)
I always just use key and it seem to work fine but i copy and paste peoples keys out of byond so its hard to make the mistake
In response to Sheepywoolyfluff (#13)
Thanks for your help.



~C
YMI is right, but additionally, you're misusing goto. Use while() instead.