0 Members and 1 Guest are viewing this topic.
Access violation at address 00405037 in module 'soldatserver.exe'. Read of addrss C15E7544
... WriteConsole(0,'Bum!!!!!!!!!',Color); // nova(MinesX[j], MinesY[j], 0, 90, 100, 100, 4, 15); WriteConsole(0,'Bum!!!!!!!!!',Color) // nova(MinesX[j], MinesY[j], 0, 60, 100, 100, 4, 10); nova(Minesx[j], MinesY[j], 0, 30, 100, 100, 4, 5); end;...
for j:=1 to Mines+1 do
[*] [Error] mines -> (AppOnIdle): Out Of Range
const Color= $FF0033FF; MaxDist=14;var MinesX, MinesY: array[1..100] of single; MinesT: array[1..100] of byte; Mines: byte; MinesP: array[1..100] of byte; MinesO: array[1..100] of boolean;procedure new (ID:byte); var x1, y1: single; begin if GetPlayerStat(ID,'kills')>=5 then begin GetPlayerXY(ID,x1,y1); Mines:=Mines+1; MinesX[Mines]:=x1; MinesY[Mines]:=y1; MinesT[Mines]:=GetPlayerStat(ID,'Team'); MinesP[Mines]:=ID; MinesO[Mines]:=True; SetScore(ID,GetPlayerStat(ID,'Kills')-5); WriteConsole(0,GetPlayerStat(ID,'Name')+' put mine',Color); end; end; procedure nova(const x, y, speed, radius, power: single; id, style: byte; n: integer); var i: byte; angle: single; begin angle := 2 * pi / n; for i := 0 to n do createbullet(x + cos(angle * i) * radius, y + sin(angle * i) * radius, cos(angle * i) * speed, sin(angle * i) * speed, power, style, id); end;function OnPlayerCommand(ID: Byte; Text: string): Boolean;begin if Text='/mine' then SetScore(ID,5) new(ID); end;procedure AppOnIdle(Ticks: integer); var i,j: byte; dist: Single; begin if Mines<>0 then for i:=1 to 16 do begin for j:=0 to Mines do begin if MinesO[j] then if MinesT[j]<>GetPlayerStat(i,'Team')then begin Dist:=Distance(MinesX[j],MinesY[j],GetPlayerStat(i,'X'),GetPlayerStat(i,'Y')); if Dist <= MaxDist then begin nova(MinesX[j], MinesY[j], 0, 90, 100, MinesP[j], 4, 15); WriteConsole(0,'Bum!!!!!!!!!',Color) nova(MinesX[j], MinesY[j], 0, 60, 100, MinesP[j], 4, 10); nova(Minesx[j], MinesY[j], 0, 30, 100, MinesP[j], 4, 5); MinesO[j]:=False; end; end; end; end; end;
for j:=0 to Mines do begin
typeT_Mine = record X : single; Y : single; T : byte; O : boolean;end;//this array is dynamic, use setArrayLength(Mines, x) to change it's size:Mines : array of T_Mine;//call like this:Mines[i].T := 2;
setArrayLength(MyArray, 2); //changes size of MyArray to 2, that means MyArray[0] and MyArray[1] exist now. (NOT MyArray[2]!!)MySize := getArrayLength(MyArray); //MySize will now be 2 aswell.