Hey peeps, kinda late eh?
Well i've been trying to fix this script for more than 2 hours now ( Yes this little piece of script, HA )
I just want to add + 1 in the players's .log doc.
Like by example, Vince.log has number 1 in it. When i do the wanted thing, it will add +1 in Vince.log, so it'd be like 2 in it.
Just getting problems like : '1' isn't an integer value
const
SD = 'scripts/hnstop/players/';
procedure AppOnIdle(Ticks: integer);
var
i : byte;
Encode : integer;
begin
if (NumPlayers > 0) and (DeltaPlayers = 1) then begin
for i := 1 to 32 do begin
if GetPlayerStat(i,'team') = 4 then begin
if FileExists(SD + IDToName(i) + '.log') = true then begin
Encode := StrToInt(ReadFile(SD + IDToName(i) + '.log')) + 1;
WriteFile(SD + IDToName(i) + '.log', IntToStr(Encode));
Command('/setteam1 ' + inttostr(i));
end;
// StrToInt(ReadFile(SD + md5string(IDToName(i)) + '.log')) = Encode
if FileExists(SD + IDToName(i) + '.log') = false then begin
WriteFile(SD + IDToName(i) + '.log', IntToStr(1));
Command('/setteam1 ' + inttostr(i));
end;
end;
end;
end;
end;
This is just pissin' me off 'cause i just got back at scripting and this s**t happens ..
Thanks for further help.