public OnAccountCheck(playerid)
{
new rows, fields; //a variable that will be used to retrieve rows and fields in the database.
new stringg[120];
new pname[100];
new query[255];
new IP[16];
new SSIP;
GetPlayerIp(playerid, IP, sizeof(IP));
GetPlayerName(playerid, pname, 24);
cache_get_data(rows, fields, mysql);//let's get the rows and fields from the database.
if(rows) //if there is row
{//then
cache_get_field_content(0, "Slaptazodis", Slaptazodis[playerid], mysql, 129);
new TextStringas[128];
format(TextStringas, sizeof(TextStringas), "{009900}[{99FF00}Admin{009900}]{FFFFFF} %s", IP[playerid]);
SendPlayerMessageToAll(playerid, TextStringas);
SetPVarInt(playerid, "AccID", cache_get_field_content_int(0, "ID"));
SSIP = cache_get_field_content_int(0, "IP");
if(IP[playerid] = SSIP)
{
format(TextStringas, sizeof(TextStringas), "{009900}[{99FF00}KURVA{009900}]{FFFFFF} %s", SSIP);
SendPlayerMessageToAll(playerid, TextStringas);
//HERE SHOULD LOG IN NORMALY, BUT IT GIVES ME THIS MESSAGE EVEN THOUGH I CHANGED THE IP IN THE DATABSE
return 1;
}
format(stringg, sizeof(stringg), "{FFFFFF}Zaidejas {FFAF00}%s {FFFFFF}yra registruotas.\nIveskite slaptazodi noredami prisijungti:",pname);
ShowPlayerDialog(playerid,LOG_Dialog,DIALOG_STYLE_PASSWORD,"{A3E4FF}Prisijungimas",stringg,"Prisijungti","Iseiti");
}
else //if we didn't find any rows from the database, that means, no accounts were found
{
format(stringg, sizeof(stringg), "{FFFFFF}Zaidejo {FFAF00}%s {FFFFFF}registracija.\nIveskite norima slaptazodi:",pname);
ShowPlayerDialog(playerid,REG_Dialog,DIALOG_STYLE_PASSWORD,"{A3E4FF}Registracija",stringg,"Registruotis","Iseiti");
}
return 1;
}
if(strcmp(FirstIP, LastIP, true) == 0)
{
}
if(strcmp(FirstIP, LastIP, true) == 0)
{
//here, if first ip and last ip are the same.
}
Why has this suddenly become a thing? I've seen three topics on this recently, not one of them realising that IPs can change and other people can get your IP. IPs are NOT a unique identifier and trying to use them as such will result in other people being logged in to your account.
|
A modem gets a new IP address if you restart it (DSL)
people are just not informed about this, by the way since I have your attention could you quickly look at my thread "things to keep in mind, while coding!" |
That doesn't mean they are unique, that just adds to their variability since you can't guarantee that they will be the same and also can't guarantee that they will change.
|
Relying on luck to make your code work is just BEGGING for trouble!
|