Author Topic: [Fixed]Rank System  (Read 3932 times)

0 Members and 1 Guest are viewing this topic.

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
[Fixed]Rank System
« on: February 22, 2013, 11:34:42 pm »
Code: [Select]
new Kills[MAX_PLAYERS],Deaths[MAX_PLAYERS];[pawn]new Pname[MAX_PLAYER_NAME];[/pawn]
[pawn]#define Ranks                   353[/pawn]
in onplayerconnect
[pawn]    if(!dini_Exists("Deaths.cfg"))
   {
     dini_Create("Deaths.cfg");
   }

   if(!dini_Exists("Kills.cfg"))
   {
     dini_Create("Kills.cfg");
   }
   
   GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
    Deaths[playerid] = dini_Int("Deaths.cfg", Pname);
    Kills[playerid] = dini_Int("Kills.cfg", Pname);
[/pawn]
in onplayerdissconnect
[pawn]   /* Player leaved get his stats currently of kills and deaths got updated */
     GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
     dini_IntSet("Deaths.cfg", Pname, Deaths[playerid]);
     dini_IntSet("Kills.cfg", Pname, Kills[playerid]);[/pawn]
[pawn]      else if (strcmp(cmd, "myrank", true) == 0)
      {
          format(str,sizeof(str),"~r~rank ~w~%d",GetPlayerRank(playerid));
         GameTextForPlayerBottom(playerid,str);

         return 1;
}
      [/pawn]
[pawn]      else if (strcmp(cmd, "!myrank", true) == 0)
      {
          format(str,sizeof(str),"~r~Kills: ~w~%d",Kills[playerid]);
         GameTextForPlayerBottom(playerid,str);
         GetPlayerRank(playerid);

         return 1;

    }
[/pawn]
[pawn]GetPlayerRank(playerid)
{

   if(Kills[playerid]<10)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Newbie Shooter");
   }
   else if(Kills[playerid]<25 && Kills[playerid]>=10)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Killer Shooter");
   }
   else if(Kills[playerid]<75 && Kills[playerid]>=25)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Master Shooter");
   }
   else if(Kills[playerid]<150 && Kills[playerid]>=75)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Pro Shooter");
   }
   else if(Kills[playerid]<250 && Kills[playerid]>=150)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Striker Shooter");
   }
   else if(Kills[playerid]<450 && Kills[playerid]>= 250)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Freekill Shooter");
   }
   else if(Kills[playerid]<675 && Kills[playerid]>= 450)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Psycho Shooter");
   }
   else if(Kills[playerid]<1000 && Kills[playerid]>= 625)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Fatal Shooter");
   }
   else if(Kills[playerid]<1500 && Kills[playerid]>= 1000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Havoc Shooter");
   }
   else if(Kills[playerid]<3375 && Kills[playerid]>= 1500)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Extreme Shooter");
   }
   else if(Kills[playerid]<3375 && Kills[playerid]>= 7650)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Wild Shooter");
   }
   else if(Kills[playerid]<7650 && Kills[playerid]>= 11475)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Hazardous Shooter");
   }
   else if(Kills[playerid]<11475 && Kills[playerid]>= 2650)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~IGI Shooter");
   }
   else if(Kills[playerid]<26250 && Kills[playerid]>= 37500)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Tactical Shooter");
   }
   else if(Kills[playerid]<37500 && Kills[playerid]>= 39375)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Dedicated Shooter");
   }
   else if(Kills[playerid]<39375 && Kills[playerid]>= 60000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Insane Shooter");
   }
   else if(Kills[playerid]<60000 && Kills[playerid]>= 100000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~The Real Shooter");
   }
   else if(Kills[playerid]<100000 && Kills[playerid]>= 100000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Professional Shooter");
   }
   else if(Kills[playerid]> 100000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Rockstar Shooter");
   }
   return 1;
   
}
stock GetPlayerKills(playerid)
{
   return Kills[playerid];
}
stock GetPlayerDeaths(playerid)
{
   return Deaths[playerid];
}

public OnPlayerRank(playerid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i)) GetPlayerRank(i);
   
   if(Kills<10)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Newbie Shooter");
   }
   else if(Kills<25 && Kills>=10)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Killer Shooter");
   }
   else if(Kills<75 && Kills>=25)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Master Shooter");
   }
   else if(Kills<150 && Kills>=75)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Pro Shooter");
   }
   else if(Kills<250 && Kills>=150)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Striker Shooter");
   }
   else if(Kills<450 && Kills>= 675)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Freekill Shooter");
   }
   else if(Kills<675 && Kills>= 1000)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Psycho Shooter");
   }
   else if(Kills<1000 && Kills>= 1500)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Fatal Shooter");
   }
   else if(Kills<1500 && Kills>= 2250)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Havoc Shooter");
   }
   else if(Kills<2250 && Kills>= 3375)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Extreme Shooter");
   }
   else if(Kills<3375 && Kills>= 5100)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Wild Shooter");
   }
   else if(Kills<5100 && Kills>= 7650)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Hazardous Shooter");
   }
   else if(Kills<7650 && Kills>= 11475)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~IGI Shooter");                                                                                                                                                                 /*Scripted By Sufyan*/
   }
   else if(Kills<11475 && Kills>= 17500)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Tactical Shooter");
   }
   else if(Kills<17500 && Kills>= 26250)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Dedicated Shooter");
   }
   else if(Kills<26250 && Kills>= 39375)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Insane Shooter");
   }
   else if(Kills<39375 && Kills>= 60000)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~The Real Shooter");
   }
   else if(Kills<60000 && Kills>= 100000)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Professional Shooter");
   }
   else if(Kills> 100000)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Rockstar Shooter");
   }
   }
   return 1;
}[/pawn]
i neeed  this display every 1 minutes our rank
as player kills he got increase his rank
i have deaths and kills cfg
but i need if i type !myrank it shows my kills not rank name
or if i type /c myrank it shows rank1,2,3,4,5,6, etc
HELP
« Last Edit: February 27, 2013, 02:31:53 am by mrockxkingbutt »
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: [Help] FIxing Rank System
« Reply #1 on: February 22, 2013, 11:42:21 pm »
Code: [Select]
new Kills[MAX_PLAYERS],Deaths[MAX_PLAYERS];[pawn]new Pname[MAX_PLAYER_NAME];[/pawn]
[pawn]#define Ranks                   353[/pawn]
in onplayerconnect
[pawn]    if(!dini_Exists("Deaths.cfg"))
   {
     dini_Create("Deaths.cfg");
   }

   if(!dini_Exists("Kills.cfg"))
   {
     dini_Create("Kills.cfg");
   }
   
   GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
    Deaths[playerid] = dini_Int("Deaths.cfg", Pname);
    Kills[playerid] = dini_Int("Kills.cfg", Pname);
[/pawn]
in onplayerdissconnect
[pawn]   /* Player leaved get his stats currently of kills and deaths got updated */
     GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
     dini_IntSet("Deaths.cfg", Pname, Deaths[playerid]);
     dini_IntSet("Kills.cfg", Pname, Kills[playerid]);[/pawn]
[pawn]      else if (strcmp(cmd, "myrank", true) == 0)
      {
          format(str,sizeof(str),"~r~rank ~w~%d",GetPlayerRank(playerid));
         GameTextForPlayerBottom(playerid,str);

         return 1;
}
      [/pawn]
[pawn]      else if (strcmp(cmd, "!myrank", true) == 0)
      {
          format(str,sizeof(str),"~r~Kills: ~w~%d",Kills[playerid]);
         GameTextForPlayerBottom(playerid,str);
         GetPlayerRank(playerid);

         return 1;

    }
[/pawn]
[pawn]GetPlayerRank(playerid)
{

   if(Kills[playerid]<10)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Newbie Shooter");
   }
   else if(Kills[playerid]<25 && Kills[playerid]>=10)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Killer Shooter");
   }
   else if(Kills[playerid]<75 && Kills[playerid]>=25)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Master Shooter");
   }
   else if(Kills[playerid]<150 && Kills[playerid]>=75)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Pro Shooter");
   }
   else if(Kills[playerid]<250 && Kills[playerid]>=150)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Striker Shooter");
   }
   else if(Kills[playerid]<450 && Kills[playerid]>= 250)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Freekill Shooter");
   }
   else if(Kills[playerid]<675 && Kills[playerid]>= 450)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Psycho Shooter");
   }
   else if(Kills[playerid]<1000 && Kills[playerid]>= 625)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Fatal Shooter");
   }
   else if(Kills[playerid]<1500 && Kills[playerid]>= 1000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Havoc Shooter");
   }
   else if(Kills[playerid]<3375 && Kills[playerid]>= 1500)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Extreme Shooter");
   }
   else if(Kills[playerid]<3375 && Kills[playerid]>= 7650)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Wild Shooter");
   }
   else if(Kills[playerid]<7650 && Kills[playerid]>= 11475)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Hazardous Shooter");
   }
   else if(Kills[playerid]<11475 && Kills[playerid]>= 2650)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~IGI Shooter");
   }
   else if(Kills[playerid]<26250 && Kills[playerid]>= 37500)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Tactical Shooter");
   }
   else if(Kills[playerid]<37500 && Kills[playerid]>= 39375)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Dedicated Shooter");
   }
   else if(Kills[playerid]<39375 && Kills[playerid]>= 60000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Insane Shooter");
   }
   else if(Kills[playerid]<60000 && Kills[playerid]>= 100000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~The Real Shooter");
   }
   else if(Kills[playerid]<100000 && Kills[playerid]>= 100000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Professional Shooter");
   }
   else if(Kills[playerid]> 100000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Rockstar Shooter");
   }
   return 1;
   
}
stock GetPlayerKills(playerid)
{
   return Kills[playerid];
}
stock GetPlayerDeaths(playerid)
{
   return Deaths[playerid];
}

public OnPlayerRank(playerid)
{
    for(new i = 0; i <= MAX_PLAYERS; i++) {
    if(IsPlayerConnected(i)) GetPlayerRank(i);
   
   if(Kills<10)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Newbie Shooter");
   }
   else if(Kills<25 && Kills>=10)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Killer Shooter");
   }
   else if(Kills<75 && Kills>=25)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Master Shooter");
   }
   else if(Kills<150 && Kills>=75)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Pro Shooter");
   }
   else if(Kills<250 && Kills>=150)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Striker Shooter");
   }
   else if(Kills<450 && Kills>= 675)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Freekill Shooter");
   }
   else if(Kills<675 && Kills>= 1000)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Psycho Shooter");
   }
   else if(Kills<1000 && Kills>= 1500)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Fatal Shooter");
   }
   else if(Kills<1500 && Kills>= 2250)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Havoc Shooter");
   }
   else if(Kills<2250 && Kills>= 3375)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Extreme Shooter");
   }
   else if(Kills<3375 && Kills>= 5100)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Wild Shooter");
   }
   else if(Kills<5100 && Kills>= 7650)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Hazardous Shooter");
   }
   else if(Kills<7650 && Kills>= 11475)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~IGI Shooter");                                                                                                                                                                 /*Scripted By Sufyan*/
   }
   else if(Kills<11475 && Kills>= 17500)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Tactical Shooter");
   }
   else if(Kills<17500 && Kills>= 26250)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Dedicated Shooter");
   }
   else if(Kills<26250 && Kills>= 39375)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Insane Shooter");
   }
   else if(Kills<39375 && Kills>= 60000)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~The Real Shooter");
   }
   else if(Kills<60000 && Kills>= 100000)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Professional Shooter");
   }
   else if(Kills> 100000)
   {
   GameTextForPlayerBottom(i,"~r~RANK:~w~Rockstar Shooter");
   }
   }
   return 1;
}[/pawn]
i neeed  this display every 1 minutes our rank
as player kills he got increase his rank
i have deaths and kills cfg
but i need if i type !myrank it shows my kills not rank name
or if i type /c myrank it shows rank1,2,3,4,5,6, etc
HELP

I'll help ya' tomorrow dude, ok?


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: [Help] FIxing Rank System
« Reply #2 on: February 22, 2013, 11:48:43 pm »
Thanks You Sure You Can Fix It
I Hope You Can
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: [Help] FIxing Rank System
« Reply #3 on: February 23, 2013, 01:22:21 am »
Quote
[pawn]format(str,sizeof(str),"~r~rank ~w~%d",GetPlayerRank(playerid));[/pawn]
Using %d in format() tells it to read GetPlayerRank as an integer, not a string, so it'll only give you garbage numbers that have no use. Use %s instead of %d and read this for future reference:

http://www.cplusplus.com/reference/cstdio/printf/
Do not PM me for support.




Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: [Help] FIxing Rank System
« Reply #4 on: February 23, 2013, 01:36:29 am »
Ok THANKS
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: [Help] FIxing Rank System
« Reply #5 on: February 23, 2013, 10:43:15 am »
[pawn]GetPlayerRank(playerid)
{

   if(Kills[playerid]<10)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Newbie Shooter");
   }
   else if(Kills[playerid]<25 && Kills[playerid]>=10)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Killer Shooter");
   }
   else if(Kills[playerid]<75 && Kills[playerid]>=25)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Master Shooter");
   }
   else if(Kills[playerid]<150 && Kills[playerid]>=75)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Pro Shooter");
   }
   else if(Kills[playerid]<250 && Kills[playerid]>=150)
   {
   GameTextForPlayerBottom(playerid,"~r~RANK:~w~Striker Shooter");
   }
   else if(Kills[playerid]<450 && Kills[playerid]>= 250)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Freekill Shooter");
   }
   else if(Kills[playerid]<675 && Kills[playerid]>= 450)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Psycho Shooter");
   }
   else if(Kills[playerid]<1000 && Kills[playerid]>= 625)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Fatal Shooter");
   }
   else if(Kills[playerid]<1500 && Kills[playerid]>= 1000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Havoc Shooter");
   }
   else if(Kills[playerid]<3375 && Kills[playerid]>= 1500)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Extreme Shooter");
   }
   else if(Kills[playerid]<3375 && Kills[playerid]>= 7650)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Wild Shooter");
   }
   else if(Kills[playerid]<7650 && Kills[playerid]>= 11475)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Hazardous Shooter");
   }
   else if(Kills[playerid]<11475 && Kills[playerid]>= 2650)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~IGI Shooter");
   }
   else if(Kills[playerid]<26250 && Kills[playerid]>= 37500)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Tactical Shooter");
   }
   else if(Kills[playerid]<37500 && Kills[playerid]>= 39375)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Dedicated Shooter");
   }
   else if(Kills[playerid]<39375 && Kills[playerid]>= 60000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Insane Shooter");
   }
   else if(Kills[playerid]<60000 && Kills[playerid]>= 100000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~The Real Shooter");
   }
   else if(Kills[playerid]<100000 && Kills[playerid]>= 100000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Professional Shooter");
   }
   else if(Kills[playerid]> 100000)
   {
   GameTextForPlayerBottom(playerid,"~o~rank~x~=~y~Rockstar Shooter");
   }
   return 1;
   
}[/pawn]

GetPlayerRank is public? or it's stock function?


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: [Help] FIxing Rank System
« Reply #6 on: February 23, 2013, 12:14:26 pm »
i think stock
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: [Help] FIxing Rank System
« Reply #7 on: February 23, 2013, 05:32:39 pm »
Right, I just realized what GetPlayerRank is actually supposed to do. In your command:
Quote
[pawn]
else if (strcmp(cmd, "myrank", true) == 0)
      {
          format(str,sizeof(str),"~r~rank ~w~%d",GetPlayerRank(playerid));
         GameTextForPlayerBottom(playerid,str);
[/pawn]

You don't need to set the game text at the bottom of the screen because the function GetPlayerRank will already do that. All you need to put there is:
[pawn]
else if (strcmp(cmd, "myrank", true) == 0)
      {
          GetPlayerRank(playerid);
[/pawn]
Do not PM me for support.




Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: [Help] FIxing Rank System
« Reply #8 on: February 23, 2013, 06:54:11 pm »
Right, I just realized what GetPlayerRank is actually supposed to do. In your command:
Quote
[pawn]
else if (strcmp(cmd, "myrank", true) == 0)
      {
          format(str,sizeof(str),"~r~rank ~w~%d",GetPlayerRank(playerid));
         GameTextForPlayerBottom(playerid,str);
[/pawn]

You don't need to set the game text at the bottom of the screen because the function GetPlayerRank will already do that. All you need to put there is:
[pawn]
else if (strcmp(cmd, "myrank", true) == 0)
      {
          GetPlayerRank(playerid);
[/pawn]

dude...ya right. I though it's the main problem, then I though it isn't. All the reason is in my stupidity in strings and variables.


-Funniest quotes-

Quote from: asad3man
i cant able to understand