here is the full script so:
const
Color = $EE30DDEE;
MaximumPlayers = 10;
var
knifes: array[1..MaximumPlayers] of integer;
players: array[1..MaximumPlayers] of byte;
GiveKnifes: byte;
KnifesGiven: byte;
procedure spawn(ID: byte);
var
i: byte;
begin
knifes[ID]:=SpawnObject(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 12);
KnifesGiven:=1;
end;
procedure OnPlayerSpeak(ID: Byte; Text: string);
var
i: byte;
begin
if(Text = '!knifes') then
begin
GiveKnifes:=1;
KnifesGiven:=0;
for i:=1 to MaximumPlayers do
begin
if (GetObjectStat(knifes[i],'Active') = true) then GiveKnifes:=0;
end;
for i:=1 to MaximumPlayers do
begin
if (GetPlayerStat(i,'Active') = true) and (GetPlayerStat(i,'Health') > 0) then
begin
players[i]:=1;
if (GetPlayerStat(i,'Primary') = 14) or (GetPlayerStat(i,'Secondary') = 14) then GiveKnifes:=0;
end;
end;
if (GiveKnifes =1) then
begin
for i:=1 to MaximumPlayers do
begin
if players[i]=1 then spawn(i);
end;
end;
if (KnifesGiven=1) then
begin
WriteConsole(0,'Knifes spawned!',Color);
WriteLn('Knifes spawned!');
end
else
begin
WriteConsole(0,'There are still knifes on the map!',Color);
WriteLn('There are still knifes on the map!');
end;
end;
end;