Jump to content

Warp


isa_Khamdan

Recommended Posts

fadeCamera ( true,1 ) --Show after 1 second. 
fadeCamera ( false,1 ) --Hide after 1 second . 

It doesn't work

addEventHandler("onClientGUIClick",root, 
    function () 
        local sel = guiGridListGetSelectedItem(grid) 
        local theVehicle = getPedOccupiedVehicle ( localPlayer ) 
        if source == move then 
          if sel ~= -1 then 
             if not isPedInVehicle ( localPlayer ) then 
             local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
                fadeCamera ( false, 0.5) 
                fadeCamera ( true, 2 )   
                setElementPosition(localPlayer,x,y,z) 
  
             elseif source == move then 
           if sel ~= -1 then 
                if isPedInVehicle ( localPlayer ) then 
                local Controler = getVehicleController ( theVehicle )  
                if ( Controler ) then 
                local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
                fadeCamera ( false, 0.5 ) 
                fadeCamera ( true, 2 )   
                setElementPosition(theVehicle,x,y,z) 
                warpPedIntoVehicle ( localPlayer, theVehicle )  
        end  
         end 
           end 
       end 
    else        
    outputChatBox("* Please Select A Positon",255,0,0) 
    end 
   end  
end 
) 

Link to comment

warpPedIntoVehicle is not required, that function is used to warp a player/ped into a vehicle, not change the position of it.

addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        local sel = guiGridListGetSelectedItem ( grid ) 
        local theVehicle = getPedOccupiedVehicle ( localPlayer ) 
        if ( source == move ) then 
            if ( sel ~= -1 ) then 
                local theElement = ( theVehicle and theVehicle or localPlayer ) 
                local x, y, z = unpack ( guiGridListGetItemData ( grid, sel, 1 ) ) 
                fadeCamera ( false, 0.5 ) 
                fadeCamera ( true, 2 ) 
                setElementPosition ( theElement, x, y, z ) 
            else        
                outputChatBox ( "* Please Select A Positon", 255, 0, 0 ) 
            end 
        end 
    end 
) 

That should change the position of the vehicle ( if he/she is in one ) and the localPlayer ( if not in a vehicle ).

Link to comment
warpPedIntoVehicle is not required, that function is used to warp a player/ped into a vehicle, not change the position of it.
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        local sel = guiGridListGetSelectedItem ( grid ) 
        local theVehicle = getPedOccupiedVehicle ( localPlayer ) 
        if ( source == move ) then 
            if ( sel ~= -1 ) then 
                local theElement = ( theVehicle and theVehicle or localPlayer ) 
                local x, y, z = unpack ( guiGridListGetItemData ( grid, sel, 1 ) ) 
                fadeCamera ( false, 0.5 ) 
                fadeCamera ( true, 2 ) 
                setElementPosition ( theElement, x, y, z ) 
            else        
                outputChatBox ( "* Please Select A Positon", 255, 0, 0 ) 
            end 
        end 
    end 
) 

That should change the position of the vehicle ( if he/she is in one ) and the localPlayer ( if not in a vehicle ).

It is working but why the Camera doesn't fade?

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