Quote:
Originally Posted by Djole1337
pawn Code:
stock ProvedAtRandom() { new Random = random(3); switch(Random) { case 0: SendRconCommand("gmx"); case 1: SendRconCommand("password Tutorial."); case 2: SendRconCommand("reloadfs Tutorial"); } return Random; }
Can be shortened down to:
pawn Code:
stock ProvedAtRandom() { new Random = random(3); SendRconCommand((Random == 0) ? ("gmx") : ((Random == 1) ? ("password Tutorial") : ("reloadfs Tutorial"))); return Random; }
|
Shortening code isn't always optimizing it.