10.03.2015, 06:57
Quote:
Proper form of Control Structures.
You have added the general ones (>, !, ==) but what about Triadic opreators (? & ! These would help to shorten the code. Just for an example: Code:
new bool:x[2]; main() { x[0] = true; if(x[0]) { x[1] = true; } else { x[1] = false; } } Code:
new bool:x[2]; main() { x[1] = (x[0] == true) ? (true) : (false); } Implementing in a pm script: Code:
CMD:togglepm(playerid, params[]) { pm[playerid] = ( pm[playerid] == true ) ? ( false ) : ( true ); return 1; } |
Code:
var = !var;