|
|
|
|
#1 | |
|
Big Clucker
![]() ![]() Join Date: Nov 2009
Posts: 168
Reputation: 19
|
Description:
Attention: Quote:
Wrong using this plugin can significantly corrupt your gamemode.How to use: pawn Code:
Log:
Natives: pawn Code:
Example: With CreateThread pawn Code:
With CreateThreadEx pawn Code:
Download: Last edited by Fro1sha; 26/06/2011 at 06:43 AM. |
|
|
|
|
|
|
#2 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2010
Location: United Kingdom
Posts: 2,131
Reputation: 505
|
I'm confused about what this dose, is it just a different way to call a function?
|
|
|
|
|
|
#3 | |
|
Big Clucker
![]() ![]() Join Date: Nov 2009
Posts: 168
Reputation: 19
|
Quote:
If you speak Russian, i can explain it to you =))) |
|
|
|
|
|
|
#4 | |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2010
Location: United Kingdom
Posts: 2,131
Reputation: 505
|
Quote:
|
|
|
|
|
|
|
#5 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2010
Location: Gujarat, India.
Posts: 1,141
Reputation: 66
|
will get in handy for ....pro scripter.....not a beginner like me.....
|
|
|
|
|
|
#6 |
|
Big Clucker
![]() ![]() Join Date: Jun 2011
Location: SC4MPT0N
Posts: 69
Reputation: 3
|
Can't this corrupt your computer?
|
|
|
|
|
|
#7 |
|
Big Clucker
![]() ![]() Join Date: Nov 2009
Posts: 168
Reputation: 19
|
|
|
|
|
|
|
#8 |
|
Big Clucker
![]() ![]() Join Date: Jun 2011
Location: Bowmanville, Ontario
Posts: 73
Reputation: 1
|
I was actually wondering why there didn't seem to be a threading plugin yet, based on the source, the parameter known as 'pubname' defines a function to be executed by the thread. Also, I'm guessing the function loops until the thread is destroyed? If so, you should change that so that threads can die naturally without being told to, it is much easier to implement a loop than to perform logic to assume when would be a good time to call DestroyThread. That way you could also implement a OnThreadDeath callback.
That way something like this would work. Code:
new bool:active;
new tickid;
public OnGameModeInit()
{
tickid = ThreadCreate( "MyFunction" );
}
public OnGameModeExit()
{
active = false;
}
public MyFunction()
{
active = true;
while ( active )
{
printf( "tick..." );
SleepThread( 1000 );
}
}
public onThreadDeath( threadid )
{
if ( threadid = tickid )
printf( "The tick thread has died naturally." );
}
|
|
|
|
|
|
#9 | |
|
Big Clucker
![]() ![]() Join Date: Nov 2009
Posts: 168
Reputation: 19
|
Quote:
|
|
|
|
|
|
|
#10 | ||
|
Big Clucker
![]() ![]() Join Date: Jun 2011
Location: Bowmanville, Ontario
Posts: 73
Reputation: 1
|
Quote:
I recommend having a look at this, while its Java, it does give some insight as to the dangers of stopping a thread. Quote:
|
||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MultiThread in Streamer | Fro1sha | Screenshots and Videos | 0 | 03/06/2011 05:25 AM |