fcreate INI 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: fcreate INI file (
/showthread.php?tid=583576)
fcreate INI file -
SumX - 29.07.2015
PHP код:
error 035: argument type mismatch (argument 1)
These both 2 lines get this error.Why?
PHP код:
fcreate(ZoneFile(ZoneCount));
new INI:file = INI_Open(ZoneFile(ZoneCount));
PHP код:
stock ZoneFile(zoneid)
{
new filename;
format(filename, sizeof(filename), "Zones/%d.ini", zoneid);
return filename;
}
stock fcreate(filename[])
{
if(fexist(filename)) return 0;
new File:file = fopen(filename, io_write);
fclose(file);
return 1;
}
Re: fcreate INI file -
Mariciuc223 - 29.07.2015
You know that y_ini it's much faster and easiest (for me and others) than file functions..
I'm not sure but i think that file functions can create only .txt or .cfg files
Re: fcreate INI file -
SumX - 29.07.2015
so what is wrong? i am using y_ini too
Re: fcreate INI file -
Mariciuc223 - 29.07.2015
You can't use file functions with y_ini combined (i think) ..
Use that:
Create file like that:
Код:
new INI:File = INI_Open("file.ini");
INI_WriteInt(File, String[], Value) // or something like that - String what to write / value = the value (That it's for integer values ...
Код HTML:
Stock:
INI_Load - Loads an INI file using standard features.
INI_ParseFile - Loads a file as an ini and distributes data.
INI_GetEntryName - Gets the name of an INI item.
INI_GetEntryText - Gets the value of an INI item.
INI_Open - Opens an INI for writing.
INI_Close - Closes an INI being written to.
INI_SetTag - Sets a subheading in an INI fo subsequent writes.
INI_WriteString - Writes a string to an INI.
INI_WriteInt - Writes an int to an INI.
INI_WriteFloat - Writes a float to an INI.
INI_WriteHex - Writes a hex to an INI.
INI_WriteBin - Writes a binary to an INI.
INI_WriteBool - Writes a boolean to an INI.
INI_RemoveEntry - Remove an entry from a file.
Static:
INI_WriteBuffer - Writes an INI's buffer to the file.
INI_AddToBuffer - Adds a string to an INI buffer.
Inline:
INI_Int - Parse an integer INI entry.
INI_Float - Parse a float INI entry.
INI_Hex - Parse a hex INI entry.
INI_Bin - Parse a binary INI entry.
INI_Bool - Parse a binary INI entry.
INI_String - Parse a string INI entry.
EDIT: You are Romanian , like me , if you want more help you can PM me
Re: fcreate INI file -
dominik523 - 29.07.2015
Код:
new filename;
format(filename, sizeof(filename), "Zones/%d.ini", zoneid);
You are trying to format an integer value. Change it to a string.