0 Members and 2 Guests are viewing this topic.
var testing: boolean;timestested: integer;testid: byte;procedure ActivateServer();begintesting := false;timestested := 0;end;function OnCommand(ID: Byte; Text: string): boolean;beginif getpiece(text,' ',0) = '/test' then begin if testing = false then begin testing := true; testid := ID; dodamage(1,-111); exit; end; if testing = true then begin testing := false; writeconsole(ID,'It tested it ' + inttostr(timestested) + ' times!',$ffffffff); timestested := 0; exit; end; end;end;function OnPlayerDamage(Victim,Shooter: Byte;Damage: Integer) : integer;beginresult := damage;if (shooter = victim) AND (damage = -111) AND (testing = true) AND (getplayerstat(shooter,'human') = false) then begin result := 0; inc(timestested,1); writeconsole(testid,'Tested - ' + inttostr(timestested),$ffffffff); sleep(10); dodamage(shooter,-111); end;end;
repeat sleep(10); FastAppOnIdle;until false;
I used a Dummy in a special room that was standing on a hurting polygon and set the damage to 0 for this dummy and i created a procedure FastApponIdle that executed itself 32 times a second and that worked with no lags and problems