Login/register errors
#7

Quote:

public OnPlayerConnect(playerid)
{
pLogged[playerid] = 0;
#if defined AUTOLOGIN
new tmpIP[16];
GetPlayerIp(playerid,tmpIP,sizeof(tmpIP)); //Getting IP
#endif
if(fexist(PlayerPath(playerid))) {
INI_ParseFile(PlayerPath(playerid), "UserDataLoad_%s", .bExtra = true, .extra = playerid); //Calling loading callback
#if defined AUTOLOGIN
if(strcmp(tmpIP,pIP[playerid],true) == 0) { //Checking if the IPs match
pLogged[playerid] = 1;
SetPlayerScore(playerid,pInfo[playerid][Score]);
GivePlayerMoney(playerid,pInfo[playerid][Cash]);
SendClientMessage(playerid,lime,"You've been auto-logged in. [IP match]");
return 1;
}
#endif
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYL E_INPUT,"Login","Please enter your password below.","Login","Leave");
} else {
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_S TYLE_INPUT,"Register","Please register by entering a password below.","Register","Leave");
}
return 1;
}

forward UserDataLoad_data(playerid,name[],value[]);

public UserDataLoad_data(playerid,name[],value[]) { //This loads the settings from the INI file
INI_Int("Pass",pInfo[playerid][Pass]);
INI_String("IP",pIP[playerid],16);
INI_Int("Admin",pInfo[playerid][Admin]);
INI_Int("Cash",pInfo[playerid][Cash]);
INI_Int("Score",pInfo[playerid][Score]);
INI_Int("Banned",pInfo[playerid][Banned]);
return 1;
}

There you go
Reply


Messages In This Thread
Login/register errors - by Dwerig - 13.03.2013, 18:33
Re: Login/register errors - by Mystique - 13.03.2013, 19:14
Re: Login/register errors - by Calabresi - 13.03.2013, 19:15
Re: Login/register errors - by Dwerig - 13.03.2013, 19:17
Re: Login/register errors - by Calabresi - 13.03.2013, 19:19
Re: Login/register errors - by Mystique - 13.03.2013, 19:22
Re: Login/register errors - by Dwerig - 13.03.2013, 19:28
Re: Login/register errors - by Mystique - 13.03.2013, 19:40
Re: Login/register errors - by Dwerig - 13.03.2013, 20:28

Forum Jump:


Users browsing this thread: 2 Guest(s)