01.01.2011, 22:52
Hello,
My OnPlayerAutoLogin funtion doesn't work. It will show the "Enter password" dialog if I join the server.
I think this is wrong: if(!strcmp(AccountInfo[playerid][aIP], PlayerIP))
Thanks for helping!
Battleman
OnPlayerConnect
OnPlayerRequestClass
My OnPlayerAutoLogin
My OnPlayerAutoLogin funtion doesn't work. It will show the "Enter password" dialog if I join the server.
I think this is wrong: if(!strcmp(AccountInfo[playerid][aIP], PlayerIP))
Thanks for helping!
Battleman
OnPlayerConnect
Код:
public OnPlayerConnect(playerid) { GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP)); AccountInfo[playerid][aIP]=PlayerIP; return 1; }
Код:
public OnPlayerRequestClass(playerid, classid) { if(IsUserNameAvailable(PlayerName[playerid])) { if(OnPlayerAutoLogin(playerid)) { LoadPlayer(playerid); return SpawnPlayer(playerid); } ShowPlayerDialog(playerid,DIALOGID+1,DIALOG_STYLE_MSGBOX,ServerInfo[sName],"The system found an account by your nickname. \nYou have to login to continue.","Login","Quit"); }else{ ShowPlayerDialog(playerid,DIALOGID+2,DIALOG_STYLE_MSGBOX,ServerInfo[sName],"The system didn't found an account by your nickname. You can play with or without an account. \nIf you don't register, you stats won't be restored. If you register your stats will be stored. \nPlease make your choice.","Register","Don't Reg."); } return 1; }
Код:
stock OnPlayerAutoLogin(playerid) { format(File, sizeof(File), "/accountfiles/%s.sav", PlayerName[playerid]); AutoLogin = dini_Int(File, "AutoLogin"); if(AutoLogin) { GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP)); AccountInfo[playerid][aIP] = dini_Int(File, "IP"); if(!strcmp(AccountInfo[playerid][aIP], PlayerIP)) { return 1; } } return 0; }