• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Bar Stopped Updating
#1
Either it's magic or I have memory problems, the bar stopped working

init
Code:
init()
{
level.captureBarValue = 0;
}

map = getDvar("mapname");
    switch(map)
    {
        case "mp_array":
            thread captureObjectiveArray((-95, 933, 353));

captureObjectiveArray
Code:
captureObjectiveArray(org)
{
    level endon("game_ended");

    rad = 120;
        
    while(1)
    {
        for ( i = 0; i < level.players.size; i++ )
        {
            player = level.players[i];
            dis = distance(player.origin, org);
            if(dis < rad)
            {
                if(player.pers["team"] == "axis")
                    level.captureBarValue++;
                else if(player.pers["team"] == "allies")
                {
                    if(level.captureBarValue >= 0)
                        level.captureBarValue--;
                }
                wait 1;
            }
        }
        if(level.captureBarValue == 100)
        {
            thread maps\mp\gametypes\_globallogic::endGame( "axis", "Satellite-C3 was captured" );
        }
      wait .1;
    }
}

and the bar updating:
Code:
updateCustomBar()
{
    self endon("disconnect");
    v = createPrimaryProgressBar( -300 );
    v.bar.horzAlign = "LEFT";
    v.bar.vertAlign = "MIDDLE";
    v.bar.y = -100;
    v.bar.x = -410;
    v.y = -100;
    v.x = -350;
        
    while(1)
    {
        v.bar updateBar(level.captureBarValue/100); //even v updateBar(level.captureBarValue/100); fail
        v.bar.color=(0,0,1);    
      wait .1;
    }
}

Code:
onPlayerSpawned()
{
    self endon("disconnect");

    self thread showWelcomeMessage();
    self thread updateCustomBar();
    for(;;)
    {

WHY
[Image: 1fxsnb.jpg]
  Reply
#2
ist updateCustomBar supposed to be in the for loop @ OnPlayerSpawned?
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

  Reply
#3
No, why?
[Image: 1fxsnb.jpg]
  Reply
#4
(04-06-2011, 16:54)4FunPlayin Wrote: No, why?

I'm not sure .. but if you want to let it update it needs to be in a for() loop ..
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

  Reply
#5
It is in a loop
while(1)
{
v.bar updateBar(level.captureBarValue/100); //even v updateBar(level.captureBarValue/100); fail
v.bar.color=(0,0,1);
wait .1;
}
[Image: 1fxsnb.jpg]
  Reply
#6
Increase the loop wait time.
YouTube 1: Azumikkel - Modding
YouTube 2: DerpShark - Gaming Entertainment
Website: Jensby.me
Contact: im[at]jensby.me
  Reply
#7
I tried 0.5 and then I tried 0.9, but still nothing Sad
[Image: 1fxsnb.jpg]
  Reply
#8
are you on the right team?

Code:
if(player.pers["team"] == "axis")
                    level.captureBarValue++;
                else if(player.pers["team"] == "allies")
                {
                    if(level.captureBarValue >= 0)
                        level.captureBarValue--;
                }

that^^ will only add percentage if ur on the axis team......

but if thats intended:
try making level.captureBarValue = 1; to start and see if the bar starts working from there

edit:
Code:
self thread updateCustomBar();
with the self this might be a problem but im not sure

Code:
v = createPrimaryProgressBar(...);
self.v = self createPrimaryProgressBar(...);

self.v.bar updateBar(...);
etc..
[Image: b_560_95_1.png]
  Reply
#9
(04-06-2011, 21:42)[CoDBOMod]Nukem Wrote: are you on the right team?

Code:
if(player.pers["team"] == "axis")
                    level.captureBarValue++;
                else if(player.pers["team"] == "allies")
                {
                    if(level.captureBarValue >= 0)
                        level.captureBarValue--;
                }

that^^ will only add percentage if ur on the axis team......

but if thats intended:
try making level.captureBarValue = 1; to start and see if the bar starts working from there

edit:
Code:
self thread updateCustomBar();
with the self this might be a problem but im not sure

Code:
v = createPrimaryProgressBar(...);
self.v = self createPrimaryProgressBar(...);

self.v.bar updateBar(...);
etc..

I tried making level.captureBarValue = 50 and nothing, and yes I'm on the right team, if you're on the allied team the bar value decreased, if you're on the axis team bar~increase

the "self updateCustomBar" isn't the problem, updateCustomBar is creating the bar itself for the player
Code:
updateCustomBar()
{
    self endon("disconnect");
    v = createPrimaryProgressBar( -300 );
    v.bar.horzAlign = "LEFT";
    v.bar.vertAlign = "MIDDLE";
    v.bar.y = -100;
    v.bar.x = -410;
    v.y = -100;
    v.x = -350;
        
    while(1)
    {
        v.bar updateBar(level.captureBarValue/100); //even v updateBar(level.captureBarValue/100); fail
        v.bar.color=(0,0,1);    
      wait .1;
    }
}
[Image: 1fxsnb.jpg]
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [d3d9.dll] MW3 Server Has Stopped Working.. bertancakici 4 3,715 11-16-2012, 01:09
Last Post: JariZ
Rainbow Help Server is not updating Nekochan 1 733 11-06-2012, 20:15
Last Post: JariZ
  Help My Server isnt updating by itself DeMenTor 10 1,950 06-09-2012, 19:20
Last Post: DidUknowiPwn
  Display driver nvlddmkm stopped responding. Mayo 15 4,005 01-25-2012, 01:34
Last Post: kokole
  [Request] Continue Updating Zombie Epidemic Mod Lemon 11 2,409 09-20-2011, 16:14
Last Post: johamort
Question Help Custom texures stopped working Xidding 15 3,434 06-04-2011, 17:49
Last Post: Xidding
  [News] Black Ops Patch 1.09 xD mod support Updating // 5/26/11 rotceh_dnih 16 4,907 05-28-2011, 09:19
Last Post: aosma8
  new update in action - english files stopped working nonab 2 717 11-12-2010, 11:54
Last Post: 4FunPlayin
  [Release] Self updating DLL via Sigs d0h! 1 824 11-07-2010, 13:45
Last Post: Cgallagher

Forum Jump:


Users browsing this thread: 1 Guest(s)