Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how stop the Loop?
#11
add self endon("mything");
to stop loop: self notify("mything"); ??
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#12
yep that should work this should also

add this to your onspawnedplayer

ie

Code:
onPlayerSpawned()
{
    self endon("disconnect");
    self thread hud_health();    
    for(;;)
    {
        self waittill("spawned_player");
        self.gotgun1 = 0;
}
}

then on the onMenuResponse add self.gotgun1++;
Code:
ie


        self.money-=1000;
        self.hud_score_value setValue(self.money);
        self giveWeapon( "l96a1_mp" );
        self switchToWeapon( "l96a1_mp" );
        self thread ScoreHUD( -1000);
        self iPrintln("L96 purchased");
        self.done1++;
tested and works but the notify thing should work to but my way you can control the player buying the gun twice and wasting moneys
Reply

#13
(03-08-2012, 11:05)rotceh_dnih Wrote: yep that should work this should also

add this to your onspawnedplayer

ie

Code:
onPlayerSpawned()
{
    self endon("disconnect");
    self thread hud_health();    
    for(;;)
    {
        self waittill("spawned_player");
        self.gotgun1 = 0;
}
}

then on the onMenuResponse add self.gotgun1++;
Code:
ie


        self.money-=1000;
        self.hud_score_value setValue(self.money);
        self giveWeapon( "l96a1_mp" );
        self switchToWeapon( "l96a1_mp" );
        self thread ScoreHUD( -1000);
        self iPrintln("L96 purchased");
        self.done1++;
tested and works but the notify thing should work to but my way you can control the player buying the gun twice and wasting moneys

dont work still remove 6times money -.-
(03-08-2012, 10:38)Se7en Wrote: add self endon("mything");
to stop loop: self notify("mything"); ??

works 1 times,
but cant start the loop again.
Reply

#14
soz i made a mistake edit it so it looks like this


Code:
if (response == "l96" && self.money >= 1000 && self.gotgun1 == 0 )
    
        {

        self.money-=1000;
        self.hud_score_value setValue(self.money);
        self giveWeapon( "l96a1_mp" );
        self switchToWeapon( "l96a1_mp" );
        self thread ScoreHUD( -1000);
        self iPrintln("L96 purchased");
        self.gotgun1++;

i tested it and that will work .
Reply

#15
yes the first time it works,

but when im buying the gun.
and want to buy it again, it will not work
Reply

#16
Use this instead:
Code:
if (response == "l96" && self.money >= 1000 && !self hasWeapon("l96a1_mp"))  )
Though I would also add the notify thing because it actually stops the loop, so it'll be more memory effecient or something.

PS: You're trying to add something to the AI Survival mod again, aren't you? Tongue
Would like to make a donation? Click here
Reply

#17
(03-08-2012, 16:00)Cyborgking Wrote: Use this instead:
Code:
if (response == "l96" && self.money >= 1000 && !self hasWeapon("l96a1_mp"))  )
Though I prefer the notify thing because it actually stops the loop, so it'll be more memory effecient or something.

PS: You're trying to add something to the AI Survival mod again, aren't you? Tongue

i need the option to buy it twice or more times!. i have option napalm(or anything)
so i cant buy more than 1 napalm, or buy a weapon to refillammo.
Reply

#18
any other idears?
Reply

#19
ok fix it,
explane it later

thanks anyway
Reply

#20
(03-08-2012, 22:43)p2tk Wrote: ok fix it,
explane it later

thanks anyway

ok fit it with,

Quote:onMenuResponse()
{
self endon( "death" );
self endon( "disconnect" );


for(;;)
{
self waittill( "menuresponse", menu, response );





if (response == "say1" && self.money >= 500 && self.gotgun1 == 0 )
{
self.money -= 500;
self.hud_score_value setValue(self.money);
self sayAll( "Hi there bitches <3" );
self thread ScoreHUD( -500 );
self.gotgun1++;
}
}
}


openMenuThread()
{
self endon( "disconnect" );
while( true )
{
if( self useButtonPressed() )
self openMenu( game[ "exi_menu" ] );
self.gotgun1 = 0;
wait( 0.05 );

}
}

onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self thread onMenuResponse();
self.gotgun1 = 0;
}
}

so but i get in all other function bug
-.- and it crash after some rounds
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Potential Infinite Loop DidUknowiPwn 5 3,739 10-27-2013, 22:22
Last Post: surtek
  STOP IT Nekochan 2 1,878 02-23-2013, 12:38
Last Post: surtek
  server stop working s.j-rez 9 4,742 08-26-2012, 06:23
Last Post: s.j-rez
  stop working eror{please help me:((} s.j-rez 0 1,779 08-25-2012, 12:47
Last Post: s.j-rez
  Help Stop music, change icons anedaktos13 2 2,301 06-12-2012, 15:50
Last Post: SuperNovaAO
  Stop your Black Ops Pre-order now! Samme 6 3,396 05-31-2012, 19:25
Last Post: Arteq
  Surprise - Stop itsmods negativity estebespt 11 5,919 05-04-2012, 20:06
Last Post: Arteq
Question help needed for: loop atenziono 2 2,269 03-02-2012, 17:42
Last Post: zxz0O0
  Help help to stop while vb.net reavenz 3 3,460 12-14-2011, 17:10
Last Post: barata
  STOP CALLING PEOPLE 4FunPlayin 1 2,027 10-01-2011, 15:15
Last Post: AZUMIKKEL

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.