pawn Код:
if(dialogid == 1) //Logging
{
if(!response)
{
SendClientMessage(playerid,COLOR_RED,"You Have To Login In Order To Play!");
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
}
if(response)
{
new ppw[256];
ppw = dini_Get(pfile, "Password");
if(strcmp(ppw, inputtext, true))
{
SendClientMessage(playerid,COLOR_RED,"Wrong Password");
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Please Type Your Password Below To Login","Login","Cancel");
}
else
{
IsLogged[playerid] = 1;
LoadPlayer(playerid);
SetTimerEx("TimePlayerLogged", 1000, true, "i", playerid);
GameTextForPlayer(playerid,"~g~Logged In",2000,1);
}
}
return 1;
}
it loads the player but it doesnt actually log him in aka islogged = 1;
also my login cmd
pawn Код:
CMD:login(playerid, params[])
{
new ppw[20], str[128];
format(pfile, sizeof(pfile), pfile_path, Playername(playerid));
if(sscanf(params, "s", ppw)) return SendMsg(playerid, RED, "*USAGE: /register [password] - Max length is 20 & minium is 3");
if(strlen(ppw) <= 3) return SendMsg(playerid, RED, "*Error: Password Is Under The Limit Sorry");
if(strlen(ppw) >= 19) return SendMsg(playerid, RED, "*Error: Password Is Over The Limit Sorry");
if(IsLogged[playerid] == 1) return SendMsg(playerid, RED, "*Error: |- You Are Already Logged In -|");
if(!dini_Exists(pfile)) return SendMsg(playerid, RED, "*Error: No account with that username is registered, please register");
if(strcmp(dini_Get(pfile, "Password"), ppw, true) != 0) return SendMsg(playerid, RED, "*Error: Wrong Password. Password Did Not Match With The One You Have Register With.");
format(str, sizeof(str), "*Success: You have Successfully Logged In %s", Playername(playerid), dini_Int(pfile, "AdminLevel"));
SendMsg(playerid, LIME, str);
LoadPlayer(playerid);
IsLogged[playerid] = 1;
SetTimerEx("TimePlayerLogged", 1000, true, "i", playerid);
Invited[playerid] = -1;
InHouse[playerid] = -1;
House[playerid] = -1;
new Pname[24], File[65]; GetPlayerName(playerid, Pname, 24);
for(new V=0; V<HouseCount + 1; V++)
{
if(!strcmp(HouseInfo[V][HouseOwner], Pname, true))
{
House[playerid] = V;
break;
}
}
if(dini_Exists(File))
{
for(new K=0; K<HouseCount + 1; K++)
{
format(File, sizeof(File), "HouseKeys/%s.ini", HouseInfo[K][HouseNames]);
if(dini_Int(File, Pname) == 1) Keys[playerid][K] = 1;
}
}
return 1;
}
i deleted the register dialog.. but i'll remake it