Kenix Posted May 8, 2011 Share Posted May 8, 2011 how to create player vehicle exit? i have this but not work: server: root = getRootElement() addEventHandler("onPlayerJoin",root, function ( ) local thePlayer = source local veh = createVehicle(470,2759.697265625,-2484.0651855469,13.822604942322) warpPedIntoVehicle(source,veh) setElementVelocity(veh,0,0.33,0) setTimer(function() if isElement (thePlayer) then setCameraTarget(thePlayer,thePlayer) triggerClientEvent(thePlayer,"setContrl",thePlayer) end end,9500,1) setCameraMatrix(source,2751.2658691406,-2419.8408203125,13.6328125,2761.0546875,-2454.3334960938,13.554655075073) end ) client: addEvent("setContrl",true) addEventHandler("setContrl",root, function( ) setPedControlState(source,"enter_exit",true) end ) Link to comment
NeXTreme Posted May 8, 2011 Share Posted May 8, 2011 Mhm.. Server: root = getRootElement() addEventHandler("onPlayerJoin",root, function ( ) local veh = createVehicle(470,2759.697265625,-2484.0651855469,13.822604942322) warpPedIntoVehicle(source,veh) setElementVelocity(veh,0,0.33,0) setTimer(function(thePlayer) if isElement (thePlayer) then setCameraTarget(thePlayer,thePlayer) triggerClientEvent(thePlayer,"setContrl",thePlayer) end end,9500,1,source) setCameraMatrix(source,2751.2658691406,-2419.8408203125,13.6328125,2761.0546875,-2454.3334960938,13.554655075073) end ) Client: addEvent("setContrl",true) addEventHandler("setContrl",root, function( ) setPedControlState(source,"enter_exit",true) end ) Link to comment
Kenix Posted May 8, 2011 Author Share Posted May 8, 2011 yeah but the "enter_exit" don't work Link to comment
MX_Master Posted May 10, 2011 Share Posted May 10, 2011 you must use setControlState (without `source` argument), setPedControlState is ONLY for peds addEvent("setContrl",true) addEventHandler( "setContrl", root, function() setControlState( "enter_exit", true ) end ) Link to comment
Kenix Posted May 10, 2011 Author Share Posted May 10, 2011 you must use setControlState (without `source` argument), setPedControlState is ONLY for peds addEvent("setContrl",true) addEventHandler( "setContrl", root, function() setControlState( "enter_exit", true ) end ) thx dude Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now