Player ranks.
#2

Quote:
Originally Posted by iOxide
Посмотреть сообщение
Hey guys, can anyone tell me how can i make a rank system for players? I don't need any special commands for each ranks, just want the rank 3DTextabel appear on their name always after reaching the selected score. +rep for one who can help me
pawn Код:
//at the top
#define MAJOR        0
#define PRIVATE      1// defining a simple ranks
// and
new gRank[MAX_PLAYERS]; // making a varb for player's rank
now we have defined them , we gonna make a function for the player when he reachs a rank:
pawn Код:
forward OnPlayerReachRank(playerid);
public OnPlayerReachRank(playerid)
{
      new Float:X , Float:Y , Float:Z; // the coordinates of text
      if(GetPlayerScore(playerid) => 50 && GetPlayerScore(playerid) < 100) // if his score is 50 and under 100
      {
            SendClientMessage(playerid, green, "Congratulations!, You have been promoted to private!");
            gRank[playerid] = PRIVATE; // setting his rank
            GetPlayerPos(playerid, X , Y , Z); // getting player pos for the 3dtext
            Create3DTextLabel("Major", -1, X, Y, 20.0, 10.0, 0, 0); // text is major, color is -1, 20.0 is at head of the player(i guess so), 10.0 is the distance if it's able to see from, 0 is the world and 0 is the testLOS( if it can be seen through objects
      }
      if(GetPlayerScore(playerid) => 100 && GetPlayerScore(playerid) < 300) // if his score is 100 and under 300
      {
            SendClientMessage(playerid, green, "You have been promoted to major!");
            gRank[playerid] = MAJOR; // setting his rank
      }
      return 1;
}
not tested, but i think it will work.. hope so
Reply


Messages In This Thread
Player ranks. - by iOxide - 17.12.2013, 01:48
Re: Player ranks. - by Sawalha - 17.12.2013, 05:37
Re: Player ranks. - by iOxide - 17.12.2013, 05:40
Re: Player ranks. - by Sawalha - 17.12.2013, 05:46
Re: Player ranks. - by iOxide - 17.12.2013, 06:00
Re: Player ranks. - by Sawalha - 17.12.2013, 07:26

Forum Jump:


Users browsing this thread: 1 Guest(s)