Ivanleviathan 0 Posted January 28 Share Posted January 28 Hello everyone. I am writing a script for a taxi with a peds. So, player reaches a marker -> ped enter vehicle on passenger seat -> you got new marker -> reach this marker -> ped leaving car and dissapers after timeout. Trouble fires when ped trying to enter vehicle on passenger seat. Ped startring to move in place, and after timeout ped is already in car, without animations of car door opening and e.t.c... Have this code. function pickUpPassenger(){ let interval = setInterval(function(){ if(player.vehicle){ ped.taskEnterVehicle(player.vehicle.handle, 5000, 0, 1, 1, 0); clearInterval(interval); setTimeout(function(){ mp.events.call('passengerSit'); }, 5000); } }, 1000); } "ped" variable is global, so ped object always ok. Link to post Share on other sites
Stefan Mentosan 0 Posted January 28 Share Posted January 28 try a larger timeout on taskEnterVehicle Link to post Share on other sites
Ivanleviathan 0 Posted January 28 Author Share Posted January 28 26 минут назад, Stefan Mentosan сказал: try a larger timeout on taskEnterVehicle function pickUpPassenger(){ missionStatus = 2; let interval = setInterval(function(){ if(player.vehicle){ ped.taskEnterVehicle(player.vehicle.handle, 50000, 0, 1, 1, 0); clearInterval(interval); setTimeout(function(){ mp.events.call('passengerSit'); }, 50000); } }, 1000); } same Link to post Share on other sites
Ivanleviathan 0 Posted January 30 Author Share Posted January 30 so, fixed it. U need to init ped at server-side. Link to post Share on other sites
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