Of course we are familiar with countitem() script. Countitem() script will counts certain item in player inventory. It has a parameter, item_id. For example, countitem(501) which will gives return value of how many Red Potion in player inventory.
The idea to make this custom script was I got from rAthena forum. Someone asked about extension script to count certain item in player cart, of course for player that has cart on.
For an example, we have custom NPC script that need to count how many Red Potions (item id: 501) in player’s cart for event script. So, to use this script, we only need type this line:
If player has a cart on, and the cart inventory contains Red Potion, cartcountitem script tells us how many Red Potion in cart inventory.
Here the screenshots of cartcountitem() used
Download cartcountitem() script – Count certain item in cart inventory – Free code
*Above are Mediafire links*