12-31-2013, 03:28 AM
How doesn't it work, is there an error message when the plugin loads, when this code executes, or no error message but no visible result?
I'm guessing Pickups is the cItems variable received in the OnPlayerBrokenBlock() hook, you really should check its size before querying items using the Get() function - if there's only one kind of pickup, the code will fail on the "item2 = i2.m_ItemType" line, because i2 is nil. And if there's no pickup at all, it will fail one line above that.
I'm guessing Pickups is the cItems variable received in the OnPlayerBrokenBlock() hook, you really should check its size before querying items using the Get() function - if there's only one kind of pickup, the code will fail on the "item2 = i2.m_ItemType" line, because i2 is nil. And if there's no pickup at all, it will fail one line above that.