25.01.2012, 18:30
Well, i don't know why when i type my/everyone password wrong, next time , even if i write it correctly the server still kicks me for wrong password.
PHP код:
if(dialogid == 15500) //Dialog login
{
if(!response)
{
Kick(playerid);
}
if(response)
{
if(Wrongpass[playerid] >= 1)
{
GetPlayerName( playerid, Nam, sizeof Nam );
format( mystring, sizeof mystring, "Admin-Log: %s has been kicked for wrong password.", Nam);
SendAdminMessage( COLOR_WHITE, mystring);
SendClientMessage(playerid, COLOR_RED, "You have been kicked for wrong password.");
Kick(playerid);
}
ShowPlayerDialog(playerid, 15500+1, DIALOG_STYLE_MSGBOX, "{FFFFFF}Rules!", "{00FFFF}Server rules!\n\n{FFFFFF}- Do not deathmatch unless an admin has started a DM event or anything similar to that.\n{FFFFFF}- Don't spam/flood the server chat.\n- Don't insult people.\n{FFFFFF}- Don't go around and annoy people that is drifting. (eg ramming)\n\n{00FFFF}By clicking the Ok button you will agree with those terms.","Ok","");
new query[200], pnamez[24], escapepass[100];
GetPlayerName(playerid, pnamez, 24);
mysql_real_escape_string(inputtext, escapepass);
format(query, sizeof(query), "SELECT `user` FROM playerdata WHERE user = '%s' AND password = SHA1('%s')", pnamez, escapepass);
mysql_query(query);
mysql_store_result();
new numrows = mysql_num_rows();
if(numrows == 1) MySQL_Login(playerid);
if(!numrows)
{
new strz[182];
GetPlayerName(playerid,pname,sizeof(pname));
format(strz,sizeof(strz), "{00FFFF}Account: {FFFFFF}%s\n\n{FF0000}ERROR: {FFFFFF}You have entered an invalid password.\n\n{FFFFFF}Type your password below in order to login.",pname);
ShowPlayerDialog(playerid, 15500, DIALOG_STYLE_PASSWORD, "{FFFFFF}Login", strz,"Login","Quit");
Wrongpass[playerid]++;
}
mysql_free_result();
}
}