Hi
Why doesn,t AppOnIdleTimer variable changing work? I have tested it with this:
var
start: boolean;
procedure ActivateServer();
begin
start := false;
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/1s' then begin
if start = false then begin
start := true;
WriteConsole(0, '1 changed to true', RGB(255,255,255));
end else begin
start := false;
WriteConsole(0, '1 changed to false', RGB(255,255,255));
end;
end;
if Text = '/1c' then begin
if AppOnIdleTimer = 120 then begin
AppOnIdleTimer := 60;
WriteConsole(0, '1 changed to 60', RGB(255,255,255));
end else begin
AppOnIdleTimer := 120;
WriteConsole(0, '1 changed to 120', RGB(255,255,255));
end;
end;
end;
procedure AppOnIdle(Ticks: integer);
begin
if start = true then WriteConsole(0, '1 apponidletimer: ' + IntToStr(AppOnIdleTimer) + ' ticks: ' + IntToStr(Ticks), RGB(255,255,255));
end;
When i typed '/1s' it started. Difference between ticks = 60 (default) and apponidletimer = 60
But when i typed '/1c' it should be changed. It didn't change :<. Difference between ticks = 60 (default) and apponidletimer = 120.
Why?
Thanks.
Delete please, I discovered it must be -safe 0