GetPlayerIp weird thing
#1

Hey guys, I have added the most simple autologin system to my Admin mode, but I noticed something weird
When I register a new admin (in this case, myself), it marks the IP as 127.0.0.1 (which is localhost)

It also registers it on the database
Code:
PHP Code:
if(!aInfo[playerb][aLevel])
    {
        
mysql_format(mysqlquerysizeof(query), "INSERT INTO `Admins` (`Username`, `ALogin`, `APassword`, `AdminLevel`, `IP`) VALUES ('%e', '0', '', '%d', '%s')"RPN(playerb), levelRPIP(playerb));
        
mysql_tquery(mysqlquery);
        
format(stringsizeof(string), "Congratulations, You have been promoted to level %d Admin by %s %s."levelRPARN(playerid), RPN(playerid));
        
SendClientMessage(playerbCOLOR_REDstring);
        
SendClientMessage(playerbCOLOR_RED"Please set your private admin password using /AdmPass, You cannot receieve your powers until then.");
        
AdminChat[playerid] = 1;
    } 
This is where I update the data when an Admin disconnects
PHP Code:
    if(aInfo[playerid][aLevel])
    {
        new 
query[1000], string[128];
        
mysql_format(mysqlquerysizeof(query), "UPDATE `Admins` SET `AdminLevel`='%d', `APassword`='%s', `IP`='%s', `ALogin`='%d' WHERE `Username`='%e' LIMIT 1",
         
aInfo[playerid][aLevel], aInfo[playerid][aPass], RPIP(playerid), aInfo[playerid][aALogin], RPN(playerid));
         
mysql_tquery(mysqlquery);
         
format(stringsizeof(string), "    Administrator %s has disconnected from the server."RPN(playerid));
         
SendAMessage(1string);
    } 
Now, I checked up my database and I noticed that the IP is 255.255.255.255

The RPIP is a simple code
PHP Code:
stock RPIP(playerid)
{
    new 
ip[16];
    
GetPlayerIp(playeridipsizeof(ip));
    return 
ip;

How can I fix it ?
It prevents my autologin function from working
Reply


Messages In This Thread
GetPlayerIp weird thing - by NeXoR - 16.06.2016, 02:41
Re: GetPlayerIp weird thing - by oMa37 - 16.06.2016, 03:36
Re: GetPlayerIp weird thing - by Konstantinos - 16.06.2016, 11:09
Re: GetPlayerIp weird thing - by Gammix - 16.06.2016, 11:16
Re: GetPlayerIp weird thing - by Konstantinos - 16.06.2016, 11:26
Re: GetPlayerIp weird thing - by NeXoR - 17.06.2016, 02:37

Forum Jump:


Users browsing this thread: 1 Guest(s)