ItsMods
how stop the Loop? - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: how stop the Loop? (/Thread-how-stop-the-Loop.html)

Pages: 1 2 3


how stop the Loop? - p2tk - 03-08-2012

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");
}

}



RE: how stop the Loop? - rotceh_dnih - 03-08-2012

maybe
Code:
continue;
Confused



RE: how stop the Loop? - p2tk - 03-08-2012

stop the loop, if i use break; they dont stop an make 6 times the while( true)




RE: how stop the Loop? - rotceh_dnih - 03-08-2012

my god, did you try continue; ?




RE: how stop the Loop? - p2tk - 03-08-2012

continue; instead of what?


RE: how stop the Loop? - rotceh_dnih - 03-08-2012

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

break; Tongue


RE: how stop the Loop? - p2tk - 03-08-2012

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)


RE: how stop the Loop? - rotceh_dnih - 03-08-2012

dont know, it sure sound's like your making wins though

oh derp maybe throw a wait in there that might help


RE: how stop the Loop? - p2tk - 03-08-2012

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


RE: how stop the Loop? - rotceh_dnih - 03-08-2012

(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