Jump to content

Aircraft Carrier


kev|GER

Recommended Posts

Posted

Hello everyone,

First, I've searched and searched looking for it and didn't found it. I need a script of some working Aircraft Carrier.

I'm a noob at scripting, and I'm trying to learn it. Ofc, as all other guys, I prefer ask for the script instead of try make one. But I can give it a try.

I need the script for a public server I'm trying to create. I've played in other server and I saw that they, somehow, created it.

I downloaded a resource in mta page, but just can't get it working and, for what I read, it's not that good.

So, if possible, give me a link or something for I download.

I can give a try and script it, but I just don't know what functions and other things I must use and learn.

Till now, I've created a GUI (which is the way I wanna control it) whit GUI Creator resource. After that, don't know what's next. I know I must create the objects, but don't know how move them all together, and how to put it being controlled by GUI.

Sorry for my bad English. Thanks.

Posted

Ye, that was the one I tried, but just can't put it working. And in comments people are complaining a bit about it, so don't think it really works well.

Posted
Make a carrier is easy, seriosly, make the map.

get the id of the elevator, then "moveObject"

i will search if i still have my one, if i still have i will give it to you :DD

Thanks for reply mate. I know how to do that, but I want a drivable carrier, not just the elevator.

Posted
Make a carrier is easy, seriosly, make the map.

get the id of the elevator, then "moveObject"

i will search if i still have my one, if i still have i will give it to you :DD

Thanks for reply mate. I know how to do that, but I want a drivable carrier, not just the elevator.

Just attach the carrier to a boat :D

Posted

Can u please explain me how to do that? And what after that? How I move the carrier up and down, to right and left ? And how I can, after have the functions done, "redirect" them to the gui that I've created?

Thanks for reply.

Posted

Okay, I got the attachment thingy. Now I'd like to do something like

moveCarrierForward = moveObjectToTarget ( nameOfObject, numberOfPixelsUp, NumberOfPixelsDown, left right and rotations etc.)

I can't find the command. I know the moveObject one but it will fail I think cause it moves the a location given, I dont wanna that. Then, I wont do it by GUI. I want to do something like

addCommandHandler ( "carrierforward, moveCarrierForward )

and all the other commands.

So, what I need to know it's what are the commands to do it. Thanks a lot.

Btw, if possible, after I've the script finished if some1 can help me putting it into a GUI,cuz whit commands it takes more time and stuff.

Script atm:

partofcarrier1 = createObject ( 10771, 2014.1197509766, 3017.8559570313, 9.375, 0, 0, 0 ) 
partofcarrier2 = createObject ( 11145, 1951.1853027344, 3017.8220214844, 8.2094535827637, 0, 0, 0 )
partofcarrier3 = createObject ( 11146, 2005.0550537109, 3018.4548339844, 16.224634170532, 0, 0, 0 )
partofcarrier4 = createObject ( 3884, 2072.220703125, 3010.1181640625, 22.22149848938, 0, 0,0 )
partofcarrier5 = createObject ( 3885, 2072.37890625, 3009.3210449219, 21.750085830688, 0, 0,0 )
partofcarrier6 = createObject ( 10772, 2015.9813232422, 3018.1411132813, 20.938188552856, 0, 0, 0 )
partofcarrier7 = createObject ( 11149, 2008.0537109375, 3012.9792480469, 15.536260604858, 0, 0, 0 )
partofcarrier7 = createObject ( 10770, 2017.3670654297, 3010.7241210938, 42.518768310547, 0, 0, 0 )
partofcarrier8 = createObject ( 3115, 1915.5963134766, 3017.947265625, 13.7763671875, 0, 0, 0 )
 
-- Atachement of the Objects
 
attachElement ( partofcarrier1, partofcarrier2, 0, 0, 0 )
attachElement ( partofcarrier2, partofcarrier3, 0, 0, 0 )
attachElement ( partofcarrier3, partofcarrier4, 0, 0, 0 )
attachElement ( partofcarrier4, partofcarrier5, 0, 0, 0 )
attachElement ( partofcarrier5, partofcarrier6, 0, 0, 0 )
attachElement ( partofcarrier6, partofcarrier7, 0, 0, 0 )
attachElement ( partofcarrier7, partofcarrier8, 0, 0, 0 )

  • Discord Moderators
Posted

If you expect your hangar to only go forwards you could use timers with moveObject, so that everytime the point has been reached, a new one is set according to ships rotation etc..

I've played in other server and I saw that they, somehow, created it.

We have special vehicles in DKR you can control, hot air balloons, rockets and hangar ships, did you see it there?

Cause I am pretty sure we attach hangar objects to an invisible tropic by command.

Posted
If you expect your hangar to only go forwards you could use timers with moveObject, so that everytime the point has been reached, a new one is set according to ships rotation etc..
I've played in other server and I saw that they, somehow, created it.

We have special vehicles in DKR you can control, hot air balloons, rockets and hangar ships, did you see it there?

Cause I am pretty sure we attach hangar objects to an invisible tropic by command.

I didn't seen it there. But I'll try play there and see how it is.

Can u release the scripts ? Or give me the short part about that timer and the way it will know the ships rotation etc. I'd be really appreciate.

Posted

So, I tried attach the boat to the carrier and when I droved the boat, the ship didn't move.

HEres the script

tropic = createVehicle ( 454, 2120.2375488281, 3017.9653320313, 0, 0, 0, 268.5 )
partofcarrier1 = createObject ( 10771, 2014.1197509766, 3017.8559570313, 9.375, 0, 0, 0 ) 
partofcarrier2 = createObject ( 11145, 1951.1853027344, 3017.8220214844, 8.2094535827637, 0, 0, 0 )
partofcarrier3 = createObject ( 11146, 2005.0550537109, 3018.4548339844, 16.224634170532, 0, 0, 0 )
partofcarrier4 = createObject ( 3884, 2072.220703125, 3010.1181640625, 22.22149848938, 0, 0,0 )
partofcarrier5 = createObject ( 3885, 2072.37890625, 3009.3210449219, 21.750085830688, 0, 0,0 )
partofcarrier6 = createObject ( 10772, 2015.9813232422, 3018.1411132813, 20.938188552856, 0, 0, 0 )
partofcarrier7 = createObject ( 11149, 2008.0537109375, 3012.9792480469, 15.536260604858, 0, 0, 0 )
partofcarrier7 = createObject ( 10770, 2017.3670654297, 3010.7241210938, 42.518768310547, 0, 0, 0 )
partofcarrier8 = createObject ( 3115, 1915.5963134766, 3017.947265625, 13.7763671875, 0, 0, 0 )
 
-- Atachement of the Objects
 
attachElement ( tropic, partofcarrier1, 0, 0, 0 ) 
attachElement ( partofcarrier1, partofcarrier2, 0, 0, 0 )
attachElement ( partofcarrier2, partofcarrier3, 0, 0, 0 )
attachElement ( partofcarrier3, partofcarrier4, 0, 0, 0 )
attachElement ( partofcarrier4, partofcarrier5, 0, 0, 0 )
attachElement ( partofcarrier5, partofcarrier6, 0, 0, 0 )
attachElement ( partofcarrier6, partofcarrier7, 0, 0, 0 )
attachElement ( partofcarrier7, partofcarrier8, 0, 0, 0 )

Posted

You must have misread attachElements documentation. I'm pretty sure, first parameter is the object that you are attaching and second parameter is the element that other element (1st param) is being attached to.

Posted
You must have misread attachElements documentation. I'm pretty sure, first parameter is the object that you are attaching and second parameter is the element that other element (1st param) is being attached to.

So? It's right. I attachel the element one whit the other element.

Posted
So, I tried attach the boat to the carrier and when I droved the boat, the ship didn't move.

HEres the script

tropic = createVehicle ( 454, 2120.2375488281, 3017.9653320313, 0, 0, 0, 268.5 )
partofcarrier1 = createObject ( 10771, 2014.1197509766, 3017.8559570313, 9.375, 0, 0, 0 ) 
partofcarrier2 = createObject ( 11145, 1951.1853027344, 3017.8220214844, 8.2094535827637, 0, 0, 0 )
partofcarrier3 = createObject ( 11146, 2005.0550537109, 3018.4548339844, 16.224634170532, 0, 0, 0 )
partofcarrier4 = createObject ( 3884, 2072.220703125, 3010.1181640625, 22.22149848938, 0, 0,0 )
partofcarrier5 = createObject ( 3885, 2072.37890625, 3009.3210449219, 21.750085830688, 0, 0,0 )
partofcarrier6 = createObject ( 10772, 2015.9813232422, 3018.1411132813, 20.938188552856, 0, 0, 0 )
partofcarrier7 = createObject ( 11149, 2008.0537109375, 3012.9792480469, 15.536260604858, 0, 0, 0 )
partofcarrier7 = createObject ( 10770, 2017.3670654297, 3010.7241210938, 42.518768310547, 0, 0, 0 )
partofcarrier8 = createObject ( 3115, 1915.5963134766, 3017.947265625, 13.7763671875, 0, 0, 0 )
 
-- Atachement of the Objects
 
attachElement ( tropic, partofcarrier1, 0, 0, 0 ) 
attachElement ( partofcarrier1, partofcarrier2, 0, 0, 0 )
attachElement ( partofcarrier2, partofcarrier3, 0, 0, 0 )
attachElement ( partofcarrier3, partofcarrier4, 0, 0, 0 )
attachElement ( partofcarrier4, partofcarrier5, 0, 0, 0 )
attachElement ( partofcarrier5, partofcarrier6, 0, 0, 0 )
attachElement ( partofcarrier6, partofcarrier7, 0, 0, 0 )
attachElement ( partofcarrier7, partofcarrier8, 0, 0, 0 )

You must have misread attachElements documentation. I'm pretty sure, first parameter is the object that you are attaching and second parameter is the element that other element (1st param) is being attached to.

So? It's right. I attachel the element one whit the other element.

Well, first, try to find attachElement on wiki I can't find such function. Then look at attachElements wiki page. It's not right... Read your code and wiki carefully. Check your 1st attachElement call and wiki.

  • 1 year later...
  • Moderators
Posted (edited)

can't you better attach all objects to the boad?

instead of attach them to each other?

Edited by Guest
Posted

ive made it, here

type /acc to enter and drive it, ill add weapons soon.

function carrier(player) 
    boat = createVehicle ( 453, 2120.2375488281, 3017.9653320313, 0, 0, 0, 90) 
    hull = createObject ( 10771, 2014.1197509766, 3017.8559570313, 5.375, 0, 0, 0 )  
    lowdeck = createObject ( 11145, 1951.1853027344, 3017.8220214844, 4.2094535827637, 0, 0, 0 ) 
    hangar = createObject ( 11146, 2005.0550537109, 3018.4548339844, 12.224634170532, 0, 0, 0 ) 
    samsite = createObject ( 3884, 2072.220703125, 3010.1181640625, 18.22149848938, 0, 0,0 ) 
    sambase = createObject ( 3885, 2072.37890625, 3009.3210449219, 17.750085830688, 0, 0,0 ) 
    lines = createObject ( 10772, 2015.9813232422, 3018.1411132813, 17.16, 0, 0, 0 ) 
    accorridors = createObject ( 11149, 2008.0537109375, 3012.9792480469, 11.536260604858, 0, 0, 0 ) 
    bridge = createObject ( 10770, 2017.3670654297, 3010.7241210938, 38.518768310547, 0, 0, 0 ) 
    lift1 = createObject ( 3115, 1915.5963134766, 3017.947265625, 9.7763671875, 0, 0, 0 ) 
     
    attachElements(hull, boat, 0, 0, 5.375, 0, 0, 90) --done 
    attachElements(lowdeck, boat, 0, -63, 4.2094535827637, 0, 0, 90) --done 
    attachElements(hangar, boat, -0.6, -9, 12.224634170532, 0, 0, 90) --done 
    attachElements(samsite, boat, 7, 45, 17.5, 0, 0, 90) 
    attachElements(sambase, boat, 7, 45, 17.750085830688, 0, 0, 90) 
    attachElements(lines, boat, 0.1, 1.4, 17.16, 0, 0, 90) -- done 
    attachElements(accorridors, boat, 5.1, -6, 11.8, 0, 0, 90) -- done 
    attachElements(bridge, boat, 7.5, 3.3, 38.518768310547, 0, 0, 90) --done 
    attachElements(lift1, boat, 0, -99, 16.8, 0, 0, 90) --done 
     
    warpPedIntoVehicle(player, boat) 
end 
addCommandHandler("acc", carrier) 

Still to do is add guns (i think i can do this), a marker to enter it form the deck (imnot good with client side so can someone help me here), vehicle spawns, new handling for boat and sinking. To make it sink ill make it change the boat to a car if it takes enough damage.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...