[release]Admin gives car to database

1.The administrator gives a car directly to the player through instructions, and the car will be added to the player’s garage
2.The administrator directly deletes the player’s vehicle through instructions

[give me]
1./givecar [model]
[give to Player]
2./giveyoucar [model] [Player game id (number)]
[Delete vehicle]
3./dvplate [plate]

tutorial:
youtube:fivem给玩家车辆 - YouTube

update:
download->https://github.com/Nuo-Ke/fivem_esx_givecar
tebex.io
https://nuoke.tebex.io/package/4276927

10 Likes

is the text really in chinese?

Yes he is chinese right

1 Like
Plate: "Goma"
Duplicate entry "Goma"

i think you already have the car or the plate is already in the database ?

3 Likes

plate must not be repeated, all letters must be capitalized

1 Like

dope as hell

1 Like

is this only for ESX?

1 Like

Works great, only thing I note is the car that actually spawns is not the car with the plate, but if you delete it, and grab the actual car from the impound it works fine.

Thanks for this

even if it is its not hard to translate bud

1 Like

@Nuo Hey you should add a native to your code to set the plate as the plate you want.
its this native

In client.lua add line between 22 and 23, and also 39 and 40

SetVehicleNumberPlateText(vehicle, newPlate)

Problem, i get the car in garage and i can take it out but when i want to store it again says, did you really own this car? Also i can lock the cars cause system do not detect owned car nearby, any fix?

use my code to fix it, add those to client.lua

1 Like

Ah thanks! I’ll give that a go

1 Like

thanks

Does this have any dependencies as i cant get it to work?
I am also using the latest version of es_extended if that has anything to do with it aswell

Hey nice one, so bad that we cant store it in the garage … even with @Pigrobot code :frowning:

There’s actually another script that works just like this
esx_giveownedcar

the script is very good , could you help me to add modelname of the car on database ?
for example if i type
/givecar nissantitan17 PLATE ID
nissantitan17 is a modelname in my database
i added this to server/main.lua

RegisterServerEvent('nuo:setVehicleBySql')
AddEventHandler('nuo:setVehicleBySql', function (vehicleProps,vehicleData)
	local _source = source
	local xPlayer = ESX.GetPlayerFromId(_source)

	MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle, modelname) VALUES (@owner, @plate, @vehicle, @modelname)',
	{
		['@owner']   = xPlayer.identifier,
		['@plate']   = vehicleProps.plate,
		['@vehicle'] = json.encode(vehicleProps),
		['@modelname'] = vehicleData.model
	}, function (rowsChanged)
		TriggerClientEvent('esx:showNotification', _source,'addCar:palte:'..vehicleProps.plate)
	end)
end)

Anyone know how to fix it not giving the car to the person/not having car keys

Any plan to make this for qbcore ?

4 Likes