• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] How do I prevent a player from getting into a specific car?
#1
Hello everyone C: a question, how do I make that a player can not enter a specific car? I explain:



Code:
new carvid_0;



carvid_0?= CreateVehicle(506,539.846,-1287.868,16.946,359.176,6,0,-1);



I need that they can't get into that specific vehicle, I can do it but only using the model of the car and that would prevent them from getting into all the cars of that model, but I only want that one. Does anyone know what I have to do? thanks c:
  Reply
#2
(2021-03-24, 06:49 PM)Boxi Wrote: Hello everyone C: a question, how do I make that a player can not enter a specific car? I explain:



Code:
new carvid_0;



carvid_0?= CreateVehicle(506,539.846,-1287.868,16.946,359.176,6,0,-1);



I need that they can't get into that specific vehicle, I can do it but only using the model of the car and that would prevent them from getting into all the cars of that model, but I only want that one. Does anyone know what I have to do? thanks c:



https://open.mp/docs/scripting/functions...rVehicleID



Your vehicle id is
Quote:carvid_0
  Reply
#3
https://open.mp/docs/scripting/functions...sForPlayer
Quote:doorslocked | 0 to unlock the doors or 1 to lock them.
  Reply
#4
Good ideas, I will give it a try. Thanks to both of you
  Reply
#5
Use OnPlayerStateChange. If player's oldstate is onfoot and newstate is driver, you can get the vehicleid there and remove him from vehicle.
[Image: QIDa2vB.png]

  Reply


Forum Jump: