Making a 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Making a moving ship. (
/showthread.php?tid=310864)
Making a moving ship. -
nickdodd25 - 14.01.2012
So i have a queston about moveobject and using it to move a ship. I was just wondering if it was possible to take 6 objects....
PHP код:
shipa = CreateObject(9585, -1024.33, -282.61, 7.56, 0.00, 0.00, 97.62);
shipb = CreateObject(9586, -1023.86, -284.75, 17.64, 0.00, 0.00, 97.62);
shipc = CreateObject(9584, -1014.37, -356.68, 26.62, 0.00, 0.00, 97.62);
shipd = CreateObject(9590, -1025.17, -279.31, 9.25, 0.00, 0.00, 97.62);
shipe = CreateObject(9761, -1024.14, -283.73, 27.44, 0.00, 0.00, 97.62);
shipf = CreateObject(9698, -1014.68, -344.78, 29.51, 0.00, 0.00, 97.62);
...Them 6, and make it into one identifyer for the ease of making the ship move as a whole instead of making 6 seperate moveobject, cause at the moment its not working out too good. I made the ship in samp map editor so its close enough to perfect for me. I am new to scripting and at the moment using a premade moving ship script and using it to learn how to make my own.
And my other question is how would i make a constant route with the ship and no stops, i know how to use setobjectrot, but just wondering what i would have to do to make it keep going.
Thanks
Nick
Re: Making a moving ship. -
mineralo - 14.01.2012
I know how, you need use moveobject
https://sampwiki.blast.hk/wiki/MoveObject and enter the coordenates to where you want and make a timer if the object in that coordenates then move the ship in other place, if you give more information about your idea then I can help you out
Re: Making a moving ship. -
Outcast - 14.01.2012
pawn Код:
#define MAX_SHIP_OBJECTS 7 // 6+1
new shipobject[MAX_SHIP_OBJECTS];
shipobject[0] = CreateObject(9585, -1024.33, -282.61, 7.56, 0.00, 0.00, 97.62);
shipobject[1] = CreateObjec...
And to move the objects:
for(new i=0; i<MAX_SHIP_OBJECTS;i++)
{
MoveObject(shipobject[i], ...);
}