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_Give( id, iBonusXP )
{
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 != 0 )
{
new Float:fCurrentLevel = float( p_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_Check( id );
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_defusing( defuser )
{
if ( !WC3_Check() )
{
return;
}
// Make sure that this isn't called more than once per round
if ( !bHasBegunPlantingOrDefusing[defuser] )
{
if(get_user_flags( defuser ) & ADMIN_LEVEL_H)
{
new iBonusXP = XP_Give( defuser, DEFUSING_BOMB ) * 2;
}
else
{
new iBonusXP = XP_Give( defuser, DEFUSING_BOMB );
}
if ( iBonusXP != 0 )
{
client_print( defuser, print_chat, "%s You have been awarded %d XP for starting to defuse the bomb", g_MODclient, iBonusXP );
}
}
bHasBegunPlantingOrDefusing[defuser] = true;
}
Second part i wouldnt like, becouse then i would need to change a lot of lines :O