0 Members and 2 Guests are viewing this topic.
function RT (Player:byte;dst: single): byte;var dist: single;begin for i := 1 to 32 do begin result[i] := 0; if (GetPlayerStat(i, 'Active') = true) and (GetPlayerStat(i, 'team') = 2) and (RayCast(GetPlayerStat(i, 'x'), GetPlayerStat(i, 'y'), GetPlayerStat(player, 'x'), GetPlayerStat(player, 'y'), dist, dst) = true) then begin lol := lol + 1; result := i; end; end;end;procedure AppOnIdle(Ticks: integer);begin for i := 1 to 32 do begin for j := 1 to 5 do begin if DS[i].DS[j].Style = 1 then begin tar := RT(i, 150); realtar := tar[Random(1,GetArrayLength(tar))]; WriteLn('Target:' + inttostr(tar) + ' i:' + inttostr(i) + ' j:' + inttostr(j)); if realtar <> 0 then begin Fire(GetPlayerStat(i, 'x'), GetPlayerStat(i, 'y'), GetPlayerStat(realtar, 'x'), GetPlayerStat(realtar, 'y'), 20, 40, 10, 20, i, 14); end; end else if DS[i].DS[j].Style = 2 then begin end else if DS[i].DS[j].Style = 3 then begin end else if DS[i].DS[j].Style = 4 then begin end else if DS[i].DS[j].Style = 5 then begin end; end; end;end;
function NearestHuman(X1,Y1: single; team,maxrange: integer; alive,human: boolean): integer;var X2,Y2,temp: single; i: integer;begin temp := maxrange; result := 0; for i := 1 to Max_ID do If (GetPlayerStat(i,'Active') = true) then if (GetPlayerStat(i,'Alive') = alive) and (GetPlayerStat(i,'Team') = team) and (GetPlayerStat(i,'Human') = human) then begin GetPlayerXY(i,X2,Y2); If (Distance(X1,Y1,X2,Y2) < temp) and (Distance(X1,Y1,X2,Y2) > 1) then begin temp := Distance(X1,Y1,X2,Y2); result := i; end; end;end;
function RangePlayer(X1,Y1,X2,Y2,MinDist,MaxDist: single): byte;// Returns a player ID that is within min and maxdist. if there isnt one it returns 0var i: byte; cands: array of byte; dst: single;beginfor i := 1 to 32 do if getplayerstat(i,'active')=true then begin dst:=distance(X1,Y1,X2,Y2); if (dst>=mindist) AND (dst<=maxdist) AND (getplayerstat(i,'alive')=true) then begin setarraylength(cands,getarraylength(cands)+1); cands[getarraylength(cands)-1] := i; end endif getarraylength(cands)>1 then result := cands[random(0,getarraylength(cands)-1)] else result := 0end;
var a,b:integer;begin for a:= 1 to 1000000 do inc(b);a:=random(10)+1; {this makes "a" a random number from 1 to 10}writeln(a);end.
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.
I know, thats easy, i did it years ago, but get a RANDOM player?