SA-MP Forums Archive
GetPlayerIp troubleshooting - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetPlayerIp troubleshooting (/showthread.php?tid=264995)



GetPlayerIp troubleshooting - kin - 28.06.2011

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


Re: GetPlayerIp troubleshooting - Shadoww5 - 28.06.2011

Show us the code.


Re: GetPlayerIp troubleshooting - =WoR=Varth - 28.06.2011

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



Re: GetPlayerIp troubleshooting - kin - 28.06.2011

Code is quite simple,

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



Re: GetPlayerIp troubleshooting - kin - 28.06.2011

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


Re: GetPlayerIp troubleshooting - =WoR=Varth - 29.06.2011

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


Re: GetPlayerIp troubleshooting - kin - 29.06.2011

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.


Re: GetPlayerIp troubleshooting - =WoR=Varth - 29.06.2011

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



Re: GetPlayerIp troubleshooting - dr.pepper - 29.06.2011

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.


Re: GetPlayerIp troubleshooting - kin - 29.06.2011

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.