Joxte.~ Posted July 12, 2012 Share Posted July 12, 2012 Hello! Look, i have this simple function: objectName = createObject (objectID, posX, posY, posZ, rotationX, rotationY, rotationZ) I need to create an invisible object and after destroy it hitting a marker, then i need to create it with that function. My question is simple, How can i add interior and doubleside to this fuction? Greetz . Link to comment
Castillo Posted July 12, 2012 Share Posted July 12, 2012 setElementInterior setElementDoubleSided Link to comment
naz19 Posted July 12, 2012 Share Posted July 12, 2012 [url=https://wiki.multitheftauto.com/wiki/SetElementDoubleSided]https://wiki.multitheftauto.com/wiki/Set ... oubleSided[/url] [url=https://wiki.multitheftauto.com/wiki/SetElementInterior]https://wiki.multitheftauto.com/wiki/SetElementInterior[/url] --do like : setElementInterior ( objectName, 1) setElementDoubleSided ( objectName, true ) Link to comment
Joxte.~ Posted July 12, 2012 Author Share Posted July 12, 2012 Thanks! But i don't know anything about lua :C Look, i wrote this but it didn't work: function Main () point1 = createMarker(812.59881591797, -4124.7998046875, 92.460250854492, "corona", 4, 0, 0, 0, 0) obstacle1 = createObject(8171, 691.27099609375, -4124.7021484375, 91.771263122559, 90, 0, 90) obstacle2 = createObject(8171, 934.40093994141, -4124.7021484375, 91.771263122559, 90, 0, 270) addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), Main ) function Interior () setElementInterior ( obstacle1, 1) setElementInterior ( obstacle2, 1) addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), Interior ) function MainFunction ( hitPlayer, matchingDimension ) vehicle = getPedOccupiedVehicle ( hitPlayer ) if hitPlayer ~= Me then return end if source == point1 then destroyElement( obstacle1) destroyElement( obstacle2) end end Can you write a right code? please. Link to comment
Castillo Posted July 12, 2012 Share Posted July 12, 2012 You don't need to make a second function to set the interior. function Main () point1 = createMarker(812.59881591797, -4124.7998046875, 92.460250854492, "corona", 4, 0, 0, 0, 0) obstacle1 = createObject(8171, 691.27099609375, -4124.7021484375, 91.771263122559, 90, 0, 90) obstacle2 = createObject(8171, 934.40093994141, -4124.7021484375, 91.771263122559, 90, 0, 270) setElementInterior ( obstacle1, 1) setElementInterior ( obstacle2, 1) addEventHandler ( "onClientMarkerHit", point1, MainFunction ) end addEventHandler( "onClientResourceStart", resourceRoot, Main ) function MainFunction ( hitPlayer, matchingDimension ) vehicle = getPedOccupiedVehicle ( hitPlayer ) if hitPlayer ~= Me then return end if source == point1 then destroyElement( obstacle1) destroyElement( obstacle2) end end Link to comment
Joxte.~ Posted July 12, 2012 Author Share Posted July 12, 2012 Thanks, now setElementInterior works, but when i hit the marker i don't destroy the obtacles Link to comment
Castillo Posted July 12, 2012 Share Posted July 12, 2012 You have "Me" variable defined? Link to comment
Joxte.~ Posted July 12, 2012 Author Share Posted July 12, 2012 I've just defined it, and now it works Thank you a lot dude. 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