This topic was marked solved by DizzasTeR, on September 14th, 2019, 10:48 AM
How to lock a bike?

Kenneth Law

  • Newbie
  • Posts: 35
How to lock a bike?
«  »
How can I lock a bike? I've used the code vehicle.Locked=true but players can still get in the bike. So any way to lock it?

MEGAMIND

  • Hero Member
  • Developer of Webnet Official
  • Posts: 801
Re: How to lock a bike?
« Reply #1,  »
Quote from Kenneth Law on September 10th, 2019, 09:57 AM
How can I lock a bike? I've used the code vehicle.Locked=true but players can still get in the bike. So any way to lock it?
hmm well, try to eject player from vehicle and display message its locked but define if its vehicle 191 for bike

Kenneth Law

  • Newbie
  • Posts: 35
Re: How to lock a bike?
« Reply #2,  »
Quote from MEGAMIND on September 10th, 2019, 11:30 AM
Quote from Kenneth Law on September 10th, 2019, 09:57 AM
How can I lock a bike? I've used the code vehicle.Locked=true but players can still get in the bike. So any way to lock it?
hmm well, try to eject player from vehicle and display message its locked but define if its vehicle 191 for bike
It's too wired to eject a player from a bike. In fact, the server Argonath RPG has found a way to avoid a player from getting on a bike without ejection. But I don't know how that is done. So I want someone to tell me.

MatheuS

  • Wiki Contributor
  • LBR | Co-Leader & Brasil Real RPG | Developer
  • Posts: 470
Re: How to lock a bike?
« Reply #3,  »
Quote from Kenneth Law on September 10th, 2019, 11:49 AM
Quote from MEGAMIND on September 10th, 2019, 11:30 AM
Quote from Kenneth Law on September 10th, 2019, 09:57 AM
How can I lock a bike? I've used the code vehicle.Locked=true but players can still get in the bike. So any way to lock it?
hmm well, try to eject player from vehicle and display message its locked but define if its vehicle 191 for bike
It's too wired to eject a player from a bike. In fact, the server Argonath RPG has found a way to avoid a player from getting on a bike without ejection. But I don't know how that is done. So I want someone to tell me.
try using this:

Code: [Select]
function onPlayerEnteringVehicle( player, vehicle, door )
{
if( vehicle.Model == 191 ) return 0;
}
Code: [Select]
if( !sucess ) tryAgain();

Kenneth Law

  • Newbie
  • Posts: 35
Re: How to lock a bike?
« Reply #4,  »
Quote from MatheuS on September 10th, 2019, 12:45 PM
Quote from Kenneth Law on September 10th, 2019, 11:49 AM
Quote from MEGAMIND on September 10th, 2019, 11:30 AM
Quote from Kenneth Law on September 10th, 2019, 09:57 AM
How can I lock a bike? I've used the code vehicle.Locked=true but players can still get in the bike. So any way to lock it?
hmm well, try to eject player from vehicle and display message its locked but define if its vehicle 191 for bike
It's too wired to eject a player from a bike. In fact, the server Argonath RPG has found a way to avoid a player from getting on a bike without ejection. But I don't know how that is done. So I want someone to tell me.
try using this:

Code: [Select]
function onPlayerEnteringVehicle( player, vehicle, door )
{
if( vehicle.Model == 191 ) return 0;
}
Cool! It works! Thanks a lot for your help!

MEGAMIND

  • Hero Member
  • Developer of Webnet Official
  • Posts: 801
Re: How to lock a bike?
« Reply #5,  »
Quote from MatheuS on September 10th, 2019, 12:45 PM
Quote from Kenneth Law on September 10th, 2019, 11:49 AM
Quote from MEGAMIND on September 10th, 2019, 11:30 AM
Quote from Kenneth Law on September 10th, 2019, 09:57 AM
How can I lock a bike? I've used the code vehicle.Locked=true but players can still get in the bike. So any way to lock it?
hmm well, try to eject player from vehicle and display message its locked but define if its vehicle 191 for bike
It's too wired to eject a player from a bike. In fact, the server Argonath RPG has found a way to avoid a player from getting on a bike without ejection. But I don't know how that is done. So I want someone to tell me.
try using this:

Code: [Select]
function onPlayerEnteringVehicle( player, vehicle, door )
{
if( vehicle.Model == 191 ) return 0;
}
yes ofc why not

Athanatos

  • Hero Member
  • Posts: 974

Kenneth Law

  • Newbie
  • Posts: 35

Athanatos

  • Hero Member
  • Posts: 974
Re: How to lock a bike?
« Reply #8,  »
I was reffering to Alecu's post, sorry for the confusion. I used your post to told him that you already tried CVehicle::Locked

Kenneth Law

  • Newbie
  • Posts: 35

DizzasTeR

  • VC:MP Beta Tester
  • Infinite loops defy infinity by overflowing memory
  • Posts: 1,185
Re: How to lock a bike?
« Reply #10,  »
The solution has been posted therefore closing this.