Im not good in script...
I guess it's this part for AppOnIdle
procedure AppOnIdle(Ticks: integer);
var
i: byte;
begin
//if not hns and pubserver is enabled then do this, im too lazy to comment it, it's pretty obvious.
if ((not hns) and (pubserver)) then begin
if NumPlayers = 1 then if not pop then begin
WriteConsole(0, '2 more players to start Hide ''n Seek.',Color);
pop := true;
exit;
end;
if NumPlayers = 2 then if not pop2 then begin
WriteConsole(0, '1 more player to start Hide ''n Seek.',Color);
pop2 := true;
exit;
end;
if NumPlayers = 3 then begin
StartGame(ChooseRandomPlayer(32));
pop2 := false;
pop := false;
exit;
end;
if NumPlayers = 0 then if pop then begin
pop := false;
pop2 := false;
exit;
end;
end;
//if hns = true then begin
if hns then begin
for i := 1 to MaxPlayer do begin
//If you're counting you get a black screen and you're frozen in place until the time runs out.
if Player[i].Counting then begin
DrawText(i,'||',200,RGB(0,0,0),40,-2500,-500);
if GetPlayerStat(i, 'X') <> Player[i].X then MovePlayer(i, Player[i].X, Player[i].Y) else if GetPlayerStat(i, 'Y') <> Player[i].Y then MovePlayer(i, Player[i].X, Player[i].Y);
end;
//if the count isnt 0 then deincriment it by 1.
if Player[i].count <> 0 then begin
WriteConsole(0, inttostr(Player[i].count),Color);
Player[i].count := Player[i].count - 1;
end;
//if count = 0 then unfreeze the seekah!
if Player[i].count = 0 then begin
if Player[i].Counting then begin
WriteConsole(0, 'Ready or not, here I come!',Color);
Player[i].seeker := true;
Player[i].Counting := false;
ForceWeapon(i, 7, 7, -1);
end;
end;
end;
//if theres only 1 or less people in the server then stop the game.
if NumPlayers <= 2 then if not pubserver then StopGame() else begin
pop := false;
pop2 := false;
StopGame();
exit;
end;
//If therte are too many seekers reset the game.
if AlphaPlayers >= 2 then begin
WriteConsole(0, 'ERROR: Too many seekers! Restarting...',Color);
StartGame(ChooseRandomPlayer(32));
exit;
end;
//If there are no alphaplayers then reset the game.
if AlphaPlayers = 0 then begin
StartGame(ChooseRandomPlayer(32));
exit;
end;
//If there are no bravoplayers start a new round.
if BravoPlayers = 0 then begin
for i := 1 to MaxPlayer do if Player[i].First then begin
last := false;
StartGame(i);
exit;
end;
end;
//the last bravo player wins and gets 1 point!
if BravoPlayers = 1 then begin
if not last then begin
for i := 1 to MaxPlayer do if GetPlayerStat(i, 'Team') = 2 then if not Player[i].JustLeft then begin
Player[i].score := Player[i].score + 1;
WriteConsole(0, GetPlayerStat(i, 'Name') + ' is the last to be caught and has won the round!',Color);
last := true;
Player[i].First := true;
sleep(1000);
Command('/kill ' + inttostr(i));
break;
end;
end;
end;
end;
if delay <> 0 then begin
if delay <> 1 then delay := delay - 1 else begin
delay := delay - 1;
exit;
end;
WriteConsole(0,'Game Starting in: ' + inttostr(delay) + '.',Color);
end;
if delay = 1 then begin
for i := 1 to MaxPlayer do begin
if Player[i].it then begin
GetPlayerXY(i,Player[i].X,Player[i].Y);
Player[i].Counting := true;
Player[i].count := 20;
exit;
end;
end;
end;
end;
And part for OnPlayerLeave
procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);
var
i, j: byte;
begin
//if the first person to get caught leaves it chooses a new random player.
if Player[ID].First then begin
Player[ID].First := false;
for i := 1 to 255 do begin
j := ChooseRandomPlayer(32);
if j <> ID then begin
Player[j].First := true;
WriteConsole(0, 'The first to get caught has left the game! Choosing random person...',Color);
break;
end else continue;
end;
for i := 1 to MaxPlayer do if Player[i].First then WriteConsole(0, GetPlayerStat(i, 'Name') + ' is now going to be it!',Color);
end;
//if the seeker leaves then start a new round.
if ((Player[ID].it) or (Player[ID].Counting) or (Player[ID].seeker)) then begin
WriteConsole(0, 'The seeker has left! Lamer! Resetting game...',Color);
Player[ID].count := 0;
Player[ID].seeker := false;
Player[ID].it := false;
for i := 1 to 255 do begin
j := ChooseRandomPlayer(32);
if j <> ID then begin
StartGame(j);
break;
end else continue;
end;
end;
Player[ID].it := false;
Player[ID].seeker := false;
Player[ID].count := 0;
Player[ID].First := false;
Player[ID].NotPlaying := true;
//Player[ID].JustLeft := true;
end;
Thanks again this is really appreciated