The worst way I can suggest is to use preThink.
Make something like random command execution.
Code below will check if player is a bot. If it is a bot then generate random number from 1 to 100 and if number is in range of USAGE_CHANCE then execute your function
PHP Code:
// IMHO USAGE_CHANCE should be pretty small
#define USAGE_CHANCE 1..5
new bool:g_bBot[MAX_PLAYERS+1]
// when client connects to server
public client_putinserver(id)
{
// cache bots to probably decrease CPU usage
g_bBot[id] = bool:is_user_bot(id)
}
public client_PreThink(id)
{
if(g_bBot[id])
{
switch(random_num(1, 100))
{
case USAGE_CHANCE:
{
// run heal function
give_health(id)
}
}
}
}
__________________