AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Xp Earned Hud (https://forums.alliedmods.net/showthread.php?t=168059)

modernwarfare 09-23-2011 17:41

Xp Earned Hud
 
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?

Doc-Holiday 09-24-2011 00:39

Re: Xp Earned Hud
 
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.

modernwarfare 09-24-2011 06:13

Re: Xp Earned Hud
 
Quote:

Originally Posted by Doc-Holiday (Post 1561936)
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?

modernwarfare 09-24-2011 06:13

Re: Xp Earned Hud
 
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

modernwarfare 09-24-2011 06:52

Re: Xp Earned Hud
 
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 :)

2reason2kill 09-24-2011 08:59

Re: Xp Earned Hud
 
Quote:

Originally Posted by modernwarfare (Post 1562061)
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....

Doc-Holiday 09-24-2011 09:43

Re: Xp Earned Hud
 
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

modernwarfare 09-24-2011 12:49

Re: Xp Earned Hud
 
fixed please close


All times are GMT -4. The time now is 19:42.

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