0 Members and 2 Guests are viewing this topic.
It's not a good idea though, the bow won't work.
function OnPlayerCommand(ID: Byte; Text: string): boolean;beginif Text = '/bow' then beginForceWeapon(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
Quote from: GSx_Major on November 16, 2008, 06:19:07 pmIt'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..
Quote from: sckme on November 17, 2008, 09:54:40 amits sucks beacuse when i get rambo bow and shot someone, he dont die ;( he have 1 % HP ;fthats 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
function OnPlayerDamage(Victim,Shooter: Byte;Damage: Integer) : integer;begin case GetPlayerStat(Shooter,'weapon') of 12,13: DoDamageBy(Victim,Shooter,100); end; Result := damage;end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;beginif Text = '/bow' then beginForceWeapon(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;
08-11-17 18:07:20 [*] [Error] Bow -> (OnPlayerDamage): Invalid variant operation
That script works for me.. maybe your using out-dated version of SoldatServer?
function OnPlayerCommand(ID: Byte; Text: string): boolean;beginif Text = '/bow' then beginForceWeapon(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;
when i wrote in cmd /bow, server is crashed...
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;