23.08.2009, 22:13
Thx i the problem was there in "whatever" and "table" and "username" XD!! but now the problem is i use the correct password in /login but keep "incorrect password = contraseсa incorrecta" that :S:S
My NEW code
My database is "NFS" my table is "PLAYERS" and my rows are "nombre for NAME" and "password for pass"...
My NEW code
pawn Код:
if(!strcmp(cmdtext, "/login", true, 6))
{
if(cmdtext[9] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Utiliza: /login [password]");
return 1;
}
else
{
if(logueado == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "Ya estas logueado");
}
else
{
new name[128];
new query[128];
new pass = cmdtext[7];
GetPlayerName(playerid, name, sizeof(name));
format(query, sizeof(query),"SELECT id FROM players WHERE Nombre = '%s' AND Password = '%s'", name, pass);
samp_mysql_query(query);
samp_mysql_store_result();
if(samp_mysql_num_rows() > 0)
{
logueado = 1;
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________________");
SendClientMessage(playerid, COLOR_YELLOW, "Has sido logueado correctamente.");
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________________");
}
else
{
if(intentos == 3)
{
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________________");
SendClientMessage(playerid, COLOR_YELLOW, "Limites de intentos por contraseсa. Has sido Kickeado.");
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________________");
Kick(playerid);
}
else
{
intentos = intentos +1;
SendClientMessage(playerid, COLOR_GREEN, "_________________________________________");
SendClientMessage(playerid, COLOR_YELLOW, "Contraseсa incorrecta.");
SendClientMessage(playerid, COLOR_GREEN, "_________________________________________");
}
}
}
}
return 1;
}

