Jump to content

help me in Telports scripts


AnDReJ98

Recommended Posts

Posted
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?

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

Posted
--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) 

Posted
--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]) ?

Posted
That is not required, the event handler is binded to that button now.

its work

thank you

but when in the Vehicle and click button

this picture

1

ev9ho9ot53xr.png

2

nv5rf7xvwdod.png

why?????

Posted
I have no idea, it worked fine in my server.

its work fine

when player out the Vehicle

crdhk1ja3h4g.png

but when in the Vehicle

the Vehicle fly and blow

any one help me

Posted

This teleport script castillo gave you CANNOT MAKE THAT!

That error is related to another script you were running at the time.

Posted
That is not required, the event handler is binded to that button now.

its work

thank you

but when in the Vehicle and click button

this picture

1

ev9ho9ot53xr.png

2

nv5rf7xvwdod.png

why?????

use

  setElementRotation  

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