Raised This Month: $ Target: $400
 0% 

XP Mod, setting lvls, exp, saving


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
katna
Senior Member
Join Date: May 2010
Old 08-07-2010 , 03:43   Re: XP Mod, setting lvls, exp, saving
Reply With Quote #1

PHP Code:
new const ExpNeeded[5] = // 5 equal the max levels
{
        
100,
        
300,
        
600,
        
1000,
        
2000

PHP Code:
register_event("DeathMsg""eDeath""a"); 
PHP Code:
public eDeath( )
{
    new 
attacker read_data(1);
    new 
victim read_data(2);
        
pInfo[attacker][Exp] += 20;
        
pInfo[victim][Exp] -= 5;
        while(
pInfo[attacker][Exp] >= ExpNeeded[pInfo[attacker][Level]])
        {
                
// Leveled up
                
pInfo[attacker][Level] += 1;
                
client_print(id,print_chat,"Congratulation! you just leveled up!");
        }


katna is offline
Old 08-07-2010, 04:31
infek
This message has been deleted by infek. Reason: Double posted
infek
Senior Member
Join Date: May 2009
Location: Behind you
Old 08-07-2010 , 04:31   Re: XP Mod, setting lvls, exp, saving
Reply With Quote #3

Quote:
Originally Posted by katna View Post
[php]
new const ExpNeeded[5] = // 5 equal the max levels
{
100, <-- This is Level 0
300, <-- This will be the first level -iNfek
600,
1000,
2000
}
Actually you need 6
PHP Code:
new const ExpNeeded[6] = // 6 equal the max levels
{
        
0// Not a Level 0 Level
        
100// Needed Points for 1st Level
        
300// Needed Points for 2nd Level
        
600// Needed Points for 3rd Level
        
1000// Needed Points for 4th Level
        
2000 // Needed Points for 5th Level

__________________
"Domo Arigato, Mr. Roboto!"
PM me if you want to know a secret
infek 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 00:06.


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