25.12.2016, 00:42
i input correct my password, but always considered wrong..
can help?
can help?
PHP код:
public OnPlayerConnect(playerid)
{
Info[playerid][Admin] = 0;
Info[playerid][Score] = 0;
Info[playerid][DMScore] = 0;
Info[playerid][FRScore] = 0;
Info[playerid][inDM] = 0;
Info[playerid][inDMZone] = 0;
Info[playerid][Skin] = 0;
Info[playerid][MB] = 0;
Info[playerid][God] = 0;
Info[playerid][Money] = 0;
Info[playerid][Color] = 0;
SendDeathMessage(INVALID_PLAYER_ID,playerid, 200);
if (fexist(UserBanPath(playerid)))
{
INI_ParseFile(UserBanPath(playerid), "loadban_%s", .bExtra = true, .extra = playerid);
if (Info[playerid][Banned] == 1)
{
new str1[400];
format(str1, sizeof(str1), ""ORANGE"You are banned from the server!\nBan Time: "GREY"Permanent\n"RED"Admin who banned you: "GREY"%s\n"ORANGE"Reason: "GREY"%s\n\n{F2DD3F}Were you banned unfairly or do you want to get unbanned? Make an unban appeal at "GREEN"bfesamp.tk{F2DD3F}!", Info[playerid][BanAdmin], Info[playerid][BanReason]);
ShowPlayerDialog(playerid, DIALOG_BAN, DIALOG_STYLE_MSGBOX, ""RED"You are banned!", str1, "OK", "");
SetTimerEx("KickPlayer", 100, false, "i", playerid);
return 1;
}
else
{
new d,m,y,h,mi,s, str2[400];
TimestampToDate(Info[playerid][BanExpire],y,m,d,h,mi,s,0,0);
if(gettime()>Info[playerid][BanExpire])
{
fremove(UserBanPath(playerid));
SendClientMessage(playerid, -1, ""CYAN"SERVER: Your ban has expired. You are now unbanned from the server.");
}
format(str2, sizeof(str2), ""ORANGE"You are banned from the server!\nBan Expire: "GREY"%i/%i/%i [DD/MM/YY] | %i:%i\n"ORANGE"Admin who banned you: "GREY"%s\n"RED"Reason: "GREY"%s\n\n{F2DD3F}Were you banned unfairly or do you want to get unbanned? Make an unban appeal at "GREEN"www.bfesamp.tk{F2DD3F}!", d, m, y, h, mi,Info[playerid][BanAdmin], Info[playerid][BanReason]);
ShowPlayerDialog(playerid, DIALOG_TEMPBAN, DIALOG_STYLE_MSGBOX, ""RED"You are banned!", str2, "OK", "");
SetTimerEx("KickPlayer", 100, false, "i", playerid);
}
}
else if(fexist(Path(playerid)))
{
INI_ParseFile(Path(playerid), "loadaccount_user", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""RED"BFE - Login", ""WHITE"Type your password below to login.", "Login", "Quit");
new file[256];
new name[24];
GetPlayerName(playerid,name,24);
format(file,sizeof(file),"Users/%s.ini",name);
if(!fexist(file))
{
for(new i;i<MAX_OSLOTS;i++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, i))
{
aInfo[playerid][i][Amodel]=0;
aInfo[playerid][i][Abone]=0;
aInfo[playerid][i][AfOffsetX]=0;
aInfo[playerid][i][AfOffsetY]=0;
aInfo[playerid][i][AfOffsetZ]=0;
aInfo[playerid][i][AfRotX]=0;
aInfo[playerid][i][AfRotY]=0;
aInfo[playerid][i][AfRotZ]=0;
aInfo[playerid][i][AfScaleY]=0;
aInfo[playerid][i][AfScaleZ]=0;
}
}
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""GREEN"BFE - Register", ""WHITE"Type your password below to register a new account.", "Register", "Quit");
}
//Default values of vehicle settings
AutoRepair[playerid] = 1;
SBvalue[playerid] = 1.5;
Nitro[playerid] = 1;
VJump[playerid]=1;
AntiFall[playerid] = 1;
pms[playerid] = 1;
Goto[playerid] = 1;
Info[playerid][God] = 0;
PrisonTime[playerid] = 0;
Info[playerid][Jailed] = 0;
////////////////////////////////////////
//TEXT DRAWS///////////////////////////
TextDrawShowForPlayer(playerid, bfetop);
TextDrawShowForPlayer(playerid, bfecmds);
TextDrawShowForPlayer(playerid, website);
////////////////////////////////////////
Info[playerid][inDM] = 0;
return 1;
}
PHP код:
if (dialogid == DIALOG_LOGIN)
{
if(!response) return Kick(playerid);
if(response)
{
new pass[129];
WP_Hash(pass, 129, inputtext);
if(!strcmp(pass, Info[playerid][Pass], false))
{
INI_ParseFile(Path(playerid), "loadaccount_%s", .bExtra = true, .extra = playerid);
SendClientMessage(playerid, -1, ""GREEN"You have successfully logged in.");
Info[playerid][Logged] = 1;
SpawnPlayer(playerid);
Info[playerid][Spawned] = 1;
SetPlayerColor(playerid, Info[playerid][Color]);
SetPlayerScore(playerid,Info[playerid][Score]);
GivePlayerMoney(playerid,Info[playerid][Money]);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""RED"Login", ""WHITE"You have entered an incorrect password.\nType your password below to login.", "Login", "Quit");
}
}
}