Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: frosty on June 07, 2010, 01:07:44 pm

Title: Server Administration: stopping scripts for randomly crashing?
Post by: frosty on June 07, 2010, 01:07:44 pm
a few of my scripts just crash randomly, i would get a whole heap of Out Of Range messages for the script thats gonna crash then i crashes, problem is, all of the vars in the function specified by the error are all integars, so wth is causing all my vars to get so big? any ideas? would the problem be elsewhere in the script? anything in particular i need to look out for?


thanks guys
Title: Re: Server Administration: stopping scripts for randomly crashing?
Post by: DarkCrusade on June 07, 2010, 01:33:31 pm
I'd recommend posting all the scripts you are using which are causing trouble
Title: Re: Server Administration: stopping scripts for randomly crashing?
Post by: frosty on June 07, 2010, 07:51:26 pm
ok heres my shop script:Shop.pas(attached), that is the only one currently crashing, the rest seemed to have sorted themselves out with the exception of Achievement.pas(attached)
Title: Re: Server Administration: stopping scripts for randomly crashing?
Post by: Hacktank on June 07, 2010, 09:07:31 pm
It is probably array indexes that are invalid.
Title: Re: Server Administration: stopping scripts for randomly crashing?
Post by: Gizd on June 08, 2010, 06:50:36 am
It is probably array indexes that are invalid.
It must be.
Title: Re: Server Administration: stopping scripts for randomly crashing?
Post by: Swompie on June 08, 2010, 09:10:22 am
It is probably array indexes that are invalid.
It must be.
Sometimes other stuff seems to be causing that too iirc, but really rarely.

Even though, I now need to WTF:
Code: [Select]
procedure ActivateServer();
begin
BioKills[Killer]:=BioKills[Killer]*0;
end;

Next thing, do not use ID as a global var (If you use your brain you know what may can happen >_>)
Also you need to check if a player is active before doing something.. (AppOnIdle.., aswell everywhere else in the loops)
Also take a look at your indenting, looks horrible at some places