15.02.2012, 15:12
i wonna to store ip on player when he disconnect and here my code
and my stock for GetPlayerIP
on mysql i use IP int(16) and sometimes store ip like 55 sometimes dont store (im 100% connect to datebase )
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new Query[100];
format(Query,sizeof(Query),"UPDATE playerdata SET money=%d, score=%d, ip=%s WHERE username='%s'",GetPlayerMoney(playerid),GetPlayerScore(playerid),GetPlayerIP(playerid),PlayerName(playerid));
mysql_query(Query);
return true;
}
PHP код:
stock GetPlayerIP(playerid)
{
new Ip[25];
GetPlayerIp(playerid, Ip, sizeof(Ip));
return Ip;
}