SA-MP Forums Archive
Function for save anything - 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: Function for save anything (/showthread.php?tid=530681)



Function for save anything - Orei - 08.08.2014

Hello community.

I would like to know the function that make is saved to a file a certain thing:

For example, when you register in a server and asks for age and then save as "pAge = 20" in a ini file for the user.

Other example on the GodFather GM:

UserName.ini:
Код:
Key=
Level=
AdminLevel=
UpgradePoints=
ConnectedTime=
Registered=
Sex=
Age=
Thanks!


Re: Function for save anything - mamorunl - 08.08.2014

If you are really going to start with saving data, might I recommend going it in MySQL? SA:MP is that far ahead already and it takes up less space than an ini file.

If you absolutely want to work with files, I guess the best option to go for is ******' Y_INI. There is no one-size-fits-all when it comes to this, so the methods will be different in every plugin. Best to learn with examples from the topic of the plugin.


Re: Function for save anything - Orei - 08.08.2014

I can use both options. Although I am new on pawn and if they have any tutorial would be much better if you do not mind. I want to do it alone but with a tutorial to learn xD.

Thanks mamorunl!