error 035: error 035: argument type mismatch (argument 1)
#1

pawn Код:
dini_IntSet(file, "Weed", dini_Int(file, "Weed")-strval(amount));
what is the error here?

Код:
error 035: argument type mismatch (argument 1)
Reply
#2

show the 'file' define. Arguement mismatch usually means something like for example you've used a Float when it should be an int. The error is because of 'file' thats arguement 1.
Reply
#3

pawn Код:
//oncommandtext
new file[50]

//savetofile
CopyToFile(file[], string[])
{
    new entry[128];
    format(entry, sizeof(entry), "%s\r\n", string);
    new File:hFile = fopen(file, io_append);
    if(hFile)
    {
        fwrite(hFile, entry);
        fclose(hFile);
    }
}
Reply
#4




But seriously, show us the define to the file.
Reply
#5

Did you format file? to represent the filename?
Reply
#6

you mean this?

#define BAG_FILE "Bag/Acc/%s.cfg"
#define LOG_FILE "Bag/Log.txt"
Reply
#7

No.
I dont use dini i use djson but i think its simalar in the way its set out so shouldnt it look like something lke this?.

pawn Код:
new file[50];
pawn Код:
format(file,sizeof(file),"%s.ini",playername(playerid));
pawn Код:
dini_IntSet(file "Weed", dini_Int(file, "Weed")-strval(amount));
Obviously thats not the function you want but i think it should be simalar to that, as file is just an empty array without formatting it.
Reply
#8

i already had

format(file, sizeof(file), BAG_FILE, name);

sorry for leaving that out
Reply
#9

Hmm no placeholder for 'name'.

My bad just looked at the defines.
Reply
#10

Код:
        new file[50], name[MAX_PLAYER_NAME], string[128];
	GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), BAG_FILE, name);
ignore the string[128] its for format number of something
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)