public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
// Regisztráció
new Pass[128], MyRegID;
if(dialogid == 1)
{
if(response)
{
if(GetPVarInt(playerid, \"LoggedIn\"))
{
SendClientMessage(playerid, PIROS, \"Már be vagy jelentkezve.\");
return 1;
}
if(!strlen(inputtext[0]))
{
SendClientMessage(playerid, PIROS, \"Nem írtál be semilyen jelszót!\");
LoginDialog(playerid);
return 1;
}
format(query, sizeof(query), \"SELECT * FROM `players` WHERE `name` = \'%s\'\", pName(playerid));
mysql_query(query);
mysql_store_result();
mysql_fetch_row(line);
mysql_free_result();
sscanf(line, \"p<|>d{s[24]s[20]}s[30]{s[30]s[30]d}\", MyRegID, Pass);
SetPVarInt(playerid, \"RegID\", MyRegID);
if(strval(inputtext) == Pass)
{
LoginPlayer(playerid, Pass);
}
else
{
SendClientMessage(playerid, PIROS, \"HIBA: Rossz jelszó.\");
return 1;
}
GetPlayerIp(playerid, ip, sizeof(ip));
format(query, sizeof(query), \"UPDATE `players` SET `ip` = \'%s\' WHERE `reg_id` = %d\", ip, GetPVarInt(playerid, \"RegID\"));
mysql_query(query);
SendClientMessage(playerid, COLOR_GREEN, \"Sikeresen bejelentkeztél.\");
}
else
{
LoginDialog(playerid);
}
}