1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Force drop

Discussion in 'Development' started by Vortix, Jul 24, 2014.

  1. Vortix

    Vortix Moderator Staff Member Moderator Legend Clockwork Customer

    How might I go about making an unequipped item force drop? It is possible?
     
  2. 1. Find the item in their inventory
    2. Remove the item from their inventory
    3. Create item-entity in front of the player
     
  3. Won't work if the player is looking far away or otherwise prevented from dropping an item.
     
  4. Vortix

    Vortix Moderator Staff Member Moderator Legend Clockwork Customer

    I can manage the first two I believe, however how would I go about creating an item-entity in front of the player?
     
  5. Just search how the drop function does it?
     
  6. Vortix

    Vortix Moderator Staff Member Moderator Legend Clockwork Customer

    Looking up the drop function I can see it is called when a player attempts to drop an item. Also, I can't seem to find a drop entry for when a player dies either.
     
  7. NightAngel

    NightAngel Fuck off Lev

    I'd say look up how zipties force weapons off of a player. It would probably be in the code of the item itself, in schema/items. Hope this helps! :)
     
  8. Just checked the code, it's actually simple:

    Clockwork.item:CreateItem(player, itemTable, position)
     
  9. /plysearch

    Admin-Only
     
  10. He's trying to make another player forcefully drop an item. You can, as an administrator, use /plysearch [player name] to open the player's inventory as if they are tied, and take whatever items out as needed, then drop them on the ground if needed.

    But I assume he's just trying to confiscate items, like a minge taking a gun and running.
     
  11. Vortix

    Vortix Moderator Staff Member Moderator Legend Clockwork Customer

    I'm talking about on death, items tend to stay in the inventory on death unless it was equipped.
    For me though all items in my inventory are dropping, not instantly after death, but after a period of time has passed the items will appear after the person has died in that spot. Strange.
     
  12. NightAngel

    NightAngel Fuck off Lev

    What function are you using? Maybe take a look at other plugins that deal with death, like Atebite's magical death digits, my antlion or zombie plugin, or maybe look at which function makes the Combine death sound play through all units.
     
  13. Vortix

    Vortix Moderator Staff Member Moderator Legend Clockwork Customer

    Lucky me, I have all of them! Also, I am using the correct function, however this is not the problem as the mentioned problem occurs without me making any changes. This is happening due to something else.
     
  14. Polis

    Polis Guest

    Yes, but you would probably have to hook into that decay function.
     

Previous Readers (Total: 0)