SA-MP Forums Archive
[FilterScript] Moving Ship - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Moving Ship (/showthread.php?tid=332505)

Pages: 1 2


Moving Ship - Faisal_khan - 08.04.2012

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:

MediaFire



Re: Moving Ship - Delete_ - 08.04.2012

Screens?


Re: Moving Ship - Knight_Rider - 08.04.2012

Any screens or video..!!??


Re: Moving Ship - ChickenKiller - 08.04.2012

Video or Screens please


Re: Moving Ship - Faisal_khan - 08.04.2012

Updated...


Re: Moving Ship - Knight_Rider - 08.04.2012

Its Nice


Re: Moving Ship - organe. - 08.04.2012

cool D


Re : Moving Ship - Vukilore - 08.04.2012

Cool bro


Re: Moving Ship - Deanx - 08.04.2012

Nice !


Re: Moving Ship - ChickenKiller - 08.04.2012

Is there a .amx and .pwn download? :P


Re: Moving Ship - Issam - 08.04.2012

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.


Re: Moving Ship - Faisal_khan - 09.04.2012

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


Re: Moving Ship - Phyrunx - 10.04.2012

Wow Awesome Dude Serioulsy Awesome Repped


Re: Moving Ship - Mamaca - 10.04.2012

good job


Re: Moving Ship - thefatshizms - 11.04.2012

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


Re: Moving Ship - Juninho_Oakley - 11.04.2012

Nice job


Re: Moving Ship - Faisal_khan - 11.04.2012

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.


Re: Moving Ship - Reeshan - 11.04.2012

nice ship


Re: Moving Ship - SublimESmokeR420 - 11.04.2012

That's pretty awesome man, never thought of that


Re: Moving Ship - Unknownich - 12.04.2012

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.