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