Jump to content

car jack


robod

Recommended Posts

ok so i have this

client

addEvent("goPassaneger", true)
function goPassaneger()

setPedControlState ( getLocalPlayer(), "enter_passenger", true )
 toggleControl ( "enter_passenger", true )

end
addEventHandler("goPassaneger", getRootElement(), goPassaneger)

server

function enterVehicle ( player, seat, jacked ) 
        if jacked ~= false then
        cancelEvent()
		triggerClientEvent(player, "goPassaneger", player)
        end
end
addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle )

 

How can I now make if player try to steal then he go as passaneger?

Edited by robod
Link to comment

setPedControlState is for enable entering vehicle by pressing g.

How can I mix this. 

addEvent("goPassaneger", true)
function goPassaneger()

setPedControlState ( getLocalPlayer(), "enter_passenger", true )
 toggleControl ( "enter_passenger", true )
  setControlState ( "enter_passenger", true )

end
addEventHandler("goPassaneger", getRootElement(), goPassaneger)

just like this?

Link to comment

setPedControlState is for peds. For local player use setControlState and "enter_passenger" as a control name. 

I give you the link for topic where guys seem to made this work for "enter_exit" control name. So if use the same algorithm you can probably achieve the desired behavior.

  • Thanks 1
Link to comment

First you say "Oh ok. Try to use setControlState instead of toggleControl" and then "setPedControlState is for peds. For local player use setControlState and "enter_passenger" as a control name. "

I tested both and this still dont work

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