y_ini login help [ +rep ] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: y_ini login help [ +rep ] (
/showthread.php?tid=328171)
y_ini login help [ +rep ] -
RicaNiel - 24.03.2012
Guys my problem is it wont add the variable
of MAX_LOGIN_ATTEMPT
can anyone help me please
pawn Код:
case D_LOGIN:
{
if (!response ) return Kick (playerid);
if(response)
{
if(udb_hash(inputtext) == pFiles[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SendClientMessage(playerid,C_WHITE,"You have succesfuly loggedin to server");
}
else
{
new ldialog[500],lattemp[MAX_PLAYERS],try[128];
lattemp [playerid] += 1;
switch(lattemp[playerid])
{
case 1: try = "Three Loggedin Attempt Left ";
case 2: try = "Two Loggedin Attempt Left ";
case 3: try = "One Loggedin Attempt Left ";
}
if(lattemp[playerid] == 0)
{
format(ldialog,sizeof(ldialog),""CWHITE"This Account is Registred\n\nUserName: "CORANGE"%s"CWHITE"\n\nPlease Enter your password bellow\n\n"CRED"%s",PlayerName(playerid),try);
ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,""CSERVER"est",ldialog,"Login","Quit");
}
else if(lattemp[playerid] >= 1)
{
format(ldialog,sizeof(ldialog),""CWHITE"This Account is Registred\n\nUserName: "CORANGE"%s"CWHITE"\n\nPlease Enter your password bellow\n\n"CRED"%s",PlayerName(playerid),try);
ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,"Test",ldialog,"Login","Quit");
}
if(lattemp [playerid] == 4)
{
new string[128];
format(string,sizeof(string),""CORANGE"%s"CWHITE" has been kicked from the server ( "CRED"MAX LOGIN ATTEMPT"CWHITE" )");
SendClientMessageToAll(C_WHITE,string);
}
}
return 1;
}
}
Re: y_ini login help [ +rep ] -
Blunt - 24.03.2012
pawn Код:
case D_LOGIN:
{
if (!response ) return Kick (playerid);
{
if(udb_hash(inputtext) == pFiles[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SendClientMessage(playerid,C_WHITE,"You have succesfuly loggedin to server");
}
else
{
new ldialog[500],lattemp[MAX_PLAYERS],try[128];
lattemp [playerid] += 1;
switch(lattemp[playerid])
{
case 1: try = "Three Loggedin Attempt Left ";
case 2: try = "Two Loggedin Attempt Left ";
case 3: try = "One Loggedin Attempt Left ";
}
if(lattemp[playerid] == 0)
{
format(ldialog,sizeof(ldialog),""CWHITE"This Account is Registred\n\nUserName: "CORANGE"%s"CWHITE"\n\nPlease Enter your password bellow\n\n"CRED"%s",PlayerName(playerid),try);
ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,""CSERVER"est",ldialog,"Login","Quit");
}
else if(lattemp[playerid] >= 1)
{
format(ldialog,sizeof(ldialog),""CWHITE"This Account is Registred\n\nUserName: "CORANGE"%s"CWHITE"\n\nPlease Enter your password bellow\n\n"CRED"%s",PlayerName(playerid),try);
ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,"Test",ldialog,"Login","Quit");
}
if(lattemp [playerid] == 4)
{
new string[128];
format(string,sizeof(string),""CORANGE"%s"CWHITE" has been kicked from the server ( "CRED"MAX LOGIN ATTEMPT"CWHITE" )");
SendClientMessageToAll(C_WHITE,string);
}
}
return 1;
}
}
You needed to remove the if(response) line you already had, you simply stated it twice which is most likely the issue.