fcreate INI file
#1

PHP код:
error 035argument 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(filenamesizeof(filename), "Zones/%d.ini"zoneid);
    return 
filename;
}
stock fcreate(filename[])
{
    if(
fexist(filename)) return 0;
    new 
File:file fopen(filenameio_write);
    
fclose(file);
    return 
1;

Reply
#2

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
Reply
#3

so what is wrong? i am using y_ini too
Reply
#4

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
Reply
#5

Код:
new filename;
format(filename, sizeof(filename), "Zones/%d.ini", zoneid);
You are trying to format an integer value. Change it to a string.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)