15.11.2014, 09:46
Hmmm, the method you used is good but it takes many memory waste.
Try like this. I use the same.
Try like this. I use the same.
pawn Код:
new RankName[][] = {
"Newbie",
"Private",
"OMG DESTROYER!!!!"
};
new Rank[MAX_PLAYERS], PlayerText:tRank[MAX_PLAYERS];
forward Check();
public Check()
{
for(new i=0; i < GetMaxPlayers(); i++) if(IsPlayerConnected(i)) { //If you use foreach instead of normal loop, it'd be better.
switch(GetPlayerScore(i)) {
case 0..9: Rank[i] = 0; //This is a bit confusing. case x..x means between x and x. like case 0..9 means between 0 and 9.
case 10..49: Rank[i] = 1;
default: Rank[i] = 2; //default means the rest.
}
PlayerTextDrawSetString(i, tRank[i], RankName[Rank[i]]);
}
return 1;
}