Accessible code
Config = {
Locale = 'en',
FrameworkName = IsESX() and 'es_extended' or 'qb-core',
Target = {
ped = 'a_m_y_business_02', -- https://docs.fivem.net/docs/game-references/ped-models/
coords = vector4(-599.2646, -933.6917, 23.8644, 100.2251),
distance = 3
},
Blip = { -- https://docs.fivem.net/docs/game-references/blips/
id = 605,
scale = .8,
colour = 2,
label = 'NFT Marketplace'
}
}
Discord = {
url = '', -- url here
title = 'Server Name',
/*
https://www.spycolor.com/
['default'] = 14423100,
['blue'] = 255,
['red'] = 16711680,
['green'] = 65280,
['white'] = 16777215,
['black'] = 0,
['orange'] = 16744192,
['yellow'] = 16776960,
['pink'] = 16761035,
['lightgreen'] = 65309,
*/
color = 65309, -- green
imageUrl = 'https://cdn.discordapp.com/attachments/1126197898439295066/1129791542379434004/discord_banner_uniq.png', -- optional, if you dont want it put ''
}
function Notify(msg, type)
lib.notify({
description = msg,
type = type,
position = 'bottom'
})
end
RegisterNetEvent('uniq_nft:Notify', Notify)
-- Target
exports["qtarget"]:AddTargetModel(Config.Target.ped, {
options = {
{
icon = "ad",
label = L('target'),
action = function()
TriggerServerEvent('uniq_nft:server:OpenMarket')
end
}
},
distance = Config.Target.distance
})
function HasMoney(source, price)
if IsESX() then
return ESX.GetPlayerFromId(source)?.getMoney() >= price
elseif IsQBCore() then
return QBCore.Functions.GetPlayer(source)?.Functions.GetMoney('cash') >= price
end
return false
end
function RemoveMoney(source, amount)
if IsESX() then
ESX.GetPlayerFromId(source).removeMoney(amount)
elseif IsQBCore() then
QBCore.Functions.GetPlayer(source)?.Functions.RemoveMoney('cash', amount, '')
end
end
-- you can put some other checks
function IsAdmin(source)
return IsPlayerAceAllowed(source, 'command')
end
Locales['en'] = {
target = 'NFT Marketplace',
nft = 'NFT',
your_nfts = 'Your NFT\'s',
options = 'Options',
marketplace = 'Marketplace',
buy_nft = 'Buy NFT',
reports = 'Reports',
comments = 'Comments',
nft_market = {
nft_description = 'Price: %s | Rating: %s',
rate_nft = 'Rate NFT',
rate_nft_description = 'Rating (0 - 5)',
report_nft = 'Report NFT',
report_nft_reason = 'Reason',
report_nft_reason_desc = 'Description',
comment_nft = 'Comment',
comments = 'Comments',
edit_price = 'Edit Price',
new_price = 'New price for %s',
price = 'Price',
remove_from_market = 'Remove From Marketplace',
buy_nft_alert = 'Hello there, are you sure you want to buy this NFT for $%s?'
},
create_nft = {
label = 'Create NFT',
name = 'Name',
image = 'NFT Image URL',
},
my_nfts = {
label = 'My NFT\'s',
publish_on_market = 'Publish On Marketplace',
input_price = 'Input Price',
},
notify = {
successfully_created_nft = 'You have successfully created NFT %s',
removed_nft = 'NFT %s successfully removed from Marketplace',
nft_published = 'NFT %s successfully published on Marketplace',
successfully_commented = 'You have successfully commented on NFT %s',
successfully_reported = 'You have successfully reported NFT %s',
not_enough_money = 'You don\'t have enough money',
price_updated = 'Price for NFT %s updated to $%s',
nft_rated = 'NFT %s successfully rated with Rating %s',
},
logs = {
price_updated = 'Price Updated',
price_updated_desc = '%s has updated price for NFT %s, new price $%s',
nft_rated = 'NFT Rated',
nft_rated_desc = '%s has rated %s with %s',
nft_created = 'NFT Created',
nft_created_desc = '%s has created new NFT %s, ID %s',
nft_reported = 'NFT Reported',
nft_reported_desc = '%s has reproted %s for %s',
nft_comment = 'New NFT Comment',
nft_comment_desc = '%s has left comment on %s, comment: %s',
nft_removed = 'NFT Removed From Marketplace',
nft_removed_desc = '%s has removed NFT %s from Marketplace',
new_nft = 'New NFT on Marketplace',
new_nft_desc = '%s has uploaded %s on marketplace for %s',
nft_purchase = 'NFT Purchase',
nft_purchase_desc = '%s haws bought NFT %s for $%s',
},
warnings = {
updatePrice = '%s(%s) tried to update price for NFT %s but is not owner',
}
}
Last updated