level system [question]
#3

Hmmm, the method you used is good but it takes many memory waste.

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;
}
Reply


Messages In This Thread
level system [question] - by Supermaxultraswag - 15.11.2014, 09:06
Re: level system [question] - by DavidSparks - 15.11.2014, 09:32
Re: level system [question] - by k0r - 15.11.2014, 09:46
Re: level system [question] - by Supermaxultraswag - 15.11.2014, 10:01
Re: level system [question] - by Supermaxultraswag - 15.11.2014, 10:22
Re: level system [question] - by CutX - 15.11.2014, 10:29

Forum Jump:


Users browsing this thread: 1 Guest(s)