Jump to content

not moving from one place


Recommended Posts

function shapeHit ( thePlayer )  
    setElementPosition ( thePlayer, 1569, -1690, 6 ) 
end 
  
function setZone ( playerSource ) 
    local zone = createColSphere ( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) -- create a col 
    addEventHandler ( "onColShapeHit", zone, shapeHit ) -- add a handler for the onColShapeHit event 
end 
addEventHandler ( "onResourceStart", setZone ) 

I suppose this all wrong ... kk

so this is I do?

Link to comment
local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) 
  
function shapeHit(hitPlayer, matchingDimension) 
    if getElementType(hitPlayer) == "player" then 
        setElementPosition( hitPlayer, 1569, -1690, 6 ) 
    end 
end 
addEventHandler( 'onColShapeHit', zone, shapeHit ) 

Link to comment
zone = createColSphere ( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) 
  
function shapeHit ( ) 
    setElementPosition ( thePlayer, 1569, -1690, 6 ) 
end 
addEventHandler ( 'onColShapeHit', zone, shapeHit ) 

thePlayer = ?? not defined!

You should to check the hitter is player or not!

And use "local" .

Edited by Guest
Link to comment
zone = createColSphere ( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) 
  
function shapeHit ( ) 
    setElementPosition ( thePlayer, 1569, -1690, 6 ) 
end 
addEventHandler ( 'onColShapeHit', zone, shapeHit ) 

thePlayer = ?? not defined!

Sorry, I've done it in a rush, But DNL291 fixed it ..

Link to comment
local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) 
  
function shapeHit(hitPlayer, matchingDimension) 
    if getElementType(hitPlayer) == "player" then 
        local v = getPedOccupiedVehicle(pVar) 
        if (v) then 
            removePedFromVehicle ( hitPlayer ) 
            setElementPosition ( v, 1569, -1690, 6 ) 
            warpPedIntoVehicle ( hitPlayer, v )    
        else 
            setElementPosition( hitPlayer, 1569, -1690, 6 ) 
        end 
    end 
end 
addEventHandler( 'onColShapeHit', zone, shapeHit ) 

Work?

Link to comment
local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) 
  
function shapeHit(hitPlayer, matchingDimension) 
    if getElementType(hitPlayer) == "player" then 
        local v = getPedOccupiedVehicle(pVar) 
        if (v) then 
            removePedFromVehicle ( hitPlayer ) 
            setElementPosition ( v, 1569, -1690, 6 ) 
            warpPedIntoVehicle ( hitPlayer, v )    
        else 
            setElementPosition( hitPlayer, 1569, -1690, 6 ) 
        end 
    end 
end 
addEventHandler( 'onColShapeHit', zone, shapeHit ) 

Work?

Try this :

local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) 
function shapeHit(hitPlayer, matchingDimension) 
    if getElementType(hitPlayer) == "player" then 
        local v = getPedOccupiedVehicle(hitPlayer) 
        if (v) then 
            removePedFromVehicle ( hitPlayer ) 
            setElementPosition ( v, 1569, -1690, 6 ) 
            warpPedIntoVehicle ( hitPlayer, v )    
        else 
            setElementPosition( hitPlayer, 1569, -1690, 6 ) 
        end 
    end 
end 
addEventHandler( 'onColShapeHit', zone, shapeHit ) 
  
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...