robod Posted March 2, 2018 Share Posted March 2, 2018 Hello, is it possible to make anty car jack. Player from same team can just enter the vehicle as a passaneger and when he try to steal the car he go as passaneger. How can I do that? Thanks Link to comment
LoveFist Posted March 2, 2018 Share Posted March 2, 2018 You can rely on OnVehicleStartEnter event. More information and good example you can find at wiki - https://wiki.multitheftauto.com/wiki/OnVehicleStartEnter 1 Link to comment
Storm-Hanma Posted March 2, 2018 Share Posted March 2, 2018 Use the team function too 1 Link to comment
robod Posted March 2, 2018 Author Share Posted March 2, 2018 (edited) 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 March 2, 2018 by robod Link to comment
LoveFist Posted March 2, 2018 Share Posted March 2, 2018 (edited) https://wiki.multitheftauto.com/wiki/WarpPedIntoVehicle But you should call it server side. Also you may need to check if vehicle seat is free (https://wiki.multitheftauto.com/wiki/GetVehicleOccupants) Edited March 2, 2018 by LoveFist 1 Link to comment
robod Posted March 2, 2018 Author Share Posted March 2, 2018 i want if player press f for steal the car acts like he pressing g. https://wiki.multitheftauto.com/wiki/WarpPedIntoVehicle this just warps the ped into vehicle it's not that i want Link to comment
LoveFist Posted March 2, 2018 Share Posted March 2, 2018 Oh ok. Try to use setControlState instead of toggleControl Related topic 1 Link to comment
robod Posted March 2, 2018 Author Share Posted March 2, 2018 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
LoveFist Posted March 2, 2018 Share Posted March 2, 2018 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. 1 Link to comment
robod Posted March 2, 2018 Author Share Posted March 2, 2018 (edited) can you show an example? i dont understand or modify the code Edited March 2, 2018 by robod Link to comment
robod Posted March 2, 2018 Author Share Posted March 2, 2018 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
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