Raised This Month: $ Target: $400
 0% 

WC3FT Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-04-2011 , 02:12   WC3FT Help
Reply With Quote #1

I have already posted in the wc3mods.net forums, but that forum is dead, so I put my post here and there.

I seem to have a problem with giving a player double XP if he has a certain shopmenu item.

PHP Code:
stock XP_GiveidiBonusXP )
{

    if ( !
WC3_Check() || !id )
    {
        return 
0;
    }

    
// Make sure we have the minimum amount of players
    
if ( !XP_MinPlayers() )
    {
        return 
0;
    }

    
// Bonus calculated by:
    // Bonus XP * (lvl of player/10 + 1.0)
    // I.E. if Player is level 10, then it will be Bonus XP * 2.0
    
    
if ( iBonusXP != )
    {
        new 
Float:fCurrentLevel floatp_data[id][P_LEVEL] );
        new 
Float:iLevelMultiplier = ( fCurrentLevel 10.0 ) + 1.0;
        new 
iRealBonusXP floatround(iLevelMultiplier iBonusXP);

        if( 
ITEM_HasidITEM_PENDANT ) )
        {
            
iRealBonusXP *= 2;
        }
        

        
p_data[id][P_XP] += iRealBonusXP;

        
XP_Checkid );

        return 
iRealBonusXP;
    }

    return 
0;

When I do this, for some reason the player gets half the XP rather than twice the XP.

If any of you are familiar with the WC3 coding, could you help me out?
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
 



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 03:27.


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