16.06.2012, 10:08
Hey!
My question is.. is there some other way to make this values to let it compile? Because Pawncc says me it's a duplicate of case. Is there any solution?
P.S
I won't use 'if'
edit://
By the way, this one works fine, but it's taking ages to compile script (i've just remove a one amount of value)
My question is.. is there some other way to make this values to let it compile? Because Pawncc says me it's a duplicate of case. Is there any solution?
pawn Code:
switch(newexperience)
{
case 1000..2500: SetPlayerLevel(playerid, 2);
case 2500..4500: SetPlayerLevel(playerid, 3);
case 4500..7000: SetPlayerLevel(playerid, 4);
case 7000..10000: SetPlayerLevel(playerid, 5);
case 10000..13500: SetPlayerLevel(playerid, 6);
case 13500..17500: SetPlayerLevel(playerid, 7);
case 17500..22000: SetPlayerLevel(playerid, 8);
case 22000..27000: SetPlayerLevel(playerid, 9);
case 27000..32500: SetPlayerLevel(playerid, 10);
case 32500..38500: SetPlayerLevel(playerid, 11);
case 38500..45500: SetPlayerLevel(playerid, 12);
case 45500..53000: SetPlayerLevel(playerid, 13);
case 53000..61000: SetPlayerLevel(playerid, 14);
case 61000..69500: SetPlayerLevel(playerid, 15);
case 69500..78500: SetPlayerLevel(playerid, 16);
case 78500..88000: SetPlayerLevel(playerid, 17);
case 88000..98000: SetPlayerLevel(playerid, 18);
case 98000..108500: SetPlayerLevel(playerid, 19);
case 108500: SetPlayerLevel(playerid, 20);
default: SetPlayerLevel(playerid, 1);
}
I won't use 'if'
edit://
By the way, this one works fine, but it's taking ages to compile script (i've just remove a one amount of value)
pawn Code:
switch(newexperience)
{
case 1000..2499: SetPlayerLevel(playerid, 2);
case 2500..4499: SetPlayerLevel(playerid, 3);
case 4500..6999: SetPlayerLevel(playerid, 4);
case 7000..9999: SetPlayerLevel(playerid, 5);
case 10000..13499: SetPlayerLevel(playerid, 6);
case 13500..17499: SetPlayerLevel(playerid, 7);
case 17500..21999: SetPlayerLevel(playerid, 8);
case 22000..26999: SetPlayerLevel(playerid, 9);
case 27000..32499: SetPlayerLevel(playerid, 10);
case 32500..38499: SetPlayerLevel(playerid, 11);
case 38500..45499: SetPlayerLevel(playerid, 12);
case 45500..52999: SetPlayerLevel(playerid, 13);
case 53000..60999: SetPlayerLevel(playerid, 14);
case 61000..69499: SetPlayerLevel(playerid, 15);
case 69500..78499: SetPlayerLevel(playerid, 16);
case 78500..87999: SetPlayerLevel(playerid, 17);
case 88000..97999: SetPlayerLevel(playerid, 18);
case 98000..108499: SetPlayerLevel(playerid, 19);
case 108500: SetPlayerLevel(playerid, 20);
default: SetPlayerLevel(playerid, 1);
}