đConfigurables
--[[
BY RX Scripts Š rxscripts.xyz
--]]
Config.Locale = 'en'
Config.RequiredItem = { item = 'phone', label = 'Phone', removeAfterStartScrap = false } -- Remove line to disable
Config.TableModel = 'prop_tablesaw_01'
Config.ScrappingCooldown = 3600 -- Cooldown in seconds that a player has to wait before scrapping another vehicle
Config.WeldingTime = 2000 -- In ms
Config.DeleteVehiclesFromDB = false -- Delete owned vehicles from database when scrapped?
Config.SpawnVehicleAtStart = {
enabled = false, -- Spawn vehicle at start of scrapping?,
coords = vector4(-442.5281, -1670.0328, 19.0291, 126.4909),
models = { -- Models where a random model gets picked from
'adder'
}
}
Config.Suspicion = {
enabled = true,
mistakesBeforeNotifyingPolice = 3,
cancelOnSuspiciousReason = true,
suspiciousReasonWords = {
'stolen',
'steal',
'stole',
'heist',
}
}
Config.RequiredJobs = {
enabled = false, -- Do you want to players to need a job to scrap vehicles?
jobs = {
'mechanic',
'police',
}
}
Config.PartReturns = { -- Items you get from scrapping parts
trunk = {
{ item = 'scrapmetal', amount = 10 },
{ item = 'copper', amount = 3 },
},
hood = {
{ item = 'scrapmetal', amount = 10 },
{ item = 'copper', amount = 3 },
},
doorFrontRight = {
{ item = 'scrapmetal', amount = 5 },
{ item = 'copper', amount = 2 },
},
doorFrontLeft = {
{ item = 'scrapmetal', amount = 5 },
{ item = 'copper', amount = 2 },
},
doorRearRight = {
{ item = 'scrapmetal', amount = 5 },
{ item = 'copper', amount = 2 },
},
doorRearLeft = {
{ item = 'scrapmetal', amount = 5 },
{ item = 'copper', amount = 2 },
},
wheelFrontRight = {
{ item = 'scrapmetal', amount = 5 },
{ item = 'rubber', amount = 5 },
},
wheelFrontLeft = {
{ item = 'scrapmetal', amount = 4 },
{ item = 'rubber', amount = 5 },
},
wheelRearRight = {
{ item = 'scrapmetal', amount = 4 },
{ item = 'rubber', amount = 5 },
},
wheelRearLeft = {
{ item = 'scrapmetal', amount = 4 },
{ item = 'rubber', amount = 5 },
},
}
Config.Scrapyards = {
{
vehicleCoords = vector3(-426.5357, -1688.9329, 19.0291),
tableCoords = vector3(-428.3014, -1681.5248, 19.0291),
onlyPlayerNotOwnedCars = true, -- Only allow scrapping of cars that are not owned by a player
npc = {
label = 'Scrapyard Worker',
model = 's_m_m_autoshop_02',
coords = vector4(-425.5182, -1679.4059, 18.0291, 198.2127),
},
blip = {
enabled = true,
sprite = 446,
color = 5,
scale = 0.8,
display = 4,
label = 'Scrapyard',
},
blacklistedVehicles = {
'adder',
},
}
}
--[[
BY RX Scripts Š rxscripts.xyz
--]]
-- return true if minigame has been succeeded, false if not
function ScrapMinigame()
return lib.skillCheck({'easy', 'easy', 'easy'}, {'w', 'a', 's', 'd'})
end
function Notify(msg, type)
if Core == 'ESX' then
CoreObj.ShowNotification(msg, type)
elseif Core == 'QB' then
CoreObj.Functions.Notify(msg, type)
end
end
function Marker(coords)
DrawMarker(1, coords.x, coords.y, coords.z, 0, 0, 0, 0, 0, 0, 3.0, 3.0, 0.5, 255, 255, 0, 80, false, true, 2, false, false, false, false)
end
function GetJob()
if ESX then
return ESX.GetPlayerData().job
elseif QB then
return QB.Functions.GetPlayerData().job
else
-- Your own job system
end
end
--[[
BY RX Scripts Š rxscripts.xyz
--]]
function DeleteVehicleFromDB(plate)
local vehTable = 'owned_vehicles'
if Core == 'QB' then
vehTable = 'player_vehicles'
end
MySQL.single('SELECT * FROM '..vehTable..' WHERE plate = @plate', {
['@plate'] = plate
}, function(row)
if not row then return end
if row then
MySQL.query('DELETE FROM '..vehTable..' WHERE plate = @plate', {
['@plate'] = plate
})
end
end)
end
function IsPlayerOwnedVehicle(plate)
local vehTable = 'owned_vehicles'
if Core == 'QB' then
vehTable = 'player_vehicles'
end
local row = MySQL.single.await('SELECT * FROM '..vehTable..' WHERE plate = @plate', {
['@plate'] = plate
})
return row ~= nil
end
function GetPlayerFromSrc(src)
if Core == 'ESX' then
return CoreObj.GetPlayerFromId(src)
elseif Core == 'QB' then
return CoreObj.Functions.GetPlayer(src)
end
return nil
end
function GetIdentifier(src)
local player = GetPlayerFromSrc(src)
if player then
if Core == 'ESX' then
return player.identifier
elseif Core == 'QB' then
return player.PlayerData.citizenid
end
end
return nil
end
function AddInventoryItem(src, item, count)
local player = GetPlayerFromSrc(src)
if player then
if Core == 'ESX' then
player.addInventoryItem(item, count)
elseif Core == 'QB' then
player.Functions.AddItem(item, count)
end
end
end
function RemoveInventoryItem(src, item, count)
local player = GetPlayerFromSrc(src)
if player then
if Core == 'ESX' then
player.removeInventoryItem(item, count)
elseif Core == 'QB' then
player.Functions.RemoveItem(item, count)
end
end
end
function InformCops(msg)
if Core == 'ESX' then
local cops = CoreObj.GetExtendedPlayers('job', 'police')
for k, v in pairs(cops) do
TriggerClientEvent('esx:showNotification', v.source, msg)
end
elseif Core == 'QB' then
local players = CoreObj.Functions.GetQBPlayers()
for k, v in pairs(players) do
if v.PlayerData.job.name == 'police' then
TriggerClientEvent('QBCore:Notify', v.PlayerData.source, msg)
end
end
end
end
Last updated