Jump to content

setElementRotation BUG!


naz19

Recommended Posts

addEventHandler('onResourceStart',root, 
    function() 
     ped = createPed(252,-158,584,15) 
        veh = createVehicle(515,-158,584,16,0,0,284) 
         setTimer(function()   
            warpPedIntoVehicle (ped, veh,0) 
          end,1000,1) 
        if (veh) then 
           setTimer( 
               function() 
                 setElementVelocity(veh,0.5,0,0) 
               end 
          ,5000,1) 
        end 
  marker = createMarker(-35,613,11,"ring",3) 
  addEventHandler('onMarkerHit',root, 
      function(hitElement, matchingDimension) 
          if source ==  marker then 
              if hitElement == veh then 
                 setTimer( 
                    function() 
                     setElementRotation(veh,0,90,30)             ------------------------ don't rotate!  
                   end 
                 ,1000,1)    
            end 
        end 
     end 
  ) 
    end 
) 

HELP ME!!!!!!!!!!!

debugscript (3) says nothing x(

Link to comment

Try

Server

addEventHandler( 'onResourceStart', root, 
    function( ) 
        uPed = createPed( 252, -158, 584, 15) 
        uVehicle = createVehicle( 515, -158, 584, 16, 0, 0, 284 ) 
        setTimer( 
            function( uVehicle )   
                warpPedIntoVehicle ( uPed, uVehicle ) 
            end, 
        1000, 1, uVehicle ) 
         
        if uVehicle then 
            setTimer( 
                function( uVehicle ) 
                    setElementVelocity( uVehicle, 0.5, 0, 0 ) 
                end, 
            5000, 1, uVehicle ) 
        end 
        uMarker = createMarker( -35, 613, 11, "ring", 3 ) 
        addEventHandler( 'onMarkerHit', root, 
            function( uHitElement, bDim ) 
                if source == uMarker then 
                    if getElementType( uHitElement ) == 'player' and isPedInVehicle( uHitElement ) then 
                        setTimer( 
                            function( uHitElement ) 
                                setElementRotation( getPedOccupiedVehicle( uHitElement ) or uHitElement, 0, 90, 30 )             ------------------------ don't rotate!  
                            end, 
                        1000, 1, uHitElement )    
                    end 
                end 
            end 
        ) 
    end 
) 

Link to comment
Try

Server

addEventHandler( 'onResourceStart', root, 
    function( ) 
        uPed = createPed( 252, -158, 584, 15) 
        uVehicle = createVehicle( 515, -158, 584, 16, 0, 0, 284 ) 
        setTimer( 
            function( uVehicle )   
                warpPedIntoVehicle ( uPed, uVehicle ) 
            end, 
        1000, 1, uVehicle ) 
         
        if uVehicle then 
            setTimer( 
                function( uVehicle ) 
                    setElementVelocity( uVehicle, 0.5, 0, 0 ) 
                end, 
            5000, 1, uVehicle ) 
        end 
        uMarker = createMarker( -35, 613, 11, "ring", 3 ) 
        addEventHandler( 'onMarkerHit', root, 
            function( uHitElement, bDim ) 
                if source == uMarker then 
                    if getElementType( uHitElement ) == 'player' and isPedInVehicle( uHitElement ) then 
                        setTimer( 
                            function( uHitElement ) 
                                setElementRotation( getPedOccupiedVehicle( uHitElement ) or uHitElement, 0, 90, 30 )             ------------------------ don't rotate!  
                            end, 
                        1000, 1, uHitElement )    
                    end 
                end 
            end 
        ) 
    end 
) 

don't work x(

Link to comment

the most worst is that i can't see any error x(

idea of my code (as you see) is to create car that will move without anyone (controlled by script), i tryed use markers for this, but as i can't see error and it's don't work, i must ask have you any another idea how to make it?

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