Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Recommended Posts

Posted (edited)

Salutare am si eu o problema cu un gm si nu stiu cu m sa o rezolv 

[23:01:06] [debug] Run time error 4: "Array indexarrow-10x10.png out of bounds"
[23:01:06] [debug]  Accessing element at indexarrow-10x10.png 999 past array upper bound 49
[23:01:06] [debug] AMX backtrace:
[23:01:06] [debug] #0 000520e8 in public OnObjectMoved () from xxx.amx
[23:01:14] [debug] Run time error 4: "Array index out of bounds"
[23:01:14] [debug]  Accessing element at index 999 past array upper bound 49
[23:01:14] [debug] AMX backtrace:
[23:01:14] [debug] #0 000520e8 in public OnObjectMoved () from xxx.amx
[23:01:22] [debug] Run time error 4: "Array index out of bounds"
[23:01:22] [debug]  Accessing element at index 999 past array upper bound 49
[23:01:22] [debug] AMX backtrace:
[23:01:22] [debug] #0 000520e8 in public OnObjectMoved () from xxx.amx
[23:01:30] [debug] Run time error 4: "Array index out of bounds"
[23:01:30] [debug]  Accessing element at index 999 past array upper bound 49
[23:01:30] [debug] AMX backtrace:
[23:01:30] [debug] #0 000520e8 in public OnObjectMoved () from xxx.amx

acesta este codul

//=============================================================================================================================================================
// = OnObjectMoved
//=============================================================================================================================================================
Functie OnObjectMoved(objectid)
{
	//Carnaval
	if(objectid == gFerrisWheel)
	{
	    SetTimer("RotateWheel",3*1000,0);
	}
	else if(objectid == pirateship[0])
	{
	    if(IsObjectMoving(pirateship[0])) StopObject(pirateship[0]);
	    if(piratestep[3] == 2)
	    {
	    	piratestep[6] = 0; piratestep[5] = 0; piratestep[4] = 0; piratestep[3] = 0; piratestep[2] = 0; piratestep[1] = 0;
	    	for(new i;i<MAX_PLAYERS;i++)
	    	{
	    	    if(IsPlayerConnected(i) && GetPVarType(i, "pPirate"))
	    	    {
		    		DeletePVar(i, "pPirate");
			    	new Float:rand=random(5);
			    	SetPlayerPos(i, 1427.0665+rand,-129.3872+rand,23.2147);
			    	SeteazaHP(i, GetPVarFloat(i, "pOldHealth"));
	    			DeletePVar(i, "pOldHealth");
				}
			}
		}
		else
		{
		    new Float:X, Float:Y, Float:Z, Float:RX, Float:RY, Float:RZ;
		    GetObjectPos(pirateship[0], X, Y, Z); GetObjectRot(pirateship[0], RX, RY, RZ);
		    if(piratestep[1] == 0)
		    {
			    if(RY < 0.0) MoveObject(pirateship[0], X, Y, Z+0.1, 0.1, 0.0, RY-3.0, 40.0);
			    else MoveObject(pirateship[0], X, Y, Z-0.1, 0.1, 0.0, RY+3.0, 40.0);
			    piratestep[1] = 1;
			}
			else
			{
	  			if(RY < 0.0) MoveObject(pirateship[0], X, Y, Z+0.1, 0.01, 0.0, 0.0, 40.0);
	  			else MoveObject(pirateship[0], X, Y, Z-0.1, 0.01, 0.0, 0.0, 40.0);
	      		piratestep[1] = 0;
		    	SetTimer("MovePirateShip", 1000, false);
			}
		}
	}
	//Carnaval
    new i = Baller;
    if(ShootingBall == 2)
    {
		BallDown2(i);
		return 1;
    }
    else if(ShootingBall == 3)
    {
		BallDown3(i);
		return 1;
    }
    else if(ShootingBall == 4)
    {
		BallDown4(i);
		return 1;
    }
    else if(ShootingBall == 5)
    {
		BallDown5(i);
		return 1;
    }
    else if(ShootingBall == 6)
    {
        ApplyAnimation(i,"BSKTBALL","BBALL_walk",4.1,1,1,1,1,1);
		HavingBall[i] = 1;
		AnimBasket[i] = 0;
    }
    if(BallBounce == 1)
    {
        new Float:x, Float:y, Float:z;
	    GetObjectPos(Ball, x, y, z);
	    MoveObject(Ball, x, y, z+1.2, 4);
	    BallBounce = 2;
	}
	else if(BallBounce == 2)
    {
        new Float:x, Float:y, Float:z;
	    GetObjectPos(Ball, x, y, z);
	    MoveObject(Ball, x, y, z-1.2, 4);
	    BallBounce = 3;
	}
	else if(BallBounce == 3)
    {
        new Float:x, Float:y, Float:z;
	    GetObjectPos(Ball, x, y, z);
	    MoveObject(Ball, x, y, z+0.8, 3);
	    BallBounce = 4;
	}
	else if(BallBounce == 4)
    {
        new Float:x, Float:y, Float:z;
	    GetObjectPos(Ball, x, y, z);
	    MoveObject(Ball, x, y, z-0.8, 3);
	    BallBounce = 5;
	}
	else if(BallBounce == 5)
    {
        new Float:x, Float:y, Float:z;
	    GetObjectPos(Ball, x, y, z);
	    MoveObject(Ball, x, y, z+0.5, 2);
	    BallBounce = 6;
	}
	else if(BallBounce == 6)
    {
        new Float:x, Float:y, Float:z;
	    GetObjectPos(Ball, x, y, z);
	    MoveObject(Ball, x, y, z-0.5, 2);
	    BallBounce = 7;
	}
	else if(BallBounce == 7)
    {
        new Float:x, Float:y, Float:z;
	    GetObjectPos(Ball, x, y, z);
	    MoveObject(Ball, x, y, z+0.2, 1);
	    BallBounce = 8;
	}
	else if(BallBounce == 8)
    {
        new Float:x, Float:y, Float:z;
	    GetObjectPos(Ball, x, y, z);
	    MoveObject(Ball, x, y, z-0.2, 1);
	    BallBounce = 0;
	}
    if(!HavingBall[i]) return 1;
	new Keys, ud, lr;
	GetPlayerKeys(i, Keys, ud, lr);
    if(AnimBasket[i])
    {
        switch(BallStatus)
	    {
			case 0:
			{
				BallStatus = 1;
				new Float:x, Float:y, Float:z;
				GetPlayerPos(i, x, y, z);
				StopObject(Ball);
				new Float:x2, Float:y2;
		 	    GetXYInFrontOfPlayerBasket(i, x2, y2,0.4);
				MoveObject(Ball, x2, y2, z+0.1, 5.5);
			}
			case 1:
			{
        		BallStatus = 0;
        		new Float:x, Float:y, Float:z;
				GetPlayerPos(i, x, y, z);
				StopObject(Ball);
				new Float:x2, Float:y2;
				GetXYInFrontOfPlayerBasket(i, x2, y2,0.4);
				MoveObject(Ball, x2, y2, z-0.8, 5.5);
			}
		}
		return 1;
    }
Edited by Mr.Antonios

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.