prodbynasty Posted March 4, 2021 Share Posted March 4, 2021 Client event "playerStartEnterVehicle" is not working... My script: mp.events.add("playerStartEnterVehicle", (vehicle, seat) => { mp.gui.chat.push("Test"); }); Link to comment Share on other sites More sharing options...
Kopra Posted March 4, 2021 Share Posted March 4, 2021 Try like this mp.events.add("playerStartEnterVehicle", (player, vehicle, seat) => { mp.gui.chat.push(`${player.name} started to get into the car ID: ${vehicle.id}. Seat: ${seat}`); }); PlayerStartEnterVehicle - RAGE Multiplayer Wiki Link to comment Share on other sites More sharing options...
prodbynasty Posted March 5, 2021 Author Share Posted March 5, 2021 9 hours ago, Kopra said: Try like this mp.events.add("playerStartEnterVehicle", (player, vehicle, seat) => { mp.gui.chat.push(`${player.name} started to get into the car ID: ${vehicle.id}. Seat: ${seat}`); }); PlayerStartEnterVehicle - RAGE Multiplayer Wiki Without changess. It remains: mp.events.add('render', () => { const controls = mp.game.controls; let localPlayer = mp.players.local; controls.disableControlAction(0, 23, true); if(controls.isDisabledControlJustPressed(0, 23)) { if (!localPlayer.vehicle) { let position = mp.players.local.position; let vehHandle = mp.game.vehicle.getClosestVehicle(position.x, position.y, position.z, 5, 0, 70); let vehicle = mp.vehicles.atHandle(vehHandle); let vehOwner = vehicle.getVariable("veh:owner"); let uid = mp.players.local.getVariable("plr:uid"); if(vehicle && vehicle.isAnySeatEmpty() && vehicle.getSpeed() < 5 && vehOwner == null || vehOwner == uid) { mp.players.local.taskEnterVehicle(vehicle.handle, 5000, -1, 0, 1, 0); return; } if (vehOwner != uid) { mp.gui.chat.push("Nie posiadasz kluczyków do tego pojazdu."); } } } }); 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