04.07.2011, 16:35
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <thread>
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
new tickid, tick2id, ticknumber = 0, tick2number = 0;
public OnGameModeInit()
{
tickid = CreateThread( "MyFunction" );
tick2id = CreateThread( "MyFunction2" );
}
public OnGameModeExit()
{
DestroyThread( tickid );
DestroyThread( tick2id );
}
forward MyFunction(threadid);
public MyFunction(threadid)
{
ticknumber++;
if(ticknumber == 10) {
printf( "Closing Thread (%d)", tickid );
LockThread( threadid );
} else {
SleepThread( 1000 );
printf( "tick %d: %d", tickid, ticknumber);
}
}
forward MyFunction2(threadid);
public MyFunction2(threadid)
{
tick2number++;
if(tick2number == 10) {
printf( "Closing Thread (%d)", threadid );
LockThread( tick2id );
} else {
SleepThread( 2000 );
printf( "tick %d: %d", tick2id, tick2number);
}
}