RemovePlayer From Lock Cars
#1

Hello. I have a problem, because when my car is closed and I wanted to do when a player is getting into the car to give him RemovePlayerFromVehicle (playerid).

This is the code:
Код:
if(newstate == 5 || newstate == 6)
{
if(CarInfo[vehid][cLock])RemovePlayerFromVehicle(playerid);
}
Please Help
Reply
#2

Quote:
Originally Posted by MrLeNy
This is the code:
Код:
if(newstate == 5 || newstate == 6)
{
if(CarInfo[vehid][cLock])RemovePlayerFromVehicle(playerid);
}
Please Help
Well do you have a /lock so it changes CarInfo[vehid][cLock] to something like 1 or another number so you can use it to define it's locked?

An Example Would Be Then:

Код:
if(newstate == 5 || newstate == 6)
{
  if(CarInfo[vehid][cLock] == 1)
  {
     RemovePlayerFromVehicle(playerid);
     return 1;
  }
}
Reply
#3

Add CarInfo[vehid][cLock] = 0;

Код:
if(newstate == 5 || newstate == 6)
{
  if(CarInfo[vehid][cLock] == 1)
  {
     RemovePlayerFromVehicle(playerid);
     CarInfo[vehid][cLock] = 0;
     return 1;
  }
}
Reply
#4

Quote:
Originally Posted by Robert007
Add CarInfo[vehid][cLock] = 0;

Код:
if(newstate == 5 || newstate == 6)
{
  if(CarInfo[vehid][cLock] == 1)
  {
     RemovePlayerFromVehicle(playerid);
     CarInfo[vehid][cLock] = 0;
     return 1;
  }
}
This is fail, CarInfo[vehid][cLock] = 0; will unlock the car lawl
Reply
#5

Quote:
Originally Posted by MrLeNy
Hello. I have a problem, because when my car is closed and I wanted to do when a player is getting into the car to give him RemovePlayerFromVehicle (playerid).

This is the code:
Код:
if(newstate == 5 || newstate == 6)
{
if(CarInfo[vehid][cLock])RemovePlayerFromVehicle(playerid);
}
Please Help
That code is fine. Make sure you're setting the appropriate value to the variable when you lock the vehicle. In this case anything above 0.
Reply
#6

Could this be scripted to where if you are not a cop or medic skin or anything etc, you get kicked from car?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)