Skip to content

Commit 7fd0704

Browse files
authored
Merge pull request #51 from it-scripts/v1.4.1beta
v1.4.1beta
2 parents 08dd8cc + 5d77fa9 commit 7fd0704

13 files changed

Lines changed: 101 additions & 44 deletions

File tree

client/cl_menus.lua

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -501,35 +501,62 @@ RegisterNetEvent("it-drugs:client:showSellMenu", function(data)
501501
local amount = data.amount
502502
local price = data.price
503503
local ped = data.entity
504+
local rewardItems = data.rewardItems
504505

505506
local itemLabel = exports.it_bridge:GetItemLabel(item)
506507

508+
509+
local options = {}
510+
if price > 0 then
511+
table.insert(options, {
512+
title = _U('MENU__SELL__DEAL'),
513+
description = _U('MENU__SELL__DESC'):format(itemLabel, amount, amount * price),
514+
icon = "coins",
515+
})
516+
else
517+
table.insert(options, {
518+
title = _U('MENU__SELL__DEAL'),
519+
description = _U('MENU__SEEL__DESC__ZERO'):format(itemLabel, amount),
520+
icon = "coins",
521+
})
522+
end
523+
524+
if rewardItems then
525+
table.insert(options, {
526+
title = _U('MENU__SELL__REWARD'),
527+
icon = "gift",
528+
})
529+
for _, itemData in pairs(rewardItems) do
530+
table.insert(options, {
531+
title = exports.it_bridge:GetItemLabel(itemData.name),
532+
description = _U('MENU__SELL_REWARD_DESC'):format(itemData.amount * amount),
533+
icon = "coins",
534+
})
535+
end
536+
end
537+
538+
table.insert(options, {
539+
title = _U('MENU__SELL__ACCEPT'),
540+
icon = "circle-check",
541+
description = _U('MENU__SELL__ACCEPT__DESC'),
542+
arrow = true,
543+
event = "it-drugs:client:salesInitiate",
544+
args = {type = 'buy', item = item, price = price, amount = amount, tped = ped}
545+
})
546+
547+
table.insert(options, {
548+
title = _U('MENU__SELL__REJECT'),
549+
icon = "circle-xmark",
550+
description = _U('MENU__SELL__REJECT__DESC'),
551+
arrow = true,
552+
event = "it-drugs:client:salesInitiate",
553+
args = {type = 'close', tped = ped}
554+
})
555+
507556
lib.registerContext({
508557
id = "it-drugs-sell-menu",
509558
title = _U('MENU__SELL'),
510-
options = {
511-
{
512-
title = _U('MENU__SELL__DEAL'),
513-
description = _U('MENU__SELL__DESC'):format(itemLabel, amount, amount * price),
514-
icon = "coins",
515-
},
516-
{
517-
title = _U('MENU__SELL__ACCEPT'),
518-
icon = "circle-check",
519-
description = _U('MENU__SELL__ACCEPT__DESC'),
520-
arrow = true,
521-
event = "it-drugs:client:salesInitiate",
522-
args = {type = 'buy', item = item, price = price, amount = amount, tped = ped}
523-
},
524-
{
525-
title = _U('MENU__SELL__REJECT'),
526-
icon = "circle-xmark",
527-
description = _U('MENU__SELL__REJECT__DESC'),
528-
arrow = true,
529-
event = "it-drugs:client:salesInitiate",
530-
args = {type = 'close', tped = ped}
531-
}
532-
}
559+
options = options,
533560
})
534561
lib.showContext("it-drugs-sell-menu")
535562
end)

client/cl_selling.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ RegisterNetEvent('it-drugs:client:checkSellOffer', function(entity)
128128
local availabeItems = {}
129129
for itemName, itemData in pairs(zoneConfig.drugs) do
130130
if exports.it_bridge:HasItem(itemName)then
131-
table.insert(availabeItems, {item = itemName, price = itemData.price, moneyType = itemData.moneyType})
131+
table.insert(availabeItems, {item = itemName, price = itemData.price, moneyType = itemData.moneyType, rewardItems = itemData.rewardItems})
132132
end
133133
end
134134

@@ -156,7 +156,8 @@ RegisterNetEvent('it-drugs:client:checkSellOffer', function(entity)
156156
sellItemData = {
157157
item = randomDrugKey,
158158
price = zoneConfig.drugs[randomDrugKey].price,
159-
moneyType = zoneConfig.drugs[randomDrugKey].moneyType
159+
moneyType = zoneConfig.drugs[randomDrugKey].moneyType,
160+
rewardItems = zoneConfig.drugs[randomDrugKey].rewardItems
160161
}
161162

162163
playerItems = exports.it_bridge:GetItemCount(sellItemData.item)
@@ -170,7 +171,7 @@ RegisterNetEvent('it-drugs:client:checkSellOffer', function(entity)
170171
sellAmount = playerItems
171172
end
172173

173-
TriggerEvent('it-drugs:client:showSellMenu', {item = sellItemData.item, price = sellItemData.price, amount = sellAmount, entity = entity})
174+
TriggerEvent('it-drugs:client:showSellMenu', {item = sellItemData.item, price = sellItemData.price, amount = sellAmount, entity = entity, rewardItems = sellItemData.rewardItems})
174175
SetTimeout(Config.SellSettings['sellTimeout']*1000, function()
175176
if Config.Debug then lib.print.info('Sell Menu Timeout... Current Menu', lib.getOpenContextMenu()) end
176177
if lib.getOpenContextMenu() ~= nil then

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ game 'gta5'
33

44
author '@allroundjonu'
55
description 'Advanced Drug System for FiveM'
6-
version 'v1.4.0'
6+
version 'v1.4.1'
77

88
identifier 'it-drugs'
99

locales/de.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ Locales['de'] = {
4949
['MENU__DEALER__SELL_DESC'] = 'Verkaufe Gegenstände an den Dealer',
5050
['MENU__DEALER_SELL_ITEM__DESC'] = 'Verkaufe %s für $%g pro Stück',
5151

52-
53-
5452
['MENU__SELL'] = 'Verkaufen',
5553
['MENU__SELL__DEAL'] = 'Deal',
5654
['MENU__SELL__DESC'] = 'Verkaufe %s (x%g) für $%g',
55+
['MENU__SEEL__DESC__ZERO'] = 'Verkaufe %s (x%g) und erhalte:',
56+
57+
['MENU__SELL__REWARD'] = 'Gegenstände:',
58+
['MENU__SELL_REWARD_DESC'] = 'Du erhältst x%g',
5759

5860
['MENU__SELL__ACCEPT'] = 'Angebot annehmen',
5961
['MENU__SELL__ACCEPT__DESC'] = 'Nimm das aktuelle Angebot an',

locales/en.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ Locales['en'] = {
4949
['MENU__DEALER__SELL_DESC'] = 'Sell items to the dealer',
5050
['MENU__DEALER_SELL_ITEM__DESC'] = 'Sell %s for $%g per item',
5151

52-
53-
5452
['MENU__SELL'] = 'Sell',
5553
['MENU__SELL__DEAL'] = 'Deal',
5654
['MENU__SELL__DESC'] = 'Sell %s (x%g) for $%g',
55+
['MENU__SEEL__DESC__ZERO'] = 'Sell %s (x%g) and get:',
56+
57+
['MENU__SELL__REWARD'] = 'Items:',
58+
['MENU__SELL_REWARD_DESC'] = 'You will get x%g',
5759

5860
['MENU__SELL__ACCEPT'] = 'Accept offer',
5961
['MENU__SELL__ACCEPT__DESC'] = 'Accept the current offer',

locales/es.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ Locales['es'] = {
4848
['MENU__DEALER_SELL'] = 'Vender',
4949
['MENU__DEALER__SELL_DESC'] = 'Vende objetos al traficante',
5050
['MENU__DEALER_SELL_ITEM__DESC'] = 'Vende %s por $%g cada uno',
51-
51+
5252
['MENU__SELL'] = 'Vender',
5353
['MENU__SELL__DEAL'] = 'Trato',
5454
['MENU__SELL__DESC'] = 'Vende %s (x%g) por $%g',
55+
['MENU__SEEL__DESC__ZERO'] = 'Vende %s (x%g) y obtén:',
56+
57+
['MENU__SELL__REWARD'] = 'Objetos:',
58+
['MENU__SELL_REWARD_DESC'] = 'Recibirás x%g',
5559

5660
['MENU__SELL__ACCEPT'] = 'Aceptar oferta',
5761
['MENU__SELL__ACCEPT__DESC'] = 'Acepta la oferta actual',

locales/fr.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ Locales['fr'] = {
4949
['MENU__DEALER__SELL_DESC'] = 'Vendre des objets au dealer',
5050
['MENU__DEALER_SELL_ITEM__DESC'] = 'Vendre %s pour $%g pièce',
5151

52-
53-
5452
['MENU__SELL'] = 'Vendre',
5553
['MENU__SELL__DEAL'] = 'Accord',
5654
['MENU__SELL__DESC'] = 'Vendre %s (x%g) pour $%g',
55+
['MENU__SEEL__DESC__ZERO'] = 'Vendre %s (x%g) et obtenir :',
56+
57+
['MENU__SELL__REWARD'] = 'Objets :',
58+
['MENU__SELL_REWARD_DESC'] = 'Vous recevrez x%g',
5759

5860
['MENU__SELL__ACCEPT'] = 'Accepter l\'offre',
5961
['MENU__SELL__ACCEPT__DESC'] = 'Accepter l\'offre actuelle',

locales/he.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ Locales['he'] = {
5454
['MENU__SELL'] = 'מכירה',
5555
['MENU__SELL__DEAL'] = 'עסקה',
5656
['MENU__SELL__DESC'] = 'מכור %s (x%g) תמורת ₪%g',
57+
['MENU__SEEL__DESC__ZERO'] = 'מכור %s (x%g) ותקבל:',
58+
59+
['MENU__SELL__REWARD'] = 'פריטים:',
60+
['MENU__SELL_REWARD_DESC'] = 'תקבל x%g',
5761

5862
['MENU__SELL__ACCEPT'] = 'קבל הצעה',
5963
['MENU__SELL__ACCEPT__DESC'] = 'קבל את ההצעה הנוכחית',

locales/it.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ Locales['it'] = {
4949
['MENU__DEALER__SELL_DESC'] = 'Vendi oggetti al trafficante',
5050
['MENU__DEALER_SELL_ITEM__DESC'] = 'Vendi %s a $%g al pezzo',
5151

52-
53-
5452
['MENU__SELL'] = 'Vendi',
5553
['MENU__SELL__DEAL'] = 'Affare',
5654
['MENU__SELL__DESC'] = 'Vendi %s (x%g) per $%g',
55+
['MENU__SEEL__DESC__ZERO'] = 'Vendi %s (x%g) e ottieni:',
56+
57+
['MENU__SELL__REWARD'] = 'Oggetti:',
58+
['MENU__SELL_REWARD_DESC'] = 'Otterrai x%g',
5759

5860
['MENU__SELL__ACCEPT'] = 'Accetta offerta',
5961
['MENU__SELL__ACCEPT__DESC'] = 'Accetta l\'offerta corrente',

locales/nl.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ Locales['nl'] = {
2727
['MENU__ITEM'] = 'Items',
2828
['MENU__ITEM__DESC'] = 'Gebnuikt dit item om je plant te verzorgen',
2929

30-
31-
3230
['MENU__PROCESSING'] = 'Verwerk',
3331
['MENU__RECIPE__DESC'] = 'Verwerk je drugs met dit recept',
3432

@@ -51,11 +49,13 @@ Locales['nl'] = {
5149
['MENU__DEALER__SELL_DESC'] = 'Verkoop items aan dealer',
5250
['MENU__DEALER_SELL_ITEM__DESC'] = 'verkoop %s voor $%g per item',
5351

54-
55-
5652
['MENU__SELL'] = 'Verkoop',
5753
['MENU__SELL__DEAL'] = 'Deal',
5854
['MENU__SELL__DESC'] = 'Verkoop %s (x%g) voor $%g',
55+
['MENU__SEEL__DESC__ZERO'] = 'Verkoop %s (x%g) en krijg:',
56+
57+
['MENU__SELL__REWARD'] = 'Items:',
58+
['MENU__SELL_REWARD_DESC'] = 'Je krijgt x%g',
5959

6060
['MENU__SELL__ACCEPT'] = 'Accepteer offer',
6161
['MENU__SELL__ACCEPT__DESC'] = 'Accepteer het huidig offer',

0 commit comments

Comments
 (0)