27.08.2014, 03:40
Hey, guys well im trying to compare the save IP, and players IP so that if they are the same i could log the player in instantly. Well its not working as planned, for some reason have troubles. Even if saved IP is different it still would connect me..
Anybody know how to fix this?
pawn Код:
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;
}