//                        TINY LOONY RACE                          
// first betatest's! 06.02.2009                                    
// Official relased  22.03.2009                                    
// Map created by Areen ! For beloved Loony Clan!                  
// Script created by Razor !                                       
// GTATWO.FORA.PL                                                  
// Thanks: Razor, Ziommal & Kamil for more ideas                   

PLAYER_PED p1 = ( 58.5, 198.5, 6.0 ) 11 270 
PLAYER_PED p2 = ( 58.5, 199.5, 6.0 ) 11 270 
PLAYER_PED p3 = ( 58.5, 200.5, 6.0 ) 11 270 
PLAYER_PED p4 = ( 58.5, 201.5, 6.0 ) 11 270 

car_data demrace 
car_data demrace2
car_data demrace3 
car_data demrace4 

SET_STATION_INFO ( trak00 , 2 , 1 , 1 )
SET_STATION_INFO ( trak01 , 4 , 0 , 0 )

COUNTER loop = 1
COUNTER numberOfLaps = 3
COUNTER P1check1 = 0
COUNTER P1check2 = 0
COUNTER P1check3 = 0
COUNTER P2check1 = 0
COUNTER P2check2 = 0
COUNTER P2check3 = 0
COUNTER P3check1 = 0
COUNTER P3check2 = 0
COUNTER P3check3 = 0
COUNTER P4check1 = 0
COUNTER P4check2 = 0
COUNTER P4check3 = 0
COUNTER lapsP1 = 0
COUNTER lapsP2 = 0
COUNTER lapsP3 = 0
COUNTER lapsP4 = 0

ONSCREEN_COUNTER P1Lapcount
ONSCREEN_COUNTER P2Lapcount
ONSCREEN_COUNTER P3Lapcount
//ONSCREEN_COUNTER P4Lapcount

SOUND smiech = ( 61.5 , 199.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech2 = ( 63.5 , 196.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech3 = ( 115.5 , 193.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech4 = ( 114.5 , 197.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech5 = ( 60.5 , 182.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech6 = ( 65.5 , 185.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech7 = ( 48.5 , 176.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech8 = ( 86.5 , 173.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech9 = ( 79.5 , 173.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech10 = ( 74.5 , 160.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech11 = ( 112.5 , 167.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech12 = ( 124.5 , 178.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech13 = ( 86.5 , 186.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech14 = ( 95.5 , 180.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech15 = ( 92.5 , 188.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech16 = ( 89.5 , 190.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech17 = ( 69.5 , 194.5 , 4.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech18 = ( 59.5 , 170.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech19 = ( 76.5 , 182.5 , 6.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech20 = ( 72.5 , 180.5 , 6.0 ) FUNNY_FARM PLAY_FOREVER
SOUND smiech21 = ( 115.5 , 167.5 , 3.0 ) FUNNY_FARM PLAY_FOREVER
SOUND muza = ( 76.5 , 183.5 , 5.0 ) COUNTRY_CLUB PLAY_FOREVER
SOUND muza2 = ( 76.5 , 183.5 , 5.0 ) COUNTRY_CLUB PLAY_FOREVER
SOUND muza3 = ( 76.5 , 183.5 , 5.0 ) COUNTRY_CLUB PLAY_FOREVER

OBJ_DATA tb1 = ( 49.5, 160.5, 5.0 ) 0 TUNNEL_BLOCKER
OBJ_DATA tb2 = ( 49.5, 163.5, 5.0 ) 0 TUNNEL_BLOCKER
OBJ_DATA tb3 = ( 70.5, 184.5, 6.0 ) 0 TUNNEL_BLOCKER
OBJ_DATA tb4 = ( 70.5, 188.5, 6.0 ) 0 TUNNEL_BLOCKER
OBJ_DATA tb5 = ( 118.5, 162.5, 6.0 ) 0 TUNNEL_BLOCKER
OBJ_DATA tb6 = ( 118.5, 165.5, 6.0 ) 0 TUNNEL_BLOCKER
OBJ_DATA tb7 = ( 118.5, 199.5, 6.0 ) 0 TUNNEL_BLOCKER
OBJ_DATA tb8 = ( 118.5, 204.5, 6.0 ) 0 TUNNEL_BLOCKER 

SET_GANG_INFO ( lgang , 11 , pistol , pistol , pistol , 1 , 0.0 , 0.0 , 0.0 , 0 , ISETTA , -1 )

MAP_ZONE lgangzone = ( 1000 , 0, 0 , 0 , 1000 , 0 , 0 , 0, 1000 , 0 , 100 )

LEVELSTART

SET_DIR_OF_TV_VANS ( 85.0 , 182.5 )

DECLARE_POLICELEVEL ( 5 )

SET_AMBIENT_LEVEL ( 0.3, 3 )
SET_SHADING_LEVEL (20)

DISPLAY_MESSAGE ( 5504 )

demrace = CREATE_GANG_CAR ( 57.5 , 198.5 , 5.0 ) 20 270 ISETTA END
demrace2 = CREATE_GANG_CAR ( 57.5 , 199.5 , 5.0 ) 20 270 ISETTA END
demrace3 = CREATE_GANG_CAR ( 57.5 , 200.5 , 5.0 ) 20 270 ISETTA END
demrace4 = CREATE_GANG_CAR ( 57.5 , 201.5 , 5.0 ) 20 270 ISETTA END

ADD_ONSCREEN_COUNTER  ( P1LapCount , lapsP1 )
ADD_ONSCREEN_COUNTER  ( P2LapCount , lapsP2 )
ADD_ONSCREEN_COUNTER  ( P3LapCount , lapsP3 )
//ADD_ONSCREEN_COUNTER  ( P4LapCount , lapsP4 )

WHILE ( loop = 1 ) 
if ( is_car_wrecked ( demrace )) 
demrace = CREATE_GANG_CAR ( 57.5 , 198.5 , 5.0 ) 20 270 ISETTA END
endif 

if ( is_car_wrecked ( demrace2 )) 
demrace2 = CREATE_GANG_CAR ( 57.5 , 199.5 , 5.0 ) 20 270 ISETTA END
endif 

if ( is_car_wrecked ( demrace3 )) 
demrace3 = CREATE_GANG_CAR ( 57.5 , 200.5 , 5.0 ) 20 270 ISETTA END
endif 

if ( is_car_wrecked ( demrace4 )) 
demrace4 = CREATE_GANG_CAR ( 57.5 , 201.5 , 5.0 ) 20 270 ISETTA END
endif 

///////////////////////////////////////////////////

IF ( P1check3 = 1 )
 IF (IS_CHAR_IN_ZONE( p1, start ))
ADD_SCORE ( p1, 1 )
SET  P1check1  = 1
 ENDIF
ENDIF 

IF (IS_CHAR_IN_ZONE( p1, checkpoint1 ))
ADD_SCORE ( p1, 1)
SET  P1check2  = 1
ENDIF

IF (IS_CHAR_IN_ZONE( p1, checkpoint2 ))
ADD_SCORE ( p1, 1)
SET  P1check3  = 1
ENDIF

///////////////////////////////////////////////////

 IF ( P2check3 = 1 )
IF (IS_CHAR_IN_ZONE( p2, start ))
ADD_SCORE ( p2, 1 )
SET  P2check1  = 1
 ENDIF
ENDIF
IF (IS_CHAR_IN_ZONE( p2, checkpoint1 ))
ADD_SCORE ( p2, 1)
SET  P2check2  = 1
ENDIF

IF (IS_CHAR_IN_ZONE( p2, checkpoint2 ))
ADD_SCORE ( p2, 1)
SET  P2check3  = 1
ENDIF

///////////////////////////////////////////////////

 IF ( P3check3 = 1 )
IF (IS_CHAR_IN_ZONE( p3, start ))
ADD_SCORE ( p3, 1 )
SET  P3check1  = 1
 ENDIF
ENDIF
IF (IS_CHAR_IN_ZONE( p3, checkpoint1 ))
ADD_SCORE ( p3, 1)
SET  P3check2  = 1
ENDIF

IF (IS_CHAR_IN_ZONE( p3, checkpoint2 ))
ADD_SCORE ( p3, 1)
SET  P3check3  = 1
ENDIF

///////////////////////////////////////////////////

// IF ( P4check3 = 1 )
//IF (IS_CHAR_IN_ZONE( p4, start ))
//ADD_SCORE ( p4, 1 )
//SET  P4check1  = 1
// ENDIF
//ENDIF
//IF (IS_CHAR_IN_ZONE( p4, checkpoint1 ))
//ADD_SCORE ( p4, 1)
//SET  P4check2  = 1
//ENDIF

//IF (IS_CHAR_IN_ZONE( p4, checkpoint2 ))
//ADD_SCORE ( p4, 1)
//SET  P4check3  = 1
//ENDIF

///////////////////////////////////////////////////

IF ( P1check1 = 1 )  
IF ( P1check2 = 1 ) 
IF ( P1check3 = 1 )
++lapsP1
DELAY_HERE ( 10 )
SET  P1check1  = 0
SET  P1check2  = 0
SET  P1check3  = 0
ENDIF
ENDIF
ENDIF

IF ( P2check1 = 1 )  
IF ( P2check2 = 1 ) 
IF ( P2check3 = 1 )
++lapsP2
DELAY_HERE ( 10 )
SET  P2check1  = 0
SET  P2check2  = 0
SET  P2check3  = 0
ENDIF
ENDIF
ENDIF

IF ( P3check1 = 1 )  
IF ( P3check2 = 1 ) 
IF ( P3check3 = 1 )
++lapsP3
DELAY_HERE ( 10 )
SET  P3check1  = 0
SET  P3check2  = 0
SET  P3check3  = 0
ENDIF
ENDIF
ENDIF

//IF ( P4check1 = 1 )  
//IF ( P4check2 = 1 ) 
//IF ( P4check3 = 1 )
//++lapsP4
//DELAY_HERE ( 10 )
//SET  P4check1  = 0
//SET  P4check2  = 0
//SET  P4check3  = 0
//ENDIF
//ENDIF
//ENDIF

IF ( lapsP1 = 3 ) 
EXPLODE (p2)
EXPLODE (p3)
//EXPLODE (p4)
CLEAR_ONSCREEN_COUNTER (P2Lapcount)
//CLEAR_ONSCREEN_COUNTER (P3Lapcount)
//CLEAR_ONSCREEN_COUNTER (P4Lapcount)
EXPLODE_SMALL ( 52.5  , 202.5 , 6.0 )
EXPLODE_SMALL ( 55.5  , 202.5 , 6.0 )
ADD_SCORE ( p1, 1000000 )
DISPLAY_MESSAGE ( 5501 )
SET loop = 0
ENDIF

IF ( lapsP2 = 3 ) 
EXPLODE (p1)
EXPLODE (p3)
//EXPLODE (p4)
CLEAR_ONSCREEN_COUNTER (P1Lapcount)
CLEAR_ONSCREEN_COUNTER (P3Lapcount)
//CLEAR_ONSCREEN_COUNTER (P4Lapcount)
EXPLODE_SMALL ( 52.5  , 202.5 , 6.0 )
EXPLODE_SMALL ( 55.5  , 202.5 , 6.0 )
ADD_SCORE ( p2, 1000000 )
DISPLAY_MESSAGE ( 5501 )
SET loop = 0
ENDIF

IF ( lapsP3 = 3 ) 
EXPLODE (p2)
EXPLODE (p1)
//EXPLODE (p4)
CLEAR_ONSCREEN_COUNTER (P2Lapcount)
CLEAR_ONSCREEN_COUNTER (P1Lapcount)
//CLEAR_ONSCREEN_COUNTER (P4Lapcount)
EXPLODE_SMALL ( 52.5  , 202.5 , 6.0 )
EXPLODE_SMALL ( 55.5  , 202.5 , 6.0 )
ADD_SCORE ( p3, 1000000 )
DISPLAY_MESSAGE ( 5501 )
SET loop = 0
ENDIF

//IF ( lapsP4 = 3 ) 
//EXPLODE (p2)
//EXPLODE (p3)
//EXPLODE (p1)
//CLEAR_ONSCREEN_COUNTER (P2Lapcount)
//CLEAR_ONSCREEN_COUNTER (P3Lapcount)
//CLEAR_ONSCREEN_COUNTER (P1Lapcount)
//EXPLODE_SMALL ( 52.5  , 202.5 , 6.0 )
//EXPLODE_SMALL ( 55.5  , 202.5 , 6.0 )
//ADD_SCORE ( p4, 1000000 )
//DISPLAY_MESSAGE ( 5501 )
//SET loop = 0
//ENDIF

ENDWHILE



LEVELEND
