[FilterScript] Moving Ship
#1

Moving Ship
Hi guys this is my first Filterscript. Hope I get positive response. Have you guys ever thought of having a ship moving on its path in your gamemode? I made one. This idea was my brother’s, he helped me build the ship. Its just a simple filterscript in which we have a ship which moves on its path without disturbing others. It’s just moving no commands needed or no need to push it lol. Here we go with the explanation,
These are our ships route points which can be edited further as your wish:
pawn Код:
new Float:gShipRoutePoints[NUM_SHIP_ROUTE_POINTS][6] = {
{-1982.57, 2052.56, 0.00,   0.00, 0.00, 144.84},
{-2178.63, 2103.67, 0.00,   0.00, 0.00, 189.24},
{-2366.64, 2020.28, 0.00,   0.00, 0.00, 215.22},
{-2539.06, 1892.52, 0.00,   0.00, 0.00, 215.22},
{-2722.79, 1787.85, 0.00,   0.00, 0.00, 205.62},
{-2918.51, 1729.60, 0.00,   0.00, 0.00, 190.50},
{-3124.70, 1758.03, 0.00,   0.00, 0.00, 156.36},
{-3316.51, 1850.08, 0.00,   0.00, 0.00, 153.36},
{-3541.12, 1977.99, 0.00,   0.00, 0.00, 145.74},
{-3772.54, 2140.70, 0.00,   0.00, 0.00, 144.96},
{-4078.78, 2272.93, 0.00,   0.00, 0.00, 167.52},
{-4382.22, 2222.52, 0.00,   0.36, 0.06, 206.70},
{-4578.11, 2013.70, 0.00,   0.36, 0.54, 244.80},
{-4603.54, 1718.89, 0.00,   1.92, -0.36, 283.26},
{-4463.49, 1504.50, 0.00,   0.92, -0.36, 316.32},
{-4228.00, 1380.52, 0.00,   0.92, -0.36, 342.54},
{-3950.14, 1346.96, 0.00,   0.02, -0.06, 359.64},
{-3646.69, 1344.57, 0.00,   0.02, -0.06, 359.64},
{-3350.01, 1410.39, 0.00,   0.02, -0.06, 384.48},
{-2854.63, 1651.56, 0.00,   0.02, -0.06, 378.54},
{-2590.84, 1667.61, 0.00,   0.02, -0.06, 356.28},
{-2345.84, 1633.19, 0.00,   0.02, -0.06, 350.28},
{-2106.14, 1639.23, 0.00,   0.02, -0.06, 378.36},
{-1943.63, 1743.98, 0.00,   0.02, -0.06, 411.42},
{-1891.39, 1907.57, 0.00,   0.02, -0.06, 457.14}
};
This is our StartMovingTimer function:
pawn Код:
public StartMovingTimer()
{
    MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
                               gShipRoutePoints[gShipCurrentPoint][1],
                               gShipRoutePoints[gShipCurrentPoint][2],
                               SHIP_MOVE_SPEED / 3.0,
                               gShipRoutePoints[gShipCurrentPoint][3],
                               gShipRoutePoints[gShipCurrentPoint][4],
                               gShipRoutePoints[gShipCurrentPoint][5]);
}
Here you can edit the speed:
pawn Код:
SHIP_MOVE_SPEED / 3.0,
Change this value to any as your need here we have 3.0.
But don’t forget to change the speed here also:
pawn Код:
public OnObjectMoved(objectid)
{
    if(objectid != gMainShipObjectId) return 0;

    if(gShipCurrentPoint > 0 && !(gShipCurrentPoint % 5)) {
        // play some seagulls audio every 5 points
        PlaySoundForPlayersInRange(6200, 200.0, gShipRoutePoints[gShipCurrentPoint][0],
                        gShipRoutePoints[gShipCurrentPoint][1],
                        gShipRoutePoints[gShipCurrentPoint][2]);
    }

    gShipCurrentPoint++;

    if(gShipCurrentPoint == NUM_SHIP_ROUTE_POINTS) {
        gShipCurrentPoint = 0;

        MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
                               gShipRoutePoints[gShipCurrentPoint][1],
                               gShipRoutePoints[gShipCurrentPoint][2],
                               SHIP_MOVE_SPEED / 2.0,
                               gShipRoutePoints[gShipCurrentPoint][3],
                               gShipRoutePoints[gShipCurrentPoint][4],
                               gShipRoutePoints[gShipCurrentPoint][5]);
        return 1;
    }

    if(gShipCurrentPoint == 1) {
        SetTimer("StartMovingTimer",30*1000,0);
        return 1;
    }

    MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
                               gShipRoutePoints[gShipCurrentPoint][1],
                               gShipRoutePoints[gShipCurrentPoint][2],
                               SHIP_MOVE_SPEED,
                               gShipRoutePoints[gShipCurrentPoint][3],
                               gShipRoutePoints[gShipCurrentPoint][4],
                               gShipRoutePoints[gShipCurrentPoint][5]);

    return 1;
}
You will find this in the above code:
pawn Код:
SHIP_MOVE_SPEED / 2.0,
If you are testing this filterscript, I also added a teleport command which will teleport you to the ship,
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/tele", true))
    {
        SetPlayerPos(playerid,-2100, 2052.56, 0);
        return 1;
    }
    return 0;
}
PICTURES






Hope you all like it.
CREDITS:

Faisal_khan
Kye some things extracted from his FS
Ahemad Khan my brother who got the idea.
Pastebin Link:

Reply
#2

Screens?
Reply
#3

Any screens or video..!!??
Reply
#4

Video or Screens please
Reply
#5

Updated...
Reply
#6

Its Nice
Reply
#7

cool D
Reply
#8

Cool bro
Reply
#9

Nice !
Reply
#10

Is there a .amx and .pwn download? :P
Reply
#11

Quote:
Originally Posted by ChickenKiller
Посмотреть сообщение
Is there a .amx and .pwn download? :P
Copy the pastebin, onto a 'new' pawn, press the compile button, and it will work fine.

Quote:
Originally Posted by Deanx
Посмотреть сообщение
Nice !
You are just spamming, the same message on each filterscript thread.
Reply
#12

Thanks guys
Quote:
Originally Posted by ChickenKiller
Посмотреть сообщение
Is there a .amx and .pwn download? :P
no
Reply
#13

Wow Awesome Dude Serioulsy Awesome Repped
Reply
#14

good job
Reply
#15

faisal hi! can i edit it to make the army ship move? would that be possible?
Reply
#16

Nice job
Reply
#17

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
faisal hi! can i edit it to make the army ship move? would that be possible?
No the army ship is a permanent object it cannot be moved yeah but you can modify this one into an extreme army ship by adding roads, lift, etc..
Hope you got it.
Reply
#18

nice ship
Reply
#19

That's pretty awesome man, never thought of that
Reply
#20

I dont wanna be rude but why should someone download this script when original script by Kye is much better. You added teleport to the ship but what if ship isnt on that position?! If you edit some1s script make it better.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)