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