R4IDER 10 Posted October 28, 2013 Hi, I am currently making a mission where I would like to limit the amount of items that a player can carry so for example I would only like a player to carry a maximum of 2 first aid kits how would I go about counting the number of kits in a players inventory? Share this post Link to post Share on other sites
Larrow 2819 Posted October 28, 2013 Something like this should do limit = 2; numberOfKits = {"FirstAidKit" == _x} count (items player); if (numberOfKits > limit) then { for "_i" from 1 to (numberOfKits - limit) do { player removeItem "FirstAidKit"; }; }; Share this post Link to post Share on other sites
R4IDER 10 Posted October 28, 2013 Thanks for your help. Share this post Link to post Share on other sites
FireWalker 329 Posted September 11, 2017 Please RISE !! , RISE from the DEAD !! ok, enough of that, I have a trigger condition that activates a task as succeeded. The condition: "SatchelCharge_Remote_Mag" in magazines player Thats all fine and good. No problems there... But I don't want to activate the trigger until the player has acquired three charges. (or however many) I tried just doing: "SatchelCharge_Remote_Mag, 3"... but I'm sure you can figure out how that went. I'm thinking I need to sort of follow what Larrow posted above? I know part of his code was deleting objects that went above 2, so that would have to be removed. Any ideas? Simple ones are always better! Thank you, Fire Share this post Link to post Share on other sites
das attorney 858 Posted September 11, 2017 Are you a necromancer? {_x == "SatchelCharge_Remote_Mag"} count magazines player > 2 That should do it, now get back to Hades! 2 Share this post Link to post Share on other sites
FireWalker 329 Posted September 12, 2017 (edited) @das attorney Ha ha, couldn't help it LOL Awesome, I'll give it a shot. I've been working on a lot of randomization in a mission lately and I've been learning a lot because of it. Thanks!! edit: Right on - Thank you Edited September 12, 2017 by FireWalker confim Share this post Link to post Share on other sites
das attorney 858 Posted September 12, 2017 np dude :) Share this post Link to post Share on other sites