Advertisement
glitchdetector

Untitled

Dec 25th, 2018
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RegisterNetEvent('drugs:sell')
  2. AddEventHandler('drugs:sell', function()
  3.     local user_id = vRP.getUserId({source})
  4.     if success then
  5.         TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  6.        
  7.         if vRP.tryGetInventoryItem({user_id, "coke_pooch", 1, true}) then
  8.             -- Cocaine
  9.             local amount = math.random(500,1000)
  10.             TriggerClientEvent("pNotify:SendNotification", source, {
  11.                 text = "You sold some cocain for $" .. amount ,
  12.                 type = "success",
  13.                 progressBar = false,
  14.                 queue = "lmao",
  15.                 timeout = 2000,
  16.                 layout = "CenterLeft"
  17.             })
  18.             TriggerClientEvent("animation", source)
  19.             vRP.giveInventoryItem({user_id, "black_money", amount, true})
  20.         elseif vRP.tryGetInventoryItem({user_id, "weed_pooch", 1, true}) then
  21.             -- Weed
  22.             local amount = math.random(150,300)
  23.             TriggerClientEvent("pNotify:SendNotification", source, {
  24.                 text = "You unloaded some weed for $" .. amount ,
  25.                 type = "success",
  26.                 progressBar = false,
  27.                 queue = "lmao",
  28.                 timeout = 2000,
  29.                 layout = "CenterLeft"
  30.             })
  31.             TriggerClientEvent("animation", source)
  32.             vRP.giveInventoryItem({user_id, "black_money", amount, true})
  33.         elseif vRP.tryGetInventoryItem({user_id, "meth_pooch", 1, true}) then
  34.             -- Meth
  35.             local amount = math.random(300,700)
  36.             TriggerClientEvent("pNotify:SendNotification", source, {
  37.                 text = "You sold some Meth for $" .. amount ,
  38.                 type = "success",
  39.                 progressBar = false,
  40.                 queue = "lmao",
  41.                 timeout = 2000,
  42.                 layout = "CenterLeft"
  43.             })
  44.             TriggerClientEvent("animation", source)
  45.             vRP.giveInventoryItem({user_id, "black_money", amount, true})
  46.         elseif vRP.tryGetInventoryItem({user_id, "opium_pooch", 1, true}) then
  47.             -- Opium
  48.             local amount = math.random(150,300)
  49.             TriggerClientEvent("pNotify:SendNotification", source, {
  50.                 text = "You have sold some Opium for $" .. amount ,
  51.                 type = "success",
  52.                 progressBar = false,
  53.                 queue = "lmao",
  54.                 timeout = 2000,
  55.                 layout = "CenterLeft"
  56.             })
  57.             TriggerClientEvent("animation", source)
  58.             vRP.giveInventoryItem({user_id, "black_money", amount, true})
  59.         else
  60.             -- No drugs
  61.         end
  62.     else
  63.       -- Sale was a failure
  64.      
  65.     end
  66. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement