if(dialogid == 2) { if(response == 1) { new query[128]; format(query, sizeof(query), "SELECT %d FROM jugadores WHERE nombre = %d LIMIT 1", inputtext, pname); mysql_query(query); mysql_store_result(); if(mysql_fetch_row(inputtext)==1) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Has Sido Logueado Correctamente."); return 1; } else { SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Contraseсa Incorrecta."); Kick(playerid); } } else { SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Has Cancelado. Tienes que loguear Obligatoriamente."); Kick(playerid); } return 1; }
new sql[512], row[128];
format(sql, sizeof(sql), "SELECT Password FROM players where Name = %s", PlayerName);
mysql_query(sql);
mysql_store_result();
mysql_fetch_row(row);
new PlayerPassword[128];
strmid(PlayerPassword, row, 0, strlen(row), 255);
mysql_free_result();
if(dialogid == 2)
{
if(response == 1)
{
new sql[128], row[128], PlayerName[128], PlayerPassword[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(sql, sizeof(sql), "SELECT Password FROM jugadores where Name = '%s'", PlayerName);
mysql_query(sql);
mysql_store_result();
mysql_fetch_row(row);
strmid(PlayerPassword, row, 0, strlen(row), 255);
mysql_free_result();
if(strcmp(inputtext, PlayerPassword, true) == 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Has Sido Logueado Correctamente.");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Contraseсa Incorrecta.");
Kick(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Has Cancelado. Tienes que loguear Obligatoriamente.");
Kick(playerid);
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); if(dialogid == 1) { if(response == 1) { new query[128]; format(query, sizeof(query), "INSERT INTO jugadores (nombre, pass) VALUES ('%s', '%s')", pname, inputtext); mysql_query(query); SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Registro Finalizado. Has Sido Logueado Automaticamente."); } else { SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Has Cancelado. El Registro es Obligatorio."); Kick(playerid); } return 1; } if(dialogid == 2) { if(response == 1) { new sql[128], row[128], PlayerName[128], PlayerPassword[128]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); format(sql, sizeof(sql), "SELECT password FROM jugadores where nombre = '%s'", PlayerName); mysql_query(sql); mysql_store_result(); mysql_fetch_row(row); strmid(PlayerPassword, row, 0, strlen(row), 255); mysql_free_result(); if(strcmp(inputtext, PlayerPassword, true) == 0) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Has Sido Logueado Correctamente."); return 1; } else { SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Contraseсa Incorrecta."); Kick(playerid); } } } else { SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Has Cancelado. Tienes que loguear Obligatoriamente."); Kick(playerid); } return 0; }
Originally Posted by Zafire2008
thx .. but do you see my code? anything is bad there? anii return or something?
hoy i can do enum Thx for ur help man |