[Release][ESX] Give or delete owned vehicle to database (plate can custom or random generate)

IDK why do you guys have this problem, but I changed the way to get player identifier, it should work now
You can update the latest commit on github download link

You can also do it like:

local xPlayer= ESX.GetPlayerFromId(_source)
local identifier = xPlayer.identifier

This method is the way I originally used, but many people happened ESX is nil problem, I don’t know why :woozy_face:
So I change to using FiveM Native function GetPlayerIdentifier(source) to get player identifier

Now i have this error
SCRIPT ERROR: Execution of native 000000007302dbcf in script host failed: Argument at index 0 was null.

havePermission (@esx_giveownedcar/server/main.lua:129)
ref (@esx_giveownedcar/server/main.lua:6)
cfx>

i have a problem i give me a car this is not in garage or db

1 Like

I dont have permission, i changed my steam 64 id but i get still the same error message

I change the steam:[ID] but it says every time i dont have permisson

:arrow_up: Update

2020/1/10

  • Merged @Myself5’s fork, thanks him
  • Abstract the current givecar to givevehicle
  • Add givecar, giveboat, giveplane and giveheli to pass type to the database
  • Rework Permission requests to limits by group, you can add group in config
1 Like

how do i fix SCRIPT ERROR: @ESX_GiveCar/server/main. lau:166: attempt to index a nil value (local ‘xPlayer’) comes up everytime please help thanks

how do i fix SCRIPT ERROR: @ESX_GiveCar/server/main. lau:166: attempt to index a nil value (local ‘xPlayer’) comes up everytime please help thanks

Does anyone know how i go about registering the spawn code on the SQL?

it doesnt work when i give it to my self it says parked in garage but there is no car

1 Like

same issues for me brotha

same with me too

any errors?

Check on ur impound, if i use advancedgarage or similiar garage with impound, it sent there.

Now i use IO Garage , it sent to recover on mur first garage.


im getting this error

where can i ind this file?

server/main.lua

line: 145 and line: 151

Hi !

Great Script !

It’s possible to make the same with Money & items ?
And how make this ?

thanks :slight_smile: