AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   about for(new i=0;i<num;i++) (https://forums.alliedmods.net/showthread.php?t=106133)

Xevious 10-11-2009 23:05

about for(new i=0;i<num;i++)
 
what is for(new i=0;i<num;i++) for?

if 1 equal to 0, if 1 less then 1, then 1+1 ? is this mean? :)

Mxnn 10-11-2009 23:21

Re: about for(new i=0;i<num;i++)
 
The for loop the task that you asigned.
The for starts at 0 and adds one by one to the "i" var increments until reaching num (not included)


Sorry for my english

Xevious 10-11-2009 23:27

Re: about for(new i=0;i<num;i++)
 
thank, your english very well :)

VMAN 10-11-2009 23:27

Re: about for(new i=0;i<num;i++)
 
the i=0 is your starting count
i < blah is your conditional
i++ means count up once each time

so if you have

for(new i=0; i < 5; i++) {
client_print(0, print_chat, "count %i", i);
}

It will start from 0 and count all the way to 4

Xevious 10-12-2009 03:35

Re: about for(new i=0;i<num;i++)
 
thank for your clearly information. :)

Arkshine 10-12-2009 03:44

Re: about for(new i=0;i<num;i++)
 
For details explanations : http://wiki.amxmodx.org/Pawn_Tutorial#For_Loops


All times are GMT -4. The time now is 22:42.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.