0 Members and 1 Guest are viewing this topic.
var kick: array[1..32] of boolean;procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);beginif getplayerstat(victim,'human') = false then kick[victim] := true;end;procedure AppOnIdle(Ticks: integer);var i: byte;beginfor i := 1 to 32 do if getplayerstat(i,'active') = true then if kick[i] then kickplayer(i);end;procedure OnJoinGame(ID, Team: Byte);beginkick[ID] := false;end;
if not GetPlayerStat(Victim, 'human') then KickPlayer(Victim);
why did you use AppOnIdle for kicking the bot?Code: [Select]if not GetPlayerStat(Victim, 'human') then KickPlayer(Victim); does the same, right?
procedure OnPlayerRespawn(ID: byte);begin if (GetPlayerStat(ID, 'Human') = false) and (GetPlayerStat(ID, 'Deaths') > 0) then KickPlayer(ID);end;
var kick: array[1..32] of boolean;check_kick: boolean;procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);begin if getplayerstat(victim,'human') = false then begin kick[victim] := true; check_kick := true; end;end;procedure AppOnIdle(Ticks: integer);var i: byte;begin if check_kick then begin for i := 1 to 32 do if kick[i] then kickplayer(i); check_kick := false; end;end;procedure OnJoinGame(ID, Team: Byte);beginkick[ID] := false;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);beginkick[ID] := false;end;
And f**king use = true for GetPlayerStat because it returns variant and not boolean and it is know of causing errors from time to time when not doing this, thanks.
const timeper = 120; // # of seconds between bot spawningvar countdown: integer;procedure AppOnIdle(Ticks: integer);beginif numplayers - numbots > 0 then if countdown > 0 then begin countdown := countdown - 1; if countdown = 0 then begin command('/addbot1 ' + randombot()); countdown := timeper; end; end;if countdown <= 0 then countdown := timeper;end;
var kick: array[1..32] of boolean;procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);beginif getplayerstat(victim,'human') = false then kick[victim] := true;end;procedure AppOnIdle(Ticks: integer);var i: byte;beginfor i := 1 to 32 do if getplayerstat(i,'active') = true then if kick[i] then kickplayer(i);end;procedure OnJoinTeam(ID, Team: Byte);beginkick[ID] := false;end;