SA-MP Forums Archive
Saving names - 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: Saving names (/showthread.php?tid=619691)



Saving names - StrikerZ - 21.10.2016

I'm making a faction system. I made /createfaction till yet. Is there any way to save the names of factions into .ini in a folder named faction? Full explanation- Admin used /createfaction, faction got created and a new file gets created into faction folder with the name of the faction.


Re: Saving names - StrikerZ - 21.10.2016

BUMP


Re: Saving names - CantBeJohn - 21.10.2016

All you really have to do is have the name saved within a string and then write a file with said string. Are you familiar with having .ini files created?


Re: Saving names - Threshold - 21.10.2016

You'd do this the exact same way as you would create a player's file when they register. Same principle, different file path.


Re: Saving names - StrikerZ - 21.10.2016

But that is for a player. But this one is a global type.


Re: Saving names - StrikerZ - 21.10.2016

FFS Bump! im waiting from morning i hab to complete da script


Re: Saving names - CantBeJohn - 21.10.2016

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
But that is for a player. But this one is a global type.
You realize that those "player files" are "global types" too right? The only reason you see them as "player types" is because within the script you're loading the files using the logged in player's name to locate said file. It's the same concept like the user above said.


Re: Saving names - Logic_ - 21.10.2016

Use the same method same player files, but load them on OnGameModeInit and unload in OnGameModeExit.


Re: Saving names - StrikerZ - 22.10.2016

So I saved them as INI_WriteString but as far I know we can't load with a function like INI_String so what should I do in that case?


Re: Saving names - SyS - 22.10.2016

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
So I saved them as INI_WriteString but as far I know we can't load with a function like INI_String so what should I do in that case?
why dont?