AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   WC3FT Help (https://forums.alliedmods.net/showthread.php?t=163842)

nikhilgupta345 08-04-2011 02:12

WC3FT Help
 
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?

nikhilgupta345 09-01-2011 00:24

Re: WC3FT Help
 
Bump..


All times are GMT -4. The time now is 03:27.

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