04-05-2011, 04:48
(This post was last modified: 04-05-2011, 06:16 by rotceh_dnih.)
hey guys ive got this killstreak code and it work's but has a very BiG bug,let me explane, the code is watching cur_kill_streak and running a function if cur_kill_streak == xx kill's is true the issue is when "ie" 5 kill's is true the function will spam untill 6 kill's, it stop's because there's not a cur_kill_streak for it so varible isnt true anymore i understand that much but how can i make it Stop once the function has ran once(stop the spaming) I have attached my code and some pic's
Edit: photobuckt not working atm photos are attached
+rep if you can help xD
Code:
CountKillstreak()
{
self endon("disconnect");
self endon("death");
for(;;)
{
killstreak = self.pers["cur_kill_streak"];
switch(killstreak)
{
case 3:
self thread killstreak1();
break;
case 5:
self thread killstreak2();
break;
case 7:
self thread killstreak3();
break;
case 10:
self thread killstreak4();
break;
case 15:
self thread killstreak5();
break;
}
wait .05;
}
}
Killstreak1()
{
for(i=1;i>0;i--)
{
self iPrintlnBold( "You are on a 3 killstreak!" );
AllClientsPrint( self.name + " is on a 3 killstreak!" );
}
}
Killstreak2()
{
for(i=1;i>0;i--)
{
self iPrintlnBold( "You are on a 5 killstreak!" );
AllClientsPrint( self.name + " is on a 5 killstreak!" );
}
}
Killstreak3()
{
for(i=1;i>0;i--)
{
self iPrintlnBold( "You are on a 7 killstreak!" );
AllClientsPrint( self.name + " is on a 7 killstreak!" );
}
}
Killstreak4()
{
for(i=1;i>0;i--)
{
self iPrintlnBold( "You are on a 10 killstreak!" );
AllClientsPrint( self.name + " is on a 10 killstreak!" );
}
}
Killstreak5()
{
for(i=1;i>0;i--)
{
self iPrintlnBold( "You are on a 15 killstreak!" );
AllClientsPrint( self.name + " is on a 15 killstreak!" );
}
}
HUDestroy(hudElem)
{
self waittill("death");
hudElem destroy();
hudElem delete();
}
+rep if you can help xD
Go home IW.... your drunk.
Youtube: http://www.youtube.com/user/TheMrStacie
Twitter: https://twitter.com/#!/rotceh_dnih
Youtube: http://www.youtube.com/user/TheMrStacie
Twitter: https://twitter.com/#!/rotceh_dnih