AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   2x experience (https://forums.alliedmods.net/showthread.php?t=194580)

GhostMan 08-29-2012 11:27

2x experience
 
How do i make 2x exp http://wc3mods.net/forums/viewtopic....5cc2c5fbb5e725 for T flag players?

Do i have to do like that with every iBonusXP variable (this method would require to change a lot of lines =/)
PHP Code:

if( get_user_flagsdefuser ) & ADMIN_LEVEL_H)
{
    new 
iBonusXP XP_GivedefuserDEFUSING_BOMB ) * 2;
}
else
{
    new 
iBonusXP XP_GivedefuserDEFUSING_BOMB );


Or its simply enought to change something in XP_Give stock?

Maby something like that?
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 float(MAX_LEVELS) ) + 1.0;
        new 
iRealBonusXP floatround(iLevelMultiplier iBonusXP);
        
        if( 
get_user_flagsid ) & ADMIN_LEVEL_H )
        {
            
p_data[id][P_XP] += iRealBonusXP 2;
        }
        else
        {
            
p_data[id][P_XP] += iRealBonusXP;
        }

        
XP_Checkid );

        if( 
get_user_flagsid ) & ADMIN_LEVEL_H )
        {
            return 
iRealBonusXP 2;
        }
        else
        {
            return 
iRealBonusXP;
        }
    }

    return 
0;




All times are GMT -4. The time now is 05:41.

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