Author Topic: procedure OnPlayerKill  (Read 832 times)

0 Members and 1 Guest are viewing this topic.

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
procedure OnPlayerKill
« on: March 31, 2013, 11:46:32 am »
Hello.
I have a little problem.

Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
if (Killer<>Victim) then begin
if (GetPlayerStat(Killer,'human') = true) and (GetPlayerStat(Victim,'Human') = false) then begin
Command('/kick Bot1');
end;
if (GetPlayerStat(Killer,'human') = true) and (GetPlayerStat(Victim,'Human') = false) then begin
Command('/kick Bot2');
end;
if (GetPlayerStat(Killer,'human') = true) and (GetPlayerStat(Victim,'Human') = false) then begin
Command('/kick Bot3');
end;
if (GetPlayerStat(Killer,'human') = true) and (GetPlayerStat(Victim,'Human') = false) then begin
Command('/kick Bot4');
end;
end;

After killing a bot, server kick all bots, instead of one.
What is wrong?
« Last Edit: March 31, 2013, 11:58:48 am by skrX »

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: procedure OnPlayerKill
« Reply #1 on: March 31, 2013, 12:33:52 pm »
What are you trying to accomplish / what do you expect to happen / what do you want to happen?

Is this what you want? When you (a human) kill a bot, that bot that just died gets kicked. Try this:
Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
  if (Killer<>Victim) then begin

  if (GetPlayerStat(Killer,'human') = true) and (GetPlayerStat(Victim,'Human') = false) then begin
    Command('/kick ' + InttoStr(Victim));
  end;

  end;
end;
« Last Edit: March 31, 2013, 12:39:23 pm by DorkeyDear »

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Re: procedure OnPlayerKill
« Reply #2 on: March 31, 2013, 12:51:41 pm »
ty, work
« Last Edit: May 14, 2013, 01:17:20 pm by skrX »