This is basically what you have to add / edit:
PHP Code:
#define LIMIT_PER_ROUND 10 // Limit per round value.
new g_bombs_bought // Global variable that indicates the number of bombs that have been bought in a round
new g_itemid // This should appear anywhere. Look for it
public plugin_init()
{
// If not registered...
register_event("HLTV", "event_newround", "a", "1=0", "2=0")
// This should also appear
g_itemid = zp_register_extra_item("blablabla")
}
public event_newround()
{
g_bombs_bought = 0 // At the beginning of the round the number of bombs bought is zero
}
public zp_extra_item_selected(id, itemid)
{
if(itemid == g_itemid)
{
if(g_bombs_bought == LIMIT_PER_ROUND) // If the limit is reached...
{
client_print(id, print_chat, "Limit reached. Can't buy a jump bomb") // We send a message
return PLUGIN_HANDLED // and refund the user
}
else // In other case...
{
// Blablaba...
g_bombs_bought++ // The number of bought bombs should increase by one.
}
}
return PLUGIN_CONTINUE
}
It can be used to add limit per round to any kind of extra item
__________________