SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/04/2012, 08:50 PM   #1
jcvag44800
Gangsta
 
jcvag44800's Avatar
 
Join Date: Jun 2010
Location: france / french
Posts: 693
Reputation: 16
Default Problem for save IP

Hi guys.

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

Create:

pawn Code:
dini_IntSet(file, "LastIP", PlayerInfo[playerid][pLastIP] = 0);

When disconnect:

pawn Code:
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.
__________________
[FS] Système AFK.
[FS] Système spawn véhicule.
jcvag44800 is offline   Reply With Quote
Old 13/04/2012, 08:53 PM   #2
Snir_sofer
Big Clucker
 
Join Date: Jul 2010
Posts: 59
Reputation: 1
Default Re: Problem for save IP

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]);
Snir_sofer is offline   Reply With Quote
Old 13/04/2012, 08:53 PM   #3
Laronic
Huge Clucker
 
Laronic's Avatar
 
Join Date: Mar 2011
Location: Somewhere you're not
Posts: 435
Reputation: 57
Default Re: Problem for save IP

new playerIP[16];
GetPlayerIP(playerid, playerIP, sizeof(playerIP));
dini_Set(file, "LastIP", playerIP);
__________________
Laronic is offline   Reply With Quote
Old 13/04/2012, 08:54 PM   #4
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,028
Reputation: 648
Default Re: Problem for save IP

IP is a string ...

pawn Code:
//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]);
__________________
ViniBorn is offline   Reply With Quote
Old 13/04/2012, 08:55 PM   #5
Snir_sofer
Big Clucker
 
Join Date: Jul 2010
Posts: 59
Reputation: 1
Default Re: Problem for save IP

PHP Code:
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]); 
Snir_sofer is offline   Reply With Quote
Old 13/04/2012, 08:59 PM   #6
jcvag44800
Gangsta
 
jcvag44800's Avatar
 
Join Date: Jun 2010
Location: france / french
Posts: 693
Reputation: 16
Default Re : Problem for save IP

Thanks all !
__________________
[FS] Système AFK.
[FS] Système spawn véhicule.
jcvag44800 is offline   Reply With Quote
Old 14/04/2012, 09:00 AM   #7
jcvag44800
Gangsta
 
jcvag44800's Avatar
 
Join Date: Jun 2010
Location: france / french
Posts: 693
Reputation: 16
Default Re : Problem for save IP

When i'm connected, the IP is 255.255.255.255... How I can resolve this ?
__________________
[FS] Système AFK.
[FS] Système spawn véhicule.
jcvag44800 is offline   Reply With Quote
Old 14/04/2012, 11:17 AM   #8
jcvag44800
Gangsta
 
jcvag44800's Avatar
 
Join Date: Jun 2010
Location: france / french
Posts: 693
Reputation: 16
Default Re : Problem for save IP

Help plz !

EDIT: http://forum.sa-mp.com/showthread.php?t=331420&langid=2

Sorry
__________________
[FS] Système AFK.
[FS] Système spawn véhicule.
jcvag44800 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save pos problem. tuuker Help Archive 21 03/03/2011 06:19 PM
/save problem barneystinson Server Support 8 27/02/2011 06:13 AM
car save problem ken9926 Help Archive 20 01/09/2010 08:30 AM


All times are GMT. The time now is 10:39 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.