26.01.2011, 12:50
The ternary operator is called the triadic operator on the wiki.
I don't know what its real name is, but I've been using it for quite a while and it's very useful.
Also, something I have been doing lately is using packed arrays for player vars.
These are 1/4th of the size of a regular array and work just as good.
Example:
The only downside: You can't store a value greater than 254 (defined as charmax) in it, but it's great if you only need to store true (1) or false (0) or something.
I don't know what its real name is, but I've been using it for quite a while and it's very useful.
Also, something I have been doing lately is using packed arrays for player vars.
These are 1/4th of the size of a regular array and work just as good.
Example:
pawn Code:
new
SomePlayerVar[MAX_PLAYERS char];
// This will create an array with 125 cells, instead of 500
// To use:
SomePlayerVar{playerid} = 1;
if(SomePlayerVar{playerid})
{
// do stuff
}