Eddyxd Posted December 13, 2013 Share Posted December 13, 2013 Hi, how are you? I hope is fine I have a problem when cars change (with vehiclechange) , when i change the vehicle in zones hard, the vehicle appear bad like this example how can fix this Other example: I finishing this world: I got the hunter and appear bad I want it then appears as follows: Look that video in min 6: 45 - 6:52 www.youtube.com/watch?v=rihDOvWPV4M In this video does not pass the error happens to me? (Vehiclechange to Hunter), as I can fix it? Link to comment
Moderators IIYAMA Posted December 13, 2013 Moderators Share Posted December 13, 2013 Try this(fill in the location) local x,y,z = 0,0,0 -- fill in addEventHandler("onElementModelChange", root, function (oldModel,newModel) if newModel == 425 and getElementType(source) == "vehicle" then --425 = hunter setElementPosition(source,x,y,z) end end) Link to comment
Eddyxd Posted December 13, 2013 Author Share Posted December 13, 2013 Thanks Yama, but in every map i need change the x,y,z position? and only work with the hunter? Because i got this bug with others cars Link to comment
Moderators IIYAMA Posted December 13, 2013 Moderators Share Posted December 13, 2013 You can also use: https://wiki.multitheftauto.com/wiki/SetElementRotation For that sample with the bugged car. Link to comment
Eddyxd Posted December 14, 2013 Author Share Posted December 14, 2013 I tired from try with SetElementRotation but i dont know how script, Im noob scripting I use this : local x,y,z = 0,0,0 -- fill in addEventHandler("onElementModelChange", root, function (oldModel,newModel) if newModel == 425 and getElementType(source) == "vehicle" then --425 = hunter local rotX, rotY, rotZ = getElementRotation(425) -- get the local client's vehicle rotation setElementRotation(localVehicle,rotX,rotY+10) end end) Dont work! btw: sorry for bad english Link to comment
pa3ck Posted December 14, 2013 Share Posted December 14, 2013 (edited) You are trying to get the rotation of a number. addEventHandler("onElementModelChange", root, function (oldModel,newModel) if newModel == 425 and getElementType(source) == "vehicle" then --425 = hunter local rotX, rotY, rotZ = getElementRotation(source) -- get the local client's vehicle rotation setElementRotation(source,rotX,rotY+10, rotZ) end end) Edited December 14, 2013 by Guest Link to comment
Moderators IIYAMA Posted December 14, 2013 Moderators Share Posted December 14, 2013 I tired from try with SetElementRotation but i dont know how script, Im noob scripting I use this : local x,y,z = 0,0,0 -- fill in addEventHandler("onElementModelChange", root, function (oldModel,newModel) if newModel == 425 and getElementType(source) == "vehicle" then --425 = hunter local rotX, rotY, rotZ = getElementRotation(425) -- get the local client's vehicle rotation setElementRotation(localVehicle,rotX,rotY+10) end end) Dont work! btw: sorry for bad english If you don't know how an event or function works. There is this page to help you with finding out what the source is, etc. addEventHandler("onElementModelChange", root, function (oldModel,newModel) if newModel == 425 and getElementType(source) == "vehicle" then --425 is the model of the hunter local rotX, rotY, rotZ = getElementRotation(source) -- source is the variable of the vehicle setElementRotation(source,rotX,rotY+10,0) -- always define all required fields. end end) 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