SA-MP Forums Archive
Login without a password? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Login without a password? (/showthread.php?tid=145788)



Login without a password? - Antonio [G-RP] - 03.05.2010

This code doesnt require a password to log in.. help please!

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) //the callback
{
if (dialogid == 1)
{
if (response == 1) //making sure "Login" was pressed
{
if (LogAttempts[playerid] < 2) //is it greater then or equal to 2?
{
if (!strcmp(inputtext, PlayerInfo[playerid][pPassword])) //checking if it is the players password
{
OnPlayerLogin(playerid,inputtext);
return 1;
}
else //incorrect password
{
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Invalid Password", "Invalid Password, try again", "Login", "Exit"); //shows another dialog, with the same dialogid.
LogAttempts[playerid]++; //increments a variable to know how many time he has tried to login
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Too many attempts, kicked");
Kick(playerid);
return 1;
}
}
}
else //pressed "Cancel"
{
SendClientMessage(playerid, COLOR_RED, "You must Login to play!");
Kick(playerid);
}
return 1;
}