Sign in to follow this  
Joxte.~

Interior and doubleside at createObject fuction

Recommended Posts

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 :).

Share this post


Link to post
[url=http://wiki.multitheftauto.com/wiki/SetElementDoubleSided]http://wiki.multitheftauto.com/wiki/Set ... oubleSided[/url] 
[url=http://wiki.multitheftauto.com/wiki/SetElementInterior]http://wiki.multitheftauto.com/wiki/SetElementInterior[/url] 
--do like : 
setElementInterior ( objectName, 1) 
setElementDoubleSided ( objectName, true ) 

Share this post


Link to post

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.

Share this post


Link to post

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 

Share this post


Link to post

Thanks, now setElementInterior works, but when i hit the marker i don't destroy the obtacles :(

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.