Error 035 - 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 (
/showthread.php?tid=238889)
Error 035 -
sekol - 12.03.2011
I get this error
Код:
error 035: argument type mismatch (argument 2)
From this command
pawn Код:
COMMAND:item(playerid, params[])
{
new name[128], type, var1, var2;
if(!sscanf(params, "s[64]ddd", name, type, var1, var2))
{
AddItem(playerid, name, type, var1, var2); // error line
return 1;
}
return 1;
}
And thats my custom function
pawn Код:
public AddItem(playerid, itemname, type, var1, var2)
{
new string[128];
new i = 0;
while(i <= MAX_ITEMS)
{
i++;
format(string, sizeof(string), "Przedmioty/%d.ini", i);
if(!fexist(string))
{
new name[128];
djCreateFile(string);
format(name, sizeof(name), "%s", itemname);
djSet(string, "Name", name);
djSetInt(string, "Type", type);
djSetInt(string, "Var1", var1);
djSetInt(string, "Var2", var2);
LoadCertainItem(i);
return 1;
}
}
return 1;
}
What could be wrong?
Re: Error 035 -
Finn - 12.03.2011
In your function
itemname is declared as an integer when it should be a string.
This is how it should be:
pawn Код:
public AddItem(playerid, itemname[], type, var1, var2)
Re: Error 035 -
sekol - 12.03.2011
Thanks it works!