Jump to content

help me in Telports scripts


AnDReJ98

Recommended Posts

If I'm right, you need to remove the player from the vehicle.
addEventHandler ( "onClientGUIClick", resourceRoot, 
        function ( ) 
            if (source == GUIEditor_Button[1]) then   
     local theVehicle = getPedOccupiedVehicle(localPlayer) 
     if not theVehicle then 
                    setElementPosition (localPlayer, 1523.9138183594, 1527.1204833984, 10.2602405548  ) 
                    return 
     end 
                    removePedFromVehicle ( localPlayer ) 
                    setElementPosition (theVehicle , 1523.9138183594, 1527.1204833984, 10.2602405548  ) 
                    warpPedIntoVehicle ( localPlayer, theVehicle) 
    end 
end) 

no i mean when in the car

i click the button my car go this Position but car fly and blow why?

Link to comment
--This function is executed when the button is clicked - it warps the local player. 
local function onTeleportButtonClicked() 
 if (source == GUIEditor_Button[1]) then 
    local localVehicle = getPedOccupiedVehicle(localPlayer) 
    if localVehicle then 
        if getVehicleController(localVehicle) == localPlayer then --IF the player is driving a vehicle, warp the vehicle. 
            setElementPosition(localVehicle, 1523.9138183594, 1527.1204833984, 10.2602405548) 
        end 
    else 
        setElementPosition(localPlayer, 1523.9138183594, 1527.1204833984, 10.2602405548) 
    end 
end 
addEventHandler("onClientGUIClick", GUIEditor_Button[1], onTeleportButtonClicked, false) 

Solidsnake14

this not work

please help me

Link to comment
--This function is executed when the button is clicked - it warps the local player. 
local function onTeleportButtonClicked() 
    local localVehicle = getPedOccupiedVehicle(localPlayer) 
    if localVehicle then 
        if getVehicleController(localVehicle) == localPlayer then --IF the player is driving a vehicle, warp the vehicle. 
            setElementPosition(localVehicle, 1523.9138183594, 1527.1204833984, 10.2602405548) 
        end 
    else 
        setElementPosition(localPlayer, 1523.9138183594, 1527.1204833984, 10.2602405548) 
    end 
end 
addEventHandler("onClientGUIClick", GUIEditor_Button[1], onTeleportButtonClicked, false) 

Link to comment
--This function is executed when the button is clicked - it warps the local player. 
local function onTeleportButtonClicked() 
    local localVehicle = getPedOccupiedVehicle(localPlayer) 
    if localVehicle then 
        if getVehicleController(localVehicle) == localPlayer then --IF the player is driving a vehicle, warp the vehicle. 
            setElementPosition(localVehicle, 1523.9138183594, 1527.1204833984, 10.2602405548) 
        end 
    else 
        setElementPosition(localPlayer, 1523.9138183594, 1527.1204833984, 10.2602405548) 
    end 
end 
addEventHandler("onClientGUIClick", GUIEditor_Button[1], onTeleportButtonClicked, false) 

what about if (source == GUIEditor_Button[1]) ?

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