SA-MP Forums Archive
Adding extra line to INI after player's registering - 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: Adding extra line to INI after player's registering (/showthread.php?tid=578690)



Adding extra line to INI after player's registering - XxBaDxBoYxX - 21.06.2015

So My current infos saved when the player register
Код:
new INI:File = INI_Open(UserPath(playerid));
                WP_Hash(buf, sizeof(buf), inputtext);
                INI_SetTag(File,"data");
                INI_WriteString(File, "pPassword", buf);
		INI_WriteInt(File,"pKills",0);
		INI_WriteInt(File,"pDeaths",0);
                INI_Close(File);
Now, Lets say I want to add [pBans] to a player who's already registered, How could I do this ? :/


Re: Adding extra line to INI after player's registering - shocktheripper - 21.06.2015

I think you can't just because that function has never been implemented. If it's possibile, well you'll probably have to waste your time. Or you can always make a command that allows you to ban offline players.


Re: Adding extra line to INI after player's registering - XxBaDxBoYxX - 21.06.2015

ban the player is not enough, If he evades he can still use the account, I can simply block the account and if he wanted to evade he can go ahead with new name.

Anyways, I need a way to add it :/


Re: Adding extra line to INI after player's registering - shocktheripper - 21.06.2015

Take a look.

https://sampforum.blast.hk/showthread.php?tid=401701


Re: Adding extra line to INI after player's registering - M0HAMMAD - 21.06.2015

you can fremove(UserPath(playerid)); and re-created !


Re: Adding extra line to INI after player's registering - XxBaDxBoYxX - 21.06.2015

Quote:
Originally Posted by shocktheripper
Посмотреть сообщение
Dude, I don't want a custom ban system, I want to add an extra line to players who are already registered!

Quote:
Originally Posted by M0HAMMAD
Посмотреть сообщение
you can fremove(UserPath(playerid)); and re-created !
I'm quite sure there is an easier way to do that :/


Re: Adding extra line to INI after player's registering - Jonny5 - 22.06.2015

best bet is not to use INI for registration and user system
"The INI file format is an informal standard for configuration files for some platforms or software"
my advice is to switch to sqlite or mysql.


now to try and answer your question despite my opinion.. lol

have you tried just writing the var to the file?
you may have to write a script that will loop threw every user file and add the field, should be simple.
if you need help with that part we will need you to post the UserPath function your using.