24.08.2018, 06:43
PHP код:
function LoadAcc(playerid)
{
NameCheck(playerid);
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
INI_ParseFile(IPPath(playerid), "LoadIPBan_%s", .bExtra = true, .extra = playerid);
if(!strcmp(RPIP(playerid), pInfo[playerid][pIP]))
{
BanCheck(playerid);
if(tInfo[playerid][ClearLog] == 0)
{
SendClientMessage(playerid,COL_NOTIFY,"Your account has been automatically logged in.");
SendClientMessage(playerid,-1,"{F52C2C}=========================================================");
SendClientMSG(playerid,-1,"{F52C2C}[MOTD]:{D17777} %s",MOTDInfo[MOTDstr]);
SendClientMessage(playerid,-1,"{F52C2C}=========================================================");
if(pInfo[playerid][Email] == 0)
{
SendClientMessage(playerid,COL_NOTIFY,"Your account doesn't have an assigned Email Address. Use /assignemail to link one to this account.");
SendClientMessage(playerid,COL_NOTIFY,"This Email Address will only be used for account recovery purposes ONLY.");
}
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"...Login...",""COL_WHITE"This account is registered.Please enter your password below","Login","Quit");
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"...Registration...",""COL_WHITE"To register this account please enter your desired password below.","Register","Quit");
}
return 1;
}
//banchecks here
if(fexist(IPPath(playerid)))
{
tInfo[playerid][ClearLog] = 1;
SendClientMessage(playerid, COLOR_SERVER, "Your account has been IP Banned from the server.");
SendClientMessage(playerid, COL_ERROR,"============"SERVER_NAME"=============");
SendClientMSG(playerid, COLOR_SERVER,"Account Name: %s(ID:%d) ",ReturnPlayerName(playerid),playerid);
SendClientMSG(playerid, COLOR_SERVER,"IP Address: %s ",RPIP(playerid));
SendClientMSG(playerid, COLOR_SERVER,"Banned By: %s ",IPinfo[IPBannedBy]);
SendClientMSG(playerid, COLOR_SERVER,"Banned Date: %s ",IPinfo[IPBannedDate]);
SendClientMSG(playerid, COLOR_SERVER,"Reason: %s ",IPinfo[IPBannedRea]);
SendClientMessage(playerid, COL_ERROR,"======================================");
SendServerMSG(COLOR_SERVER,"%s(ID:%d) has been kicked from the server. [Reason: IP Banned] ",ReturnPlayerName(playerid),playerid);
GameTextForPlayer(playerid, "~r~Banned",2500,3);
SetTimerEx("KickPlayer",50,false,"d",playerid);
}
//the update version
functionLoadIPBan(playerid,name[],value[])
{
INI_String("IPBannedBy",IPinfo[IPBannedBy],64);
INI_String("IPBannedRea",IPinfo[IPBannedRea],128);
INI_String("IPBannedDate",IPinfo[IPBannedDate],128);
return 1;
}