tigerman Posted February 26, 2011 Share Posted February 26, 2011 Hey, im trying to make freeroam script for specific car, when u hit this car you will explode and also this car is moving.. i tryed with marker, attached it and then used onmarkerhit event but dint work, maybe some more ideas what should i use for this ? Link to comment
Moderators Citizen Posted February 26, 2011 Moderators Share Posted February 26, 2011 Hi tigerman, When you attach a marker on a vehicle, the marker take the position of the vehicle also if you use offsets. So create a marker ( don't hide during the test ) which is bigger than the vehicle and attach it to the vehicle. Try to enter in the marker and if he doesn't work, try to go on the vehicle. Tell me if you are detected and where. Link to comment
tigerman Posted February 26, 2011 Author Share Posted February 26, 2011 it works fine if its not attached but when i attach it wount work anymore Link to comment
Moderators Citizen Posted February 26, 2011 Moderators Share Posted February 26, 2011 So create a setTimer like that: local marker = createMarker( x, y, z, ... ) setElementID( marker, "marker1" ) setTimer( updateThePosition, 50, 0 ) function updateThePosition() local veh = ... local marker = getElementByID( "marker1" ) if veh then local x, y, z= getElementPosition( veh ) if marker then setElementPosition( marker, x, y, z ) end end end Try that Link to comment
Moderators Citizen Posted February 26, 2011 Moderators Share Posted February 26, 2011 No problem 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