Whats wrong? - 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: Whats wrong? (
/showthread.php?tid=210795)
Whats wrong? -
Tutrix - 13.01.2011
Hello, I get some errors on this code:
pawn Код:
Float:functionB0(Float:arg0, Float:arg1, arg2)
{
new Float:var0[4];
for(new var1 = 0; var1 < 3; var1++)
{
var0[var1] = arg0[var1] - arg1[var1];
var0[var1] = var0[var1] * var0[var1];
}
var0[3] = var0[0] + var0[1] + var0[2];
return (arg2 ? floatsqroot(var0[3]) : var0[3]);
}
This is the errors :
Код:
error 028: invalid subscript (not an array or too many subscripts): "arg0"
Warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
This is the line:
pawn Код:
var0[var1] = arg0[var1] - arg1[var1];
i dont get whats wrong :S it has a ; sign on the end.
Respuesta: Whats wrong? -
anonymousx - 13.01.2011
You created the float "arg0" for functionB0 without any array.
Re: Whats wrong? -
Tutrix - 14.01.2011
no thats not it.