0 Members and 1 Guest are viewing this topic.
procedure SetPlayerHealth(ID: byte; Health,Vest: integer);var chealth,cvest,delta: integer;beginchealth := getplayerstat(ID,'health');cvest := getplayerstat(ID,'vest');if (chealth=health) AND (cvest=vest) then exit;if chealth = 0 then dodamage(ID,1000);if vest = 0 then begin while(cvest > 0) do begin dodamage(ID,2); cvest := cvest - 1; end; dodamage(ID,chealth-health); exit; end else begin if cvest = 0 then begin givebonus(ID,3); cvest := 100; end; while(chealth <> health) do begin if chealth < health then delta := -1 else delta := 1; dodamage(ID,3*delta); chealth := chealth - delta; cvest := cvest - delta; if cvest < 0 then cvest := 0; if cvest > 100 then cvest := 100; if cvest = 0 then begin givebonus(ID,3); cvest := 100; end; if cvest <> vest then begin if cvest < vest then delta := -1 else delta := 1; dodamage(ID,2*delta); cvest := cvest - delta; end; end; while(cvest <> vest) do begin if cvest < vest then delta := -1 else delta := 1; dodamage(ID,2*delta); cvest := cvest - delta; end; exit; end;givebonus(ID,3);cvest := 100;while(cvest > vest) do begin dodamage(ID,2); cvest := cvest - 1; end;end;
Because soldat pascal likes to give me random out of range errors when i use bytes