28.07.2011, 17:52
It doesn't have to be a boolean, you can make it:
or even:
But, using "static" is really not required here. Statics are used for this if I recall:
and, if you used:
This will return errors, since the array didn't get passed out of the loop.
NOTE: This might not be what statics do, it's just what I think they do, I don't know if I remember right.
pawn Код:
new IsJailed[ MAX_PLAYERS ];
pawn Код:
static IsJailed[ MAX_PLAYERS ];
pawn Код:
public Callback( params ) {
for( new i = 0; i < 5; ++i ) {
static var[ i ];
}
// You can still use the "var[ i ]" outside the loop if you use "static", if I remember.
var[ 0 ] = 0;
var[ 1 ] = 0;
var[ 2 ] = 0;
var[ 3 ] = 0;
var[ 4 ] = 0;
return false;
}
pawn Код:
public Callback( params ) {
for( new i = 0; i < 5; ++i ) {
new var[ i ];
}
// You now can't use the "var[ i ]"
var[ 0 ] = 0;
var[ 1 ] = 0;
var[ 2 ] = 0;
var[ 3 ] = 0;
var[ 4 ] = 0;
return false;
}
NOTE: This might not be what statics do, it's just what I think they do, I don't know if I remember right.

