Raised This Month: $ Target: $400
 0% 

Xp Earned Hud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
modernwarfare
Senior Member
Join Date: Aug 2011
Location: sweden
Old 09-23-2011 , 17:41   Xp Earned Hud
Reply With Quote #1

Hey guys i made an xp mod

but i have a bug

when i like kill 2 ppl it just shows me the xp earned at the hud for the first kill

and here is my death method:

Code:
public eDeath(iVictim, iAttacker) {
    new HitGroup = get_pdata_int(iVictim, m_LastHitGroup);
    Killstreaks[iVictim] = 0;
    kills[iVictim] = 0;
    HS[iVictim] = 0;

    if(get_cvar_num("Deathmatch") == 1 && !BombPlanted) {
        set_task(3.00, "RespawnPlayer", iVictim);
        set_task(0.01, "Respawntext", iVictim);
    }


    if(!IsPlayer(iAttacker)){
        return HAM_IGNORED;
    }
    new weapon = get_user_weapon(iAttacker);

    if(get_user_team(iAttacker) != get_user_team(iVictim)) {
            ++Killstreaks[iAttacker];
            if(kills[iAttacker] != get_pcvar_num(KILLSTREAK)  && HS[iAttacker] != get_pcvar_num(HSSTREAK))
            {
                if(weapon == CSW_KNIFE)
                {
                    if(HitGroup != HIT_HEAD)
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) + get_pcvar_num(KNIFE_Kill));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(KNIFE_Kill));
                        ++kills[iAttacker];
                    }
                    else
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) +  get_pcvar_num(HS_Kill) + get_pcvar_num(KNIFE_Kill));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(HS_Kill) + get_pcvar_num(KNIFE_Kill));
                        ++kills[iAttacker];
                        ++HS[iAttacker];
                    }
                }
                else 
                {
                    if(HitGroup != HIT_HEAD)
                    {
                        PlayerXP[iAttacker] += get_pcvar_num(XP_Kill);
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill));
                        ++kills[iAttacker];
                    }
                    else
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) +  get_pcvar_num(HS_Kill));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(HS_Kill));
                        ++kills[iAttacker];
                        ++HS[iAttacker];
                    }
                }
            }
            if(kills[iAttacker] == get_pcvar_num(KILLSTREAK) && HS[iAttacker] == get_pcvar_num(HSSTREAK))
            {
                if(weapon == CSW_KNIFE)
                {
                    if(HitGroup != HIT_HEAD)
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(KILLSTREAKBONUS) + get_pcvar_num(HSSTREAKBONUS));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(KILLSTREAKBONUS) + get_pcvar_num(HSSTREAKBONUS));
                        kills[iAttacker] = 0;
                        HS[iAttacker] = 0;
                    }
                    else
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) +  get_pcvar_num(HS_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(KILLSTREAKBONUS) + get_pcvar_num(HSSTREAKBONUS));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(HS_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(KILLSTREAKBONUS) + get_pcvar_num(HSSTREAKBONUS));
                        kills[iAttacker] = 0;
                        HS[iAttacker] = 0;
                    }
                }
                else 
                {
                    if(HitGroup != HIT_HEAD)
                    {
                        PlayerXP[iAttacker] += get_pcvar_num(XP_Kill) + get_pcvar_num(KILLSTREAKBONUS) + get_pcvar_num(HSSTREAKBONUS);
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(KILLSTREAKBONUS) + get_pcvar_num(HSSTREAKBONUS));
                        kills[iAttacker] = 0;
                        HS[iAttacker] = 0;
                    }
                    else
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) +  get_pcvar_num(HS_Kill) + get_pcvar_num(KILLSTREAKBONUS) + get_pcvar_num(HSSTREAKBONUS));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(HS_Kill) + get_pcvar_num(KILLSTREAKBONUS) + get_pcvar_num(HSSTREAKBONUS));
                        kills[iAttacker] = 0;
                        HS[iAttacker] = 0;
                    }
                }
            }
            if(kills[iAttacker] == get_pcvar_num(KILLSTREAK) && HS[iAttacker] != get_pcvar_num(HSSTREAK))
            {
                if(weapon == CSW_KNIFE)
                {
                    if(HitGroup != HIT_HEAD)
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(KILLSTREAKBONUS));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(KILLSTREAKBONUS));
                    }
                    else
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) +  get_pcvar_num(HS_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(KILLSTREAKBONUS));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(HS_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(KILLSTREAKBONUS));
                        ++HS[iAttacker];
                    }
                }
                else 
                {
                    if(HitGroup != HIT_HEAD)
                    {
                        PlayerXP[iAttacker] += get_pcvar_num(XP_Kill) + get_pcvar_num(KILLSTREAKBONUS);
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(KILLSTREAKBONUS));
                    }
                    else
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) +  get_pcvar_num(HS_Kill) + get_pcvar_num(KILLSTREAKBONUS));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(HS_Kill) + get_pcvar_num(KILLSTREAKBONUS));
                        ++HS[iAttacker];
                    }
                }
                kills[iAttacker] = 0;    
            }
            if(HS[iAttacker] == get_pcvar_num(HSSTREAK) && kills[iAttacker] != get_pcvar_num(KILLSTREAK))
            {
                if(weapon == CSW_KNIFE)
                {
                    if(HitGroup != HIT_HEAD)
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(HSSTREAKBONUS));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(HSSTREAKBONUS));
                        HS[iAttacker] = 0;
                    }
                    else
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) +  get_pcvar_num(HS_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(HSSTREAKBONUS));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(HS_Kill) + get_pcvar_num(KNIFE_Kill) + get_pcvar_num(HSSTREAKBONUS));
                        HS[iAttacker] = 0;
                    }
                }
                else 
                {
                    if(HitGroup != HIT_HEAD)
                    {
                        PlayerXP[iAttacker] += get_pcvar_num(XP_Kill) + get_pcvar_num(HSSTREAKBONUS);
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(HSSTREAKBONUS));
                        HS[iAttacker] = 0;
                    }
                    else
                    {
                        PlayerXP[iAttacker] += (get_pcvar_num(XP_Kill) +  get_pcvar_num(HS_Kill) + get_pcvar_num(HSSTREAKBONUS));
                        set_hudmessage(0, 255, 50, 0.50, 0.33, 1, 2.0, 2.0);
                        ShowSyncHudMsg(iAttacker, gHudSyncXp, "+ %d", get_pcvar_num(XP_Kill) + get_pcvar_num(HS_Kill) + get_pcvar_num(HSSTREAKBONUS));
                        HS[iAttacker] = 0;
                    }
                }
            }
    }
    if(get_cvar_num("SaveXP") == 1 && !is_user_bot(iAttacker)) {
    SaveData(iAttacker);
    }
    ShowHud(iAttacker);
    CheckLevel(iAttacker);
    return HAM_IGNORED;
}
an exemple

i kill 3 players in same time

very fast

so this comes


100+ and its supposted to be 300+

so any idea?
__________________
Im supporting/coding XP Mod Plugin
Free Palestine
R.I.P. The 2967 American people that lost their lives 9/11 and R.I.P.
The 48,644 Afghan and 1,690,903 Iraqi people that paid the ultimate price for a crime they did not commit.



modernwarfare is offline
Send a message via MSN to modernwarfare Send a message via Skype™ to modernwarfare
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 09-24-2011 , 00:39   Re: Xp Earned Hud
Reply With Quote #2

your using the hud from battle field and the reason for this is because it shows it per kill which means
you kill 3 people it shows it three times.... you can try and set a timer... (time between kills) and just keep showing the amount of xp there getting.

try and set something up for it.. ill play around with it some time.. but try it and post what you got lol dont just wait for mine.

if you wanna learn you gotta try.
Doc-Holiday is offline
modernwarfare
Senior Member
Join Date: Aug 2011
Location: sweden
Old 09-24-2011 , 06:13   Re: Xp Earned Hud
Reply With Quote #3

Quote:
Originally Posted by Doc-Holiday View Post
your using the hud from battle field and the reason for this is because it shows it per kill which means
you kill 3 people it shows it three times.... you can try and set a timer... (time between kills) and just keep showing the amount of xp there getting.

try and set something up for it.. ill play around with it some time.. but try it and post what you got lol dont just wait for mine.

if you wanna learn you gotta try.

ok thx i will try
but give me some hints
like

do i make i timer

like how much seconds between every hud?
__________________
Im supporting/coding XP Mod Plugin
Free Palestine
R.I.P. The 2967 American people that lost their lives 9/11 and R.I.P.
The 48,644 Afghan and 1,690,903 Iraqi people that paid the ultimate price for a crime they did not commit.



modernwarfare is offline
Send a message via MSN to modernwarfare Send a message via Skype™ to modernwarfare
modernwarfare
Senior Member
Join Date: Aug 2011
Location: sweden
Old 09-24-2011 , 06:13   Re: Xp Earned Hud
Reply With Quote #4

like call of duty black ops (real one)

you get xp 100+ for the first kill then it hides and onther one come up again 100+

after like 2 secs
__________________
Im supporting/coding XP Mod Plugin
Free Palestine
R.I.P. The 2967 American people that lost their lives 9/11 and R.I.P.
The 48,644 Afghan and 1,690,903 Iraqi people that paid the ultimate price for a crime they did not commit.



modernwarfare is offline
Send a message via MSN to modernwarfare Send a message via Skype™ to modernwarfare
modernwarfare
Senior Member
Join Date: Aug 2011
Location: sweden
Old 09-24-2011 , 06:52   Re: Xp Earned Hud
Reply With Quote #5

oh fixed

i made so it shows the hud fast and hide fast
now

and onther thing

when i kill someone

like it comes 100+

and onther one faster but got like headshot

it be replaced with 150+

so its better
__________________
Im supporting/coding XP Mod Plugin
Free Palestine
R.I.P. The 2967 American people that lost their lives 9/11 and R.I.P.
The 48,644 Afghan and 1,690,903 Iraqi people that paid the ultimate price for a crime they did not commit.



modernwarfare is offline
Send a message via MSN to modernwarfare Send a message via Skype™ to modernwarfare
2reason2kill
Senior Member
Join Date: Feb 2011
Old 09-24-2011 , 08:59   Re: Xp Earned Hud
Reply With Quote #6

Quote:
Originally Posted by modernwarfare View Post
oh fixed

i made so it shows the hud fast and hide fast
now

and onther thing

when i kill someone

like it comes 100+

and onther one faster but got like headshot

it be replaced with 150+

so its better
Stop bumping, Edit your post....
2reason2kill is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 09-24-2011 , 09:43   Re: Xp Earned Hud
Reply With Quote #7

lol and i have no idea wtf your talking about.. if you havnt changed my death function your using... it gives bonus' for Headshots and multi kills and multi headshots
Doc-Holiday is offline
modernwarfare
Senior Member
Join Date: Aug 2011
Location: sweden
Old 09-24-2011 , 12:49   Re: Xp Earned Hud
Reply With Quote #8

fixed please close
__________________
Im supporting/coding XP Mod Plugin
Free Palestine
R.I.P. The 2967 American people that lost their lives 9/11 and R.I.P.
The 48,644 Afghan and 1,690,903 Iraqi people that paid the ultimate price for a crime they did not commit.



modernwarfare is offline
Send a message via MSN to modernwarfare Send a message via Skype™ to modernwarfare
Reply



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 19:42.


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