za0 3 Posted August 30, 2021 I'm using Ace mod and there is that plasma sack with the id as follow: ACE_plasmaIV_250 Well, I'm trying to remove it from my inventory when I reach the trigger area with the command : this removeItem ACE_plasmaIV_250; ...but nothing happens I've also tried use: this removeItemFromBackpack ACE_plasmaIV_250; with the item in my backpack but still nothing happens... :l Any idea? tks in advance! Share this post Link to post Share on other sites
beno_83au 1369 Posted August 31, 2021 Always check the biki: https://community.bistudio.com/wiki/removeItem Turning on showScriptErrors helps too. Share this post Link to post Share on other sites
Maff 251 Posted August 31, 2021 The command removeItem should do the job, even if it is in your uniform, vest or backpack. From your example you aren't using the command right. this removeItem "ACE_plasmaIV_250"; Note the string, or quotes, around the class name. Now. How you use it in this instance depends on a few things. Are you only playing Single Player? Or, Is it Multiplayer? If it's Single Player, you can simply use the following in the On Activation field of your trigger; player removeItem "ACE_plasmaIV_250"; Share this post Link to post Share on other sites
za0 3 Posted August 31, 2021 It worked! The problem was the quotes. I'm creating for a multiplayer 🙂 Each character will have a different variable name so these scripts will also have their names to work correctly. But I'm with another problem here... this script works but it only removes 1 item from the inventory... Is there a way to remove multiple items, like 5 plasma sacks at once? Share this post Link to post Share on other sites
Maff 251 Posted August 31, 2021 1 hour ago, za0 said: this script works but it only removes 1 item from the inventory... Is there a way to remove multiple items, like 5 plasma sacks at once? There is also removeItems which "Removes all items with given class name from the inventory". // Removes all "ACE_plasmaIV_250" from a unit. this removeItems "ACE_plasmaIV_250"; But if the unit had 7 250mL Plasma IV Bags, for example, and you only wanted to remove 5 of them. You would use: // Removes only 5 "ACE_plasmaIV_250" from the unit. for "_i" from 1 to 5 do { this removeItem "ACE_plasmaIV_250"; }; 1 Share this post Link to post Share on other sites
wogz187 1086 Posted September 1, 2021 Remove all this classname from the calling unit, [this, "ACE_plasmaIV_250"] call {{(_this #0) removeItem _x} forEach (((uniformItems (_this #0) + vestItems (_this #0) + backpackItems (_this #0))) select {_x== (_this #1)})} If you'll be calling this often, you_remove_strings= { {(_this #0) removeItem _x} forEach (((uniformItems (_this #0) + vestItems (_this #0) + backpackItems (_this #0))) select {_x== (_this #1)}) }; //call [this, "ACE_plasmaIV_250"] call you_remove_strings Have fun! 1 Share this post Link to post Share on other sites
za0 3 Posted September 12, 2021 tks guys, for everything Share this post Link to post Share on other sites
Soapbox0331 17 Posted August 29, 2022 On 8/30/2021 at 7:23 PM, Maff said: The command removeItem should do the job, even if it is in your uniform, vest or backpack. From your example you aren't using the command right. this removeItem "ACE_plasmaIV_250"; Note the string, or quotes, around the class name. Now. How you use it in this instance depends on a few things. Are you only playing Single Player? Or, Is it Multiplayer? If it's Single Player, you can simply use the following in the On Activation field of your trigger; player removeItem "ACE_plasmaIV_250"; How should I be using removeItem in MP, dedicated? Share this post Link to post Share on other sites
Maff 251 Posted September 16, 2022 On 8/29/2022 at 3:47 AM, Soapbox0331 said: How should I be using removeItem in MP, dedicated? Better late than never... I don't see why removeItem wouldn't work in MP. I'm still wary of answering dedicated server related questions. As time has gone by... Do you have the answer(s)? Share this post Link to post Share on other sites
Soapbox0331 17 Posted September 16, 2022 36 minutes ago, Maff said: As time has gone by... Do you have the answer(s)? Thanks @Maff, I actually have a test set up...will let you know how it goes. 1 Share this post Link to post Share on other sites
Harzach 2517 Posted September 17, 2022 removeItem is GA/GE, so it should work just fine in MP/dedi. 1 1 Share this post Link to post Share on other sites