I just tried to do a gather-ish script.
I get a type mismatch when i starting the server(in some earlier versions that happened when i typed !add ingame).
I guess it has something to do with byte and integer cooperation.
So could you guys help me out please?
Also please tell me what lines i could delete to make this shorter, cause im nubtard at scripting(this is my first serious script).
thanks
var
adders: array [1..32] of integer;
people: integer;
function isIn(put: array [1..32] of integer; get: integer): boolean;
var i: integer;
begin
for i:=1 to 32 do
begin
if put[i]=get then
begin
result:=true;
exit;
end;
end;
result:=false;
end;
procedure activateserver();
var i: integer;
begin
for i:=1 to 32 do
begin
adders[i] := 0
end;
people:=0;
end;
procedure OnPlayerSpeak(ID: Byte; Text: string);
begin
if lowercase(Text) = '!add' then
begin
if isIn(adders,id)=true then
begin
SayToPlayer(ID,'already added!') end
else begin
adders[people+1]:=id;
people:=people+1;
SayToPlayer(ID,'added');
end;
end;
end;