Skip to content

Commit

Permalink
refactor: add ContractData class for contract information
Browse files Browse the repository at this point in the history
  • Loading branch information
toshko003 committed Oct 11, 2024
1 parent a18482a commit 8f41c14
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8f41c14

Please sign in to comment.