0 Members and 1 Guest are viewing this topic.
[*] [Error] shop -> (AppOnIdle): Out Of Range
type minetype = record x,y: single; owner: byte; end;type plr = record ... mines: array of minetype; ... end;var player: array[1..32] of plr; ...procedure DetMine(ID,MineID: byte);var i,curnum: byte; rawspeed: single;begincurnum := getarraylength(player[ID].mines)-1;if (mineid <= curnum) AND (mineid >= 0) then begin rawspeed := 5; for i := 1 to 20 do begin createbullet(player[ID].mines[mineid].x,player[ID].mines[mineid].y,floatrandom(-rawspeed,rawspeed),floatrandom(-rawspeed,rawspeed),100,10,ID); end; if mineid < curnum then begin for i := mineid to curnum do begin player[ID].mines[i-1].x := player[ID].mines[i].x; player[ID].mines[i-1].y := player[ID].mines[i].y; end; end; setarraylength(player[ID].mines,curnum); writeconsole(ID,'One of you mines has detenated!',$ffffffff); end;end;procedure CheckMines();var i,ii,iii,minelen: byte; dst: single;beginfor i := 1 to 32 do if getplayerstat(i,'active') = true then begin minelen := getarraylength(player[i].mines); if minelen > 0 then for ii := 0 to minelen-1 do begin for iii := 1 to 32 do if getplayerstat(iii,'active') = true then begin if (getplayerstat(iii,'team') <> getplayerstat(i,'team')) OR (getplayerstat(i,'team') = 0) then if raycast(player[i].mines[ii].x,player[i].mines[ii].y,getplayerstat(iii,'x'),getplayerstat(iii,'y'),dst,100) then begin detmine(i,ii); break; end; createbullet(player[i].mines[ii].x,player[i].mines[ii].y,0,0,0,5,i); end; end; end;end;procedure UseMine(ID: byte);var curlen: integer;begincurlen := getarraylength(player[ID].mines);setarraylength(player[ID].mines,curlen+1);player[ID].mines[curlen].x := getplayerstat(ID,'x');player[ID].mines[curlen].y := getplayerstat(ID,'y')-11;end;
setarraylength(player[ID].mines,curnum);writeln('setting length of player[' + inttostr(ID) + '].mines array to ' + inttostr(curnum));
hah, i, ii, iii. Way to make your code unreadable.
array[remove_index] := array[highest_index]setArrayLenght(array, highest_index)
for ii:=0 to getArrayLenght(Player[i].mines)-1 do begin
Quote from: freestyler on August 11, 2009, 01:43:39 pmhah, i, ii, iii. Way to make your code unreadable.HackTank is KING of the Unreadable Code, The Man of the One-Letter-Functions and Master of Puzzling Variable Names!That's too bad for him if he needs help...
ic(ply[i].c,rnd(32,55));wc(a,'You have $'+its(ply[i].c),cSc);end;for n:=1 to 31 doif gps(n,'Active') thenif gps(n,'Human') thenif d(dp[i].x,dpe[i].y,gps(n,'x'),gps(n,'y')) < 15 then beginply[i].fz := 2;dt(n,'Item: '+itm[dp[i].iti].name + nl +'Use /take to take thisitem!',120,cSs,0.10,80,340);end;