Author Topic: In need of assistance.  (Read 1035 times)

0 Members and 1 Guest are viewing this topic.

Offline Ahmed Muhammad

  • Major(1)
  • Posts: 6
In need of assistance.
« on: June 13, 2007, 06:53:03 am »
Hey Guys.

Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
var
human: boolean;
killedby: string;

begin
 killedby := IDToName(Killer);
 human := GetPlayerStat(Victim,'Human')
begin
 if (human = true) And (killedby = 'Exasador') then
begin 
Command('/SETTEAM3 ' + inttostr(Victim));
Command('/SAY Testing 123');
end;
end;
end;

Its meant to change a player to team 3 if they are killed by Exasador exept it doesnt seem to be activating.
Exasador happens to be a bot btw. Any ideas?

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: In need of assistance.
« Reply #1 on: June 13, 2007, 07:02:15 am »
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
var
killedby: string;

begin
   killedby := IDToName(Killer);
   if (GetPlayerStat(Victim,'Human') = true) and (killedby = 'Exasador') then
   begin
      Command('/SETTEAM3 ' + inttostr(Victim));
      Command('/SAY Testing 123');
  end;
end;



it should be sth like that lol

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: In need of assistance.
« Reply #2 on: June 13, 2007, 01:48:32 pm »
don't use IDtoName. use GetPlayerStat(Killer,'Name') instead
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: In need of assistance.
« Reply #3 on: June 13, 2007, 01:52:30 pm »
yup that aswell!

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: In need of assistance.
« Reply #4 on: June 13, 2007, 02:03:43 pm »
don't use IDtoName. use GetPlayerStat(Killer,'Name') instead

Why?
urraka

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: In need of assistance.
« Reply #5 on: June 13, 2007, 02:10:59 pm »
IDtoName tends to not work
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: In need of assistance.
« Reply #6 on: June 13, 2007, 02:17:20 pm »
Is that official?. It has always worked just fine for me.
urraka

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: In need of assistance.
« Reply #7 on: June 13, 2007, 05:01:10 pm »
enesce told me so ;P
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Ahmed Muhammad

  • Major(1)
  • Posts: 6
Re: In need of assistance.
« Reply #8 on: June 14, 2007, 05:41:28 am »
Cheers guys, ur great.