Код:
if(dialogid == 15500)
{
if(!response) //Daca da click pe "Iesi"
{
SendClientMessage(playerid, 0xFF0000, "Ai ales sa iesi de pe server!"); //Mesaj de instiintare inainte de kick
Kick(playerid);
}
if(response) //Daca da click pe login
{
new query[200], nume[24];
GetPlayerName(playerid, nume, 24); //Cerem username de la server
if(strfind(inputtext, ">", true) != -1 || strfind(inputtext, "<", true) != -1 || strfind(inputtext, "=", true) != -1
|| strfind(inputtext, "'", true) != -1 || strfind(inputtext, "update", true) != -1 || strfind(inputtext, "Update", true) != -1
|| strfind(inputtext, "UPDATE", true) != -1 || strfind(inputtext, "Insert", true) != -1 || strfind(inputtext, "INSERT", true) != -1
|| strfind(inputtext, "insert", true) != -1 || strfind(inputtext, ";", true) != -1 || strfind(inputtext, "set", true) != -1
|| strfind(inputtext, "SET", true) != -1 || strfind(inputtext, "Set", true) != -1)// verificam daca parola contine sintaxe nepermise
{
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}/SETNAME{FFFF00}: Parola ta contine sintaxe nepermise.");
ShowPlayerDialog(playerid, 15500, DIALOG_STYLE_INPUT, "Logare"," Te rugam {0000FF}sa completezi{FFFFFF} parola pentru a te loga!\n {FF0000}ERROR:Parola ta contine sintaxe nepermise !","Login","Iesi"); //Reafisam dialogul de logare cont
}
else
{
format(query, sizeof(query), "SELECT * FROM users WHERE nume = '%s' AND parolauser = md5('%s')", nume, inputtext);
mysql_query(query);
mysql_store_result();
new numrows = mysql_num_rows();//Verificam daca parola introdusa este valida
if(numrows == 1)//Daca este corecta parola stocam informatii
{
new username[24];
new baniuser[24];
mysql_fetch_field(1, username);
mysql_fetch_field(3, baniuser);
new userbani = strval(baniuser);
GivePlayerMoney(playerid, userbani);
SpawnPlayer(playerid);
}
if(!numrows)//Daca parola este gresita
{
ShowPlayerDialog(playerid, 15500, DIALOG_STYLE_INPUT, "Logare","Te rugam {0000FF}sa completezi{FFFFFF} parola pentru a te inregistra!\n{FF0000} Ai introdus o parola gresita!","Login","Iesi"); //Reafisam dialogul de logare cont
SendClientMessage(playerid, 0xFF0000, "Parola incorecta!"); //Trimite instiintare la user
}
mysql_free_result(); //Eliberam baza de date
}
}
}