Problem with < and >, and mutliplying [level system]
#1

pawn Код:
neededEXP[playerid] = playerVariables[playerid][pLevel] * 8;

if(playerVariables[playerid][pLevel] * 8 >= neededEXP[playerid]) //If I set as > the player keeps leveling up regardless of his EXP amount. If I set it to < the player can't level up no matter what his EXP is.
        {
            //level 1 player has less than 8
            playerVariables[playerid][pLevel] += 1;
            playerVariables[playerid][pEXP] = 0;
            format(string, sizeof(string), "Congratulations! You have gained a level! You have unlocked new features.");
            SendClientMessage(playerid, COLOR_YELLOW, string);
            format(string, sizeof(string), "You are now level %d. Your EXP has been resetted to 0.", playerVariables[playerid][pLevel]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            SetPlayerScore(playerid, playerVariables[playerid][pLevel]);
        }
Can someone please help me fix this code? I want it so their current player level times (mutlied by) 8 is greater than their neededEXP. If it is greater than their neededEXP then they may level up, else they the script will just tell them how much EXP they need.
Reply


Messages In This Thread
Problem with < and >, and mutliplying [level system] [FIXED!] - by Sledge - 09.08.2011, 15:54
Re: Problem with < and >, and mutliplying [level system] - by MadeMan - 09.08.2011, 16:01
Re: Problem with < and >, and mutliplying [level system] - by Cameltoe - 09.08.2011, 16:05

Forum Jump:


Users browsing this thread: 1 Guest(s)