Reading From File - 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: Reading From File (
/showthread.php?tid=536382)
Reading From File -
HerBan - 09.09.2014
Hello!
How can i open this string from file with Dialog?
pawn Код:
CMD:ban(playerid, params[])
{
format( iString, 258, "===============================================\r\n\
Admin: %s\r\n\
Level: %d\r\n\
Player: %s\r\n\
Date: %d/%d/%d at %d:%d\r\n\
Reason: %s\r\n\
===============================================\r\n\r\n\r\n",
PlayerName2( playerid ),
P_DATA[ playerid ][ P_Level ],
PlayerName2( params[ 0 ] ),
D,
M,
Y,
H,
Mi,
params[ 1 ] );
FILE = fopen(SlogBan, io_append);
if (FILE)
{
fwrite(FILE, iString);
fclose(FILE);
}
Re: Reading From File -
rockhopper - 09.09.2014
Why don't You please Use Y_INI ? ? ? ? ?
Re: Reading From File -
HerBan - 09.09.2014
bcause ywrite faster than y_ini
Re: Reading From File -
CutX - 09.09.2014
Quote:
Originally Posted by HerBan
How can i open this string from file with Dialog?
|
fread can be used to read from files.
the wiki has a nice example too.
i'd also suggest reading&writing binary that'll be faster. read more about it
here