2x exp

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Post Reply
KamiN
Gana aktyvus vartotojas
Posts: 227
Joined: 2011 Apr 23 13:17

2x exp

Post 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.

User avatar
aaarnas
Vyr. diskusijų administratorius
Posts: 3891
Joined: 2010 Aug 31 13:21
Skype: fiarno
Contact:

Re: 2x exp

Post 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.
Palikau CS pasaulį ;/ . Nebepasiekiamas.

KamiN
Gana aktyvus vartotojas
Posts: 227
Joined: 2011 Apr 23 13:17

Re: 2x exp

Post 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
Last edited by KamiN on 2011 Jul 14 18:06, edited 1 time in total.

User avatar
aaarnas
Vyr. diskusijų administratorius
Posts: 3891
Joined: 2010 Aug 31 13:21
Skype: fiarno
Contact:

Re: 2x exp

Post 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
Palikau CS pasaulį ;/ . Nebepasiekiamas.

KamiN
Gana aktyvus vartotojas
Posts: 227
Joined: 2011 Apr 23 13:17

Re: 2x exp

Post by KamiN »

Va visas xp.inl
Attachments
XP.inl
(19.43 KiB) Downloaded 715 times

User avatar
aaarnas
Vyr. diskusijų administratorius
Posts: 3891
Joined: 2010 Aug 31 13:21
Skype: fiarno
Contact:

Re: 2x exp

Post by aaarnas »

Šiame faile netinka. Čia tik atvaizdavimas. Dar kartą nukopijuok XP_Give stock.
Palikau CS pasaulį ;/ . Nebepasiekiamas.

KamiN
Gana aktyvus vartotojas
Posts: 227
Joined: 2011 Apr 23 13:17

Re: 2x exp

Post 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;}

User avatar
aaarnas
Vyr. diskusijų administratorius
Posts: 3891
Joined: 2010 Aug 31 13:21
Skype: fiarno
Contact:

Re: 2x exp

Post 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;}
Palikau CS pasaulį ;/ . Nebepasiekiamas.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests