0 Members and 2 Guests are viewing this topic.
for j := 1 to 32 do if (i <> j) and (GetPlayerStat(j, 'Active')) then if GetPlayerStat(j, 'Human') = false then if GetPlayerStat(i, 'Team') <> GetPlayerStat(j, 'Team') then if IDToName(j) = 'Dummy' then begin
function MaxID: Byte;var i: Byte;begin Result := 0; for i := 1 to 32 do if GetPlayerStat(i,'Active') = True then Result := i;end;
IdHigh := MaxId();
function MaxId(): byte;begin for Result := 32 downto 1 do if (GetPlayerStat(Result, 'Active') = true) then exit; Result := 0;end;
Yes But when doing this you should update the value every time a player joins or quits
OnCommand (addbot)
yes, use OnPlayerDamage for this.
function OnPlayerDamage(WHAT TO WRITE HERE?): AND HERE; var i, j: byte; X2, Y2, DX, DY: single;begin for i := 1 to 32 do if (GetPlayerStat(i, 'Active') = true) then if (GetPlayerStat(i, 'Human') = true) then begin for j := 1 to 32 do if ((i <> j) and (GetPlayerStat(j, 'Active') = true)) then if ((GetPlayerStat(j, 'Human') = false) and (GetPlayerStat(j, 'Name') = 'Dummy') and (GetPlayerStat(i, 'Team') <> GetPlayerStat(j, 'Team'))) then begin GetPlayerXY(j, X2, Y2); PlaceBot('Witch', GetPlayerStat(j, 'Team'), X2, Y2); KickPlayer(j); end; end; end;end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);begin if (IdToName(victim) = 'Witch') and (IdToName(killer) <> 'Major') then begin WriteConsole(Killer,'You killed the Witch!',RGB(200,200,200)) Command('/Kick Witch'); end;end;
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;begin Result := Damage // You need that otherwise you won't able to do any damage ingame!end;