Saving IP - 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: Saving IP (
/showthread.php?tid=70925)
Saving IP -
Byrner - 28.03.2009
I am trying to get the players IP to save to his player file.
pawn Код:
new pIp[20];
GetPlayerIp(playerid, pIp, sizeof(pIp));
dUserSetINT(PlayerName(playerid)).("IP", strval(pIp) );
There's my code, it just saves the first part of the players IP.
For example if my IP was 92.46.436.21
It would save IP as
Anyone any ideas ?
Re: Saving IP -
kasco - 28.03.2009
strval() is to convert to numbers!
just remove the strval()
pawn Код:
new pIp[20];
GetPlayerIp(playerid, pIp, sizeof(pIp));
dUserSetINT(PlayerName(playerid)).("IP", pIp );
Re: Saving IP -
Byrner - 28.03.2009
When I use that code:
Код:
C:\Documents and Settings\Compaq_Owner\Desktop\samp022server.win322\gamemodes\MY Script\When working on it\2.4.9\crrpg.pwn(48349) : error 035: argument type mismatch (argument 3)
Re: Saving IP -
Rks25 - 28.03.2009
I could help you if you would use Dini.
Re: Saving IP -
Byrner - 28.03.2009
Quote:
Originally Posted by Rk_
I could help you if you would use Dini.
|
Sorry, I have too much stuff that works with my player files, switching systems would be too much bother.
I think I have it anyway, this seemed to work on register:
pawn Код:
new pIp[16];
GetPlayerIp(playerid, pIp, sizeof(pIp));
dUserSet(PlayerName(playerid)).("IP", pIp);
Re: Saving IP -
Rks25 - 28.03.2009
than just copy that piece of code for OnPlayerDisconnect or what ever part u use to store things in a file.
Re: Saving IP -
Byrner - 28.03.2009
Hmmmm......
pawn Код:
new pIp[16];
GetPlayerIp(playerid, pIp, sizeof(pIp));
dUserSet(PlayerName(playerid)).("IP", pIp);
Works on register, but not on anything else.....strange. :/
Any ideas ?
Re: Saving IP -
Kinetic - 28.03.2009
An IP is a string not an integer.