[ HELP ]
#1

Hello everyone.
I have the mod MYSQL so I have a problem with logging.
Register and everything is ok until I restart the server.
When I want to log not to read the password with which I registered.
Part of the script that may help:

Quote:

/ ----------------------------- [ LOGIN ] ------------------------ LOGIN
if(dialogid == 27)
{
if(response)
{
PrijavaSpremna[playerid] = 0;
if(strlen(inputtext) < MIN_DUZINA_LOZINKE || strlen(inputtext) > MAX_DUZINA_LOZINKE)
{
new string[128];
format(string, sizeof string, "(greska) Lozinka mora sadrzati najmanje %d, a najvise %d znakova.", MIN_DUZINA_LOZINKE, MAX_DUZINA_LOZINKE);
SCM(playerid, CRVENA, string);
new string1[256];
new hIme[MAX_PLAYER_NAME];
ImeIgraca(playerid, hIme);
format(string1, sizeof string1, "{FFFFFF}Dobrodosli {00a2f5}%s\n{FFFFFF}Vas nalog je pronadjen. Molimo upisite svoju lozinku:", hIme);
SPD(playerid, 27, DIALOG_STYLE_PASSWORD, "{00a2f5}Zynga Roleplay - PRIJAVA", string1, "Prijava", "Odustani");
return 1;
}
new imex[MAX_PLAYER_NAME];
ImeIgraca(playerid, imex);
new upit[128], escinput[32], buf[129];
mysql_real_escape_string(inputtext, escinput);
WP_Hash(buf, 129, escinput);
format(upit, 128, "SELECT `ID` FROM `Igraci` WHERE `Ime` = '%s' AND `Lozinka` = '%s'", imex, buf);
mysql_query(upit, THREAD_PASSPROVERA, playerid);
}
else Kick(playerid);
}

Quote:

PASSWORD CHECK


case THREAD_PASSPROVERA:
{
mysql_query();
mysql_store_result();
if(mysql_num_rows() == 0)
{
mysql_free_result();
SCM(extraid, CRVENA, "(greska) Uneli ste pogresnu lozinku!");
new string1[128];
new hIme[MAX_PLAYER_NAME];
ImeIgraca(extraid, hIme);
format(string1, sizeof string1, "{FFFFFF}Dobrodosli {00a2f5}%s\n{FFFFFF}Vas account je pronadjen. Molimo upisite svoju lozinku:", hIme);
SPD(extraid, 27, DIALOG_STYLE_PASSWORD, "{00a2f5}Zynga Roleplay - PRIJAVA", string1, "Prijava", "Odustani");
hPokusajiLogovanja[extraid]++;
if(hPokusajiLogovanja[extraid] >= MAX_POKUSAJA_LOGOVANJA)
{
new string[128];
format(string, sizeof string, "AntiBoT | Uneli ste pogresnu lozinku vise od %d puta. Vasa IP adresa je banovana i zabelezena.", MAX_POKUSAJA_LOGOVANJA);
SCM(extraid, CRVENA, string);
new ip[16], logstring[128];
ImeIgraca(extraid, hIme);
GetPlayerIp(extraid, ip, sizeof ip);
format(logstring, sizeof logstring, "|NEUSPESNO| Igrac: %s | %d puta | IP: %s", hIme, hPokusajiLogovanja[extraid], ip);
UpisiLog(FAJL_FLOGINLOG, logstring);
Kick(extraid);
}
return 1;
}

Quote:

THREAD_LOGIN


case THREAD_PRIJAVA:
{
mysql_store_result();
mysql_query(upit, THREAD_PASSPROVERA, playerid);
new linija[850];
mysql_fetch_row(linija);
mysql_free_result();
ProcitajLiniju(extraid, linija);
new hIme[MAX_PLAYER_NAME], ime[MAX_PLAYER_NAME];
ImeIgraca(extraid, hIme);
RPIme(extraid, ime);
if(PI[extraid][Banovan] == 1)
{
new cupit[100];
format(cupit, 100, "SELECT * FROM `Banovi` WHERE `Ime` = '%s' ORDER BY `ID` DESC LIMIT 1", hIme);
mysql_query(cupit, THREAD_BANINFO, extraid);
return 1;
}
if(PI[extraid][GM] > 0 || PI[extraid][Admin] > 0)
{
SPD(extraid, 261, DIALOG_STYLE_PASSWORD, "Login [drugi deo - PIN]", "{FFFFFF}Vi ste admin/gm, unesite svoj PIN kod.\n\n{FF0000}Imate pravo na samo jedan pokusaj, ako pogresite dobijate ban!", "Potvrdi", "");
return 1;
}

Pls for Help
Reply


Messages In This Thread
[ HELP ] - by dario94 - 25.06.2012, 17:27

Forum Jump:


Users browsing this thread: 1 Guest(s)