Thread: Teaching: for()
View Single Post
  #2  
Old 09-07-2003, 09:44 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Re: Teaching: for()

Quote:
Originally posted by Mal1core
for those of you who are new like me and dont know how the for command it used, its like saying:


if (i=0)//if the index is equil to zero it will perform the command
while(i<#)//this is like adding to the if(), saying the index must be less then 64.
and then the last section is adding or subtracting forom the index.
so all together it looks like:

for(i=0; i<64; i+=2{
in here u may put commands. i will also give one example of how this may be used.

if(created){toweapons test;
}
if(weaponfired){
for(explosionx=playerx; explosionx<64 explosionx+=1.5
putexplosion 1,explosionx,playery+1;
}
}

this script is a little messed up but does show a little how to use for.

note: props to jagen for teaching me what for's are, and also if someone can show me how to put in a scriting section to make this easier to read it would be greatly apreciated.
you misunderstood me x_X its
i=0;
while(i<#) i++;
not if(i=0)
Reply With Quote