Domebic Posted April 3, 2021 Share Posted April 3, 2021 Hello. I create a transport on the server side and create an event on the client side for the transport to start the engine or turn on the headlights. But nothing works. mp.events.add('playerJoin', (player) => { player.spawn(new mp.Vector3(2550.088, 4691.932, 33.618)); var theVehicle = mp.vehicles.new(mp.joaat("hauler"), new mp.Vector3(2544.879, 4664.066, 34.076), { numberPlate: "513485" }); theVehicle.setColor(255, 0); player.call('engineOn', [theVehicle]); }); mp.events.add('engineOn', (theVehicle) => { if (theVehicle) { theVehicle.setEngineOn(true, true, false); } }); Link to comment Share on other sites More sharing options...
Division Posted April 10, 2021 Share Posted April 10, 2021 (edited) mp.events.add('playerJoin', (player) => { player.spawn(new mp.Vector3(2550.088, 4691.932, 33.618)); var theVehicle = mp.vehicles.new(mp.joaat("hauler"), new mp.Vector3(2544.879, 4664.066, 34.076), { numberPlate: "513485" }); theVehicle.setColor(255, 0); theVehicle.setEngineOn(true, true, false); }); In your case you are mixing server-side and client-side together. Player.call triggers an client-side event from serverside. Else do mp.events.call("engineOn", theVehicle); Edited April 10, 2021 by Division Link to comment Share on other sites More sharing options...
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