Author Topic: Can't kick bot  (Read 1533 times)

0 Members and 1 Guest are viewing this topic.

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Can't kick bot
« on: July 28, 2011, 01:05:13 pm »
Does anyone have any idea why both KickPlayer(NameToID('bot's name')) and Command('/kick '+inttostr(bot's id)) fail to kick a bot? I've got a script that works perfectly fine on my server but it fails to kick bots on my friend's server (no errors or warnings, although code placed after those procedures isn't executed). Our servers run on the same OS - Debian 5.

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: Can't kick bot
« Reply #1 on: July 28, 2011, 01:51:14 pm »
No idea. I wrote some script for my server which stands on Debian too, it's aim was to add one bot when only one player is on the server and as soon as 2nd player joins the bot was kicked. It works like a charm.
"My senses are so powerful that I can hear the blood pumping through your veins."

DarkCrusade

  • Guest
Re: Can't kick bot
« Reply #2 on: July 28, 2011, 02:31:52 pm »
Code: (pascal) [Select]
procedure workslikeacharm(team:byte; botname:string);
var i:byte;
begin
  i:=command('/addbot'+intToStr(team)+' '+botname);
  command('/kick '+intToStr(i));
end;

Should work. For future reference, use this page. Note that command is a function that returns a value in most cases and these values can be stored in a variable. kickPlayer is such a stupid function that I did not even bother trying it.

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Can't kick bot
« Reply #3 on: July 28, 2011, 04:25:00 pm »
Code: (pascal) [Select]
procedure workslikeacharm(team:byte; botname:string);
var i:byte;
begin
  i:=command('/addbot'+intToStr(team)+' '+botname);
  command('/kick '+intToStr(i));
end;

That's exactly how I'm doing it and it works fine for me. There must be something wrong with my friend's server but I can't figure what.

Offline Shoozza

  • Retired Soldat Developer
  • Veteran
  • ******
  • Posts: 1632
  • Soldat's Babysitter
    • Website
Re: Can't kick bot
« Reply #4 on: July 28, 2011, 04:59:17 pm »
Didn't check but maybe ip 0 is in remote admin list and you can't kick adminbots?
Rules
Tools: ARSSE - SARS - SRB - chatMod

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Can't kick bot
« Reply #5 on: July 28, 2011, 06:14:30 pm »
afaik you can still kick person who has IP in remoteadmins.txt. Only /adminlog admins can't be kicked
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Can't kick bot
« Reply #6 on: July 29, 2011, 04:39:48 am »
That's exactly how I'm doing it and it works fine for me. There must be something wrong with my friend's server but I can't figure what.
just to make sure, are scripts enabled on his server?

Offline tk

  • Soldier
  • **
  • Posts: 235
Re: Can't kick bot
« Reply #7 on: July 29, 2011, 08:19:40 am »
Kick() function is enough, no need to play with some string operations like in Command() case

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Can't kick bot
« Reply #8 on: August 05, 2011, 05:28:59 am »
Kick() function is enough, no need to play with some string operations like in Command() case

It should be enough but in this case it's not. I've tried literally every way to kick that bot and it still wouldn't work. Surprisingly the problem has been solved by putting the code that kicks bot in separate script. I've got no idea why that bot wasn't kicked, especially when that script works perfectly fine on couple of other servers.