Hello @Fajar!
As @DangThao mentioned, there is function CheckBagItem(role, ItemID) which returns number of items with ID ItemID in role's inventory. You can use it in function check_can_enter_<mapname>(role, copymgr) which is located in server\resource\mapname\entry.lua