SA-MP Forums Archive
error 035: error 035: argument type mismatch (argument 1) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 035: error 035: argument type mismatch (argument 1) (/showthread.php?tid=169869)



error 035: error 035: argument type mismatch (argument 1) - willsuckformoney - 21.08.2010

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

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



Re: error 035: error 035: argument type mismatch (argument 1) - iggy1 - 21.08.2010

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.


Re: error 035: error 035: argument type mismatch (argument 1) - willsuckformoney - 21.08.2010

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



Re: error 035: error 035: argument type mismatch (argument 1) - Duck - 21.08.2010




But seriously, show us the define to the file.


Re: error 035: error 035: argument type mismatch (argument 1) - iggy1 - 21.08.2010

Did you format file? to represent the filename?


Re: error 035: error 035: argument type mismatch (argument 1) - willsuckformoney - 21.08.2010

you mean this?

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


Re: error 035: error 035: argument type mismatch (argument 1) - iggy1 - 21.08.2010

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.


Re: error 035: error 035: argument type mismatch (argument 1) - willsuckformoney - 21.08.2010

i already had

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

sorry for leaving that out


Re: error 035: error 035: argument type mismatch (argument 1) - iggy1 - 21.08.2010

Hmm no placeholder for 'name'.

My bad just looked at the defines.


Re: error 035: error 035: argument type mismatch (argument 1) - willsuckformoney - 21.08.2010

Код:
        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