Problem for save IP
#1

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

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]);
Reply
#3

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

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]);
Reply
#5

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]); 
Reply
#6

Thanks all !
Reply
#7

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

Help plz !

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

Sorry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)