argument type mismatch - fopen - 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)
+--- Thread: argument type mismatch - fopen (
/showthread.php?tid=595294)
argument type mismatch - fopen -
GranaT3 - 01.12.2015
Hello. I have the following code:
Код:
CMD:create(playerid,params[])
{
if(!sscanf(params, "s[12]s[12]", params[0],params[1]))
{
new File:INI = fopen(params[0],io_readwrite);
if(!fexist(INI))
{
if(INI)
{
fwrite(INI, params[1]);
}
}
}
else
{
SendClientMessage(playerid, -1, "use /create [name] [content]");
}
return 1;
}
error 035: argument type mismatch (argument 1)
line: marked in red
Re: argument type mismatch - fopen -
Jefff - 01.12.2015
pawn Код:
CMD:create(playerid,params[])
{
new name[24], content[120];
if(sscanf(params, "s[24]s[120]", name, content)) SendClientMessage(playerid, -1, "use /create [name] [content]");
else
{
if(!fexist(name))
{
new File:INI = fopen(name, io_readwrite);
if(!INI) SendClientMessage(playerid, -1, "[ERROR]: File can't be created on this location!");
else
{
fwrite(INI, content);
//fwrite(INI, "\r\n");
fclose(INI);
SendClientMessage(playerid, -1, "File created.");
}
}
else SendClientMessage(playerid, -1, "[ERROR]: File already exists!");
}
return 1;
}
Respuesta: argument type mismatch - fopen -
GranaT3 - 01.12.2015
Thank you. I'm learning the file functions.