SA-MP Forums Archive
Y_INI, Reading from files - 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, Reading from files (/showthread.php?tid=499698)



Y_INI, Reading from files - ConnorHunter - 09.03.2014

Yes, yes I know there is documentation on how to do this on the release thread but it didn't work for my needs so I need a little bit of assistance.

If I save a string to a player file (%s.ini) and then want to load it as a string ("%s", PlayerInfo[playerid][pString]), how do I call it? I've tried a few methods but all have failed and I can't find a way around it. I've tried looking through other scripts to find methods like it, but still nothing. If I save an integer to a file, and call it, it's easy, but if it's a string it just doesn't work the same way. I'm new when it comes to saving files and loading them, so excuse me if I've missed something basic.

Thanks


Re: Y_INI, Reading from files - ConnorHunter - 10.03.2014

Bump


AW: Y_INI, Reading from files - Macronix - 10.03.2014

You mean how to show the stored string PlayerInfo[playerid][pString], for example in ClientMessage?


Re: Y_INI, Reading from files - ConnorHunter - 10.03.2014

Yeah


AW: Y_INI, Reading from files - Macronix - 10.03.2014

pawn Код:
new string[256];
format(string, sizeof(string), "Test the string: %s", PlayerInfo[playerid][pString]);
SendClientMessage(playerid, -1, string);



Re: Y_INI, Reading from files - ConnorHunter - 10.03.2014

That doesn't work, I've tried it. You need to read it from the file, but I have no idea how.


AW: Y_INI, Reading from files - Macronix - 10.03.2014

Which save/load file system are you using?


Re: Y_INI, Reading from files - Threshold - 10.03.2014

Код:
INI_String("MyVariable", PlayerInfo[playerid][String], sizeof(PlayerInfo[playerid][String]));
You need the name of the 'thingy' that it's stored under in the file, the thing you want it to save it to, then the size of the string. It has an extra parameter compared to INI_Int.