From 8f41c14693fb7e687a05b34050170191c81ccfe8 Mon Sep 17 00:00:00 2001 From: toshko Date: Fri, 11 Oct 2024 22:04:29 +0300 Subject: [PATCH] refactor: add ContractData class for contract information --- server/main.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 8bd55a7..409c375 100644 --- a/server/main.lua +++ b/server/main.lua @@ -1,3 +1,13 @@ +---@class ContractData +---@field sellerId number +---@field buyerId number +---@field sellerName string +---@field buyerName string +---@field model string +---@field vehPlate string +---@field description string +---@field price number + Framework.RegisterUsableItem(Config.Item, function(source) local player = Framework.GetPlayerFromId(source) if not player then return end @@ -16,7 +26,7 @@ local function insertLog(buyer, seller, vehDescription, vehPrice, plate) end --- Send contract to buyer ----@param data { sellerId: number, buyerId: number, sellerName: string, buyerName: string, model: string, vehPlate: string, description: string, price: number } +---@param data ContractData RegisterNetEvent('tgg-contracts:server:sendContractToBuyer', function(data) local src = source local buyerSrc = data.buyerId