Comparing saved IP with players IP
#1

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..

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;
}
Anybody know how to fix this?
Reply


Messages In This Thread
Comparing saved IP with players IP - by Type-R - 27.08.2014, 03:40
Re: Comparing saved IP with players IP - by Dotayuri - 27.08.2014, 04:37
Re: Comparing saved IP with players IP - by AiRaLoKa - 27.08.2014, 07:55
Re: Comparing saved IP with players IP - by Skin123 - 27.08.2014, 08:34
Re: Comparing saved IP with players IP - by Type-R - 28.08.2014, 04:23
Re: Comparing saved IP with players IP - by Dotayuri - 28.08.2014, 06:13
Re: Comparing saved IP with players IP - by mamorunl - 28.08.2014, 11:53
Re: Comparing saved IP with players IP - by Skin123 - 28.08.2014, 12:47
Re: Comparing saved IP with players IP - by mamorunl - 29.08.2014, 10:56
Re: Comparing saved IP with players IP - by Pottus - 29.08.2014, 16:29

Forum Jump:


Users browsing this thread: 1 Guest(s)