0 Members and 3 Guests are viewing this topic.
var cooldown: array [1..32] of byte; coolbarret: array [1..32] of byte;procedure AppOnIdle(Ticks: integer);var i: Byte; hp: integer;begin for i := 1 to 32 do if getplayerstat(i,'active') then begin if cooldown[i] > 0 then cooldown[i] := cooldown[i] - 1 else begin hp:=GetPlayerStat(i,'health'); GiveBonus(i,1); DoDamage(i,GetPlayerStat(i,'health')-hp); cooldown[i] := 20; end; if coolbarret[i] > 0 then coolbarret[i] := coolbarret[i] - 1; end;end;procedure OnPlayerRespawn(ID: byte);begin cooldown[id] := 1;end;procedure OnJoinTeam(ID, Team: byte);var w: Byte;begin for w := 2 to 14 do SetWeaponActive(ID,w,false);end;procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);begin if PrimaryNum = 1 then ForceWeapon(ID,15,16,0);end;procedure OnFlagScore(ID, TeamFlag: byte);begin GiveBonus(ID,3);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/barret' then if coolbarret := 0 then begin ForceWeapon(ID,8,16,0); //'THEN' expected? coolbarret[id] := 120; end; Result := false;end;
procedure AppOnIdle(Ticks: integer);var i: Byte;begin for i := 1 to 32 do if barret[i] > 0 then barret[i] := barret[i] - 60; if m79[i] > 0 then m79[i] := m79[i] - 60; if ammo[i] > 0 then ammo[i] := ammo[i] - 60;end;
procedure AppOnIdle(Ticks: integer);var i: Byte;begin for i := 1 to 32 do begin if barret[i] > 0 then barret[i] := barret[i] - 60; if m79[i] > 0 then m79[i] := m79[i] - 60; if ammo[i] > 0 then ammo[i] := ammo[i] - 60; end;end;
var barret: array [1..32] of byte; m79: array [1..32] of byte; ammo: array [1..32] of byte;procedure AppOnIdle(Ticks: integer);var i: Byte;begin for i := 1 to 32 do begin if barret[i] > 0 then barret[i] := barret[i] - 60; if m79[i] > 0 then m79[i] := m79[i] - 60; if ammo[i] > 0 then ammo[i] := ammo[i] - 60; end;end;procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);begin if PrimaryNum = 1 then ForceWeapon(ID,15,16,0);end;procedure OnFlagScore(ID, TeamFlag: byte);begin GiveBonus(ID,3);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;var pri,sec: integer;begin if Text = '/barret' then if barret[ID] = 0 then begin ForceWeapon(ID,8,16,0); barret[ID] := 7200; end if Text = '/m79' then if m79[ID] = 0 then begin ForceWeapon(ID,7,16,0); m79[ID] := 7200; end if Text = '/ammo' then if ammo[ID] = 0 then begin pri:=GetPlayerStat(ID,'Primary'); sec:=GetPlayerStat(ID,'Secondary'); ForceWeapon(ID,pri,sec,0); m79[ID] := 3000; end;Result := false;end;procedure OnJoinTeam(ID, Team: byte);var w: Byte;begin for w := 2 to 14 do SetWeaponActive(ID,w,false); barret[ID] := 0; m79[ID] := 0; ammo[ID] := 0;end;procedure OnPlayerRespawn(ID: byte);var w: Byte;begin for w := 2 to 14 do SetWeaponActive(ID,w,false);end;procedure OnPlayerSpeak(ID: Byte; Text: string);begin if Text = '!help' then begin SayToPlayer(ID,'"""""""""""""""""""""""""""""'); SayToPlayer(ID,'"Available Commands: "'); SayToPlayer(ID,'"/ammo | get full ammo "'); SayToPlayer(ID,'"/m79 | get M79 "'); SayToPlayer(ID,'"/barret | get Barret "'); SayToPlayer(ID,'"""""""""""""""""""""""""""""'); end;end;procedure ActivateServer();begin sleep(2000); Command('/loadwep snl');end;
procedure ActivateServer();begin sleep(2000); Command('/loadwep snl');end;
The best way would be to use OnPlayerDamage. Check if the Victim is a bot, and if so, lower the Result variable.
if Text = '/cluster' then begin if Player[ID].Cluster then begin Player[ID].Cluster := False; WriteConsole(ID,'Clusterdisabled!',$A10000); end else begin Player[ID].Cluster := True; WriteConsole(ID,'Cluster enabled!',$00A100); end; end; if Text = '/nades' then begin if Player[ID].Nades then begin Player[ID].Nades := False; WriteConsole(ID,'Nade disabled!',$A10000); end else begin Player[ID].Nades := True; WriteConsole(ID,'Nade enabled!',$00A100); end; end;
procedure AppOnIdle(Ticks: integer);var i, ID: Byte;begin for i := 1 to 32 do begin if PKnova[i] > 0 then PKnova[i] := PKnova[i] - 1; if Player[i].Cluster then Clusters(Player[i].Cluster,5); if Player[i].Nades then GiveBonus(Player[i].Nades,4); end;end;
if Player[i].Cluster then Clusters(Player[i].Cluster,5); if Player[i].Nades then GiveBonus(Player[i].Nades,4);
if Player[i].Cluster then GiveBonus(i,5); if Player[i].Nades then GiveBonus(i,4);
Quote from: iDante on January 05, 2009, 06:00:04 pmThe best way would be to use OnPlayerDamage. Check if the Victim is a bot, and if so, lower the Result variable.for example result := result/2then the bot will recive half of the damage that he should recive
GiveBonus(i,5);