SA-MP Forums Archive
shuttle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: shuttle (/showthread.php?tid=430070)



shuttle - absolute - 12.04.2013

hey guys. i'm trying to script a shuttle for my server using moving objects with createdynamicobject .
i scripted this but when i test it in game , nothing happens it just shows the game text .
anyone knows how to fix it?

pawn Код:
new rlaunch1;
new rlaunch2;
new rlaunch3;
new rlaunch4;
new rlaunch5;
new rlaunchearth;
forward rlaunchtimer();

public OnGameModeInit()
{
    CreateDynamicObject(3673,230.8999939,1990.4000244,39.7999992,0.0000000,0.0000000,179.9945068, -1, -1, -1, 300); //object(laxrf_refinerybase) (1)
    rlaunch1 = CreateDynamicObject(3585,231.8000031,2000.0999756,31.1000004,0.0000000,90.0000000,0.0000000, -1, -1, -1, 300); //object(lastran1_la02) (2)
    rlaunch2 = CreateDynamicObject(3585,231.8999939,2000.0999756,39.2000008,0.0000000,90.0000000,0.0000000, -1, -1, -1, 300); //object(lastran1_la02) (3)
    rlaunch3 = CreateDynamicObject(3258,229.1999969,1999.3000488,54.9000015,359.2500000,180.0000000,180.0000000, -1, -1, -1, 300); //object(refthinchim1) (2)
    rlaunch4 = CreateDynamicObject(3258,235.3000031,1999.3000488,54.9000015,359.2474365,179.9945068,179.9945068, -1, -1, -1, 300); //object(refthinchim1) (3)
    rlaunch5 = CreateDynamicObject(3585,231.8999939,2000.0999756,47.2999992,0.0000000,90.0000000,0.0000000, -1, -1, -1, 300); //object(lastran1_la02) (4)
return 1;
}


    CMD:launch(playerid, params[])
    {
        SetTimer("rlaunchtimer",10000,0);
        GameTextForPlayer(playerid, "Shuttle will lift next 20 seconds", 3000, 5);
    }

public rlaunchtimer()
{
    if(rlaunchearth == 0)
    {
        SetObjectPos(rlaunch1, 231.8000031,2000.0999756,31.1000004);
        SetObjectPos(rlaunch2, 231.8999939,2000.0999756,39.2000008);
        SetObjectPos(rlaunch3, 229.1999969,1999.3000488,54.9000015);
        SetObjectPos(rlaunch4, 235.3000031,1999.3000488,54.9000015);
        SetObjectPos(rlaunch5, 231.8999939,2000.0999756,47.2999992);
        SetObjectRot(rlaunch1, 0.0000000,90.0000000,0.0000000 );
        SetObjectRot(rlaunch2, 0.0000000,90.0000000,0.0000000 );
        SetObjectRot(rlaunch3, 359.2500000,180.0000000,180.0000000 );
        SetObjectRot(rlaunch4, 359.2474365,179.9945068,179.9945068 );
        SetObjectRot(rlaunch5, 0.0000000,90.0000000,0.0000000 );
        MoveObject(rlaunch1, 231.89999389648, 2000.0999756, 31.1000004, 100);
        MoveObject(rlaunch2, 231.89999389648, 2000.0999756, 39.2000008, 100);
        MoveObject(rlaunch3, 231.89999389648, 1999.3000488,54.9000015, 100);
        MoveObject(rlaunch4, 231.89999389648, 1999.3000488, 54.9000015, 100);
        MoveObject(rlaunch5, 231.89999389648, 2000.0999756, 47.2999992, 100);
     }
    if(rlaunchearth == 1)
    {
        MoveObject(rlaunch1, 231.89999389648, 2000.0999756, 31.1000004, 100);
        MoveObject(rlaunch2, 231.89999389648, 2000.0999756, 39.2000008, 100);
        MoveObject(rlaunch3, 231.89999389648, 1999.3000488,54.9000015, 100);
        MoveObject(rlaunch4, 231.89999389648, 1999.3000488, 54.9000015, 100);
        MoveObject(rlaunch5, 231.89999389648, 2000.0999756, 47.2999992, 100);
    }
}



Re: shuttle - Jstylezzz - 12.04.2013

CreateDynamicObject
MoveObject

Does that say enough?
If you create your objects dynamically, move them dynamically.
MoveDynamicObject(.....);


Re: shuttle - absolute - 12.04.2013

oh im so stupid
thanks bro .
but the objects still don't move
before i enter the cmd its like this pic :


but when i enter the cmd , after a few secs it gets like this :



Re: shuttle - Jstylezzz - 12.04.2013

pawn Код:
CMD:launch(playerid, params[])
    {
        SetTimer("rlaunchtimer",10000,0);
        GameTextForPlayer(playerid, "Shuttle will lift next 20 seconds", 3000, 5);
    }
Always, when making commands, make sure that there is return 1; at the end.
So, it will be like this
pawn Код:
CMD:launch(playerid, params[])
    {
        SetTimer("rlaunchtimer",10000,0);
        GameTextForPlayer(playerid, "Shuttle will lift next 20 seconds", 3000, 5);
        return 1;
    }



Re: shuttle - absolute - 12.04.2013

oh i noticed that a few minutes you post . but the problem weren't from the return ,
i still have that problem . i tried to change the speed to the low one . i saw those 2 tall things going in those box objects slowly


Re: shuttle - absolute - 12.04.2013

i fixed some lil things , but it doesn't even move anymore :/ please someone help :/
pawn Код:
new rlaunch1;
new rlaunch2;
new rlaunch3;
new rlaunch4;
new rlaunch5;
new rlaunchearth;
forward rlaunchtimer();

public OnGameModeInit()
{
    CreateDynamicObject(3673,230.8999939,1990.4000244,39.7999992,0.0000000,0.0000000,179.9945068, -1, -1, -1, 300); //object(laxrf_refinerybase) (1)
    rlaunch1 = CreateDynamicObject(3585,231.8000031,2000.0999756,31.1000004,0.0000000,90.0000000,0.0000000, -1, -1, -1, 300); //object(lastran1_la02) (2)
    rlaunch2 = CreateDynamicObject(3585,231.8999939,2000.0999756,39.2000008,0.0000000,90.0000000,0.0000000, -1, -1, -1, 300); //object(lastran1_la02) (3)
    rlaunch3 = CreateDynamicObject(3258,229.1999969,1999.3000488,54.9000015,359.2500000,180.0000000,180.0000000, -1, -1, -1, 300); //object(refthinchim1) (2)
    rlaunch4 = CreateDynamicObject(3258,235.3000031,1999.3000488,54.9000015,359.2474365,179.9945068,179.9945068, -1, -1, -1, 300); //object(refthinchim1) (3)
    rlaunch5 = CreateDynamicObject(3585,231.8999939,2000.0999756,47.2999992,0.0000000,90.0000000,0.0000000, -1, -1, -1, 300); //object(lastran1_la02) (4)
return 1;
}


    CMD:launch(playerid, params[])
    {
        SetTimer("rlaunchtimer",10000,0);
        GameTextForPlayer(playerid, "Shuttle will lift next 20 seconds", 3000, 5);
        return 1;
    }

public rlaunchtimer()
{
    if(rlaunchearth == 0)
    {
        SetDynamicObjectPos(rlaunch1, 231.8000031,2000.0999756,31.1000004);
        SetDynamicObjectPos(rlaunch2, 231.8999939,2000.0999756,39.2000008);
        SetDynamicObjectPos(rlaunch3, 229.1999969,1999.3000488,54.9000015);
        SetDynamicObjectPos(rlaunch4, 235.3000031,1999.3000488,54.9000015);
        SetDynamicObjectPos(rlaunch5, 231.8999939,2000.0999756,47.2999992);
        SetDynamicObjectRot(rlaunch1, 0.0000000,90.0000000,0.0000000 );
        SetDynamicObjectRot(rlaunch2, 0.0000000,90.0000000,0.0000000 );
        SetDynamicObjectRot(rlaunch3, 359.2500000,180.0000000,180.0000000 );
        SetDynamicObjectRot(rlaunch4, 359.2474365,179.9945068,179.9945068 );
        SetDynamicObjectRot(rlaunch5, 0.0000000,90.0000000,0.0000000 );
        MoveDynamicObject(rlaunch1, 231.8000031, 2000.0999755859, 31.1000004, 50.0);
        MoveDynamicObject(rlaunch2, 231.8999939, 2000.0999755859, 39.2000008, 50.0);
        MoveDynamicObject(rlaunch3, 229.1999969, 1999.3000487859,54.9000015, 50.0);
        MoveDynamicObject(rlaunch4, 235.3000031, 1999.3000487859, 54.9000015, 50.0);
        MoveDynamicObject(rlaunch5, 231.8999939, 2000.0999755859, 47.2999992, 50.0);
     }
    if(rlaunchearth == 1)
    {
        MoveDynamicObject(rlaunch1, 231.8000031, 2000.0999755859, 31.1000004, 50.0);
        MoveDynamicObject(rlaunch2, 231.8999939, 2000.0999755859, 39.2000008, 50.0);
        MoveDynamicObject(rlaunch3, 229.1999969, 1999.3000487859,54.9000015, 50.0);
        MoveDynamicObject(rlaunch4, 235.3000031, 1999.3000487859, 54.9000015, 50.0);
        MoveDynamicObject(rlaunch5, 231.8999939, 2000.0999755859, 47.2999992, 50.0);
    }
}



Re: shuttle - Jstylezzz - 12.04.2013

I don't get this part
pawn Код:
SetDynamicObjectPos(rlaunch1, 231.8000031,2000.0999756,31.1000004);
        SetDynamicObjectPos(rlaunch2, 231.8999939,2000.0999756,39.2000008);
        SetDynamicObjectPos(rlaunch3, 229.1999969,1999.3000488,54.9000015);
        SetDynamicObjectPos(rlaunch4, 235.3000031,1999.3000488,54.9000015);
        SetDynamicObjectPos(rlaunch5, 231.8999939,2000.0999756,47.2999992);
        SetDynamicObjectRot(rlaunch1, 0.0000000,90.0000000,0.0000000 );
        SetDynamicObjectRot(rlaunch2, 0.0000000,90.0000000,0.0000000 );
        SetDynamicObjectRot(rlaunch3, 359.2500000,180.0000000,180.0000000 );
        SetDynamicObjectRot(rlaunch4, 359.2474365,179.9945068,179.9945068 );
        SetDynamicObjectRot(rlaunch5, 0.0000000,90.0000000,0.0000000 );
Why do you set the pos, and then move it?


Re: shuttle - absolute - 12.04.2013

well when shuttle goes up , it wont come back, so i set the object pos to the first pos . and other players can use it again


Re: shuttle - absolute - 13.04.2013

any help?


Re: shuttle - absolute - 13.04.2013

BUMP