Help with GetPlayerIp.
#1

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.
Reply
#2

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

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

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

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)