Page 1 of 1
2x exp
Posted: 2011 Jul 14 17:55
by KamiN
Code: Select all
if (equal(sAction,"Spawned_With_The_Bomb")) { g_iPlayerRole[id] = PLR_BOMB_CARRIER; new iBonusXP = XP_Give( id, SPAWN_BOMB ); if ( iBonusXP != 0 && get_pcvar_num( CVAR_wc3_show_objectives ) ) { client_print( id, print_chat, "%s You have been awarded %d XP for spawning with the bomb", g_MODclient, iBonusXP ); } }
Pavizdį parodyt galit kaip padaryt, kad jeigu žaidėjas turi flagą kokį nors gauna 2x daugiau exp, kitu atvėju gauna normaliai exp.
Re: 2x exp
Posted: 2011 Jul 14 18:01
by aaarnas
Na tai galvok logiškai. XP_Give gauna kiek xp taškų bus pridėta, perkeliama į iBonusXP kintamąjį.
Tai dabar tiesiog reikia sąlygos, jei žaidėjas vip, tai reikia tuos xp padauginti iš 2.
Code: Select all
if (equal(sAction,"Spawned_With_The_Bomb")) { g_iPlayerRole[id] = PLR_BOMB_CARRIER; new iBonusXP = XP_Give( id, SPAWN_BOMB ); if(get_user_flags(id) & ADMIN_LEVEL_H) iBonusXP *= 2 if ( iBonusXP != 0 && get_pcvar_num( CVAR_wc3_show_objectives ) ) { client_print( id, print_chat, "%s You have been awarded %d XP for spawning with the bomb", g_MODclient, iBonusXP ); } }
O dar paprasčiau, tiesiog XP_Give funkcijoje iš karto padauginti iš 2. Nereikės viso kodo redaguoti.
Re: 2x exp
Posted: 2011 Jul 14 18:05
by KamiN
Sakai šitą kažkaip redaguot?
Code: Select all
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 / 10.0 ) + 1.0; new iRealBonusXP = floatround(iLevelMultiplier * iBonusXP); p_data[id][P_XP] += iRealBonusXP; XP_Check( id ); return iRealBonusXP; } return 0;}
-- 2011 Lie 14 19:13 --
O galima toks dalykas 1.5 daugiau xp?
Code: Select all
if(get_user_flags(id) & ADMIN_LEVEL_H) iBonusXP *= 1.5
Re: 2x exp
Posted: 2011 Jul 14 18:27
by aaarnas
Su puse daug problemų, nes reikia keisti kintamųjų tipą į float. Pala dar įkelk visą tą if (equal(sAction,"Spawned_With_The_Bomb")) ir XP_Give
Re: 2x exp
Posted: 2011 Jul 14 18:32
by KamiN
Va visas xp.inl
Re: 2x exp
Posted: 2011 Jul 14 19:22
by aaarnas
Šiame faile netinka. Čia tik atvaizdavimas. Dar kartą nukopijuok XP_Give stock.
Re: 2x exp
Posted: 2011 Jul 14 19:52
by KamiN
Čia šitam faile ir yra tas xp_give, daugiau kaip jo ir niekur nėra.
Code: Select all
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 / 10.0 ) + 1.0; new iRealBonusXP = floatround(iLevelMultiplier * iBonusXP); p_data[id][P_XP] += iRealBonusXP; XP_Check( id ); return iRealBonusXP; } return 0;}
Re: 2x exp
Posted: 2011 Jul 14 20:47
by aaarnas
Code: Select all
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 / 10.0 ) + 1.0; new iRealBonusXP = floatround(iLevelMultiplier * iBonusXP); if(get_user_flags(id) & ADMIN_LEVEL_H) iRealBonusXP *= 2; p_data[id][P_XP] += iRealBonusXP; XP_Check( id ); return iRealBonusXP; } return 0;}