tomaker Posted May 2, 2015 Posted May 2, 2015 Hi i want to make a Minigun on Vehicle look like it : what function i need to use ?
Enargy, Posted May 2, 2015 Posted May 2, 2015 use createObject createWeapon setWeaponState triggerServerEvent/triggerClientEvent attachElements onClientPreRender setElementRotation
tomaker Posted May 3, 2015 Author Posted May 3, 2015 Oh thanks. And can u help how to write it ? Because i don't have any idea how to start
xXMADEXx Posted May 3, 2015 Posted May 3, 2015 Oh thanks. And can u help how to write it ? Because i don't have any idea how to start Honestly, if you're a first-time scripter, this script wouldn't be a good one to start with. You would definitely have to know what you're doing to make it.
TioTiago Posted May 3, 2015 Posted May 3, 2015 Oh thanks. And can u help how to write it ? Because i don't have any idea how to start First choice objects as a minigun and support then create attachs to stay in the car and sequence as createWeapon ... Continue: press the 1 button inside the car and you will see a minigun function upgradeTheCar() local veh = getPedOccupiedVehicle ( localPlayer ) local x,y,z = getElementPosition(veh) local Gunner = createObject ( 362, x, y, z) local pedestal = createObject ( 336, x, y, z) attachElements ( pedestal, veh, x, y, z, 0, 0, 0) attachElements ( Gunner, pedestal, 0, -0.3, 0.9, 0, 30, 60) end bindKey ( "1", "down", upgradeTheCar )
tomaker Posted May 3, 2015 Author Posted May 3, 2015 But it isn't will bug if i createWeapon and createObject i think i that pos .And i want to ask how to make a crossfire(dxDraw i know it but how to get a Player targer whic he look and set minigun rotation on that too) and which variable i need to rotate the Minigun ?
Jaydan Posted May 4, 2015 Posted May 4, 2015 There isn't a createCarWithMinigun() function, you'll have to learn Lua if you want to make this. Learning involves time.
Xwad Posted January 30, 2016 Posted January 30, 2016 Hi everybody! I saw this video too and i decided that i will make that script. Im not a beginner in lua so it was not so difficult to make it. Everythink was good when i stuck with the minigun rotation. I used the camera rotation to rotate the minigun element. The only problem is that its not rotating up and down.. only left and right:/ can someone help me? this is a part of my script local test = createWeapon("m4", -2388.41,-581.15, 132.3)setWeaponState(test, "ready") function rotate () setElementRotation(test, 0, 3.2, 96.7 -getPedCameraRotation(localPlayer)) end addEventHandler ("onClientRender", root, rotate) function findRotation( x1, y1, x2, y2 ) local t = -math.deg( math.atan2( x2 - x1, y2 - y1 ) ) return t < 0 and t + 360 or tend
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