17.06.2013, 23:17
Hello. I'm trying to fix a bug in our TDM Script.
Here's the code:
Now once you start reaching Rank 4 or higher, it won't let you choose anything lower, except Assault.
I'd like some help in fixing this.
Here's the code:
pawn Код:
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;
}
I'd like some help in fixing this.