21.06.2015, 22:28
Quote:
Just from a fast look, replace all those if/else if statements about PlayerInfo[playerb][pLevel] to a switch and the format can be replaced with an integer variable assignment and after the switch, calling valstr to convert it to string.
|
pawn Code:
//respect
new respectneed[4];
if(PlayerInfo[playerb][pLevel] == 1) format(respectneed, sizeof(respectneed), "4");
else if(PlayerInfo[playerb][pLevel] == 2) format(respectneed, sizeof(respectneed), "8");
else if(PlayerInfo[playerb][pLevel] == 3) format(respectneed, sizeof(respectneed), "12");
else if(PlayerInfo[playerb][pLevel] == 4) format(respectneed, sizeof(respectneed), "16");
else if(PlayerInfo[playerb][pLevel] == 5) format(respectneed, sizeof(respectneed), "20");
else if(PlayerInfo[playerb][pLevel] == 6) format(respectneed, sizeof(respectneed), "24");
else if(PlayerInfo[playerb][pLevel] == 7) format(respectneed, sizeof(respectneed), "28");
else if(PlayerInfo[playerb][pLevel] == 8) format(respectneed, sizeof(respectneed), "32");
else if(PlayerInfo[playerb][pLevel] == 9) format(respectneed, sizeof(respectneed), "36");
else if(PlayerInfo[playerb][pLevel] == 10) format(respectneed, sizeof(respectneed), "40");
else if(PlayerInfo[playerb][pLevel] == 11) format(respectneed, sizeof(respectneed), "44");
else if(PlayerInfo[playerb][pLevel] == 12) format(respectneed, sizeof(respectneed), "48");
else if(PlayerInfo[playerb][pLevel] == 13) format(respectneed, sizeof(respectneed), "52");
else if(PlayerInfo[playerb][pLevel] == 14) format(respectneed, sizeof(respectneed), "56");
else if(PlayerInfo[playerb][pLevel] == 15) format(respectneed, sizeof(respectneed), "60");
else if(PlayerInfo[playerb][pLevel] == 16) format(respectneed, sizeof(respectneed), "64");
else if(PlayerInfo[playerb][pLevel] == 17) format(respectneed, sizeof(respectneed), "68");
else if(PlayerInfo[playerb][pLevel] == 18) format(respectneed, sizeof(respectneed), "72");
else if(PlayerInfo[playerb][pLevel] == 19) format(respectneed, sizeof(respectneed), "76");
else if(PlayerInfo[playerb][pLevel] == 20) format(respectneed, sizeof(respectneed), "80");
else if(PlayerInfo[playerb][pLevel] == 21) format(respectneed, sizeof(respectneed), "84");
else if(PlayerInfo[playerb][pLevel] == 22) format(respectneed, sizeof(respectneed), "88");
else if(PlayerInfo[playerb][pLevel] == 23) format(respectneed, sizeof(respectneed), "92");
else if(PlayerInfo[playerb][pLevel] == 24) format(respectneed, sizeof(respectneed), "96");
else if(PlayerInfo[playerb][pLevel] == 25) format(respectneed, sizeof(respectneed), "100");
else if(PlayerInfo[playerb][pLevel] == 26) format(respectneed, sizeof(respectneed), "104");
else if(PlayerInfo[playerb][pLevel] == 27) format(respectneed, sizeof(respectneed), "108");
else if(PlayerInfo[playerb][pLevel] == 28) format(respectneed, sizeof(respectneed), "112");
else if(PlayerInfo[playerb][pLevel] == 29) format(respectneed, sizeof(respectneed), "116");
else if(PlayerInfo[playerb][pLevel] == 30) format(respectneed, sizeof(respectneed), "120");
else if(PlayerInfo[playerb][pLevel] == 31) format(respectneed, sizeof(respectneed), "124");
else if(PlayerInfo[playerb][pLevel] == 32) format(respectneed, sizeof(respectneed), "128");
else if(PlayerInfo[playerb][pLevel] == 33) format(respectneed, sizeof(respectneed), "132");
else if(PlayerInfo[playerb][pLevel] == 34) format(respectneed, sizeof(respectneed), "136");
else if(PlayerInfo[playerb][pLevel] == 35) format(respectneed, sizeof(respectneed), "140");
else if(PlayerInfo[playerb][pLevel] == 36) format(respectneed, sizeof(respectneed), "144");
else if(PlayerInfo[playerb][pLevel] == 37) format(respectneed, sizeof(respectneed), "148");
else if(PlayerInfo[playerb][pLevel] == 38) format(respectneed, sizeof(respectneed), "152");
else if(PlayerInfo[playerb][pLevel] == 39) format(respectneed, sizeof(respectneed), "156");
else if(PlayerInfo[playerb][pLevel] == 40) format(respectneed, sizeof(respectneed), "160");
pawn Code:
new respectneed[4];
format(respectneed, sizeof(respectneed), "%i", PlayerInfo[playerb][pLevel] * 4);
We still need you to post the RPFRN function and line 54528.