Author Topic: Team transformation  (Read 752 times)

0 Members and 1 Guest are viewing this topic.

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Team transformation
« on: June 23, 2008, 01:33:05 pm »
Quote
procedure OnPlayerKill(ID, ID: byte;Chainsaw: string);
if Team = 1 then begin
 Command('/setteam2 + inttostr(ID));
 WriteConsole(ID, 'You got raped',cInfo)
 end;
end;

Is this script right? (when someone from team 2 kills wit a Chaisaw team 1 member, team 1 member gets moved to team 2)
« Last Edit: June 23, 2008, 01:42:05 pm by Irlandec »

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: Team transformation
« Reply #1 on: June 23, 2008, 01:52:57 pm »
Well,
- You got ID for the killer and ID for the victim.
- Team isn't defined (use GetPlayerStat).
- Why call the weapon var 'chainsaw'?
- You forgot a ' in the setteam command (ending the string)

This script will work if cInfo is defined earlier.
Code: [Select]
procedure OnPlayerKill(Killer, Victim: Byte; Weapon: String);
begin
  if GetPlayerStat(Victim, 'Team') = 1 then
    if GetPlayerStat(Killer, 'Team') = 2 then
      if Weapon = 'Chainsaw' then begin
        Command('/setteam2 ' + inttostr(Victim));
        WriteConsole(Victim, 'You got raped', cInfo)
      end;
end;

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Team transformation
« Reply #2 on: June 23, 2008, 01:59:19 pm »
Yes , cInfo is already definied (i''m not leeching scripts)
Thx for help :)