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

Kenneth Law

  • Newbie
  • Posts: 29
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 "Web-Net" search engine
  • Posts: 753
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: 29
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: 469
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: 29
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 "Web-Net" search engine
  • Posts: 753
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
  • sin^2(x)+cos^2(x) = 1
  • Posts: 878
Infected City Survival Main Dev

Kenneth Law

  • Newbie
  • Posts: 29

Athanatos

  • Hero Member
  • sin^2(x)+cos^2(x) = 1
  • Posts: 878
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
Infected City Survival Main Dev

Kenneth Law

  • Newbie
  • Posts: 29

DizzasTeR

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