Author Topic: procedure OnPlayerKill  (Read 722 times)

0 Members and 4 Guests are viewing this topic.

Offline Unknown_member

  • Major(1)
  • Posts: 4
procedure OnPlayerKill
« on: October 08, 2007, 03:01:12 pm »
hello all
Ive got a problem.
At this tTimee im working on a script.
It does not work and i tried to figure the mistake out.
Ive found the lines which are making the problem so Ive written a test script
but it Does not work (error] (108:18) (type mismatch))!!!!
Here is it

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
writeLn( Killer ); // if i remove this line it works! (??????)
writeLn( Victim );
writeLn( Weapon );
end;

I have really no clue
may you have a solution
« Last Edit: October 08, 2007, 03:47:20 pm by Unknown_member »
Mess with the Best, Die like the Rest !

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: procedure OnPlayerKill
« Reply #1 on: October 08, 2007, 05:22:19 pm »
the WriteLn function expects a string as the parameter. You should use WriteLn(IntToStr(Killer)); (if you want to show the killer ID), or WriteLn(GetPlayerStat(ID, 'Name')); if you want to show the killer name. The same thing applies to the victim.
urraka

Offline Unknown_member

  • Major(1)
  • Posts: 4
Re: procedure OnPlayerKill
« Reply #2 on: October 08, 2007, 05:53:16 pm »
ooh thx
i don't know why i did not see my mistake. With this script i wanted to find out how soldat saves the weapon names...strange that it saves ussocom as "selfkill" but it does not matter, but 1 question left...
how can i make difference from a selfkill and a "selfkill" if the round ends (or a player moves to another team appears only sometimes as selfkill with law?!).
Mess with the Best, Die like the Rest !