15.12.2009, 19:22
Well guys, i've been working on a Server - Biological Warfare, and i've been creating an EXP bar, but how could i do it like:
so like SetProgressBarValue(BAR:RankBar, exp); then say 100 exp = rank, how could i do that? if you get what i'm trying to acomplish
pawn Код:
public RankCheck(playerid)
{
if(GetPlayerRank(playerid) == 1)
{
TextDrawSetString(Text:tRank,"Rank: Private IT");
SetProgressBarValue(Bar:RankBar, 4);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 2)
{
TextDrawSetString(Text:tRank,"Rank: Private");
SetProgressBarValue(Bar:RankBar, 8);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 3)
{
TextDrawSetString(Text:tRank,"Rank: Private F. Class");
SetProgressBarValue(Bar:RankBar, 12);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 4)
{
TextDrawSetString(Text:tRank,"Rank: Corporal");
SetProgressBarValue(Bar:RankBar, 16);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 5)
{
TextDrawSetString(Text:tRank,"Rank: Sergeant");
SetProgressBarValue(Bar:RankBar, 20);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 6)
{
TextDrawSetString(Text:tRank,"Rank: Staff Sergeant");
SetProgressBarValue(Bar:RankBar, 24);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 7)
{
TextDrawSetString(Text:tRank,"Rank: Master Sergeant");
SetProgressBarValue(Bar:RankBar, 28);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 8)
{
TextDrawSetString(Text:tRank,"Rank: First Sergeant");
SetProgressBarValue(Bar:RankBar, 32);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 9)
{
TextDrawSetString(Text:tRank,"Rank: Sergeant Major");
SetProgressBarValue(Bar:RankBar, 36);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 10)
{
TextDrawSetString(Text:tRank,"Rank: Warrant Officer 1");
SetProgressBarValue(Bar:RankBar, 40);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 11)
{
TextDrawSetString(Text:tRank,"Rank: Warrant Officer 2");
SetProgressBarValue(Bar:RankBar, 44);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 12)
{
TextDrawSetString(Text:tRank,"Rank: Warrant Officer 3");
SetProgressBarValue(Bar:RankBar, 48);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 13)
{
TextDrawSetString(Text:tRank,"Rank: Warrant Officer 4");
SetProgressBarValue(Bar:RankBar, 52);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 14)
{
TextDrawSetString(Text:tRank,"Rank: Warrant Officer 5");
SetProgressBarValue(Bar:RankBar, 56);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 15)
{
TextDrawSetString(Text:tRank,"Rank: Second Lieutenant");
SetProgressBarValue(Bar:RankBar, 60);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 16)
{
TextDrawSetString(Text:tRank,"Rank: First Lieutenant");
SetProgressBarValue(Bar:RankBar, 64);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 17)
{
TextDrawSetString(Text:tRank,"Rank: Captain");
SetProgressBarValue(Bar:RankBar, 68);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 18)
{
TextDrawSetString(Text:tRank,"Rank: Major");
SetProgressBarValue(Bar:RankBar, 72);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 19)
{
TextDrawSetString(Text:tRank,"Rank: Lieutenant Colonel");
SetProgressBarValue(Bar:RankBar, 76);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 20)
{
TextDrawSetString(Text:tRank,"Rank: Colonel");
SetProgressBarValue(Bar:RankBar, 80);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 21)
{
TextDrawSetString(Text:tRank,"Rank: Brigadier General");
SetProgressBarValue(Bar:RankBar, 84);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 22)
{
TextDrawSetString(Text:tRank,"Rank: Major General");
SetProgressBarValue(Bar:RankBar, 88);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 23)
{
TextDrawSetString(Text:tRank,"Rank: Lieutenant General");
SetProgressBarValue(Bar:RankBar, 92);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 24)
{
TextDrawSetString(Text:tRank,"Rank: General");
SetProgressBarValue(Bar:RankBar, 96);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
if(GetPlayerRank(playerid) == 25)
{
TextDrawSetString(Text:tRank,"Rank: General Of The Army");
SetProgressBarValue(Bar:RankBar, 100);
UpdateProgressBar(Bar:RankBar, playerid);
return 1;
}
return 1;
}