Jump to content

Problema Gamemode


Mr.Antonios

Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.