0 Members and 1 Guest are viewing this topic.
OnPlayerKill(Killer,Victim: byte; Weapon: string);var line: int;begintry// your normal script stuff here, for exampleif killer <> victim then givexp(killler,322); line := line + 1;inckills(killler,1); line := line + 1;// ectexcept writeln('___________________________________________________________'); writeln('OnPlayerKill Error Captured on line: '+tostr(line)); writeconsole(ID,'Login error detected, attempting to recover important data',$ffff0000); writeln('Error: ' + exceptiontostring(exceptiontype,exceptionparam)); writeln('killer='+tostr(killer)+'('+getplayerstat(killer,'name') + 'victim='+tostr(victim)+'('+getplayerstat(victim,'name')); writeln('___________________________________________________________'); end;end;
//OnPlayerCommand:if lowercase(getpiece(Text, ' ', 0)) <> '/login' then begin Line := 2; WriteLn('CMD[' + IDToName(ID) + '] ' + text);end;//OnPlayerRespawn:if GetPlayerStat(ID, 'team') <> ZombieTeam then begin Line := 6; Command('/setteam' + inttostr(ZombieTeam) + ' ' + inttostr(ID));end;//AppOnIdle:if GetPlayerStat(i, 'human') = true then begin Line := 16; if Player[i].infected then begin Player[i].Infected := false; Player[i].InfectOnRespawn := false; Player[i].ZombieClass := 1; Command('/setteam' + inttostr(HumanTeam) + ' ' + inttostr(i)); end; // Here begins Line 17
var Player: Array [1..32] of tPlayer;
Quotevar Player: Array [1..32] of tPlayer;I checked this twice if I did it that way ;/
From what i can gather you cannot do any checks with getarraylength/arrayhigh, or set it with setarraylength if you set the original size of the array with brackets. That may be your problem.
AppOnIdle - Line: 12 - Error: Out Of RangeAppOnIdle - Line: 9 - Error: Out of Proc RangeAppOnIdle - Line: 28 - Error: Exception: Type MismatchOnPlayerCommand - Line: 5 - Error: Out of Global Vars range - Text: buy 6
Code: [Select]Line := 12;if (Bots[player[i].ZombieClass].Weap <> GetPlayerStat(i, 'primary')) and (GetPlayerStat(i, 'alive') = true) then begin Line := 13;There could be only one way to cause Out of Range errors here, if Player.ZombieClass goes below zero, or, over 3. Which is never the case because I've made it so it can't do it.Code: [Select]if (player[i].draw) and (player[i].nodraw = 0) then drawtext(i, '$' + IntToStr(player[i].money) + iif((wave > 0) and (mapchangetimer = -1) and (survivetimer < 1000), BR + 'Survive ' + IntToStr(survivetimer) + ' seconds', ''), 150, cmoney, 0.11, 30, 370);I've changed that DrawText() Part slightly in the next version, but I do not think that the and in the iif() could cause errors.Code: [Select] Line := 28; if SurviveTimer = 60 then Msg(0, 'One more minute!', cGreen); if SurviveTimer = 10 then Msg(0, 'Ten seconds!', cGreen); if (SurviveTimer < 6) and (SurviveTimer > 0) then Msg(0, inttostr(SurviveTimer) + '..', cGreen);end else begin Line := 29;
Line := 12;if (Bots[player[i].ZombieClass].Weap <> GetPlayerStat(i, 'primary')) and (GetPlayerStat(i, 'alive') = true) then begin Line := 13;
if (player[i].draw) and (player[i].nodraw = 0) then drawtext(i, '$' + IntToStr(player[i].money) + iif((wave > 0) and (mapchangetimer = -1) and (survivetimer < 1000), BR + 'Survive ' + IntToStr(survivetimer) + ' seconds', ''), 150, cmoney, 0.11, 30, 370);
Line := 28; if SurviveTimer = 60 then Msg(0, 'One more minute!', cGreen); if SurviveTimer = 10 then Msg(0, 'Ten seconds!', cGreen); if (SurviveTimer < 6) and (SurviveTimer > 0) then Msg(0, inttostr(SurviveTimer) + '..', cGreen);end else begin Line := 29;
procedure foo();var i: byte;beginfor i := 1 to getarraylength(dynamicarray) do begin stuff; end;end;
for i := 1 to getarraylength(dynamicarray)-1 do begin
LengthShopArray := strtoint(readini(ini, 'Shop Settings', 'LengthShopArray', '20')); SetArrayLength(Shop, LengthShopArray + 1);
SetArrayLength(Array, 15);for i := 0 to 14 do Array[i] := smthing;
procedure Test();var myArray: array [0..3] of integer;begin myArray[123] := 0;end;