ItsMods

Full Version: [Fixed]code lets Black Ops crash
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

I have a killstreak code with and i added a progress bar to it,
The problem is that black ops crashes after a few minutes of playing because of this code.

Anybody knows how to fix it?

Code:
CountKillstreak()
{
self endon("disconnect");
self endon("death");
    
    self.startscore = self.pers["kills"];
    self.killcount = 0;

    useBar = createPrimaryProgressBar( -250 );
        useBarText = createPrimaryProgressBarText( -250 );
        useBarText settext("Progress");
    useBarText.y = 205;
    useBar.bar.y = 220;
    useBar.y = 220;
    
    for(;;)
    {
        self thread deleteProbar(useBar, useBarText);

        if(self.killcount != self.pers["kills"] - self.startscore)
        {    
            self.killcount = self.pers["kills"] - self.startscore;
            switch(self.killcount)
            {
            case 2:
            {    self iPrintlnBold("Weapon Upgraded!");
                usebar updateBar(.1);
                self takeAllWeapons();
                self GiveWeapon("m16_mp", 0, self calcWeaponoptions( 8, 0, 0, 1, 1 ));
                break;}
            case 3:
                {self iPrintlnBold("Weapon Upgraded!");
                usebar updateBar(.2);
                self takeAllWeapons();
                self GiveWeapon("enfield_mp", 0, self calcWeaponoptions( 8, 0, 0, 1, 1 ));
                break;}
            case 4:
                {self iPrintlnBold("Weapon Upgraded!");
                usebar updateBar(.3);
                self takeAllWeapons();
                self GiveWeapon("famas_mp", 0, self calcWeaponoptions( 8, 0, 0, 1, 1 ));
                break;}
            case 5:
                {self iPrintlnBold("Weapon Upgraded!");
                usebar updateBar(.4);
                self takeAllWeapons();
                self GiveWeapon("commando_mp", 0, self calcWeaponoptions( 8, 0, 0, 1, 1 ));
                break;}
            case 6:
                {self iPrintlnBold("Weapon Upgraded!");
                usebar updateBar(.5);
                self takeAllWeapons();
                self GiveWeapon("m60_mp", 0, self calcWeaponoptions( 8, 0, 0, 1, 1 ));
                break;}
            case 7:
                {self iPrintlnBold("Weapon Upgraded!");
                usebar updateBar(.6);
                self GiveWeapon("tesla_gun_zm", 0, self calcWeaponoptions( 8, 0, 0, 1, 1 ));
                break;}
            }
    
        }
    wait .05;
    }
}

deleteProBar(elem1, elem2)
{
    self waittill_any("disconnect", "death");
    if(isDefined(elem1)) elem1 destroyelem();
    if(isDefined(elem2)) elem2 destroy();

    wait .05;
}
You open this self thread deleteProbar really often. myabe u could show us the code?
(09-08-2011, 12:26)Tomsen1410 Wrote: [ -> ]You open this self thread deleteProbar really often. myabe u could show us the code?

post updated
I agree with tomsen, that might be it, altough it depends on what it does
yeah um you should really call it before for( ;; ) i think, your calling a shitload of those threads right now
Yes, i think the problem depends on the thread. cause u open the damn thread every .05 secs and it waits till someone diconnects. u have to do another one.
and btw: credits would be nice for the streak function ; )
(09-08-2011, 12:35)Tomsen1410 Wrote: [ -> ]Yes, i think the problem depends on the thread. cause u open the damn thread every .05 secs and it waits till someone diconnects. u have to do another one.
and btw: credits would be nice for the streak function ; )

ok i'll try, and i didn't "release" the code yet, so thats why i wait with the credits Wink
<snip>
(09-08-2011, 12:37)jariz Wrote: [ -> ]
(09-08-2011, 12:35)Tomsen1410 Wrote: [ -> ]Yes, i think the problem depends on the thread. cause u open the damn thread every .05 secs and it waits till someone diconnects. u have to do another one.
and btw: credits would be nice for the streak function ; )

aaaalright! Fuck yea!

i helped him alot. i just wanted to have a little credits not more : )
i already snipped, didnt knew that
plz remove the quote lololol
(09-08-2011, 12:41)jariz Wrote: [ -> ]i already snipped, didnt knew that
plz remove the quote lololol

Fuck yea!
Pages: 1 2