Auto loggin
#5

save the players IP and do something like this?

pawn Код:
forward LoadUser_IP(playerid,name[],value[]);
public LoadUser_IP(playerid,name[],value[])
{
    INI_Int("IP",PlayerInfo[playerid][pIP]);
}

public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)) && GetPlayerIP(playerid) == PlayerInfo[pIP])
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
        SendClientMessage(playerid,YOURCOLOR,"Automaticly Logged in");
    }
    else if(fexist(UserPath(playerid)) && GetPlayerIP(playerid) != PlayerInfo[pIP])
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else if(!fexist(UserPath(playerid)))
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
}
Reply


Messages In This Thread
Auto loggin - by TheMaiklas - 06.03.2014, 18:49
Re : Auto loggin - by Clad - 06.03.2014, 18:51
Re: Auto loggin - by TheMaiklas - 06.03.2014, 18:53
Re: Auto loggin - by TheMaiklas - 06.03.2014, 18:56
Re: Auto loggin - by jueix - 06.03.2014, 19:25
Re: Auto loggin - by TheMaiklas - 07.03.2014, 05:17
Re: Auto loggin - by TheMaiklas - 09.03.2014, 20:00

Forum Jump:


Users browsing this thread: 1 Guest(s)