WASSIm. Posted January 13, 2014 Share Posted January 13, 2014 hi guys. i working for script make swat tank shot like minigun but i have problem with Rot addEventHandler("onClientRender", root, function ( ) for k, thePlayer in ipairs(getElementsByType("player")) do local theVehicle = getPedOccupiedVehicle(thePlayer) if (theVehicle) and (weapon[theVehicle]) then local xt, yt, zt = getVehicleTurretPosition(theVehicle) local xt, yt = math.deg(xt), math.deg(yt) attachElements(weapon[theVehicle], theVehicle, 0, 0, 1.6, 0, yt, xt+90) end end end) Link to comment
50p Posted January 13, 2014 Share Posted January 13, 2014 It doesn't seem to rotate at all. Try to use X axis instead of Y. Maybe it's a bug and rotations are swapped. Also, there is no need for "zt", getVehicleTurretPosition returns only 2 values. Link to comment
WASSIm. Posted January 13, 2014 Author Share Posted January 13, 2014 i try to use X axis instead of Y but its have more wrong. and zt just fail Link to comment
50p Posted January 13, 2014 Share Posted January 13, 2014 Check the values of xt and yt before you attachElements: dxDrawText( "X: " .. tostring(xt) .. "; Y:" .. tostring(yt), 10, 200 ); Validate these values, if they're correct then play with the values in attachElements call. Link to comment
WASSIm. Posted January 13, 2014 Author Share Posted January 13, 2014 Check the values of xt and yt before you attachElements: dxDrawText( "X: " .. tostring(xt) .. "; Y:" .. tostring(yt), 10, 200 ); Validate these values, if they're correct then play with the values in attachElements call. its problem with Rot weapon object and other weapons like it u can open map editor and change rot weapons and see. 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