Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] How do I prevent a player from getting into a specific car?

 
  • 0 Vote(s) - 0 Average
Pawn How do I prevent a player from getting into a specific car?
Boxi
Offline

Burgershot Member
Posts: 48
Threads: 23
Joined: Jan 2021
Reputation: 0
Location: Angel Pine
#1
2021-03-24, 06:49 PM (This post was last modified: 2021-03-24, 06:49 PM by Boxi.)
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:
Virsenas
Offline

Burgershot Member
Posts: 47
Threads: 0
Joined: Feb 2021
Reputation: 6
#2
2021-03-24, 07:25 PM
(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/GetPlayerVehicleID

Your vehicle id is
Quote:carvid_0
DandoRYx
Offline

Burgershot Member
Posts: 20
Threads: 0
Joined: Feb 2021
Reputation: 2
Location: Slovakia
#3
2021-03-24, 07:53 PM (This post was last modified: 2021-03-24, 07:54 PM by DandoRYx.)
https://open.mp/docs/scripting/functions/SetVehicleParamsForPlayer
Quote:doorslocked | 0 to unlock the doors or 1 to lock them.
Boxi
Offline

Burgershot Member
Posts: 48
Threads: 23
Joined: Jan 2021
Reputation: 0
Location: Angel Pine
#4
2021-03-24, 08:46 PM
Good ideas, I will give it a try. Thanks to both of you
Snow
Offline

Burgershot Member
Posts: 48
Threads: 5
Joined: Oct 2020
Reputation: 2
Location: Pakistan
#5
2021-03-25, 04:51 PM
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]
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode