Raised This Month: $32 Target: $400
 8% 

Double exp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 08-28-2012 , 16:39   Double exp
Reply With Quote #1

http://wc3mods.net/forums/viewtopic....356ca5c0ad2d21

No ones aswering me in that forum, so i ll try here.

How to make that players with flag ADMIN_LEVEL_H (or whateva) would get double exp?

Maby it's enought to change something in xp_give stock

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);
        
        
p_data[id][P_XP] += iRealBonusXP;

        
XP_Checkid );

        return 
iRealBonusXP;
    }

    return 
0;

Or do i need to check before every new iBonusXP if player has T flag?

e.g.

PHP Code:
public bomb_defusingdefuser )
{
    if ( !
WC3_Check() )
    {
        return;
    }

    
// Make sure that this isn't called more than once per round
    
if ( !bHasBegunPlantingOrDefusing[defuser] )
    {
        if(
get_user_flagsdefuser ) & ADMIN_LEVEL_H)
        {
            new 
iBonusXP XP_GivedefuserDEFUSING_BOMB ) * 2;
        }
        else
        {
            new 
iBonusXP XP_GivedefuserDEFUSING_BOMB );
        }

        if ( 
iBonusXP != )
        {
            
client_printdefuserprint_chat"%s You have been awarded %d XP for starting to defuse the bomb"g_MODclientiBonusXP );
        }
    }

    
bHasBegunPlantingOrDefusing[defuser] = true;

Second part i wouldnt like, becouse then i would need to change a lot of lines :O
Attached Files
File Type: zip XP.zip (4.7 KB, 38 views)

Last edited by GhostMan; 08-28-2012 at 16:45.
GhostMan is offline
Reply


Thread Tools
Display Modes

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 15:49.


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