Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 44 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: How to end a thread
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, Nov. 13, 2010 03:22 pm
Hey all!

How can I end a thread if e.g. a "if" is fulfilled?

Code:
if(level.lastAllied == true)
{
	 roundRestart();
         "and finish the current thread";
}
...


Greetings
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Nov. 13, 2010 05:42 pm
Put a level endon("End_thread_38");
at the top
and a
level notify("End_thread_38");
at the if part.
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Nov. 13, 2010 06:13 pm
there was a thread made of this like a week or 2 ago use the search engine for your problems before you post them cause most the time you will fine what you are looking for.
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, Nov. 13, 2010 08:15 pm
IzNoGoD writes...
Quote:
Put a level endon("End_thread_38");
at the top
and a
level notify("End_thread_38");
at the if part.


Oh thank you, worked! How exactly does it work?
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, Nov. 13, 2010 08:53 pm
liltc64 writes...
Quote:
there was a thread made of this like a week or 2 ago use the search engine for your problems before you post them cause most the time you will fine what you are looking for.


I searched before but did not find anything.
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Nov. 13, 2010 09:16 pm
hm could have sworn there was a similar post about this not that long ago i just checked my self didnt even find it... maybe im just losing it now lol but take a look at this thread

http://modsonline.com/Forums-top-132145.html

i posted a code that uses endon and notifys what i did was put an endon at the top of my code then a notify at the end what that does is notify the endon and it will kill the thread.

Share |
clanhelio
General Member
Since: Aug 30, 2008
Posts: 223
Last: Mar 24, 2011
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, Nov. 13, 2010 09:46 pm
Instead of the notifier, you could just put

Code:
return;


And it stops the thread cold, but however you want to do it, I guess. Notifiers are more for multi-thread stuff.
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Sunday, Nov. 14, 2010 10:50 am
clanhelio writes...
Quote:
Instead of the notifier, you could just put

Code:
return;



This is the best way to end the current thread. Only use endon / notify when you want to stop a thread from a separate function as there is a memory overhead for the endon (and an associated hardcoded limit.)
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Nov. 14, 2010 11:17 am
Okay thank you IzNoGoD, clanhelio and Pedro699!
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Nov. 19, 2010 11:00 pm
And is it possible to end the killcam while the killcam is running?
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»