@@ -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" )
535562end )
0 commit comments