SA-MP Forums Archive
MySQL IP Saving doesn't show right - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL IP Saving doesn't show right (/showthread.php?tid=421504)



MySQL IP Saving doesn't show right - Patrick - 09.03.2013

Hello guys. im just confused when i debug my ip it says 127.0.0.1 'localhost' but shows different on Database it shows 255.255.255.255 can anyone help me to show player ip right? my command is provided below thank yaw!
pawn Код:
stock UpdatePlayer(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(LoggedIn[playerid])
        {
            format(query, sizeof(query),
            "UPDATE `users` SET `Coprank` = %d, `HoursPlayed` = %d, `MinutesPlayed` = %d,"\
            "`SecondsPlayed` = %d, `IpAdress` = '%s/*IP Adress Saving Here*/', `Kills` = '%d',"\
            "`Deaths` = '%d', `TotalHitFinished` = '%d' WHERE `Username` = '%s';",
            pInfo[playerid][Coprank], pInfo[playerid][HoursPlayed], pInfo[playerid][MinutesPlayed],
            pInfo[playerid][SecondsPlayed], GetIP(playerid)/*GetPlayerIP Function Here*/, pInfo[playerid][Kills],
            pInfo[playerid][Deaths], pInfo[playerid][TotalHitFinished], PlayerName(playerid));
            mysql_query(query);
        }
    }
    return 1;
}



Re: MySQL IP Saving doesn't show right - Vince - 09.03.2013

GetPlayerIp doesn't work in OnPlayerDisconnect.


Re: MySQL IP Saving doesn't show right - Patrick - 09.03.2013

Oh That's why! i learned something new! thanks. i will put it when player logins thanks Vince