LOOPS changed? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: LOOPS changed? (
/showthread.php?tid=104053)
LOOPS changed? -
David_Omid - 22.10.2009
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
Re: LOOPS changed? -
yom - 22.10.2009
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.
Re: LOOPS changed? -
David_Omid - 22.10.2009
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...
Re: LOOPS changed? -
David_Omid - 22.10.2009
OOPS, I just found that I made a silly mistake...sorry about this, thanks for the suggestions
Re: LOOPS changed? -
JosipBerozTito - 22.10.2009
Offtopic:
what dies two pluses do?
e.g a[i]++;
Re: LOOPS changed? -
Marcel - 22.10.2009
It increases with 1.
a is 1 now.
Re: LOOPS changed? -
NeRoSiS - 22.10.2009
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?
Re: LOOPS changed? -
David_Omid - 22.10.2009
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