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

Pawn code:

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

In the database:

PHP код:
`IP_Registrationvarchar(16NOT NULL, `Last_IPvarchar(16NOT 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(querysizeof(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)