Thanks guys for the comments.
I have tried almost everything I could think of.
It always done the same thing.
It "works" but when a player tried to connect. Right after kicking the first bot.
It would kick the "first" connecting player. Some players could get in. Some couldn't.
I was going by the wiki here.
http://www.amxmodx.org/doc/index.htm...et_players.htm
As fysiks pointed out. It should of worked and "did".
I even added a side by side loop to make sure it wasn't a actual player being kicked.
Added is_user_connecting and is_user_connected.
From the loop. Like it was counting the player connecting for a bot. Extremely weird.
Finally I had enough, So I made this in foxbot's source.
PHP Code:
kickrandombot()
{
server_cmd("bot kickrandombot")
}
Here is an alternative I tried.
PHP Code:
public kickrandombot(id)
{
new Players[32]
new playerCount, i, player
get_players(Players, playerCount, "d")
for (i=0; i<playerCount; i++)
{
player = Players[i]
if(is_user_bot(player) && !is_user_connecting(player) && is_user_connected(player))
{
server_cmd("kick #%d", player)
break;
}
}
}
And another,
PHP Code:
public kickrandombot(id)
{
new Players[32]
new playerCount
get_players(Players, playerCount, "d")
if(playerCount > 0)
server_cmd("kick #%d", get_user_userid(players[random_num(1,playerCount)]))
}
Thank you everyone for your suggestions.
Althor