ItsMods

Full Version: how stop the Loop?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
How i can stop the loop?

if i have 2000 credits the loop will make -4x500 Money
if i have 0 Credits.
i tryed with "break;" but dont work.


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

while( true )
{
self waittill( "menuresponse", menu, response );

if( response == "l96" )



{
if(self.money >= 500)

{
self.money-=500;
self.hud_score_value setValue(self.money);
self giveWeapon( "l96a1_mp" );
self switchToWeapon( "l96a1_mp" );
self thread ScoreHUD( -500);
self iPrintln("L96 purchased");
}

}
maybe
Code:
continue;
Confused
stop the loop, if i use break; they dont stop an make 6 times the while( true)

my god, did you try continue; ?

continue; instead of what?
(03-08-2012, 04:46)p2tk Wrote: [ -> ]continue; instead of what?

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

while( true )
{
self waittill( "menuresponse", menu, response );

if (response == "l96" && self.money >= 1000 )

{
self.money-=500;
self.hud_score_value setValue(self.money);
self giveWeapon( "l96a1_mp" );
self switchToWeapon( "l96a1_mp" );
self thread ScoreHUD( -500);
self iPrintln("L96 purchased");
continue; <---dont work
}
continue; <--- dont work
}
continue; <--- dont work
}


so what now? mostly it takes 6x the item (l96)
dont know, it sure sound's like your making wins though

oh derp maybe throw a wait in there that might help
tryed wait 5.0
only affect was, i need to wait 5 secs to use this function again, and make again 6 times this function


what i can use for "while (true)"
to ask this function
(03-08-2012, 05:15)p2tk Wrote: [ -> ]tryed wait 5.0
only affect was, i need to wait 5 secs to use this function again, and make again 6 times this function


what i can use for "while (true)"
to ask this function

pack it up and pm me it and ill post fix here caint be to much wrong with it, its just hard to tell with out looking at it all, i work better when i see it happen myself i can sometime's pick an error down to the line when i run it myself after reading it lol
Pages: 1 2 3