Author Topic: rambo bow in ex. dm, ctf.  (Read 2303 times)

0 Members and 4 Guests are viewing this topic.

Offline sckme

  • Major(1)
  • Posts: 33
rambo bow in ex. dm, ctf.
« on: November 16, 2008, 12:49:39 pm »
I have a question... Let's say that I'll run a dedicated server , and I want to give the Rambo Bow to a player with a definied ID. How to do that?
Best regards.

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: rambo bow in ex. dm, ctf.
« Reply #1 on: November 16, 2008, 01:44:20 pm »
You use ForceWeapon
Also Known As REIMA


Lol Happles (happy apples)

Offline GSx_Major

  • Major
  • *
  • Posts: 97
Re: rambo bow in ex. dm, ctf.
« Reply #2 on: November 16, 2008, 06:19:07 pm »
It's not a good idea though, the bow won't work.
...and headbutt the sucker through your banana suit!

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: rambo bow in ex. dm, ctf.
« Reply #3 on: November 17, 2008, 08:39:13 am »
It's not a good idea though, the bow won't work.

It WILL work, but in some gamemodes it will give you BattleEye kick .. though!
So you can disable BE... but that's rly not wise thing you know..
Also Known As REIMA


Lol Happles (happy apples)

Offline sckme

  • Major(1)
  • Posts: 33
Re: rambo bow in ex. dm, ctf.
« Reply #4 on: November 17, 2008, 09:54:40 am »
Code: [Select]
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/bow' then begin
ForceWeapon(ID, 12, 13, 0);
end;
Result := False;
end;

its sucks beacuse when i get rambo bow and shot someone, he dont die ;( he have 1 % HP ;f

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: rambo bow in ex. dm, ctf.
« Reply #5 on: November 17, 2008, 10:53:36 am »
its sucks beacuse when i get rambo bow and shot someone, he dont die ;( he have 1 % HP ;f
thats how it is. You could try sticking a dodamageby() in onplayerdamage , but im not sure if itll work right (never tried, just throwing an idea)

Offline sckme

  • Major(1)
  • Posts: 33
Re: rambo bow in ex. dm, ctf.
« Reply #6 on: November 17, 2008, 11:04:48 am »
i dont understand u ;f

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: rambo bow in ex. dm, ctf.
« Reply #7 on: November 17, 2008, 11:46:07 am »
It's not a good idea though, the bow won't work.
It WILL work, but in some gamemodes it will give you BattleEye kick .. though!
So you can disable BE... but that's rly not wise thing you know..
No. No no no. BE kicks are not in any way related to the built-in cheat detection of the soldatserver (which can be disabled via Disable_AntiCheat_Kick in soldat.ini - not affecting the way BE works in any way).

its sucks beacuse when i get rambo bow and shot someone, he dont die ;( he have 1 % HP ;f
thats how it is. You could try sticking a dodamageby() in onplayerdamage , but im not sure if itll work right (never tried, just throwing an idea)
i dont understand u ;f
Add in a call to DoDamage in the OnPlayerDamage function that triggers if the player is using the rambo bow. Read the EnEsCe.com scripting manual for the argument list.

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: rambo bow in ex. dm, ctf.
« Reply #8 on: November 17, 2008, 11:53:29 am »
Code: [Select]
function OnPlayerDamage(Victim,Shooter: Byte;Damage: Integer) : integer;
begin
  case GetPlayerStat(Shooter,'weapon') of
12,13: DoDamageBy(Victim,Shooter,100);
  end;
  Result := damage;
end;

should work
Also Known As REIMA


Lol Happles (happy apples)

Offline sckme

  • Major(1)
  • Posts: 33
Re: rambo bow in ex. dm, ctf.
« Reply #9 on: November 17, 2008, 12:11:17 pm »
Code: [Select]
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/bow' then begin
ForceWeapon(ID, 12, 13, 0);
end;
Result := False;
end;

function OnPlayerDamage(Victim,Shooter: Byte;Damage: Integer) : integer;
begin
  case GetPlayerStat(Shooter,'weapon') of
   12,13:   DoDamageBy(Victim,Shooter,100);
  end;
  Result := damage;
end;

i must past this in Bow.PAS and start server, ya? its not work

Code: [Select]
08-11-17 18:07:20  [*] [Error] Bow -> (OnPlayerDamage): Invalid variant operation

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: rambo bow in ex. dm, ctf.
« Reply #10 on: November 17, 2008, 12:29:28 pm »
That script works for me.. maybe your using out-dated version of SoldatServer?
Also Known As REIMA


Lol Happles (happy apples)

Offline sckme

  • Major(1)
  • Posts: 33
Re: rambo bow in ex. dm, ctf.
« Reply #11 on: November 17, 2008, 12:33:11 pm »
Nope, 2.6.3

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: rambo bow in ex. dm, ctf.
« Reply #12 on: November 17, 2008, 09:51:10 pm »
That script works for me.. maybe your using out-dated version of SoldatServer?
It shouldn't work, because you used GetPlayerStat(Shooter, 'weapon'). 'weapon' isn't on the list.

This should work:
Code: [Select]
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/bow' then begin
ForceWeapon(ID, 12, 13, 0);
end;
Result := False;
end;

function OnPlayerDamage(Victim,Shooter: Byte;Damage: Integer) : integer;
begin
  case GetPlayerStat(Shooter,'Primary') of
   12,13:   DoDamageBy(Victim,Shooter,100);
  end;
  Result := damage;
end;

[edit] In OnPlayerDamage, a 'weapon' variable should be included, because if someone shoots someone with, say, a steyr, then changes to deagles before they are hit (spray), it could stuff up a script.
(If that isn't already in the suggestions topic, feel free to post it there yourself, I'm too lazy right now)
« Last Edit: November 17, 2008, 09:54:36 pm by chutem »
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline sckme

  • Major(1)
  • Posts: 33
Re: rambo bow in ex. dm, ctf.
« Reply #13 on: November 18, 2008, 07:15:26 am »
when i wrote in cmd /bow, server is crashed...


Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: rambo bow in ex. dm, ctf.
« Reply #14 on: November 18, 2008, 10:07:16 am »
when i wrote in cmd /bow, server is crashed...

.. What? Just sudden crash without warning?!
The /bow script will KICK you if your not admin (logged)... but CRASH?
Now im confused
Also Known As REIMA


Lol Happles (happy apples)

Offline sckme

  • Major(1)
  • Posts: 33
Re: rambo bow in ex. dm, ctf.
« Reply #15 on: November 18, 2008, 10:54:04 am »
Hmm i have some idea... look this is script for predator

Code: [Select]
  const
  Color = $32CD32;

var
  IsPred, AfterRespawn: array[1..32] of boolean;

procedure AppOnIdle(Ticks: cardinal);
var
  i: byte;
begin
  for i := 1 to 32 do if AfterRespawn[i] then begin
    if IsPred[i] then begin
      GiveBonus(i, 1);
      DrawText(i, '  ', 0, $00000000, 0, 0, 0);
    end;
    AfterRespawn[i] := false;
  end;
  if (Ticks mod 600) = 0 then begin
    for i := 1 to 32 do if GetPlayerStat(i, 'Active') = true then if IsPred[i] and (GetPlayerStat(i, 'Alive') = true) then begin
      GiveBonus(i, 1);
      DrawText(i, '  ', 0, $00000000, 0, 0, 0);
    end;
  end;
end;

procedure OnJoinGame(Id, Team: byte);
begin
  IsPred[Id] := false;
end;

function OnCommand(Id: byte; Text: string): boolean;
var
  Who: byte;
begin
  if Text[1] = '/' then begin
    Delete(Text, 1, 1);
    if LowerCase(GetPiece(Text, ' ', 0)) = 'setpred' then begin
      try
        Who := StrtoInt(Copy(Text, 9, Length(Text)));
        if not GetPlayerStat(Who, 'Active') then StrtoInt(' ');
        IsPred[Who] := true;
        if GetPlayerStat(Who, 'Alive') = true then begin
          GiveBonus(Who, 1);
          DrawText(Who, '  ', 0, $00000000, 0, 0, 0);
        end;
        if Id <> Who then WriteConsole(Id, 'You have given ' + GetPlayerStat(Who, 'Name') + ' infinite predator', Color);
        WriteConsole(Who, 'Admin dal ci niewidzialnosc!', Color);
      except
        WriteConsole(Id, 'Invalid player', Color);
      end;
    end else if LowerCase(GetPiece(Text, ' ', 0)) = 'delpred' then begin
      try
        Who := StrtoInt(Copy(Text, 9, Length(Text)));
        if not GetPlayerStat(Who, 'Active') then StrtoInt(' ');
        IsPred[Who] := false;
        if Id <> Who then WriteConsole(Id, 'You have taken infinite predator from ' + GetPlayerStat(Who, 'Name'), Color);
        WriteConsole(Who, 'Admin zabral ci niewidzialosc!', Color);
      except
        WriteConsole(Id, 'Invalid player', Color);
      end;
    end;
  end;
end;

procedure OnPlayerRespawn(Id: byte);
begin
  AfterRespawn[Id] := true;
end;

Maybe when we change this scirpt, them will be useful for Rambo Bow?