SA-MP Forums Archive
Problem for save 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)
+--- Thread: Problem for save IP (/showthread.php?tid=334106)



Problem for save IP - jcvag44800 - 13.04.2012

Hi guys.

I have a problem for save the IP of player.
This is my script:

Create:

pawn Код:
dini_IntSet(file, "LastIP", PlayerInfo[playerid][pLastIP] = 0);
When disconnect:

pawn Код:
new IP[17];
PlayerInfo[playerid][pLastIP] = GetPlayerIp(playerid, IP, sizeof(IP));
dini_Set(file, "LastIP",PlayerInfo[playerid][pLastIP]);
And user file... LastIP = 15....

How i can resolve my problem ?

Cordially.


Re: Problem for save IP - Snir_sofer - 13.04.2012

Create:
PlayerInfo[playerid][pLastIP] = 0;
dini_Set(file,"LastIP",PlayerInfo[playerid][pLastIP]);

Disconnect:
new IP[17];
GetPlayerIp(playerid, IP, sizeof(IP));
format(PlayerInfo[playerid][pLastIP],120,"%s",IP);
dini_Set(file, "LastIP",PlayerInfo[playerid][pLastIP]);


Re: Problem for save IP - Laronic - 13.04.2012

new playerIP[16];
GetPlayerIP(playerid, playerIP, sizeof(playerIP));
dini_Set(file, "LastIP", playerIP);


Re: Problem for save IP - ViniBorn - 13.04.2012

IP is a string ...

pawn Код:
//Enum
pLastIP[16],

// Load
format(PlayerInfo[playerid][pLastIP],16,"%s",dini_Get(file, "LastIP"));


// Save
new IP[16];
GetPlayerIp(playerid, IP, sizeof(IP);
format(PlayerInfo[playerid][pLastIP],16,"%s",IP);
dini_Set(file, "LastIP",PlayerInfo[playerid][pLastIP]);



Re: Problem for save IP - Snir_sofer - 13.04.2012

PHP код:
Create:
PlayerInfo[playerid][pLastIP] = 0;
dini_Set(file,"LastIP",PlayerInfo[playerid][pLastIP]);
Disconnect:
new 
IP[17];
GetPlayerIp(playeridIPsizeof(IP));
format(PlayerInfo[playerid][pLastIP],120,"%s",IP);
dini_Set(file"LastIP",PlayerInfo[playerid][pLastIP]); 



Re : Problem for save IP - jcvag44800 - 13.04.2012

Thanks all !


Re : Problem for save IP - jcvag44800 - 14.04.2012

When i'm connected, the IP is 255.255.255.255... How I can resolve this ?


Re : Problem for save IP - jcvag44800 - 14.04.2012

Help plz !

EDIT: https://sampforum.blast.hk/showthread.php?tid=331420&langid=2

Sorry