Jump to content

Interior and doubleside at createObject fuction


Joxte.~

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

Link to comment
[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 ) 

Link to comment

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

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...