Gribbleshnibit8 Posted December 8, 2009 Share Posted December 8, 2009 I'm trying to make an ammo sorter that supports all the WMK weapon variants. Currently I'm using Phada's script as a base (with permission), but have realized that adding all the WMK weapons to the or statements would be horribly aweful, and not very adaptable, ie DLC support as well. So I was wondering how to handle this. I've determined that what I need to do is make a form list of the items I want to search for, but how do I do a search in the player's inventory for the weapons they currently hold, and get ammo for that weapon accordingly. Currently the script does it such that if you have certain weapons (extended magazine varieties for example) it gives the proper amount for the clip size of that weapon. Example of the way it's set up now.if ( Player.GetItemCount WeapXL70E3 > 0 ) set clip5 to 35 elseif ( Player.GetItemCount WeapMinigun > 0 || Player.GetItemCount WeapUniqueMS18Minigun > 0 || Player.GetItemCount WMKWeapUniqueMS18MinigunLS > 0 || Player.GetItemCount WMKWeapMinigunLS > 0 ); eugene set clip5 to 240 endif if set cnt5 to GTAmmoCabinetRef.GetItemCount Ammo5mm if ( cnt5 > 0 ) set amountToTake to ( clip5 * numOfClip ); basé sur le minigun if ( cnt5 < amountToTake || choiceID == 6 ) set ableToTake to cnt5 else set ableToTake to amountToTake set cnt5 to ableToTake endif GTAmmoCabinetRef.RemoveItem Ammo5mm ableToTake Player.AddItem Ammo5mm ableToTake 1 endif endifNow what I know is that I need to make the call to Player.GetItemCount [formlistId]. Now, the GECK wiki says that "returns the sum of the counts for all items in the list." Does this mean that it returns how many items are in the list that are also in the callers inventory? That's the way I see it. If so, then I can easily take this down to a manageable project to handle, otherwise.....well, I'll be getting ammo the old fashioned way. Link to comment Share on other sites More sharing options...
Recommended Posts