[Release] PD Impound [ESX]

This time that I inform in the form
Days & weeks
Matches information inside the game or outside
so that player can get the release of the vehicle seized?
Is there any way for the police or mechanic to release the vehicle or only by the system?

@HorizonPls Great work man, This is amazing, Im still trying to figure out how to only allow Minutes and a max amount of minutes so people don’t abuse and impound cars for days on end and 24h IRL having to wait would be a pain

Ima work on it this weekend mate, im back home today. Ill update the thread once its done

Great man Love to hear that :slight_smile: If you can @ me That would be great. when you update the thread

UPDATE

The config file should now work, so you can set the max days etc. Let me know if you would like to control other variables. This would be update 2

Merged both update 1 and 2 into master.

@KrizFrost - tag

Alright, so for the people that havent figured this out yet. If you do not want players to be able to get their vehicles from different locations when they’re impounded you’re going to have to edit some scripts.

These scripts should be server side and include the queries to be executed on the database. What you want to do is add a where clause that executes a subquery that checks if the vehicle plate is present in the h_impounded_vehicles table. Example below is from the ESX_Eden_Garage 'eden_garage:getOutVehicles' server event.

'SELECT * FROM owned_vehicles WHERE owner=@identifier AND state=false AND owned_vehicles.plate NOT IN (SELECT plate from h_impounded_vehicles);'

The important part here is:

owned_vehicles.plate NOT IN (SELECT plate from h_impounded_vehicles);

At this moment I’ve not implemented anything that deletes the vehicle from the owned vehicles table as that could carry the risk of people their vehicles being lost completely. Not something I want to be responsible for.

In the future I might add a seperate branch that has this functionality if many of you are in need of it.

1 Like

After the last update when having apprehend vehicle I get this error in the console.
I saw that the sql had no change in GitHub

I add cod in the esx_eden_garage script
MySQL.Async.fetchAll(“SELECT * FROM owned_vehicles WHERE owner=@identifier AND state=false AND owned_vehicles.plate NOT IN (SELECT plate from h_impounded_vehicles)”,{[’@identifier’] = xPlayer.getIdentifier()}, function(data)

I use esx_eden_garage
and the vehicle appears in the garage as if seized
more due error that I reported in the MYSQL error post it does not appear in the database

Might have to look at the sql file, theres an alter table clause in it. You’d want to run that.

2 Likes

thank you very much for the support
I’ll do what you told me and see if it solves my mistake.

I performed the procedure following your orientation, I did not have any more errors in the database.
Now another doubt? I did test to apprehend my own vehicle, I am in mechanic work, in the screen of liberation of the vehicle speaks: http://prntscr.com/kxghtq.
I checked which vehicle was seized 1 day, this time and schedule in the game or real?

I am with a friend in the session he is mechanic and the options of Pay and Info I can not interact with the buttons

Currently if you tick / select the boxes on the form:

  • Must be unlocked by a mechanic
  • Must be unlocked by an officer

An officer or mechanic has to first unlock the vehicle before it can be retrieved at all. While I pushed out this update I was in a hurry so I probably didnt clarify this.

You do not need to tick these boxes if they are not applicable to your wishes. If you wish to unlock these vehicles as a mechanic or officer you’ll have to go to the following location:

3 Likes

I do not know what happens with my script that I can not use the buttons
Pay
Info
Unlock

What shall I use for this script? esx_eden_garage or esx_garage?

nevermind
[20chars][20chars]

UPDATE

You can now impound for hours instead of only weeks and days.

DONT FORGET TO CHECK THE SQL SCRIPT FOR UPDATES

AGAIN: This script has not been tested.

2 Likes

cant seem to find the location

I have the one without hours. I can impound cars but can’t unimpound it. any help?

[ERROR] [MySQL] Check the error above, an error happens when executing the callb
ack from the query : “SELECT * FROM owned_vehicles {=}”
This is the error that appears in console