Raised This Month: $ Target: $400
 0% 

Detect something what was previous.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 04-07-2009 , 13:25   Re: Detect something what was previous.
Reply With Quote #1

Just as a note, you need to find a way to know if the player should level up 1 level or more than 1, according to his exp. If his exp is bigger than the XP needed for few levels above him, he will only level up 1 level...

About saving last level, just save his current level before adding levels to it.

PHP Code:
if(PlayerXP[id] >= LEVELS[PlayerLevel[id]])
{
    
LastLevel[id] = PlayerLevel[id];
    
PlayerLevel[id] += // number of levels he should gain.

__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-07-2009 , 13:28   Re: Detect something what was previous.
Reply With Quote #2

Quote:
Just as a note, you need to find a way to know if the player should level up 1 level or more than 1, according to his exp.
PHP Code:
if(PlayerXP[id] >= LEVELS[PlayerLevel[id]])
{
    
LastLevel[id] = PlayerLevel[id];
    
PlayerLevel[id] += // number of levels he should gain.

Thanks ;)
xbatista is offline
Send a message via Skype™ to xbatista
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 04-07-2009 , 14:47   Re: Detect something what was previous.
Reply With Quote #3

You can do this:

PHP Code:
// Make sure he's not at the highest level.
if(PlayerLevel[id] < sizeof (LEVELS))
{
    while(
PlayerXP[id] >= LEVELS[PlayerLevel[id]])
    {
        
PlayerLevel[id]++;
    }

__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode