IP Wont save, YINI
#1

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

What callback is this code located under?
Reply
#3

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

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

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

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
Reply
#6

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

Could it be an issue with my server host?
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)