SA-MP Forums Archive
Y_INI writes same thing many times - 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: Y_INI writes same thing many times (/showthread.php?tid=457527)



Y_INI writes same thing many times - lramos15 - 11.08.2013

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;



Re: Y_INI writes same thing many times - San1 - 11.08.2013

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


Re: Y_INI writes same thing many times - dEcooR - 12.08.2013

Because some ppls got dynamic ip..


Re: Y_INI writes same thing many times - lramos15 - 12.08.2013

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


Re: Y_INI writes same thing many times - QuaTTrO - 12.08.2013

Show that line. I mean y_ini function


Re: Y_INI writes same thing many times - lramos15 - 13.08.2013

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



Re: Y_INI writes same thing many times - lramos15 - 15.08.2013

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


Re: Y_INI writes same thing many times - PrinceKumar - 15.08.2013

Can u show ur inii system


Re: Y_INI writes same thing many times - lramos15 - 15.08.2013

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]);



Re: Y_INI writes same thing many times - lramos15 - 16.08.2013

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


Re: Y_INI writes same thing many times - Lordzy - 16.08.2013

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);