[Release][vRP] Confiscate [Save-Tunning]

Hi, i’ve made that resource a few months ago and i think now it’s the perfect time to share it with all vRP servers

Require
  • vrp framework

Config

image
image
image


ScreenShots

(!) The screenshots are in romanian language, the resource is well translated in english

image
image
EN:

  • Your car was seized by the police. Go to the police station as soon as possible to recover it !
  • You seized plesalex100’s car [ID 34]


image
EN:

  • Seized cars
  • The cop that seized your car: plesalex100 Fine price: $5000 !


image
EN:

  • You paid the fines to recover the car.
  • Go to a garage to use it.
  • Paied $5000


Instalation

  • Copy the vrp_confiscate resource to your server
  • Dump in the database the dump.sql file

For those who don't use vrp_garages

Go to vrp/modules/basic_garage.lua replace:
OLD

MySQL.createCommand("vRP/get_vehicles","SELECT vehicle FROM vrp_user_vehicles WHERE user_id = @user_id")

NEW

MySQL.createCommand("vRP/get_vehicles","SELECT vehicle FROM vrp_user_vehicles WHERE veh_confiscate = 0 AND user_id = @user_id")

For those who use vrp_garages

Go to vrp_garages/server.lua replace:
OLD

MySQL.createCommand("vRP/ply_get_vehicles","SELECT * FROM vrp_user_vehicles WHERE user_id = @user_id")

NEW

MySQL.createCommand("vRP/ply_get_vehicles","SELECT * FROM vrp_user_vehicles WHERE veh_confiscate = 0 AND user_id = @user_id")

  • Add start vrp_confiscate in your server.cfg
  • Enjoy it

Download: GitHub

6 Likes

Niceee

1 Like

Very good

Nice script! Could be awesome if the cop desire what the “price” for the car should be :slight_smile:

When using your script to confiscate a car…

https://pastebin.com/JeY80yiL

When using your script to confiscate a car…

https://pastebin.com/FgZuTFja

@Nexicon @biielzk

Try this update for the resource. I hope it will work now.

1 Like

Again!

:broken_heart:

You are sure you have vrp_showroom by sighmir installed corectly ?

1 Like

Yes, I was with my modifications, I thought it best to download again and put 100% original, and it did not work :frowning:

not working i get erros when i try to confiscate a car

show ur errors

if i don’t use the showroom i can’t use the script right? bcs i don’t use it and i get db erros in the console of the server

By default you can’t use it without showroom

And i can disable to buy vehicles right from the garage? so i can use the showroom

This Script don’t save the Tunning no ?

Script don’t save tunning …

Hi, i change this script to working fine with tunning.(Sorry for my English) :smiley:

Explaining, the script the way the friend posted deletes the vehicle from the vrp_user_vehicles table, so it also clears the tuning.
I made some changes so this does not happen, I added a new column in the vrp_user_vehicles table called veh_confiscate where 0 is not confiscated and 1 is confiscated. and put one more condition to show vehicles in garage of user.

 

First you need to change the table of vrp_user_vehicles, i add one new column called veh_confiscate where 1 is confiscated and 0 is not confiscated. Execute this SQL in your database:

ALTER TABLE vrp_user_vehicles ADD IF NOT EXISTS veh_confiscate TINYINT NOT NULL DEFAULT 0;

 


Go to vrp_confiscate/server.lua and change this lines:

1. OLD:

MySQL.createCommand("vRP/ples_confVeh", [[
  DELETE FROM `vrp_user_vehicles` WHERE `user_id`=@u_id AND `vehicle`=@modelX;
  INSERT IGNORE INTO `vrp_confiscate` (`user_id`, `vehicle`, `cop`) VALUES (@u_id, @modelX, @cop);
]])

1. CHANGE FOR:

MySQL.createCommand("vRP/ples_confVeh", [[
  UPDATE vrp_user_vehicles SET veh_confiscate = 1 WHERE `user_id`=@u_id AND `vehicle`=@modelX;
  INSERT IGNORE INTO `vrp_confiscate` (`user_id`, `vehicle`, `cop`) VALUES (@u_id, @modelX, @cop);
]])

 


2. OLD:

MySQL.createCommand("vRP/ples_stergConf", "DELETE FROM vrp_confiscate WHERE user_id = @user_id AND vehicle = @model")

2. CHANGE FOR:

MySQL.createCommand("vRP/ples_stergConf", [[
UPDATE vrp_user_vehicles SET veh_confiscate = 0 WHERE `user_id`=@user_id AND `vehicle`=@model;
DELETE FROM vrp_confiscate WHERE user_id = @user_id AND vehicle = @model
]])

 


3. OLD:

if vRP.tryFullPayment({user_id, pret}) then
	TriggerEvent('veh_SR:CheckMoneyForBasicVeh', user_id, v.vehicle, pret, "car")
	vRPclient.notify(playerx, {"You paid the fines to recover the car.\nGo to a garage to use it."})
	local model = v.vehicle
	MySQL.execute("vRP/ples_stergConf", {user_id = user_id, model = model})
else
	vRPclient.notify(playerx, {"~r~Sem dinheiro o suficiente."})
end

3. CHANGE FOR:

if vRP.tryFullPayment({user_id, pret}) then
	local model = v.vehicle
	MySQL.execute("vRP/ples_stergConf", {user_id = user_id, model = model})
	vRPclient.notify(playerx, {"Você pagou a multa e recuperou seu carro.\nEle está disponivel na garagem."})
	vRP.closeMenu({playerx})
else
	vRPclient.notify(playerx, {"~r~Sem dinheiro o suficiente."})
end

 


 
 

Now you need to put one where clause in select of vehicles in garage from user. In my case i use vrp_garages, so i change this line:

OLD

MySQL.createCommand("vRP/ply_get_vehicles","SELECT * FROM vrp_user_vehicles WHERE user_id = @user_id")

CHANGE FOR:

MySQL.createCommand("vRP/ply_get_vehicles","SELECT * FROM vrp_user_vehicles WHERE user_id = @user_id AND veh_confiscate = 0")

Now her select all vehicles of player where veh_confiscate is 0(Not confiscated)

3 Likes

Help Erro… Vrp_BasicGarages

Anyone know how to put a timer on this? so players cant pay for the vehcile until a time has been served?

1 Like