Author Topic: OMG  (Read 791 times)

0 Members and 1 Guest are viewing this topic.

Offline xantier

  • Major(1)
  • Posts: 11
OMG
« on: May 04, 2009, 03:37:01 pm »
I got tons of Stack Overflow and Out of range errors at OnPlayerDamage and one out of range at Apponidle , i cant understand why i get these errors. I looked at script again and again but i cant find any mistakes. What causes overflow and out of range ?

Offline jettlarue

  • Flagrunner
  • ****
  • Posts: 724
Re: OMG
« Reply #1 on: May 04, 2009, 04:05:20 pm »
Out of range is trying to access an array value that isnt there. Say that you have an array called myArray[4]. That would mean it has a length of four allowing you to do: myArray[0]++ all the way up to myArray[3]. As long as i=myArray.length-1 myArray=blah will work.

Overflows are typically caused by a problem with loops having them never finish [become redundant] or if you call too much large unneeded variables. Overflow is when the stack runs out of memory.

Post your code if there is any more questions.

Offline xantier

  • Major(1)
  • Posts: 11
Re: OMG
« Reply #2 on: May 04, 2009, 09:53:20 pm »
array[1..4] doesnt include array[4] ?

Offline xantier

  • Major(1)
  • Posts: 11
Re: OMG
« Reply #3 on: May 04, 2009, 09:58:36 pm »
and can bots have ID ?

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: OMG
« Reply #4 on: May 04, 2009, 10:44:58 pm »
Bots aswell as players take up ID slots from 1 to 32.


Offline LORD KILLA

  • Camper
  • ***
  • Posts: 254
  • Happie
Re: OMG
« Reply #5 on: May 09, 2009, 10:44:10 am »
Array[1..4] DOES include 4, its exactly like:
  • 2423
  • 3255
  • 25646
  • 23
(if the array is an integer)
as i see, ur a noob in scripting, but dont worry, we all were ;)

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: OMG
« Reply #6 on: May 11, 2009, 06:16:39 pm »
Post the script here, it's easier that way.

Watch for off-by-one errors, those are annoying.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: OMG
« Reply #7 on: May 11, 2009, 07:23:51 pm »
Threads can possibly cause funny things sometimes, even if they are in different scripts on the same server.