Multiplication warnings
#1

Код:
new stolenMoney = 1, robChance = random(5);
switch(robChance) {
	case 	0: stolenMoney = 0;
	case 1..4: {
		stolenMoney * 1000 * robChance;
	}
}
The above code gives me a "expression has no effect" warning on the line "stolenMoney * 1000 * robChange" - why?
Reply
#2

pawn Код:
new stolenMoney = 1, robChance = random(5);
switch(robChance) {
    case    0: stolenMoney = 0;
    case 1..4: {
        stolenMoney = stolenMoney * 1000 * robChance;
    }
}
But this should do the same, as the complete code above.
pawn Код:
new stolenMoney = 1000 * random(5);
Reply
#3

Worked brilliantly, thankyou
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)