[Error, bug ?]Last Ip, Ip registration. mysql table
#1

Pawn code:

PHP код:
format(query, sizeof(query), "INSERT INTO `%s` (`IP_Registration`, `Last_IP`) VALUES('%s', '%s')", TABLE_NAME, ip(playerid), ip(playerid));
//------------------------
public OnPlayerDisconnect(playerid, reason) {
    if(
UserInfo[playerid][USER_STAT_LOGGED] == true) {
        
format(query, sizeof(query), "UPDATE `%s` SET `Last_IP` = '%s' WHERE `Name` = '%s'",
        
TABLE_NAME,
        
ip(playerid),
    }
    
mysql_query(query);
    return 
1;
} 
In the database:

PHP код:
`IP_Registration` varchar(16) NOT NULL, `Last_IP` varchar(16) NOT NULL, 
when i register into the server save my ip. example: 79.45.145.150, but im quit the server save my last ip in: 255.255.255.255...

is normal?
Reply
#2

Quote:
Originally Posted by TheBluec0de
Посмотреть сообщение
is normal?
Yes.

https://sampforum.blast.hk/showthread.php?tid=331420
Reply
#3

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
and no way to fix?...
Reply
#4

Just get the IP when the player connects or has logged in. There's no need to get it more than once, if the player's IP changes, they'll disconnect anyway.
Reply
#5

thanks, i have solved: i have put

PHP код:
        format(query, sizeof(query), "UPDATE `%s` SET `Last_IP` = '%s' WHERE `Name` = '%s'", 
        
TABLE_NAME, 
        
ip(playerid), 
when player logged...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)