you don’t you just add the code to your server.lua file
Please make this compatible with Discord ID thank you
doesn’t work on the newest es_extended for me either. Maybe @3Bot can make a newer version
they updated it so put it in server/main.lua
yeah it needs to be updated so it support latest es_extended
WaltZy
June 1, 2020, 10:46am
67
i have an issue it changes the vehicle to the persons steam id not his identifier
wheres the link for the script
I get this error when I try doing /revive with the thing.
[script:essentialmode] SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:853: bad argument #1 to ‘unpack’ (table expected, got nil)
[script:essentialmode] > handler (@chat /server/sv_chat.lua:27)
Is there a way of using this script with the lisence keys instead of steam?
SootyPegasus8:
RegisterCommand('givecar', function(source, args)
myself = source
if args[1] ~= nil then
other = args[1]
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
return
end
if(GetPlayerName(tonumber(args[1]))) then
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Incorrect player ID!")
return
end
mySteamID = GetPlayerIdentifiers(source)
mySteam = mySteamID[1]
myID = ESX.GetPlayerFromId(source).identifier
myName = ESX.GetPlayerFromId(source).name
targetSteamID = GetPlayerIdentifiers(args[1])
targetSteamName = ESX.GetPlayerFromId(args[1]).name
targetSteam = targetSteamID[1]
table.remove(args, 1)
local plate = ""
for k,v in pairs(args) do
plate = plate .. v .. " "
end
plate = string.sub(plate, 1, -2)
MySQL.Async.fetchAll(
'SELECT * FROM owned_vehicles WHERE plate = @plate',
{
['@plate'] = plate
},
function(result)
if result[1] ~= nil then
local playerName = ESX.GetPlayerFromIdentifier(result[1].owner).identifier
local pName = ESX.GetPlayerFromIdentifier(result[1].owner).name
CarOwner = playerName
if myID == CarOwner then
data = {}
TriggerClientEvent('chatMessage', other, "^4Vehicle with the plate ^*^1" .. plate .. "^r^4was transfered to you by: ^*^2" .. myName)
MySQL.Sync.execute("UPDATE owned_vehicles SET owner=@owner WHERE plate=@plate", {['@owner'] = targetSteam, ['@plate'] = plate})
TriggerClientEvent('chatMessage', source, "^4You have ^*^3transfered^0^4 your vehicle with the plate ^*^1" .. plate .. " ^r^4to ^*^2".. targetSteamName)
else
print("Did not transfer")
TriggerClientEvent('chatMessage', source, "^*^1You do not own the vehicle")
end
else
TriggerClientEvent('chatMessage', source, "^1^*ERROR: ^r^0This vehicle plate does not exist or the plate was incorrectly written.")
end
end
)
end)
go to sever and the main.lua
TeamGC
August 21, 2021, 6:55am
73
bro can you tell me that in which line should i specifically paste that code
3bot so where is the download link?
nice script but how can i make it to use fivem identifiers instead of steam, cause it remove the car but never give it
.i think steam is my problem here
did you get a fix for this
Azwynn
March 23, 2022, 1:46pm
77
Hi i’ve a problem. I have put everything correctly and the command works. The problem is that when the person keeps the car in the garage, it no longer appears inside. How can I solve it?