glitchdetector icon

Untitled

glitchdetector | PRO | 12/25/18 08:05:29 PM UTC | 0 ⭐ | 10538 👁️ | Never ⏰ | []
Game Maker |

0 B

|

None

|

0 👍

/

0 👎

RegisterNetEvent('drugs:sell')
AddEventHandler('drugs:sell', function()
    local user_id = vRP.getUserId({source})
    if success then
        TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
        
        if vRP.tryGetInventoryItem({user_id, "coke_pooch", 1, true}) then
            -- Cocaine
            local amount = math.random(500,1000)
            TriggerClientEvent("pNotify:SendNotification", source, {
                text = "You sold some cocain for $" .. amount ,
                type = "success",
                progressBar = false,
                queue = "lmao",
                timeout = 2000,
                layout = "CenterLeft"
            })
            TriggerClientEvent("animation", source)
            vRP.giveInventoryItem({user_id, "black_money", amount, true})
        elseif vRP.tryGetInventoryItem({user_id, "weed_pooch", 1, true}) then
            -- Weed
            local amount = math.random(150,300)
            TriggerClientEvent("pNotify:SendNotification", source, {
                text = "You unloaded some weed for $" .. amount ,
                type = "success",
                progressBar = false,
                queue = "lmao",
                timeout = 2000,
                layout = "CenterLeft"
            })
            TriggerClientEvent("animation", source)
            vRP.giveInventoryItem({user_id, "black_money", amount, true})
        elseif vRP.tryGetInventoryItem({user_id, "meth_pooch", 1, true}) then
            -- Meth
            local amount = math.random(300,700)
            TriggerClientEvent("pNotify:SendNotification", source, {
                text = "You sold some Meth for $" .. amount ,
                type = "success",
                progressBar = false,
                queue = "lmao",
                timeout = 2000,
                layout = "CenterLeft"
            })
            TriggerClientEvent("animation", source)
            vRP.giveInventoryItem({user_id, "black_money", amount, true})
        elseif vRP.tryGetInventoryItem({user_id, "opium_pooch", 1, true}) then
            -- Opium
            local amount = math.random(150,300)
            TriggerClientEvent("pNotify:SendNotification", source, {
                text = "You have sold some Opium for $" .. amount ,
                type = "success",
                progressBar = false,
                queue = "lmao",
                timeout = 2000,
                layout = "CenterLeft"
            })
            TriggerClientEvent("animation", source)
            vRP.giveInventoryItem({user_id, "black_money", amount, true})
        else
            -- No drugs
        end
    else
      -- Sale was a failure
      
    end
end)

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎