Explanation.
#1

PHP Code:
for(new i=0!=  MAX_PLAYERSi++) 
Hello,
As I am a learner so I needed anybody to explain this code for me,I wanted to learn this codes so please please can anyone explain this for me?
ThAnKs!
Reply
#2

This is an expression to count all the players on the server.

Also, it is:

pawn Code:
for(new i = 0; i < MAX_PLAYERS; i++)
{
// action
}
Reply
#3

Can you explain them to me like why do we need this:
PHP Code:
for 
why do we need this:
PHP Code:
(new 0
why do we need this:
PHP Code:
MAXPLAYERSi++ 
Please please.
Reply
#4

This is a for loop.
There are while and do while loop's as well.

What it does is, it first initialize i with 0 and check for condition(in your case i must not be equal to MAX_PLAYERS with is 500).

If condition is true, the code is executed.

Example
pawn Code:
for(new i=0;i<10;++i) printf("%d,"i);
In first eteration i = 0 which is less than 0 , so printf is executed and value of i is increased by 1.
This goes on till i is less than 10 .
In 10th eteration i will be 10. So loop stops

Code:
//result
0123456789
pawn Code:
for(i=0,j=10;j>15;++j,++i) {}
This loop is executed only 5 times as at 6th time j will be 15, which is not less than 15.
Reply
#5

Ohh tHaNkS!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)