15.10.2014, 19:28
i used a Filterscript of Basket Ball it give me erors of Index our of Bounds at on Objects moved
This is on objects moved code
if (objectid == Ball)
{
new Float: x, Float: y, Float: z;
GetObjectPos(objectid, x,y,z);
new n = END_BALL_STEP;
if (BallStep >= n)
{
new b;
if (!Mode) b = 8; else b = 10;
if (BallStep == n + b)
{
BallPos[0] = x;
BallPos[1] = y;
BallPos[2] = z;
CanJump[BallOn] = 0;
ApplyAnimation(BallOn, "BSKTBALL", "BBALL_Jump_Shot_O", 4, 0, 0, 0, 1, 100);
BallOn = -1;
}
else
{
if (!Mode)
{
GameTextForPlayer(BallOn, "~g~+1", 3000, 6);
new Float: a = BallDown[BallStep - n];
MoveObject(objectid, x,y,z + a, 8-a);
BallStep++;
}
else
{
new Float: a = BallSide[BallStep - n];
MoveObject(objectid, x+0.15*Mode, y - 0.08, z + a, 8-a);
BallStep++;
}
}
}
MoveObject(objectid, x+BallSteps[0], y+BallSteps[1], z+ZBallPos[BallStep], 7.65);
BallStep++;
}
This is on objects moved code
if (objectid == Ball)
{
new Float: x, Float: y, Float: z;
GetObjectPos(objectid, x,y,z);
new n = END_BALL_STEP;
if (BallStep >= n)
{
new b;
if (!Mode) b = 8; else b = 10;
if (BallStep == n + b)
{
BallPos[0] = x;
BallPos[1] = y;
BallPos[2] = z;
CanJump[BallOn] = 0;
ApplyAnimation(BallOn, "BSKTBALL", "BBALL_Jump_Shot_O", 4, 0, 0, 0, 1, 100);
BallOn = -1;
}
else
{
if (!Mode)
{
GameTextForPlayer(BallOn, "~g~+1", 3000, 6);
new Float: a = BallDown[BallStep - n];
MoveObject(objectid, x,y,z + a, 8-a);
BallStep++;
}
else
{
new Float: a = BallSide[BallStep - n];
MoveObject(objectid, x+0.15*Mode, y - 0.08, z + a, 8-a);
BallStep++;
}
}
}
MoveObject(objectid, x+BallSteps[0], y+BallSteps[1], z+ZBallPos[BallStep], 7.65);
BallStep++;
}