TheNightRider Posted December 31, 2011 Share Posted December 31, 2011 Hi am trying to attach a minigun to a hydra am just wondering how would it be possible. The other thing is ive made a script which creates a hydra and a platform the platform does move an the hydra with it as 1 element. However I want the script to deattach after the platform as stopped moving. platform = createObject ( 3115,-1807.3857421875, 558.2412109375, 58.630416870117) Hydra = createVehicle (520, -1806.5009765625, 559.37109375, 60.620552062988, 0, 0, 300.44860839844) weapon = createObject( 362, 0,0,0) addEventHandler ( "onResourceStart", getRootElement(), onstartup ) addEvent ( "hit", true ) function hit ( pla, dim, hitElement ) if getElementType ( pla ) ~= "player" then if vehicle or not vehicle then aclGroupListACL ( aclgroup, Admin ) if isObjectInACLGroup ( "user."..getPlayerName(pla), aclGetGroup ( "Admin" ) ) then attachElements(Hydra, weapon, 0, 0, 4) attachElements(Hydra, platform, 0, 0, 2) moveObject (platform, 30000, -1807.3857421875, 558.2414109375, 233.22088623047) else outputChatBox ( "you don't have permisson to enter", pla, 255, 0, 0 ) end local vehicle = getPedOccupiedVehicle ( pla ) if vehicle then detachElements (Hydra, platform, 0, 0, 2 ) else return 0 end end end end addEventHandler ( "onColShapeHit", g_base_col, hit) addEventHandler ( "hit", g_root, hit) Link to comment
Castillo Posted December 31, 2011 Share Posted December 31, 2011 You can attach the object of the minigun, but you can't make it shoot like a real weapon. Link to comment
TheNightRider Posted December 31, 2011 Author Share Posted December 31, 2011 Okay so how could it be done? Link to comment
DiSaMe Posted December 31, 2011 Share Posted December 31, 2011 You can attach the object of the minigun, but you can't make it shoot like a real weapon. But you can use processLineOfSight to check if there's a vehicle or player in front of the object, decrease their health and draw a line using dxDrawLine3D. Link to comment
TheNightRider Posted December 31, 2011 Author Share Posted December 31, 2011 okay I understand shame cannot use a minigun and fire the rounds as it would normally Link to comment
arezu Posted December 31, 2011 Share Posted December 31, 2011 Dont listen to these guys, because it is possible by attaching that flying rc (whatever its called) to your vehicle and use setElementSyncer (or create a ped and control the peds keyState). you can attach it at the same position as the minigun and change alpha on the rc to 0. Link to comment
TheNightRider Posted December 31, 2011 Author Share Posted December 31, 2011 sure mate but i only want a minigun i did think of creating a ghost ped and give the ped a mini gun then it would be controlling that ped. Link to comment
Castillo Posted December 31, 2011 Share Posted December 31, 2011 arezu, it's not possible to attach a weapon to a vehicle, but yes a vehicle. P.S: The RC doesn't has as much firepower as the minigun, does it? Link to comment
karlis Posted December 31, 2011 Share Posted December 31, 2011 as azeru said create ped that has infinite minigun, bind your keys to change peds fire key state, attach to hydra, set you as syncer, set his alpha to 0, and attach minigun object to same position.make ped uncollidable with hydra, object, and probably even world. only thing that could cause it not to work is peds not shooting when on ground. and solidsnake, it doesnt have that much power, but it has ~45degree autolock that is surely needed for hydra. Link to comment
TheNightRider Posted December 31, 2011 Author Share Posted December 31, 2011 as azeru said create ped that has infinite minigun, bind your keys to change peds fire key state, attach to hydra, set you as syncer, set his alpha to 0, and attach minigun object to same position.make ped uncollidable with hydra, object, and probably even world.only thing that could cause it not to work is peds not shooting when on ground. and solidsnake, it doesnt have that much power, but it has ~45degree autolock that is surely needed for hydra. That's so funny what he wrote about how do you set timer to 5 mins lol answer is within the question lol Link to comment
karlis Posted December 31, 2011 Share Posted December 31, 2011 who wrote? EDIT: nvm, its my signature, its not on the topic. Link to comment
arezu Posted January 1, 2012 Share Posted January 1, 2012 as azeru said create ped that has infinite minigun, bind your keys to change peds fire key state, attach to hydra, set you as syncer, set his alpha to 0, and attach minigun object to same position.make ped uncollidable with hydra, object, and probably even world.only thing that could cause it not to work is peds not shooting when on ground. and solidsnake, it doesnt have that much power, but it has ~45degree autolock that is surely needed for hydra. creating a ped and attaching it to the vehicle and then firing with its weapon is a bad idea, it wont work because of a mta or gta bug where the bullets go in the opposite direction downwards of the vehicle velocity (if you try to shoot forward, you will shoot your own vehicle) creating a few rc's (or a hunter) and then attach it at the same position as a minigun object and then setElementSyncer would be best. (i have tried all these before, and this idea worked the best) Link to comment
karlis Posted January 1, 2012 Share Posted January 1, 2012 or, as crystal said, stop hacking, do some matrix math, dxDrawLine3D, few fx effects, and processlineofsight for hit and/or damage effect. Link to comment
TheNightRider Posted January 1, 2012 Author Share Posted January 1, 2012 I would not advise anyone to attach a hunter to a hydra and hide the hunter by setting its alpha to 0 or something. It would come with its own problems. It would be a lot better to attach a RC instead even though as Castillo rightly said their fire power isn't as good as a mini-gun. I am thought of a much better idea, using the use of drawline or whatever to create a laser effect and set vehicle to blow when the line hits it. It could be done so the vehicle does not blow straight away so in other words use some type of time duration of the line hitting the target would probably do the trick. Could also set a timer so the laser pulses along with some sort of laser sound effect would do the trick i guess. I have not looked into it much as of yet but am sure its possible. It is a real shame MTA doesn't support attaching Ped weapons to vehicles if it did it would be more practictical and would by a perhaps would be better in performance Link to comment
karlis Posted January 1, 2012 Share Posted January 1, 2012 problem that weapon is not even a element, its just ped extension. And i don't think weapon attaching would be needed so much, you can make it as good without too much effort, especially when you now can get weapon properties. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now