Disable the ability to leave from Passenger mode.

Discussion in 'Plugin Development' started by vasil7112, Apr 6, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    Hello there,

    I want to disallow my "Player2" to leave from "Player1" when he is passenger ( player1.setPassenger(Player2) ). Normally a player can leave the passenger mode by using lshift. Is there any way to check if the player L Shifts or uses a button that will remove him from passenger mode and cancel it? Is there such an event? Or should i just make a timer for every 1 tick that will set the Player2 as passenger of player1?

    Kind regards and thanks for the help in advance,
  2. Offline


    I wonder if it would count as a ShiftToggleEvent, or a VehicleExitEvent, I'd probably try the ShiftToggleEvent, and cancel it if player2 is riding player1
  3. Offline


  4. Offline


    Alright thanks both of you, i saw vehicle event too, but i thought it wouldn't work since a player isn't a vehicle. But since you suggest it i will have a look.
    Thanks alot, and i will send you the results.

    I am not sure if ShiftToggleEvent exists :/
    Edit: will try with togglesneakevent

    Here is a solution i thought about.
    When a player Sneaks, if he is passenger, then put him back on the one he was carrying him.
    Will use: PlayerToggleSneakEvent
    Thanks again for the help above.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 7, 2016
Thread Status:
Not open for further replies.

Share This Page