Hi there Lulu! I think I've solved your problem using the ideas you gave in your first comment. Step by step here it is:
First of all, there are two type of items defined in your plugin:
1) items that are usable by bots( purse, or any upgrades )
2) items that bots cannot use( crowbar, satchel charges, or any weapons )
Then you need to specify some priority, when can a bot buy an item:
1) immediately, when sufficiant money is gathered( purse upgrade )
2) it can wait, till round start( building upgrades, withdrawing, depositing money from the bank )
3) never( items, that are disabled to bots due to their lack of ability to use it )
Lastly you need to specify the amount, that needs to be bought at a time:
1) buy as much as possible( max out )
2) buy only 1 at a time
Then you can set some properties of the items:
1) Can it be dropped
2) How long does it lasts
3) Who can buy it
All the above are like this:
PHP Code:
// Item Buy Priority - for bots
#define IBP_ASAP 0 //immediately when sufficiant money is gathered
#define IBP_SPAWN 1 //buy on spawn
#define IBP_NEVER 9 //never buy this - eg. cannot be used by a bot
// Item Buy Mode - for bots
#define IBM_MAXOUT 0 //buy as much items as possible
#define IBM_ONE 1 //gonna max out, but buy only 1 now
// Item Flags
#define IF_DROPABLE (1<<0) //can this item be dropped?
#define IF_STEALABLE (1<<1) //can be stolen by knifedown?
#define IF_LOOSEONNEWROUND (1<<2) //only last for a round
#define IF_LOOSEONDEATH (1<<3) //loose this item on death?
#define IF_LOOSEONTEAMCHANGE (1<<4) //loose this item on teamchange?
#define IF_FOR_T (1<<5) //terrorists can buy this(cs & cz)
#define IF_FOR_CT (1<<6) //ct-s can buy this(cs & cz)
Gonna continue this, stay tuned...