GetPlayerIp troubleshooting
#1

Alright, i have an annoying problem that reoccurs when i try to write a players ip to file.


Include used to write file: Dini


Now when it writes the file, after the execution of /register, and everytime they log out, it writes the ip to the file.

Now if i look in the file it shows the default subnet, 255.255.255.255. Why does this do that, and how is it fixed? Only part that is ruining my auto login system. I have no idea why it does it, so please help :S
Reply
#2

Show us the code.
Reply
#3

pawn Код:
GetPlayerIP2(playerid)
{
    new IP[24];
    GetPlayerIp(playerid,IP,24);
    return IP;
}
Reply
#4

Code is quite simple,

pawn Код:
GetPlayerIp(playerid,ip,sizeof(ip));
pawn Код:
dini_Set(file,"IP",ip);
Reply
#5

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
GetPlayerIP2(playerid)
{
    new IP[24];
    GetPlayerIp(playerid,IP,24);
    return IP;
}
did not work
Reply
#6

pawn Код:
OnSomeWhereYouWantIt(playerid,blahblahblah)
dini_Set(file,"IP",GetPlaeyrIP2(playerid));

GetPlayerIP2(playerid)
{
    new IP[24];
    GetPlayerIp(playerid,IP,24);
    return IP;
}
Like this.
EDIT: Also don't put it in OnPlayerDisconnect
Reply
#7

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
OnSomeWhereYouWantIt(playerid,blahblahblah)
dini_Set(file,"IP",GetPlaeyrIP2(playerid));

GetPlayerIP2(playerid)
{
    new IP[24];
    GetPlayerIp(playerid,IP,24);
    return IP;
}
Like this.
EDIT: Also don't put it in OnPlayerDisconnect
Either way is does not work.
Reply
#8

Where you put that?
pawn Код:
dini_Set(file,"IP",GetPlaeyrIP2(playerid));
Reply
#9

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
OnSomeWhereYouWantIt(playerid,blahblahblah)
dini_Set(file,"IP",GetPlaeyrIP2(playerid));

GetPlayerIP2(playerid)
{
    new IP[24];
    GetPlayerIp(playerid,IP,24);
    return IP;
}
Like this.
EDIT: Also don't put it in OnPlayerDisconnect
This should be made as a Stock.
Reply
#10

Quote:
Originally Posted by dr.pepper
Посмотреть сообщение
This should be made as a Stock.
Yes, i noticed his mistake and fixed it. Either way it did not change anything, and at the other dude, yes.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)