Jump to content

Teleporter Help


KillerNico

Recommended Posts

Hi everybody!

I learn scripting in this moment and need help. In a Teleporter i can set the Rotation of the player, right ??

I think its so:

function MarkerHit ( hitPlayer, matchingDimension ) 
        if source == inhouse then 
        setElementPosition( hitPlayer, x, y, z ) 
                setPlayerRotation ( x, y, z ) 
                setVehicleFrozen ( true ) 
                setTimer ( setVehicleFrozen, 1000 ) 
end 
addEventHandler( "onMarkerHit", inhouse, MarkerHit )  

Link to comment

Example:

inhouse = createMarker ( 0.0, 0.0, 0.0, 'corona', 2.0, 255, 128, 0, 255 ) 
  
-- Change the first 3 parameters to your co-ordinates 
  
function MarkerHit ( hitElement ) 
    if ( source ) == inhouse then 
        local x,y,z = getElementPosition ( inhouse ) 
        setElementPosition ( hitElement, x, y + 5, z ) 
        local rotX, rotY, rotZ = getElementRotation ( hitElement ) 
        setElementRotation ( hitElement, rotX, rotY, rotZ + 180 ) 
    end 
end 
  
addEventHandler ( 'onMarkerHit', inhouse, MarkerHit ) 

Link to comment
function MarkerHit ( hitPlayer, matchingDimension ) 
        if source == inhouse and getElementType(hitPlayer) == "player"  then 
        local veh = getPedOccupiedVehicle(hitPlayer) 
        if isElement(veh) then 
        setElementPosition( veh, x, y, z ) 
                setPlayerRotation (veh, rx, ry, rz ) 
                setVehicleFrozen (veh, true ) 
                setTimer ( setVehicleFrozen, 1000,1,veh,false ) 
      end 
end 
addEventHandler( "onMarkerHit", inhouse, MarkerHit )  

but this will do everything for you ;) :

viewtopic.php?f=108&t=32529

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