Jump to content
  • 0

problema OnObjectMoved


InceMan

Question

de ceva timp tot imi apare eroarea asta in log si nu imi dau seama de unde ar putea fi

eroarea: 

[08:56:16] [debug] AMX backtrace:
[08:56:16] [debug] #0 000518b0 in public OnObjectMoved (15) from FiveGame_v1.1.4.amx
[08:56:18] [debug] Run time error 4: "Array index out of bounds"
[08:56:18] [debug]  Attempted to read/write array element at index 999 in array of size 500
[08:56:18] [debug] AMX backtrace:
[08:56:18] [debug] #0 000518b0 in public OnObjectMoved (1) from FiveGame_v1.1.4.amx
[08:56:26] [debug] Run time error 4: "Array index out of bounds"
[08:56:26] [debug]  Attempted to read/write array element at index 999 in array of size 500

codul:

public OnObjectMoved(objectid)
{
    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;
    }
    if(Keys & KEY_SPRINT)
	{
        ApplyAnimation(i,"BSKTBALL","BBALL_run",4.1,1,1,1,1,1);
        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,1.5);
				MoveObject(Ball, x2, y2, z+0.1, 8);
			}
			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,1.5);
				MoveObject(Ball, x2, y2, z-0.8, 8);
			}
		}
		return 1;
    }
    else
    {
        ApplyAnimation(i,"BSKTBALL","BBALL_walk",4.1,1,1,1,1,1);
    }
	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,1.2);
			MoveObject(Ball, x2, y2, z+0.1, 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,1.2);
			MoveObject(Ball, x2, y2, z-0.8, 5);
		}
	}
    return 1;
}

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

Recommended Posts

  • 0

[21:56:32] [PAWN]: MAX_PLAYERS 500 
[21:56:32] Number of vehicle models: 101
[21:56:32] [debug] Run time error 4: "Array index out of bounds"
[21:56:32] [debug]  Attempted to read/write array element at index 999 in array of size 500
[21:56:32] [debug] AMX backtrace:
[21:56:32] [debug] #0 00051928 in public OnObjectMoved (13) from FiveGame_v1.1.4.amx

[21:56:32] [debug] Run time error 4: "Array index out of bounds"
[21:56:32] [debug]  Attempted to read/write array element at index 999 in array of size 500

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 9 ore, WopsS a spus:

Inseamna ca nu ai facut actualizare sau nu ai compilat gamemode-ul cu compiler-ul din fisierul in care e si gamemode-ul.

MULTUMESC AM REZOLVAT PROBLEMA [07:46:21] [PAWN]: MAX_PLAYERS 1000 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.