End a Thread?

Posts 1–6 of 6 · Page 1 of 1
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
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.
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
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.
Wrong section...

Moved to help.
Still crashes doesny help, and i set the SetText in the Thread.
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us