LOOPS changed?
#1

We are having trouble with our scripts because commands involving loops aren't allowing functions to be called after the loops...this has only been happening after we went to 0.3

We mean this...

Command functions outside of the loop, loop starts, functions in the loop, loop ends, functions outside of the loop before the return, return

The functions outside of the loop before the return aren't being called...have loops been changed at all?

We are using loops similar to this:

for(new i;i<MAX_PLAYERS;i++)


feedback as soon as possible please, thanks
Reply
#2

No, nothing changed in the Pawn language.

A loop will crash, for example if you do this:

pawn Code:
new a[200];
..
for(new i;i<MAX_PLAYERS;i++)
  a[i]++;
This loop will crash when i = 200, if MAX_PLAYERS is defined to anything greater than 200, because the last cell of the array is 199.

You should show your whole script, or at least a compilable script where your problem is reproduced.
Reply
#3

I can't show you the script because it belong to Argonath RPG but I can tell you that the example you gave, Orb is not what the problem is. Also, we are not using anything which was removed from 0.3...
Reply
#4

OOPS, I just found that I made a silly mistake...sorry about this, thanks for the suggestions
Reply
#5

Offtopic:
what dies two pluses do?
e.g a[i]++;
Reply
#6

It increases with 1.
pawn Code:
new a = 0;
a++;
a is 1 now.
Reply
#7

Quote:
Originally Posted by David_Omid
I can't show you the script because it belong to Argonath RPG but I can tell you that the example you gave, Orb is not what the problem is. Also, we are not using anything which was removed from 0.3...
So you can't give just a small snippet of code to help us help you?
Reply
#8

Quote:
Originally Posted by Wazza!
Quote:
Originally Posted by David_Omid
I can't show you the script because it belong to Argonath RPG but I can tell you that the example you gave, Orb is not what the problem is. Also, we are not using anything which was removed from 0.3...
So you can't give just a small snippet of code to help us help you?
All I wanted to know is if anything changed with loops, if the answer is no (which it is) then I know it's a problem with my script and can find and fix it myself, which I did

Thanks anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)