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

Quote:

stock FacRemoveMemberFromFile(playerid) {
new tmp[MAX_PLAYER_NAME + 2];
if(GetPlayerName(playerid, tmp, MAX_PLAYER_NAME)) {
strcat(tmp, "\r\n");
return RemoveTextFromFile("factions/SAPD/SAPDmembers.ini", tmp);}
return false;
}

Quote:

stock RemoveTextFromFile(filename[], line){
new count, string[256], File:file, File:temp;

file= fopen(filename, io_read);
temp = fopen("tmpfile.tmp", io_write);
while (fread(file, string))
if (++count != line)
fwrite(temp, string);
fclose(file);
fclose(temp);
file= fopen(filename, io_write);
temp = fopen("tmpfile.tmp", io_read);
while (fread(temp, string))
fwrite(file, string);
fclose(file);
fclose(temp);
fremove("tmpfile.tmp");
return true;
}

Quote:

(2855) : error 035: argument type mismatch (argument 2)

Line 2855
Quote:

return RemoveTextFromFile("factions/SAPD/SAPDmembers.ini", tmp);}

What did I do wrong?
Reply
#2

Second parameter must be integer, i think you've some mistake on your function.
Reply
#3

Now I get this error?
Quote:

stock RemoveTextFromFile(filename[], line[]){
new count, string[256], File:file, File:temp;

file= fopen(filename, io_read);
temp = fopen("tmpfile.tmp", io_write);
while (fread(file, string))
if (++count != line)
fwrite(temp, string);
fclose(file);
fclose(temp);
file= fopen(filename, io_write);
temp = fopen("tmpfile.tmp", io_read);
while (fread(temp, string))
fwrite(file, string);
fclose(file);
fclose(temp);
fremove("tmpfile.tmp");
return true;
}

I get error on this line
Quote:

if (++count != line)

It says the array must be indexed ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)