PDA

View Full Version : fcreate INI file


SumX
29/07/2015, 12:08 PM
error 035: argument type mismatch (argument 1)

These both 2 lines get this error.Why?

fcreate(ZoneFile(ZoneCount));
new INI:file = INI_Open(ZoneFile(ZoneCount));



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;
}

Mariciuc223
29/07/2015, 12:10 PM
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

SumX
29/07/2015, 12:12 PM
so what is wrong? i am using y_ini too

Mariciuc223
29/07/2015, 12:15 PM
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 ...

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 :rolleyes:

dominik523
29/07/2015, 12:19 PM
new filename;
format(filename, sizeof(filename), "Zones/%d.ini", zoneid);

You are trying to format an integer value. Change it to a string.