Deihim007 Posted August 10, 2017 Share Posted August 10, 2017 Hello Folks! I need some help here; Vehicles = { [468]=true,[577]=true } function enterVehicle ( player, seat, jacked ) if ( Vehicles[getElementModel(source)] ) then cancelEvent() warpPedIntoVehicle ( player, idk_what_to_put_here ) outputChatBox ( "OK!", player ) end end addEventHandler ( "onVehicleStartEnter", root, enterVehicle ) I want it to warp a player into specifics vehicles in attempt to enter. Link to comment
NeXuS™ Posted August 10, 2017 Share Posted August 10, 2017 Vehicles = {[468]=true,[577]=true} function enterVehicle ( player, seat, jacked ) if (Vehicles[getElementModel(source)]) then cancelEvent() warpPedIntoVehicle(player, source) outputChatBox( "OK!", player) end end addEventHandler("onVehicleStartEnter", root, enterVehicle) Next time, check the wiki page. Quote The source of this event is the vehicle in which a player began to enter. Link to comment
Deihim007 Posted August 10, 2017 Author Share Posted August 10, 2017 15 minutes ago, NeXuS™ said: Vehicles = {[468]=true,[577]=true} function enterVehicle ( player, seat, jacked ) if (Vehicles[getElementModel(source)]) then cancelEvent() warpPedIntoVehicle(player, source) outputChatBox( "OK!", player) end end addEventHandler("onVehicleStartEnter", root, enterVehicle) Next time, check the wiki page. i tried source before i post, but nothing happens Link to comment
Rockyz Posted August 10, 2017 Share Posted August 10, 2017 Vehicles = { [468] = true,[577] = true }; function enterVehicle ( player, seat, jacked ) if ( Vehicles [ getElementModel ( source ) ] ) then ssPlayer = source; setTimer ( function ( ) warpPedIntoVehicle ( player, ssPlayer ); end, 50, 1 ); cancelEvent ( ); end; end; addEventHandler ( "onVehicleStartEnter", root, enterVehicle ); 1 Link to comment
Deihim007 Posted August 10, 2017 Author Share Posted August 10, 2017 1 hour ago, #,+( _xiRoc[K]; > said: Vehicles = { [468] = true,[577] = true }; function enterVehicle ( player, seat, jacked ) if ( Vehicles [ getElementModel ( source ) ] ) then ssPlayer = source; setTimer ( function ( ) warpPedIntoVehicle ( player, ssPlayer ); end, 50, 1 ); cancelEvent ( ); end; end; addEventHandler ( "onVehicleStartEnter", root, enterVehicle ); Wow! nicely done, thanks. May i ask what caused it to not work? 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