Bug with Moving Objects
#1

Hey. Today I got the idea to do parkour zone with moving objects. After I wrote the script the first test showed a very sad bug (not of mine).

Just watch the video:
[ame]www.youtube.com/watch?v=B35PLhVBxts[/ame]

I am very upset that I had spent time in vain and I hope that this will be fixed...

Code of objects from the video:
pawn Код:
new ParkourObjects[10], bool:ParkourObjMoved[10];

public OnGameModeInit()
{
    ParkourObjects[0] = CreateObject(2633, 1743.3, -2997.2, 28.4, 0.0, 0.0, 90.0); //Start
    ParkourObjects[1] = CreateObject(1698, 1748.1, -2997.2, 30.0, 0.0, 0.0, 0.0); //Step 1
    ParkourObjects[2] = CreateObject(1698, 1751.3, -3001.6, 30.5, 0.0, 0.0, 0.0); //Step 2
    MoveObject(ParkourObjects[2], 1751.3, -2992.9, 30.5, 1.5);
    ParkourObjects[3] = CreateObject(1698, 1754.8, -2992.9, 32.3, 0.0, 0.0, 0.0); //Step 3
    MoveObject(ParkourObjects[3], 1754.8, -3001.6, 32.3, 3.0);
    ParkourObjects[4] = CreateObject(1698, 1759.0, -2995.5, 35.7, 0.0, 0.0, 0.0); //Step 4
    MoveObject(ParkourObjects[4], 1759.0, -2989.9, 35.7, 4.5);
    ParkourObjects[5] = CreateObject(1698, 1759.0, -2998.9, 35.7, 0.0, 0.0, 0.0); //Step 4
    MoveObject(ParkourObjects[5], 1759.0, -3004.6, 35.7, 4.5);
    ParkourObjects[6] = CreateObject(1698, 1763.5, -2993.8, 39.7, 0.0, 0.0, 0.0); //Step 5
    MoveObject(ParkourObjects[6], 1763.5, -2986.8, 39.7, 7.0);
    ParkourObjects[7] = CreateObject(1698, 1763.5, -2997.2, 39.7, 0.0, 0.0, 0.0); //Step 5
    MoveObject(ParkourObjects[7], 1766.2, -2997.2, 39.7, 1.5);
    ParkourObjects[8] = CreateObject(1698, 1763.5, -3006.6, 39.7, 0.0, 0.0, 0.0); //Step 5
    MoveObject(ParkourObjects[8], 1763.5, -3000.6, 39.7, 7.0);
    ParkourObjects[9] = CreateObject(8572, 1769.8, -2997.2, 42.1, 0.0, 0.0, 0.0); //Finish
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/parkour", cmdtext, true)) return cmd_parkour(playerid);
    return 0;
}

forward cmd_parkour(playerid);
public cmd_parkour(playerid)
{
    SetPlayerPos(playerid, 1742.9774, -2997.2134, 31.5258);
    SetPlayerFacingAngle(playerid, 270.0);
    return 1;
}

public OnObjectMoved(objectid)
{
    if(objectid == ParkourObjects[2])
    {
        if(ParkourObjMoved[2])
        {
            ParkourObjMoved[2] = false;
            MoveObject(ParkourObjects[2], 1751.3, -2992.9, 30.5, 1.5);
        }
        else
        {
            ParkourObjMoved[2] = true;
            MoveObject(ParkourObjects[2], 1751.3, -3001.6, 30.5, 1.5);
        }
    }
    else if(objectid == ParkourObjects[3])
    {
        if(ParkourObjMoved[3])
        {
            ParkourObjMoved[3] = false;
            MoveObject(ParkourObjects[3], 1754.8, -3001.6, 32.3, 3.0);
        }
        else
        {
            ParkourObjMoved[3] = true;
            MoveObject(ParkourObjects[3], 1754.8, -2992.9, 32.3, 3.0);
        }
    }
    else if(objectid == ParkourObjects[4])
    {
        if(ParkourObjMoved[4])
        {
            ParkourObjMoved[4] = false;
            MoveObject(ParkourObjects[4], 1759.0, -2989.9, 35.7, 4.5);
        }
        else
        {
            ParkourObjMoved[4] = true;
            MoveObject(ParkourObjects[4], 1759.0, -2995.5, 35.7, 4.5);
        }
    }
    else if(objectid == ParkourObjects[5])
    {
        if(ParkourObjMoved[5])
        {
            ParkourObjMoved[5] = false;
            MoveObject(ParkourObjects[5], 1759.0, -3004.6, 35.7, 4.5);
        }
        else
        {
            ParkourObjMoved[5] = true;
            MoveObject(ParkourObjects[5], 1759.0, -2998.9, 35.7, 4.5);
        }
    }
    else if(objectid == ParkourObjects[6])
    {
        if(ParkourObjMoved[6])
        {
            ParkourObjMoved[6] = false;
            MoveObject(ParkourObjects[6], 1763.5, -2986.8, 39.7, 7.0);
        }
        else
        {
            ParkourObjMoved[6] = true;
            MoveObject(ParkourObjects[6], 1763.5, -2993.8, 39.7, 7.0);
        }
    }
    else if(objectid == ParkourObjects[7])
    {
        if(ParkourObjMoved[7])
        {
            ParkourObjMoved[7] = false;
            MoveObject(ParkourObjects[7], 1766.2, -2997.2, 39.7, 1.5);
        }
        else
        {
            ParkourObjMoved[7] = true;
            MoveObject(ParkourObjects[7], 1763.5, -2997.2, 39.7, 1.5);
        }
    }
    else if(objectid == ParkourObjects[8])
    {
        if(ParkourObjMoved[8])
        {
            ParkourObjMoved[8] = false;
            MoveObject(ParkourObjects[8], 1763.5, -3000.6, 39.7, 7.0);
        }
        else
        {
            ParkourObjMoved[8] = true;
            MoveObject(ParkourObjects[8], 1763.5, -3006.6, 39.7, 7.0);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Bug with Moving Objects - by OstGot - 16.02.2016, 13:59
Re: Bug with Moving Objects - by Crayder - 16.02.2016, 16:11
Re: Bug with Moving Objects - by Sew_Sumi - 16.02.2016, 22:07
Re: Bug with Moving Objects - by Crayder - 17.02.2016, 05:04
Re: Bug with Moving Objects - by Sew_Sumi - 17.02.2016, 06:29
Re: Bug with Moving Objects - by Crayder - 17.02.2016, 11:34
Re: Bug with Moving Objects - by NaS - 21.02.2016, 02:10

Forum Jump:


Users browsing this thread: 1 Guest(s)