Jump to content

Dimensions


Lloyd Logan

Recommended Posts

getElementDimension (  theElement ) 

setElementDimension ( theElement, dimension ) 

example in wiki

function onPlayerEnterVehicle ( theVehicle, seat, jacked ) 
      if ( getElementDimension ( source ) == 0 ) then    -- if the player is in dimension 0 
            setElementDimension ( source, 1 )            -- set his dimension to 1 
            setElementDimension ( theVehicle, 1 )        -- set his vehicle's dimension to 1 as well 
      end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement ( ), onPlayerEnterVehicle ) 
  
function onPlayerExitVehicle ( theVehicle, seat, jacker ) 
      if ( getElementDimension ( source ) == 1 ) then    -- if the player is in dimension 1 
            setElementDimension ( source, 0 )            -- set his dimension back to 0 
            setElementDimension ( theVehicle, 0 )        -- set his vehicle's dimension back to 0 as well 
      end 
end 
addEventHandler ( "onPlayerVehicleExit", getRootElement ( ), onPlayerExitVehicle ) 

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