Wrong IP
#1

I'm using the last (R34) BlueG's( or by the current developer maddinat0r) mysql plugin, I'm not even sure if the problems is from the mysql part, but I'm trying to save player's IP when player leaves. The problem is that everybody's IP goes 255.255.255.255. There is part of my code:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{

if(Logged[playerid] == 1)
{
new query[512];
format(query, sizeof(query), "UPDATE players SET IP = '%s' WHERE Name = '%s'", GetIP(playerid), GetPName(playerid));
mysql_function_query(IMDb, query, false, "", "");
}
return 1;
}

stock GetPName(playerid)
{
    GetPlayerName(playerid,gName,sizeof gName);
    return gName;
}

stock GetIP(playerid)
{
    new gIP[16];
    GetPlayerIp(playerid, gIP, sizeof gIP);
    return gIP;
}
I know that getting IP wasn't working either on the onplayerconnect or onplayerdisconnect callback, but I don't remember which one. So what is the solution there ?
Thanks in advance.
Reply


Messages In This Thread
Wrong IP - by x96664 - 17.11.2013, 16:50
AW: Wrong IP - by BigETI - 17.11.2013, 16:53
Re: Wrong IP - by Konstantinos - 17.11.2013, 16:55
Re: Wrong IP - by x96664 - 17.11.2013, 17:14
Re: Wrong IP - by Memoryz - 17.11.2013, 17:22
Re: Wrong IP - by x96664 - 17.11.2013, 17:26

Forum Jump:


Users browsing this thread: 1 Guest(s)