Locales & SQL
Codesign resources contain various editable/unobscured files such as client/server functions etc.
SQL
Guide
Watch this video if you are unsure how to insert an SQL Query into your database. HeidiSQL / PHPMyAdmin.
ESX SQL
ALTER TABLE `owned_vehicles` ADD COLUMN `in_garage` TINYINT(1) NOT NULL DEFAULT '0';
ALTER TABLE `owned_vehicles` ADD COLUMN `garage_id` VARCHAR(50) NOT NULL DEFAULT 'A';
ALTER TABLE `owned_vehicles` ADD COLUMN `garage_type` VARCHAR(50) NOT NULL DEFAULT 'car';
ALTER TABLE `owned_vehicles` ADD COLUMN `job_personalowned` VARCHAR(50) NOT NULL DEFAULT '';
ALTER TABLE `owned_vehicles` ADD COLUMN `property` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `owned_vehicles` ADD COLUMN `impound` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `owned_vehicles` ADD COLUMN `impound_data` LONGTEXT NOT NULL DEFAULT '';
ALTER TABLE `owned_vehicles` ADD COLUMN `adv_stats` LONGTEXT NOT NULL DEFAULT '{"plate":"nil","mileage":0.0,"maxhealth":1000.0}';
ALTER TABLE `owned_vehicles` ADD COLUMN `custom_label` VARCHAR(30) NULL DEFAULT NULL;
ALTER TABLE `owned_vehicles` ADD COLUMN `fakeplate` VARCHAR(8) NULL DEFAULT NULL;
ALTER TABLE `users` ADD COLUMN `garage_limit` INT(10) NOT NULL DEFAULT '7';
CREATE TABLE `cd_garage_keys` (
`plate` VARCHAR(8) NOT NULL,
`owner_identifier` VARCHAR(50) NOT NULL,
`reciever_identifier` VARCHAR(50) NOT NULL,
`owner_name` VARCHAR(50) NOT NULL,
`reciever_name` VARCHAR(50) NOT NULL,
`model` VARCHAR(50) NOT NULL
);
CREATE TABLE `cd_garage_persistentvehicles` (
`persistent` LONGTEXT NOT NULL
);
CREATE TABLE `cd_garage_privategarage` (
`identifier` VARCHAR(50) NOT NULL,
`data` LONGTEXT NOT NULL
);
CREATE TABLE `vehicles` (
`name` VARCHAR(60) NOT NULL,
`model` VARCHAR(60) NOT NULL,
`price` INT(11) NOT NULL,
`category` VARCHAR(60) NULL DEFAULT NULL,
PRIMARY KEY (`model`) USING BTREE
);QBCore SQL
ALTER TABLE `player_vehicles` ADD COLUMN `in_garage` TINYINT(1) NOT NULL DEFAULT '0';
ALTER TABLE `player_vehicles` ADD COLUMN `garage_id` VARCHAR(50) NOT NULL DEFAULT 'A';
ALTER TABLE `player_vehicles` ADD COLUMN `garage_type` VARCHAR(50) NOT NULL DEFAULT 'car';
ALTER TABLE `player_vehicles` ADD COLUMN `job_personalowned` VARCHAR(50) NOT NULL DEFAULT '';
ALTER TABLE `player_vehicles` ADD COLUMN `property` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `player_vehicles` ADD COLUMN `impound` INT(10) NOT NULL DEFAULT '0';
ALTER TABLE `player_vehicles` ADD COLUMN `impound_data` LONGTEXT NOT NULL DEFAULT '';
ALTER TABLE `player_vehicles` ADD COLUMN `adv_stats` LONGTEXT NOT NULL DEFAULT '{"plate":"nil","mileage":0.0,"maxhealth":1000.0}';
ALTER TABLE `player_vehicles` ADD COLUMN `custom_label` VARCHAR(30) NULL DEFAULT NULL;
ALTER TABLE `player_vehicles` ADD COLUMN `fakeplate` VARCHAR(8) NULL DEFAULT NULL;
ALTER TABLE `players` ADD COLUMN `garage_limit` INT(10) NOT NULL DEFAULT '7';
CREATE TABLE `cd_garage_keys` (
`plate` VARCHAR(8) NOT NULL,
`owner_identifier` VARCHAR(50) NOT NULL,
`reciever_identifier` VARCHAR(50) NOT NULL,
`owner_name` VARCHAR(50) NOT NULL,
`reciever_name` VARCHAR(50) NOT NULL,
`model` VARCHAR(50) NOT NULL
);
CREATE TABLE `cd_garage_persistentvehicles` (
`persistent` LONGTEXT NOT NULL
);
CREATE TABLE `cd_garage_privategarage` (
`identifier` VARCHAR(50) NOT NULL,
`data` LONGTEXT NOT NULL
);Webhooks
------------------------------------------------------------------------------------------------------
-------------------------------------------- WEBHOOK URLS --------------------------------------------
------------------------------------------------------------------------------------------------------
--These are disabled by default, until you enter your discord webhooks.
local ExploitLogWebhook = 'CHANGE_ME' --If a player is found using cheat engine to change the hash of a vehicle, this will send a message on discord and kick them from the game.
local ImpoundLogWebhook = 'CHANGE_ME' --When a player impounds/unimpounds a vehicle.
local TransferVehicleLogWebhook = 'CHANGE_ME' --When a player transfers a vehicle to another player.
local VehicleManagementLogWebhook = 'CHANGE_ME' --When a staff member uses the vehicle managment commands.
local GarageSpaceLogWebhook = 'CHANGE_ME' --When a player sells a garage slot.
------------------------------------------------------------------------------------------------------
---------------------------------------------- WEBHOOKS ----------------------------------------------
------------------------------------------------------------------------------------------------------
function ExploitAlertLogs(source, plate, newmodel, oldmodel, identifier)
if ExploitLogWebhook ~= nil and #ExploitLogWebhook > 10 then
local message = string.format(L('logs_exploit_message'), GetPlayerName(source), plate, newmodel, oldmodel, identifier)
PerformHttpRequest(ExploitLogWebhook, function(err, text, headers) end, 'POST', json.encode({content = message}), { ['Content-Type'] = 'application/json' })
end
end
function ImpoundVehicleLogs(source, action, vehiclelabel, vehicleplate, impoundlocation)
if ImpoundLogWebhook ~= nil and #ImpoundLogWebhook > 10 then
local message, color
if action == 'impound' then
message = string.format(L('logs_impound_message'), vehicleplate, vehiclelabel, impoundlocation, GetPlayerName(source), source, GetIdentifier(source))
color = 16711680
elseif action == 'unimpound' then
message = string.format(L('logs_unimpound_message'), vehicleplate, vehiclelabel, GetPlayerName(source), source, GetIdentifier(source))
color = 56108
end
local data = {{
['color'] = color,
['title'] = action:sub(1,1):upper()..action:sub(2),
['description'] = message,
['footer'] = {
['text'] = os.date('%c'),
['icon_url'] = 'https://i.imgur.com/VMPGPTQ.png',
},
}}
PerformHttpRequest(ImpoundLogWebhook, function(err, text, headers) end, 'POST', json.encode({username = L('garage_title'), embeds = data}), { ['Content-Type'] = 'application/json' })
end
end
function TransferVehicleLogs(source, target, plate, label)
if TransferVehicleLogWebhook ~= nil and #TransferVehicleLogWebhook > 10 then
local message = string.format(L('logs_transfer_message'), plate, label, GetPlayerName(source), source, GetIdentifier(source), GetPlayerName(target), target, GetIdentifier(target))
local data = {{
['color'] = '2061822',
['title'] = L('logs_transfer_title'),
['description'] = message,
['footer'] = {
['text'] = os.date('%c'),
['icon_url'] = 'https://i.imgur.com/VMPGPTQ.png',
},
}}
PerformHttpRequest(TransferVehicleLogWebhook, function(err, text, headers) end, 'POST', json.encode({username = L('garage_title'), embeds = data}), { ['Content-Type'] = 'application/json' })
end
end
function VehicleManagmentLogs(source, action, plate, target, garage_type)
if VehicleManagementLogWebhook ~= 'CHANGE_ME' and VehicleManagementLogWebhook ~= nil then
local message, color
if action == 'add' then
message = string.format(L('logs_vehiclemanagment_add'), plate, garage_type, GetPlayerName(source), source, GetIdentifier(source), GetPlayerName(target), target, GetIdentifier(target))
color = '56108'
elseif action == 'delete' then
message = string.format(L('logs_vehiclemanagment_delete'), plate, GetPlayerName(source), source, GetIdentifier(source))
color = '16711680'
elseif action == 'plate' then
message = string.format(L('logs_vehiclemanagment_plate'), plate, target, GetPlayerName(source), source, GetIdentifier(source))
color = '2061822'
end
local data = {{
['color'] = color,
['title'] = string.format(L('logs_vehiclemanagment_title'), string.upper(action)),
['description'] = message,
['footer'] = {
['text'] = os.date('%c'),
['icon_url'] = 'https://i.imgur.com/VMPGPTQ.png',
},
}}
PerformHttpRequest(VehicleManagementLogWebhook, function(err, text, headers) end, 'POST', json.encode({username = L('garage_title'), embeds = data}), { ['Content-Type'] = 'application/json' })
end
end
function GarageSpaceLogs(source, new_limit, price, target)
if GarageSpaceLogWebhook ~= nil and #GarageSpaceLogWebhook > 10 then
local message = string.format(L('logs_garagespace_message'), new_limit, price, GetPlayerName(source), source, GetIdentifier(source), GetPlayerName(target), target, GetIdentifier(target))
local data = {{
['color'] = '2061822',
['title'] = L('logs_garagespace_title'),
['description'] = message,
['footer'] = {
['text'] = os.date('%c'),
['icon_url'] = 'https://i.imgur.com/VMPGPTQ.png',
},
}}
PerformHttpRequest(GarageSpaceLogWebhook, function(err, text, headers) end, 'POST', json.encode({username = L('garage_title'), embeds = data}), { ['Content-Type'] = 'application/json' })
end
endLocales
Lua - https://github.com/RampBST/Codesign_Locales/blob/main/cd_garage/locales.lua
Js - https://github.com/RampBST/Codesign_Locales/blob/main/cd_garage/locales_ui.js
Last updated
Was this helpful?

