Thread: End a Thread?

Results 1 to 6 of 6
  1. #1
    shotyoudie's Avatar
    Join Date
    May 2009
    Gender
    female
    Posts
    119
    Reputation
    10
    Thanks
    6
    My Mood
    Angelic

    End a Thread?

    Hi,

    is there a function where you can end a thread in a other thread?

    Like this:
    Code:
    THREAD();
    {
    End Thread OTHERTHREAD();
    }
    This doesnt work

    Please help

    Shotyoudie

  2. #2
    AZUMIKKEL's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My moms house... what's so funny about that?
    Posts
    790
    Reputation
    19
    Thanks
    462
    My Mood
    Sneaky
    put this at the top of the thread you want to end:
    Code:
    self endon("name_of_an_event_that_doesnt_exist");
    then put this where you want it to end the other thread
    Code:
    self notify("name_of_the_same_event");
    The event name can be anything, just don't make it stuff that already exists like "death", "disconnect" etc.
    www.YouTube.com/MpKiller100

  3. #3
    shotyoudie's Avatar
    Join Date
    May 2009
    Gender
    female
    Posts
    119
    Reputation
    10
    Thanks
    6
    My Mood
    Angelic
    I made it 'stopt' but now it crashes. the error was something like: Overflow(511) Time Left:2:30 (Time Left 2:30 is the text and 2:30 is just random becaus it's counts down)

    This is the code:
    Code:
    doEndingTimer()
    {
    	self endon("stopt");
    	level.min = 4;
    	level.sec = 60;
    	while(1)
    	{
    		wait 1;
    		level.sec--;
    		if(level.sec == 0)
    		{
    			if(level.min == 0)
    			{
    				foreach(player in level.players)
    				{
    					player suicide();
    					self thread maps\mp\gametypes\_hud_message::hintMessage("Humans Win");
    					level.min = 4;
    					level.sec = 60;
    				}
    				return;
    			}
    			else
    			{	
    				level.min--;
    				level.sec = 60;
    			}
    		}
    	}
    }
    And this in a other thread.
    Code:
    self.HintText setText("Time Left: "+ level.min +":"+ level.sec);
    I mostly crashes around 1:00 and 2:00

  4. #4
    B4M's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Real World
    Posts
    6,939
    Reputation
    478
    Thanks
    1,746
    My Mood
    Bored
    Wrong section...

    Moved to help.


    Back in '10



    Got a question?PM/VM me!
    I read them all.
    Also contact me via MSN.
    vlad@mpgh.net

    Minion since:07-04-2010
    Mod since:08-31-2010
    Till : 05.07.2011

  5. #5
    AZUMIKKEL's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My moms house... what's so funny about that?
    Posts
    790
    Reputation
    19
    Thanks
    462
    My Mood
    Sneaky
    Quote Originally Posted by shotyoudie View Post
    I made it 'stopt' but now it crashes. the error was something like: Overflow(511) Time Left:2:30 (Time Left 2:30 is the text and 2:30 is just random becaus it's counts down)

    This is the code:
    Code:
    doEndingTimer()
    {
    	self endon("stopt");
    	level.min = 4;
    	level.sec = 60;
    	while(1)
    	{
    		wait 1;
    		level.sec--;
    		if(level.sec == 0)
    		{
    			if(level.min == 0)
    			{
    				foreach(player in level.players)
    				{
    					player suicide();
    					self thread maps\mp\gametypes\_hud_message::hintMessage("Humans Win");
    					level.min = 4;
    					level.sec = 60;
    				}
    				return;
    			}
    			else
    			{	
    				level.min--;
    				level.sec = 60;
    			}
    		}
    	}
    }
    And this in a other thread.
    Code:
    self.HintText setText("Time Left: "+ level.min +":"+ level.sec);
    I mostly crashes around 1:00 and 2:00
    On the setText, change the wait 0.05; (or whatever it is) in the while/for loop to something higher, like 1.
    www.YouTube.com/MpKiller100

  6. #6
    shotyoudie's Avatar
    Join Date
    May 2009
    Gender
    female
    Posts
    119
    Reputation
    10
    Thanks
    6
    My Mood
    Angelic
    Still crashes doesny help, and i set the SetText in the Thread.

Similar Threads

  1. obligitary count to a bagalion thread
    By i eat trees in forum Spammers Corner
    Replies: 166
    Last Post: 05-03-2012, 02:57 PM
  2. [Solved] Endon doesn't end thread
    By dsds1 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 6
    Last Post: 08-31-2011, 10:33 AM
  3. End Thread?
    By shotyoudie in forum Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    Replies: 6
    Last Post: 08-27-2010, 12:21 AM
  4. Challenge Thread
    By arunforce in forum General
    Replies: 7
    Last Post: 03-26-2007, 02:22 PM
  5. I eat trees (lost thread)
    By Chronologix in forum Help & Requests
    Replies: 14
    Last Post: 01-27-2006, 10:29 PM