Y_INI writes same thing many times
#1

So I have made an extra variable in my user file called Ip Adress but every time the player connects it writes another line instead of over writing it here is the code to get ip
HTML Code:
    GetPlayerIp(playerid,ip, sizeof(ip));
	PlayerInfo[playerid][pAdress] = ip;
Reply
#2

Make Sure THeir is not Spaces between your INI_WriteString(File, ""NO SPACES use UNDERLINES" or INI_WriteInt(File, "NO SPACES use UNDERLINES"
Reply
#3

Because some ppls got dynamic ip..
Reply
#4

No I have it user on player connect and every time a player connects it writes a new line for their ip instead of overwriting the existing line
Reply
#5

Show that line. I mean y_ini function
Reply
#6

HTML Code:
INI_WriteString(File,"IP Adress",PlayerInfo[playerid][pAdress]);
Reply
#7

This is now happening to me with a boolean I dont know why
Reply
#8

Can u show ur inii system
Reply
#9

Heres everything for Ip

Enum:
HTML Code:
pAdress[16]
LoadUser_Data
HTML Code:
INI_Int("IP Adress",PlayerInfo[playerid][pAdress]);
OnPlayerConnect
HTML Code:
    GetPlayerIp(playerid,ip, sizeof(ip));
	PlayerInfo[playerid][pAdress] = ip;
OnPlayerDisconnect
HTML Code:
INI_WriteString(File,"IP Adress",PlayerInfo[playerid][pAdress]);
Reply
#10

Sorry for bumping but does anyone have any idea why this happens?
Reply
#11

You must specify the size of the array too at the last parameter of INI_WriteString. And, you must use INI_String instead of INI_Int while loading the IP address as it's a string, not an integer.
pawn Код:
INI_WriteString(File, "IP Address", PlayerInfo[playerid][pAdress], 16);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)