SA-MP Forums Archive
Number of arguments does not match definition o.O...HELP - 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: Number of arguments does not match definition o.O...HELP (/showthread.php?tid=74891)



Number of arguments does not match definition o.O...HELP - Bearfist - 27.04.2009


on the Top--->
Код:
new Float:RandomGG[7][7] =
{
	{-1130.9011,1076.9305,1353.4279,180.0000},
	{-1136.5948,1077.3739,1345.8052,181.1802},
	{-1083.2759,1045.3164,1343.3174,114.5518},
  {-1059.1899,1056.0432,1344.1494,285.9082},
  {-1017.5864,1050.0138,1342.8647,82.3721},
  {-974.0999,1061.7153,1345.6708,94.1719},
  {-972.9766,1022.9188,1345.0541,99.9477}
};
OnPlayerSpawn--->
Код:
new rand = random(sizeof(RandomGG));
SetPlayerPos(playerid, RandomGG[rand][0], RandomGG[rand][1], RandomGG[rand][2],RandomGG[rand][3],RandomGG[rand][4],RandomGG[rand][5],RandomGG[rand][6]);
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition

But why ??

Bearfist


Re: Number of arguments does not match definition o.O...HELP - yom - 27.04.2009

Because it is SetPlayerPos(playerid, x, y, z)

And in case you don't see, your array doesn't have 7 values in the 2nd dimension


Re: Number of arguments does not match definition o.O...HELP - Bearfist - 27.04.2009

Oh yes ...
corrected-->
Код:
new Float:RandomGG[7][3] =
{
	{-1130.9011,1076.9305,1353.4279},
	{-1136.5948,1077.3739,1345.8052},
	{-1083.2759,1045.3164,1343.3174},
  {-1059.1899,1056.0432,1344.1494},
  {-1017.5864,1050.0138,1342.8647},
  {-974.0999,1061.7153,1345.6708},
  {-972.9766,1022.9188,1345.0541}
};

new rand = random(sizeof(RandomGG));
SetPlayerPos(playerid, RandomGG[rand][0], RandomGG[rand][1], RandomGG[rand][2],RandomGG[rand][3],RandomGG[rand][4],RandomGG[rand][5],RandomGG[rand][6]);
Now It shows me this error

error 032: array index out of bounds (variable "RandomGG") ---->On Line SetPlayerPos(blabla);


Bearfist


Re: Number of arguments does not match definition o.O...HELP - Bearfist - 27.04.2009

Anyone Can Help me ??


Re: Number of arguments does not match definition o.O...HELP - Cueball - 27.04.2009

You don't deserve help if you're going to double post, especially within a 20 minute timeframe, but I would still like to help.

The errors tell you the problem; you have the wrong number of arguments. You need to remove the function arguments (parameters) so that you will be calling the function correctly. The next error you have is because you are accessing the array with an index that is higher than the size of that array.

Change your line to this:
pawn Код:
SetPlayerPos(playerid, RandomGG[rand][0], RandomGG[rand][1], RandomGG[rand][2]); // 4 arguments, no invalid indexes.
DO NOT DOUBLE POST!

~Cueball~



Re: Number of arguments does not match definition o.O...HELP - Bearfist - 27.04.2009

Alright
It works now...
thanks to all

Bearfist