JeViCo Posted August 5, 2019 Share Posted August 5, 2019 Hello there. I've recently tried to change vehicle's interior server-side and met a problem. My current code: -- client triggerServerEvent("teleporter", localPlayer, {10, 10, 2}, 1, math.random(65000)) -- server addEvent("teleporter", true) addEventHandler("teleporter", root, function(pos, int, dim) local x, y, z = unpack(pos) setElementInterior(source, int, x, y, z) setElementDimension(source, dim) end) Everything works perfect except for setElementInterior function. Interior changes, however coordinates are not. By the way, player in vehicle (driver). Any ideas? Link to comment
Moderators IIYAMA Posted August 5, 2019 Moderators Share Posted August 5, 2019 20 minutes ago, JeViCo said: Any ideas? remove the player from the vehicle first. https://wiki.multitheftauto.com/wiki/RemovePedFromVehicle 1 Link to comment
DNL291 Posted August 5, 2019 Share Posted August 5, 2019 You must set the position for the vehicle instead of for the driver (if he's in a vehicle). 1 Link to comment
JeViCo Posted August 10, 2019 Author Share Posted August 10, 2019 Thank you guys, both options work perfect. My vehicle element was driving through the marker and this caused the problem. I used setElementFrozen function to fix it 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