08.12.2012, 21:53
I have ranks set, these ranks can be earned by having a certain amount of score. Only problem is, this rank rule is not working with class selection. I have multiple classes such as medic, engineer, etc. Let's say I try to choose a medic class which requires 100 score, even if I had 500 score, I couldn't choose this class and it would say "Rank not high enough". I believe the problem may lay below, what do you think?
Код:
if(PRESSED(KEY_JUMP)) // LSHIFT
{
if(IsPlayerChoosingClass[playerid] == 1)
{
if(ClassChoosingStep[playerid] == 0) // ASSAULT
{
gClass[playerid] = ASSAULT;
}
if(ClassChoosingStep[playerid] == 1) // MEDIC
{
if(Rank(playerid) != 2) return SendClientMessage(playerid, C_WHITE, "Your rank is not high enough!");
gClass[playerid] = MEDIC;
}
if(ClassChoosingStep[playerid] == 2) // ANTI-TANK
{
if(Rank(playerid) != 3) return SendClientMessage(playerid, C_WHITE, "Your rank is not high enough!");
gClass[playerid] = ANTI-TANK;
}
if(ClassChoosingStep[playerid] == 3) // ENGINEER
{
if(Rank(playerid) != 4) return SendClientMessage(playerid, C_WHITE, "Your rank is not high enough!");
gClass[playerid] = ENGINEER;
}
if(ClassChoosingStep[playerid] == 4) // AIRFORCE
{
if(Rank(playerid) != 5) return SendClientMessage(playerid, C_WHITE, "Your rank is not high enough!");
gClass[playerid] = AIRFORCE;
}
if(ClassChoosingStep[playerid] == 5) // SPECICAL-OPS
{
if(Rank(playerid) != 6) return SendClientMessage(playerid, C_WHITE, "Your rank is not high enough!");
gClass[playerid] = SPEC-OPS;
}
TextDrawHideForPlayer(playerid, ClassBox);
TextDrawHideForPlayer(playerid, ClassNameLine);
TextDrawHideForPlayer(playerid, ClassWeapons);
TextDrawHideForPlayer(playerid, ClassDescription1);
TextDrawHideForPlayer(playerid, ClassDescription2);
TextDrawHideForPlayer(playerid, ClassRequiredRank);
TextDrawHideForPlayer(playerid, ClassHelpBox);
TextDrawHideForPlayer(playerid, ClassClick);
TextDrawHideForPlayer(playerid, ClassSpawn);
IsPlayerChoosingClass[playerid] = 0;
TogglePlayerControllable(playerid, 1);
SpawnPlayer(playerid);
}
}
return 1;
}

