Skip to content

Commit

Permalink
fixed when selling not receiving the money...
Browse files Browse the repository at this point in the history
fixed locale for opium dealer...
  • Loading branch information
diorgesl committed Dec 27, 2019
1 parent 838a225 commit 4da20f2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ Config.Drugs = {
-- sellMin: Min receveid by selling
-- sellMax: Max received by selling
-- multiplierPolice: true/false Multiply the min/max based on cops online
Field = {x = 1972.78, y = 3819.39, z = 32.50, name = _U('field', _U('opium')), sprite = 51, color = 60, callPolice = false, callPoliceChance = 100},
Processing = {x = 98.0, y = -1290.48, z = 29.27, name = _U('processing', _U('opium')), sprite = 51, color = 60, callPolice = false, callPoliceChance = 100},
--Dealer = {x = 1100.95, y = -3198.49, z = 38.99-1.0001, h = 45.24, name = _U('opium_dealer', _U('opium')), sprite = 500, color = 75, callPolice = false, callPoliceChance = 100, NPCHash = 653210662, sellMin = 200, sellMax = 500, multiplierPolice = true},
Field = {x = 1972.78, y = 3819.39, z = 32.50, name = _U('field', _U('opium')), sprite = 51, color = 60, callPolice = false, callPoliceChance = 100},
Processing = {x = 98.0, y = -1290.48, z = 29.27, name = _U('processing', _U('opium')), sprite = 51, color = 60, callPolice = false, callPoliceChance = 100},
Dealer = {x = 1053.95, y = -3246.49, z = 5.89-1.0001, h = 45.24, name = _U('dealer', _U('opium')), sprite = 500, color = 75, callPolice = false, callPoliceChance = 100, NPCHash = 653210662, sellMin = 200, sellMax = 500, multiplierPolice = true},
}
},
-- Translated name
Expand Down
2 changes: 1 addition & 1 deletion locales/br.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Locales['br'] = {
['too_many_pouches'] = 'Seu inventario estar ficando lotado de ~r~Drogas',
['packing_in_prog'] = '~y~Empacotamento em progresso~s~...',
['inv_full'] = 'Você não pode mais coletar ~r~%s~s~, seu iventario está cheio',
['not_enough'] = 'Você não tem mais ~r~%s~s~ para vender',
['not_enough'] = 'Você não tem mais ~r~%s~s~',
['sold_one'] = 'Você está vendendo ~r~%s~s~',
['used_one'] = 'Você usou ~r~x1 de ~r~%s~s~',
['sale_in_prog'] = '~g~Venda em progresso~s~...',
Expand Down
2 changes: 1 addition & 1 deletion locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Locales['en'] = {
['too_many_pouches'] = 'Your inventory is being full of ~r~Drugs',
['packing_in_prog'] = '~y~Packaging in progress~s~...',
['inv_full'] = 'You cant harvest anymore ~r~%s~s~, your inventory is full',
['not_enough'] = 'You dont have any ~r~%s~s~ to sell',
['not_enough'] = 'You dont have any ~r~%s~s~',
['sold_one'] = 'You\'re selling ~r~%s~s~',
['used_one'] = 'You have used ~r~x1 of ~r~%s~s~',
['sale_in_prog'] = '~g~Selling in progress~s~...',
Expand Down
6 changes: 5 additions & 1 deletion server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ local function Sell(source, drug)
TriggerClientEvent('esx:showNotification', source, _U('not_enough', drug))
else
xPlayer.removeInventoryItem(v.ItemTransform, 1)
xPlayer.addAccountMoney('black_money', math.random( v.Zones.Dealer.multiplierPolice and v.Zones.Dealer.sellMin * CopsConnected or v.Zones.Dealer.sellMin, v.Zones.Dealer.multiplierPolice and v.Zones.Dealer.sellMax * CopsConnected or v.Zones.Dealer.sellMax))
if CopsConnected <= 1 then
xPlayer.addAccountMoney('black_money', math.random(v.Zones.Dealer.sellMin, v.Zones.Dealer.sellMax))
else
xPlayer.addAccountMoney('black_money', math.random( v.Zones.Dealer.sellMin * CopsConnected, v.Zones.Dealer.sellMax * CopsConnected))
end
TriggerClientEvent('esx:showNotification', source, _U('sold_one', drug))
Sell(source, drug)
end
Expand Down

0 comments on commit 4da20f2

Please sign in to comment.