SA-MP Forums Archive
IP Wont save, YINI - 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: IP Wont save, YINI (/showthread.php?tid=581236)



IP Wont save, YINI - Pawnify - 11.07.2015

Hi, I'm trying to save a players IP when they register but it's not creating in the players INI file.

Here's my code under the registration dialog
Код:
				new plrIP[16];
    			GetPlayerIp(playerid, plrIP, sizeof(plrIP));
                new Year,Month,Day,DATEJOINED[15];
				getdate(Year,Month,Day);
				format(DATEJOINED, sizeof(DATEJOINED), "%i.%i.%i",Day, Month, Year);
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{6DD7E3}Registration","{FF0000}You have entered an invalid password.\n{FFFFFF}Type your password below to register a new account.\n{FFE733}This is NOT blurred out.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"AdminLevel",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Credits",50);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"VipLevel",0);
                INI_WriteString(File,"Registration IP",plrIP);
                INI_WriteString(File,"Date Joined", DATEJOINED);
                INI_Close(File);
Here's the ini file after registration



Re: IP Wont save, YINI - Threshold - 11.07.2015

What callback is this code located under?


Re: IP Wont save, YINI - Pawnify - 11.07.2015

Quote:
Originally Posted by Threshold
Посмотреть сообщение
What callback is this code located under?
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])


Re: IP Wont save, YINI - Threshold - 11.07.2015

Hmmm, add a printf line to see what 'plrIP' actually contains.

pawn Код:
printf("%s", plrIP);



Re: IP Wont save, YINI - Pawnify - 11.07.2015

Quote:
Originally Posted by Threshold
Посмотреть сообщение
Hmmm, add a printf line to see what 'plrIP' actually contains.

pawn Код:
printf("%s", plrIP);
It does indeed print my local IP here. hmm



Re: IP Wont save, YINI - Pawnify - 11.07.2015

Quote:
Originally Posted by Pawnify
Посмотреть сообщение
It does indeed print my local IP here. hmm
Hmm, it seems to save the IP when I host the server on my local machine. But I also have a game server over at OBHost and it doesn't save there.

Edit: It prints the IP but it doesn't save it to the file when hosting on the game server


Re: IP Wont save, YINI - Pawnify - 11.07.2015

Could it be an issue with my server host?


Re: IP Wont save, YINI - Hayden_Almeida - 23.07.2018

Quote:
Originally Posted by Pawnify
Посмотреть сообщение
Could it be an issue with my server host?
Same problem here.