SA-MP Forums Archive
Help with GetPlayerIp. - 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: Help with GetPlayerIp. (/showthread.php?tid=86504)



Help with GetPlayerIp. - Anwix - 14.07.2009

Im looking to create an auto login, and when the user register's it will save there IP address to there file and this is what i get.

// INSIDE MY REGISTER COMMAND
Код:
new ip[15];
new PlayerIP = GetPlayerIp(playerid, ip, sizeof(ip));
dini_Create(GetPlayerPath(playerid));
dini_IntSet(GetPlayerPath(playerid), "ip", PlayerIP);
This is inside my user.ini file once registered.
Код:
ip=13
every user that creates an account has the same 'ip=13' yet, if i used a string to print the IP it would come out as the proper IP address.
Any help on getting this so its like 'ip=xx.xx.xxx.xxx' as it should be.



Re: Help with GetPlayerIp. - Correlli - 14.07.2009

You're using dini_IntSet function which can only save integers, ip is a string.


Re: Help with GetPlayerIp. - Anwix - 14.07.2009

hmm, any other way i could get around this to save IP's?


Re: Help with GetPlayerIp. - Jefff - 14.07.2009

Код:
new ip[15];
GetPlayerIp(playerid, ip, sizeof(ip));
dini_Create(GetPlayerPath(playerid));
dini_Set(GetPlayerPath(playerid), "ip", ip);



Re: Help with GetPlayerIp. - Anwix - 14.07.2009

Quote:
Originally Posted by Jefff
Код:
new ip[15];
GetPlayerIp(playerid, ip, sizeof(ip));
dini_Create(GetPlayerPath(playerid));
dini_Set(GetPlayerPath(playerid), "ip", ip);
Would it be wrong to say 'I Love You' ?
Your a star man!