PLAYER_PED p1 = ( 137.5 , 212.5 , 5.0 ) 25 180 //( 70.5 , 182.5 , 4.0 ) 25 180  
PLAYER_PED p2 = ( 137.5 , 211.5 , 5.0 ) 25 0 
PLAYER_PED p3 = ( 137.5 , 210.5 , 5.0 ) 25 0 
PLAYER_PED p4 = ( 137.5 , 213.5 , 5.0 ) 25 180 

SET_GANG_INFO ( gta1 , 1 , pistol , pistol , pistol , 4 , 30.0 , 30.0 , 1.0 , 1 , GT24640 , 2 )
SET_GANG_INFO ( gta2 , 2 , pistol , pistol , pistol , 4 , 30.0 , 30.0 , 1.0 , 1 , BUICK , 28 )
SET_GANG_INFO ( gta3 , 3 , pistol , pistol , pistol , 4 , 30.0 , 30.0 , 1.0 , 1 , GT24640 , 2 )
SET_GANG_INFO ( gta4 , 4 , pistol , pistol , pistol , 4 , 30.0 , 30.0 , 1.0 , 1 , BUICK , 28 )

DECLARE_DOOR_INFO ( 181 , 188 , 2 )

DOOR_DATA door1 = DOUBLE ( 136 , 201 , 4 ) ( 1.0 , 1.0 , 1.0 , 1.0 , 1.0 ) BOTTOM 0 ANY_CAR CLOSE_NEVER 0 FLIP_RIGHT NOT_REVERSED
DOOR_DATA door2 = DOUBLE ( 138 , 201 , 4 ) ( 1.0 , 1.0 , 1.0 , 1.0 , 1.0 ) BOTTOM 0 ANY_CAR CLOSE_NEVER 0 FLIP_RIGHT NOT_REVERSED
DOOR_DATA door3 = SINGLE ( 139 , 201 , 4 ) ( 1.0 , 1.0 , 1.0 , 1.0 , 1.0 ) BOTTOM 0 ANY_CAR CLOSE_NEVER 0 FLIP_RIGHT NOT_REVERSED

DOOR_DATA door_re1 = DOUBLE ( 93 , 191 , 4 ) ( 94.0 , 190.6 , 4.0 , 2.0 , 0.8 ) TOP 0 ANY_CAR CLOSE_WHEN_OPEN_RULE_FAILS 0 FLIP_RIGHT NOT_REVERSED
DOOR_DATA door_re2 = DOUBLE ( 110 , 191 , 4 ) ( 111.0 , 191.5 , 4.0 , 2.0 , 1.0 ) TOP 0 ANY_CAR CLOSE_WHEN_OPEN_RULE_FAILS 0 FLIP_RIGHT NOT_REVERSED

CHAR_DATA char1pitlane1
CHAR_DATA char2pitlane1
CHAR_DATA char3pitlane1
CHAR_DATA char4pitlane1
CHAR_DATA char5pitlane1
CHAR_DATA char1pitlane2
CHAR_DATA char2pitlane2
CHAR_DATA char3pitlane2
CHAR_DATA char4pitlane2
CHAR_DATA char5pitlane2
CHAR_DATA char1pitlane3
CHAR_DATA char2pitlane3
CHAR_DATA char3pitlane3
CHAR_DATA char4pitlane3
CHAR_DATA char5pitlane3
CHAR_DATA char1pitlane4
CHAR_DATA char2pitlane4
CHAR_DATA char3pitlane4
CHAR_DATA char4pitlane4
CHAR_DATA char5pitlane4
CHAR_DATA char1pitlane5
CHAR_DATA char2pitlane5
CHAR_DATA char3pitlane5
CHAR_DATA char4pitlane5
CHAR_DATA char5pitlane5
CHAR_DATA char1pitlane6
CHAR_DATA char2pitlane6
CHAR_DATA char3pitlane6
CHAR_DATA char4pitlane6
CHAR_DATA char5pitlane6

PARKED_CAR_DATA transporter1 = ( 73.5 , 179.5 ) 34 270 TRUKTRNS
PARKED_CAR_DATA transporter2 = ( 73.5 , 175.5 ) 28 270 TRUKTRNS 
PARKED_CAR_DATA transporter3 = ( 63.5 , 177.5 ) 20 90 TRUKTRNS
PARKED_CAR_DATA transporter4 = ( 73.5 , 176.5 ) 15 270 TRUKTRNS 
PARKED_CAR_DATA transporter5 = ( 63.5 , 176.5 ) 21 90 TRUKTRNS
PARKED_CAR_DATA transporter6 = ( 63.5 , 173.5 ) 24 90 TRUKTRNS 
PARKED_CAR_DATA jeep1 = ( 65.5 , 182.5 ) 2 180 TRUKCAB1
PARKED_CAR_DATA jeep2 = ( 66.5 , 182.5 ) 2 180 TRUKCAB2
PARKED_CAR_DATA jeep3 = ( 67.5 , 182.5 ) 2 180 TRUKCAB2
PARKED_CAR_DATA jeep4 = ( 69.5 , 182.5 ) 2 180 TRUKCAB2
PARKED_CAR_DATA jeep5 = ( 70.5 , 182.5 ) 2 180 TRUKCAB1
PARKED_CAR_DATA jeep6 = ( 71.5 , 182.5 ) 2 180 TRUKCAB1
PARKED_CAR_DATA tank1 = ( 132.5 , 84.5 , 3.0 ) 8 90 TANK
PARKED_CAR_DATA tank2 = ( 141.5 , 84.5 , 3.0 ) 8 270 TANK

OBJ_DATA sprayshop_re1 = ( 103.0 , 197.5 , 4.0 ) 0 CAR_SHOP 0
OBJ_DATA sprayshop_re2 = ( 103.0 , 199.5 , 4.0 ) 0 CAR_SHOP 0
OBJ_DATA sprayshopN

COUNTER p1_wybor = 0
COUNTER p2_wybor = 0
COUNTER p3_wybor = 0
COUNTER p4_wybor = 0

COUNTER main = 1
COUNTER loading = 0
COUNTER pitlane_team1_enabled = 1
COUNTER pitlane_team2_enabled = 1
COUNTER pitlane_team3_enabled = 1
COUNTER pitlane_team4_enabled = 1
COUNTER pitlane_team5_enabled = 1
COUNTER pitlane_team6_enabled = 1
COUNTER working_pitlane1 = 0
COUNTER working_pitlane2 = 0
COUNTER working_pitlane3 = 0
COUNTER working_pitlane4 = 0
COUNTER working_pitlane5 = 0
COUNTER working_pitlane6 = 0
COUNTER pitlane1_ready = 1
COUNTER pitlane2_ready = 1
COUNTER pitlane3_ready = 1
COUNTER pitlane4_ready = 1
COUNTER pitlane5_ready = 1
COUNTER pitlane6_ready = 1

COUNTER bmw_poinst = 0
COUNTER bmw_paliwo = 0
COUNTER ferrari_poinst = 0
COUNTER ferrari_paliwo = 0
COUNTER brawn_poinst = 0
COUNTER brawn_paliwo = 0
COUNTER redbull_poinst = 0
COUNTER redbull_paliwo = 0
COUNTER mclaren_poinst = 0
COUNTER mclaren_paliwo = 0
COUNTER renault_poinst = 0
COUNTER renault_paliwo = 0

CAR_DATA gt1_mclaren
CAR_DATA gt1_renault
CAR_DATA gt1_ferrari
CAR_DATA gt1_redbull
CAR_DATA gt1_bmwsauber
CAR_DATA gt1_brawn

CAR_DATA mclaren
CAR_DATA renault
CAR_DATA ferrari
CAR_DATA redbull
CAR_DATA bmwsauber
CAR_DATA brawn

COUNTER loop = 1
COUNTER multi = 0
COUNTER multi_counter
COUNTER score_counter

COUNTER speed_bmwsauber
COUNTER speed_ferrari
COUNTER speed_brawn
COUNTER speed_redbull
COUNTER speed_mclaren
COUNTER speed_renault

COUNTER czas_bmwsauber = 0
COUNTER czas_ferrari = 0
COUNTER czas_brawn = 0
COUNTER czas_redbull = 0
COUNTER czas_mclaren = 0
COUNTER czas_renault = 0

COUNTER bmw_pitstop = 0
COUNTER ferrari_pitstop = 0
COUNTER brawn_pitstop = 0
COUNTER redbull_pitstop = 0
COUNTER mclaren_pitstop = 0
COUNTER renault_pitstop = 0

CHAR_DATA bmw_char
CHAR_DATA ferrari_char
CHAR_DATA brawn_char
CHAR_DATA redbull_char
CHAR_DATA mclaren_char
CHAR_DATA renault_char

COUNTER bmw_char_alive = 0
COUNTER ferrari_char_alive = 0
COUNTER brawn_char_alive = 0
COUNTER redbull_char_alive = 0
COUNTER mclaren_char_alive = 0
COUNTER renault_char_alive = 0

COUNTER bmw_position = 0
COUNTER ferrari_position = 0
COUNTER brawn_position = 0
COUNTER redbull_position = 0
COUNTER mclaren_position = 0
COUNTER renault_position = 0

COUNTER plus_gta1 = 0
COUNTER minus_gta1 = 0
COUNTER plus_gta2 = 0
COUNTER minus_gta2 = 0
COUNTER plus_gta3 = 0
COUNTER minus_gta3 = 0
COUNTER plus_gta4 = 0
COUNTER minus_gta4 = 0

COUNTER position_start_bmw = 1
COUNTER position_start_ferrari = 1
COUNTER position_start_brawn = 1
COUNTER position_start_redbull = 1
COUNTER position_start_mclaren = 1
COUNTER position_start_renault = 1

COUNTER laps_counter = 1
COUNTER laps_bmw = 0
COUNTER laps_ferrari = 0
COUNTER laps_brawn = 0
COUNTER laps_redbull = 0
COUNTER laps_mclaren = 0
COUNTER laps_renault = 0

COUNTER zapadnia_bmwsauber = 0
COUNTER zapadnia_ferrari = 0
COUNTER zapadnia_brawn = 0
COUNTER zapadnia_redbull = 0
COUNTER zapadnia_mclaren = 0
COUNTER zapadnia_renault = 0

COUNTER wreck_bmwsauber = 0
COUNTER wreck_ferrari = 0
COUNTER wreck_brawn = 0
COUNTER wreck_redbull = 0
COUNTER wreck_mclaren = 0
COUNTER wreck_renault = 0

COUNTER wreck_bmw_block = 0
COUNTER wreck_ferrari_block = 0
COUNTER wreck_brawn_block = 0
COUNTER wreck_redbull_block = 0
COUNTER wreck_mclaren_block = 0
COUNTER wreck_renault_block = 0

COUNTER pseudo_count = 0
COUNTER group = 0

COUNTER scorep1 = 0
COUNTER scorep2 = 0
COUNTER scorep3 = 0
COUNTER scorep4 = 0

COUNTER wreck = 0
COUNTER pyramid = 0
ONSCREEN_COUNTER screen_laps
COUNTER laps = 3
COUNTER laps_many = 3
COUNTER podium = 1

LEVELSTART

//SET_AMBIENT_LEVEL  ( 1.0 , 0) 
SET_AMBIENT_LEVEL  ( 0.3 , 0) 

bmwsauber = CREATE_CAR ( 102.5 , 208.5 , 4.0 ) -1 0 BMW END
ferrari = CREATE_CAR ( 104.5 , 208.5 , 4.0 ) -1 0 ALFA END
brawn = CREATE_CAR ( 106.5 , 208.5 , 4.0 ) -1 0 MIURA END
redbull = CREATE_CAR ( 108.5 , 208.5 , 4.0 ) -1 0 RTYPE END
mclaren = CREATE_CAR ( 110.5 , 208.5 , 4.0 ) -1 0 STRATOS END
renault = CREATE_CAR ( 112.5 , 208.5 , 4.0 ) -1 0 AMDB4 END

gt1_bmwsauber = CREATE_CAR  ( 134.5 , 209.0 , 5.0 ) -1 270 GT24640 END //( 115.5 , 188.5 , 4.0 ) -1 270 GT24640 END
gt1_ferrari = CREATE_CAR    ( 134.5 , 212.0 , 5.0 ) -1 270 GT24640 END //( 109.5 , 188.5 , 4.0 ) -1 270 GT24640 END
gt1_brawn = CREATE_CAR      ( 140.5 , 212.0 , 5.0 ) -1 90 GT24640 END //( 118.5 , 186.5 , 4.0 ) -1 270 GT24640 END
gt1_redbull = CREATE_CAR    ( 134.5 , 215.0 , 5.0 ) -1 270 GT24640 END //( 112.5 , 186.5 , 4.0 ) -1 270 GT24640 END
gt1_mclaren = CREATE_CAR    ( 140.5 , 209.0 , 5.0 ) -1 90 GT24640 END //( 103.5 , 188.5 , 4.0 ) -1 270 GT24640 END
gt1_renault = CREATE_CAR    ( 140.5 , 215.0 , 5.0 ) -1 90 GT24640 END //( 106.5 , 186.5 , 4.0 ) -1 270 GT24640 END

PUT_CAR_ON_TRAILER ( bmwsauber , gt1_bmwsauber)
PUT_CAR_ON_TRAILER ( ferrari , gt1_ferrari)
PUT_CAR_ON_TRAILER ( brawn , gt1_brawn)
PUT_CAR_ON_TRAILER ( redbull , gt1_redbull)
PUT_CAR_ON_TRAILER ( mclaren , gt1_mclaren)
PUT_CAR_ON_TRAILER ( renault , gt1_renault)

WHILE_EXEC (loop = 1)

IF (loading = 0)
 SET loading = 1
 LAUNCH_MISSION ( load.mis )
ENDIF

IF (loading = 2)
 SET loading = 3
 LAUNCH_MISSION ( ql.mis )
ENDIF

IF (loading = 4)
 SET loading = 5
 LAUNCH_MISSION ( ps.mis )
ENDIF

ENDWHILE

WHILE_EXEC (main = 0)

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX      LICZNIK PALIWA     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

STORE_CAR_CURRENT_SPEED ( gt1_bmwsauber , speed_bmwsauber )
STORE_CAR_CURRENT_SPEED ( gt1_ferrari , speed_ferrari )
STORE_CAR_CURRENT_SPEED ( gt1_brawn , speed_brawn )
STORE_CAR_CURRENT_SPEED ( gt1_redbull , speed_redbull ) 
STORE_CAR_CURRENT_SPEED ( gt1_mclaren , speed_mclaren )
STORE_CAR_CURRENT_SPEED ( gt1_renault , speed_renault )


 IF (( speed_bmwsauber > 1000 )
 AND ( speed_bmwsauber < 3000 ))
  ++ czas_bmwsauber
 ENDIF
 IF (( speed_bmwsauber > 3000 )
 AND ( speed_bmwsauber < 7000 ))
  SET czas_bmwsauber = ( czas_bmwsauber + 2 )
 ENDIF
 IF ( speed_bmwsauber > 7000 )
  SET czas_bmwsauber = ( czas_bmwsauber + 4 )
 ENDIF


 IF (( speed_ferrari > 1000 )
 AND ( speed_ferrari < 3000 ))
  ++ czas_ferrari
 ENDIF
 IF (( speed_ferrari > 3000 )
 AND ( speed_ferrari < 7000 ))
  SET czas_ferrari = ( czas_ferrari + 2 )
 ENDIF
 IF ( speed_ferrari > 7000 )
  SET czas_ferrari = ( czas_ferrari + 4 )
 ENDIF

 IF (( speed_brawn > 1000 )
 AND ( speed_brawn < 3000 ))
  ++ czas_brawn
 ENDIF
 IF (( speed_brawn > 3000 )
 AND ( speed_brawn < 7000 ))
  SET czas_brawn = ( czas_brawn + 2 )
 ENDIF
 IF ( speed_brawn > 7000 )
  SET czas_brawn = ( czas_brawn + 4 )
 ENDIF

 IF (( speed_redbull > 1000 )
 AND ( speed_redbull < 3000 ))
  ++ czas_redbull
 ENDIF
 IF (( speed_redbull > 3000 )
 AND ( speed_redbull < 7000 ))
  SET czas_redbull = ( czas_redbull + 2 )
 ENDIF
 IF ( speed_redbull > 7000 )
  SET czas_redbull = ( czas_redbull + 4 )
 ENDIF

 IF (( speed_mclaren > 1000 )
 AND ( speed_mclaren < 3000 ))
  ++ czas_mclaren
 ENDIF
 IF (( speed_mclaren > 3000 )
 AND ( speed_mclaren < 7000 ))
  SET czas_mclaren = ( czas_mclaren + 2 )
 ENDIF
 IF ( speed_mclaren > 7000 )
  SET czas_mclaren = ( czas_mclaren + 4 )
 ENDIF

 IF (( speed_renault > 1000 )
 AND ( speed_renault < 3000 ))
  ++ czas_renault
 ENDIF
 IF (( speed_renault > 3000 )
 AND ( speed_renault < 7000 ))
  SET czas_renault = ( czas_renault + 2 )
 ENDIF
 IF ( speed_renault > 7000 )
  SET czas_renault = ( czas_renault + 4 )
 ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXX                  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXX       TEAMS      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXX                  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

/// 1 /// BMW team

IF (pitlane_team1_enabled = 1)
 char1pitlane1 = CREATE_CHAR ( 101.5 , 173.5 , 4.0 ) 12 90 DUMMY END
 char2pitlane1 = CREATE_CHAR ( 101.9 , 173.5 , 4.0 ) 12 0 DUMMY END
 char3pitlane1 = CREATE_CHAR ( 102.3 , 173.5 , 4.0 ) 12 0 DUMMY END
 char4pitlane1 = CREATE_CHAR ( 102.7 , 173.5 , 4.0 ) 12 180 DUMMY END
 char5pitlane1 = CREATE_CHAR ( 103.1 , 173.5 , 4.0 ) 12 180 DUMMY END
 SET pitlane_team1_enabled = 2
 SET working_pitlane1 = 1
ENDIF


IF (working_pitlane1 = 1)

IF ( HAS_CHARACTER_DIED ( char1pitlane1))
 IF ( NOT ( DELAY ( 60 ) ) )            
  DELETE_ITEM ( char1pitlane1 )       
  char1pitlane1 = CREATE_CHAR ( 101.5 , 173.5 , 4.0 ) 12 90 DUMMY END            
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char1pitlane1 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char2pitlane1))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char2pitlane1 )
  char2pitlane1 = CREATE_CHAR ( 101.9 , 173.5 , 4.0 ) 12 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char2pitlane1 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char3pitlane1))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char3pitlane1 )
  char3pitlane1 = CREATE_CHAR ( 102.3 , 173.5 , 4.0 ) 12 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char3pitlane1 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char4pitlane1))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char4pitlane1 )
  char4pitlane1 = CREATE_CHAR ( 102.7 , 173.5 , 4.0 ) 12 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char4pitlane1 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char5pitlane1))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char5pitlane1 )
  char5pitlane1 = CREATE_CHAR ( 103.1 , 173.5 , 4.0 ) 12 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char5pitlane1 , NO_REACTION) 
ENDIF
   

IF (pitlane1_ready = 1) 
 SET_CHAR_OBJECTIVE ( char1pitlane1 , GOTO_AREA_ON_FOOT, 103.0 , 173.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane1 , GOTO_AREA_ON_FOOT, 103.0 , 173.5 , 4.0 ) 
 SET_CHAR_OBJECTIVE ( char3pitlane1 , GOTO_AREA_ON_FOOT, 103.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane1 , GOTO_AREA_ON_FOOT, 103.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane1 , GOTO_AREA_ON_FOOT, 103.0 , 173.5  , 4.0 )
ENDIF
     
          
IF (pitlane1_ready = 2)
 SET_CHAR_OBJECTIVE ( char1pitlane1 , GOTO_AREA_ON_FOOT, 102.2 , 176.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane1 , GOTO_AREA_ON_FOOT, 102.8 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char3pitlane1 , GOTO_AREA_ON_FOOT, 103.4 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane1 , GOTO_AREA_ON_FOOT, 102.8 , 177.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane1 , GOTO_AREA_ON_FOOT, 103.4 , 177.0 , 4.0 )

 IF (LOCATE_CHARACTER_ANY_MEANS ( char1pitlane1  ,  102.2 , 176.5 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char1pitlane1, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char2pitlane1  ,  102.8 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char2pitlane1, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char3pitlane1  ,  103.4 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char3pitlane1, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char4pitlane1  ,  102.8 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char4pitlane1, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char5pitlane1  ,  103.4 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char5pitlane1, WAIT_ON_FOOT)
 ENDIF
ENDIF 

ENDIF 

/// 2 /// FERRARI team

IF (pitlane_team2_enabled = 1)
 char1pitlane2 = CREATE_CHAR ( 109.5 , 173.5 , 4.0 ) 10 90 DUMMY END
 char2pitlane2 = CREATE_CHAR ( 109.9 , 173.5 , 4.0 ) 10 0 DUMMY END
 char3pitlane2 = CREATE_CHAR ( 110.3 , 173.5 , 4.0 ) 10 0 DUMMY END
 char4pitlane2 = CREATE_CHAR ( 110.7 , 173.5 , 4.0 ) 10 180 DUMMY END
 char5pitlane2 = CREATE_CHAR ( 111.1 , 173.5 , 4.0 ) 10 180 DUMMY END
 SET pitlane_team2_enabled = 2
 SET working_pitlane2 = 1
ENDIF


IF (working_pitlane2 = 1)

IF ( HAS_CHARACTER_DIED ( char1pitlane2))
 IF ( NOT ( DELAY ( 60 ) ) )            
  DELETE_ITEM ( char1pitlane2 )       
  char1pitlane2 = CREATE_CHAR ( 109.5 , 173.5 , 4.0 ) 10 90 DUMMY END            
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char1pitlane2 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char2pitlane2))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char2pitlane2 )
  char2pitlane2 = CREATE_CHAR ( 109.9 , 173.5 , 4.0 ) 10 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char2pitlane2 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char3pitlane2))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char3pitlane2 )
  char3pitlane2 = CREATE_CHAR ( 110.3 , 173.5 , 4.0 ) 10 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char3pitlane2 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char4pitlane2))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char4pitlane2 )
  char4pitlane2 = CREATE_CHAR ( 110.7 , 173.5 , 4.0 ) 10 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char4pitlane2 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char5pitlane2))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char5pitlane2 )
  char5pitlane2 = CREATE_CHAR ( 111.1 , 173.5 , 4.0 ) 10 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char5pitlane2 , NO_REACTION) 
ENDIF
   

IF (pitlane2_ready = 1) 
 SET_CHAR_OBJECTIVE ( char1pitlane2 , GOTO_AREA_ON_FOOT, 111.0 , 173.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane2 , GOTO_AREA_ON_FOOT, 111.0 , 173.5 , 4.0 ) 
 SET_CHAR_OBJECTIVE ( char3pitlane2 , GOTO_AREA_ON_FOOT, 111.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane2 , GOTO_AREA_ON_FOOT, 111.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane2 , GOTO_AREA_ON_FOOT, 111.0 , 173.5  , 4.0 )
ENDIF
     
          
IF (pitlane2_ready = 2)
 SET_CHAR_OBJECTIVE ( char1pitlane2 , GOTO_AREA_ON_FOOT, 110.2 , 176.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane2 , GOTO_AREA_ON_FOOT, 110.8 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char3pitlane2 , GOTO_AREA_ON_FOOT, 111.4 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane2 , GOTO_AREA_ON_FOOT, 110.8 , 177.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane2 , GOTO_AREA_ON_FOOT, 111.4 , 177.0 , 4.0 )

 IF (LOCATE_CHARACTER_ANY_MEANS ( char1pitlane2  ,  110.2 , 176.5 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char1pitlane2, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char2pitlane2  ,  110.8 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char2pitlane2, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char3pitlane2  ,  111.4 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char3pitlane2, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char4pitlane2  ,  110.8 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char4pitlane2 , WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char5pitlane2  ,  111.4 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char5pitlane2, WAIT_ON_FOOT)
 ENDIF
ENDIF 

ENDIF 


/// 3 /// BRAWN team

IF (pitlane_team3_enabled = 1)
 char1pitlane3 = CREATE_CHAR ( 117.5 , 173.5 , 4.0 ) 11 90 DUMMY END
 char2pitlane3 = CREATE_CHAR ( 117.9 , 173.5 , 4.0 ) 11 0 DUMMY END
 char3pitlane3 = CREATE_CHAR ( 118.3 , 173.5 , 4.0 ) 11 0 DUMMY END
 char4pitlane3 = CREATE_CHAR ( 118.7 , 173.5 , 4.0 ) 11 180 DUMMY END
 char5pitlane3 = CREATE_CHAR ( 119.1 , 173.5 , 4.0 ) 11 180 DUMMY END
 SET pitlane_team3_enabled = 2
 SET working_pitlane3 = 1
ENDIF


IF (working_pitlane3 = 1)

IF ( HAS_CHARACTER_DIED ( char1pitlane3))
 IF ( NOT ( DELAY ( 60 ) ) )            
  DELETE_ITEM ( char1pitlane3 )       
  char1pitlane3 = CREATE_CHAR ( 117.5 , 173.5 , 4.0 ) 11 90 DUMMY END            
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char1pitlane3 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char2pitlane3))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char2pitlane3 )
  char2pitlane3 = CREATE_CHAR ( 117.9 , 173.5 , 4.0 ) 11 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char2pitlane3 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char3pitlane3))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char3pitlane3 )
  char3pitlane3 = CREATE_CHAR ( 118.3 , 173.5 , 4.0 ) 11 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char3pitlane3 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char4pitlane3))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char4pitlane3 )
  char4pitlane3 = CREATE_CHAR ( 118.7 , 173.5 , 4.0 ) 11 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char4pitlane3 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char5pitlane3))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char5pitlane3 )
  char5pitlane3 = CREATE_CHAR ( 119.1 , 173.5 , 4.0 ) 11 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char5pitlane3 , NO_REACTION) 
ENDIF
   

IF (pitlane3_ready = 1) 
 SET_CHAR_OBJECTIVE ( char1pitlane3 , GOTO_AREA_ON_FOOT, 119.0 , 173.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane3 , GOTO_AREA_ON_FOOT, 119.0 , 173.5 , 4.0 ) 
 SET_CHAR_OBJECTIVE ( char3pitlane3 , GOTO_AREA_ON_FOOT, 119.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane3 , GOTO_AREA_ON_FOOT, 119.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane3 , GOTO_AREA_ON_FOOT, 119.0 , 173.5  , 4.0 )
ENDIF
     
          
IF (pitlane3_ready = 2)
 SET_CHAR_OBJECTIVE ( char1pitlane3 , GOTO_AREA_ON_FOOT, 118.2 , 176.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane3 , GOTO_AREA_ON_FOOT, 118.8 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char3pitlane3 , GOTO_AREA_ON_FOOT, 119.4 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane3 , GOTO_AREA_ON_FOOT, 118.8 , 177.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane3 , GOTO_AREA_ON_FOOT, 119.4 , 177.0 , 4.0 )

 IF (LOCATE_CHARACTER_ANY_MEANS ( char1pitlane3  ,  118.2 , 176.5 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char1pitlane3, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char2pitlane3  ,  118.8 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char2pitlane3, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char3pitlane3  ,  119.4 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char3pitlane3, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char4pitlane3  ,  118.8 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char4pitlane3 , WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char5pitlane3  ,  119.4 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char5pitlane3, WAIT_ON_FOOT)
 ENDIF
ENDIF 

ENDIF 

/// 4 /// REDBULL team

IF (pitlane_team4_enabled = 1)
 char1pitlane4 = CREATE_CHAR ( 125.5 , 173.5 , 4.0 ) 13 90 DUMMY END
 char2pitlane4 = CREATE_CHAR ( 125.9 , 173.5 , 4.0 ) 13 0 DUMMY END
 char3pitlane4 = CREATE_CHAR ( 126.3 , 173.5 , 4.0 ) 13 0 DUMMY END
 char4pitlane4 = CREATE_CHAR ( 126.7 , 173.5 , 4.0 ) 13 180 DUMMY END
 char5pitlane4 = CREATE_CHAR ( 127.1 , 173.5 , 4.0 ) 13 180 DUMMY END
 SET pitlane_team4_enabled = 2
 SET working_pitlane4 = 1
ENDIF


IF (working_pitlane4 = 1)

IF ( HAS_CHARACTER_DIED ( char1pitlane4))
 IF ( NOT ( DELAY ( 60 ) ) )            
  DELETE_ITEM ( char1pitlane4 )       
  char1pitlane4 = CREATE_CHAR ( 125.5 , 173.5 , 4.0 ) 13 90 DUMMY END            
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char1pitlane4 , NO_REACTION) 
ENDIF

IF ( HAS_CHARACTER_DIED ( char2pitlane4))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char2pitlane4 )
  char2pitlane4 = CREATE_CHAR ( 125.9 , 173.5 , 4.0 ) 13 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char2pitlane4 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char3pitlane4))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char3pitlane4 )
  char3pitlane4 = CREATE_CHAR ( 126.3 , 173.5 , 4.0 ) 13 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char3pitlane4 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char4pitlane4))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char4pitlane4 )
  char4pitlane4 = CREATE_CHAR ( 126.7 , 173.5 , 4.0 ) 13 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char4pitlane4 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char5pitlane4))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char5pitlane4 )
  char5pitlane4 = CREATE_CHAR ( 127.1 , 173.5 , 4.0 ) 13 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char5pitlane4 , NO_REACTION) 
ENDIF
   

IF (pitlane4_ready = 1) 
 SET_CHAR_OBJECTIVE ( char1pitlane4 , GOTO_AREA_ON_FOOT, 127.0 , 173.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane4 , GOTO_AREA_ON_FOOT, 127.0 , 173.5 , 4.0 ) 
 SET_CHAR_OBJECTIVE ( char3pitlane4 , GOTO_AREA_ON_FOOT, 127.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane4 , GOTO_AREA_ON_FOOT, 127.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane4 , GOTO_AREA_ON_FOOT, 127.0 , 173.5  , 4.0 )
ENDIF
     
          
IF (pitlane4_ready = 2)
 SET_CHAR_OBJECTIVE ( char1pitlane4 , GOTO_AREA_ON_FOOT, 126.2 , 176.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane4 , GOTO_AREA_ON_FOOT, 126.8 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char3pitlane4 , GOTO_AREA_ON_FOOT, 127.4 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane4 , GOTO_AREA_ON_FOOT, 126.8 , 177.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane4 , GOTO_AREA_ON_FOOT, 127.4 , 177.0 , 4.0 )

 IF (LOCATE_CHARACTER_ANY_MEANS ( char1pitlane4  ,  126.2 , 176.5 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char1pitlane4, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char2pitlane4  ,  126.8 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char2pitlane4, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char3pitlane4  ,  127.4 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char3pitlane4, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char4pitlane4  ,  126.8 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char4pitlane4 , WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char5pitlane4  ,  127.4 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char5pitlane4, WAIT_ON_FOOT)
 ENDIF
ENDIF 

ENDIF 

/// 5 /// MCLAREN team

IF (pitlane_team5_enabled = 1)
 char1pitlane5 = CREATE_CHAR ( 133.5 , 173.5 , 4.0 ) 8 90 DUMMY END
 char2pitlane5 = CREATE_CHAR ( 133.9 , 173.5 , 4.0 ) 8 0 DUMMY END
 char3pitlane5 = CREATE_CHAR ( 134.3 , 173.5 , 4.0 ) 8 0 DUMMY END
 char4pitlane5 = CREATE_CHAR ( 134.7 , 173.5 , 4.0 ) 8 180 DUMMY END
 char5pitlane5 = CREATE_CHAR ( 135.1 , 173.5 , 4.0 ) 8 180 DUMMY END
 SET pitlane_team5_enabled = 2
 SET working_pitlane5 = 1
ENDIF


IF (working_pitlane5 = 1)

IF ( HAS_CHARACTER_DIED ( char1pitlane5))
 IF ( NOT ( DELAY ( 60 ) ) )            
  DELETE_ITEM ( char1pitlane5 )       
  char1pitlane5 = CREATE_CHAR ( 133.5 , 173.5 , 4.0 ) 8 90 DUMMY END            
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char1pitlane5 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char2pitlane5))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char2pitlane5 )
  char2pitlane5 = CREATE_CHAR ( 133.9 , 173.5 , 4.0 ) 8 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char2pitlane5 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char3pitlane5))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char3pitlane5 )
  char3pitlane5 = CREATE_CHAR ( 134.3 , 173.5 , 4.0 ) 8 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char3pitlane5 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char4pitlane5))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char4pitlane5 )
  char4pitlane5 = CREATE_CHAR ( 134.7 , 173.5 , 4.0 ) 8 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char4pitlane5 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char5pitlane5))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char5pitlane5 )
  char5pitlane5 = CREATE_CHAR ( 135.1 , 173.5 , 4.0 ) 8 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char5pitlane5 , NO_REACTION) 
ENDIF
   

IF (pitlane5_ready = 1) 
 SET_CHAR_OBJECTIVE ( char1pitlane5 , GOTO_AREA_ON_FOOT, 135.0 , 173.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane5 , GOTO_AREA_ON_FOOT, 135.0 , 173.5 , 4.0 ) 
 SET_CHAR_OBJECTIVE ( char3pitlane5 , GOTO_AREA_ON_FOOT, 135.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane5 , GOTO_AREA_ON_FOOT, 135.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane5 , GOTO_AREA_ON_FOOT, 135.0 , 173.5  , 4.0 )
ENDIF
     
          
IF (pitlane5_ready = 2)
 SET_CHAR_OBJECTIVE ( char1pitlane5 , GOTO_AREA_ON_FOOT, 134.2 , 176.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane5 , GOTO_AREA_ON_FOOT, 134.8 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char3pitlane5 , GOTO_AREA_ON_FOOT, 135.4 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane5 , GOTO_AREA_ON_FOOT, 134.8 , 177.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane5 , GOTO_AREA_ON_FOOT, 135.4 , 177.0 , 4.0 )

 IF (LOCATE_CHARACTER_ANY_MEANS ( char1pitlane5  ,  134.2 , 176.5 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char1pitlane5, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char2pitlane5  ,  134.8 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char2pitlane5, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char3pitlane5  ,  135.4 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char3pitlane5, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char4pitlane5  ,  134.8 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char4pitlane5 , WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char5pitlane5  ,  135.4 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char5pitlane5, WAIT_ON_FOOT)
 ENDIF
ENDIF 

ENDIF 


/// 6 /// RENAULT team

IF (pitlane_team6_enabled = 1)
 char1pitlane6 = CREATE_CHAR ( 141.5 , 173.5 , 4.0 ) 9 90 DUMMY END
 char2pitlane6 = CREATE_CHAR ( 141.9 , 173.5 , 4.0 ) 9 0 DUMMY END
 char3pitlane6 = CREATE_CHAR ( 142.3 , 173.5 , 4.0 ) 9 0 DUMMY END
 char4pitlane6 = CREATE_CHAR ( 142.7 , 173.5 , 4.0 ) 9 180 DUMMY END
 char5pitlane6 = CREATE_CHAR ( 143.1 , 173.5 , 4.0 ) 9 180 DUMMY END
 SET pitlane_team6_enabled = 2
 SET working_pitlane6 = 1
ENDIF


IF (working_pitlane6 = 1)

IF ( HAS_CHARACTER_DIED ( char1pitlane6))
 IF ( NOT ( DELAY ( 60 ) ) )            
  DELETE_ITEM ( char1pitlane6 )       
  char1pitlane6 = CREATE_CHAR ( 141.5 , 173.5 , 4.0 ) 9 90 DUMMY END            
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char1pitlane6 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char2pitlane6))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char2pitlane6 )
  char2pitlane6 = CREATE_CHAR ( 141.9 , 173.5 , 4.0 ) 9 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char2pitlane6 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char3pitlane6))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char3pitlane6 )
  char3pitlane6 = CREATE_CHAR ( 142.3 , 173.5 , 4.0 ) 9 0 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char3pitlane6 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char4pitlane6))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char4pitlane6 )
  char4pitlane6 = CREATE_CHAR ( 142.7 , 173.5 , 4.0 ) 9 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char4pitlane6 , NO_REACTION) 
ENDIF
   
IF ( HAS_CHARACTER_DIED ( char5pitlane6))
 IF ( NOT ( DELAY ( 60 ) ) )
  DELETE_ITEM ( char5pitlane6 )
  char5pitlane6 = CREATE_CHAR ( 143.1 , 173.5 , 4.0 ) 9 180 DUMMY END
 ENDIF
ELSE
 SET_CHAR_THREAT_REACTION ( char5pitlane6 , NO_REACTION) 
ENDIF
   

IF (pitlane6_ready = 1) 
 SET_CHAR_OBJECTIVE ( char1pitlane6 , GOTO_AREA_ON_FOOT, 143.0 , 173.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane6 , GOTO_AREA_ON_FOOT, 143.0 , 173.5 , 4.0 ) 
 SET_CHAR_OBJECTIVE ( char3pitlane6 , GOTO_AREA_ON_FOOT, 143.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane6 , GOTO_AREA_ON_FOOT, 143.0 , 173.5  , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane6 , GOTO_AREA_ON_FOOT, 143.0 , 173.5  , 4.0 )
ENDIF
     
          
IF (pitlane6_ready = 2)
 SET_CHAR_OBJECTIVE ( char1pitlane6 , GOTO_AREA_ON_FOOT, 142.2 , 176.5 , 4.0 )
 SET_CHAR_OBJECTIVE ( char2pitlane6 , GOTO_AREA_ON_FOOT, 142.8 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char3pitlane6 , GOTO_AREA_ON_FOOT, 143.4 , 176.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char4pitlane6 , GOTO_AREA_ON_FOOT, 142.8 , 177.0 , 4.0 )
 SET_CHAR_OBJECTIVE ( char5pitlane6 , GOTO_AREA_ON_FOOT, 143.4 , 177.0 , 4.0 )

 IF (LOCATE_CHARACTER_ANY_MEANS ( char1pitlane6  ,  142.2 , 176.5 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char1pitlane6, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char2pitlane6  ,  142.8 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char2pitlane6, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char3pitlane6  ,  143.4 , 176.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char3pitlane6, WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char4pitlane6  ,  142.8 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char4pitlane6 , WAIT_ON_FOOT)
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS ( char5pitlane6  ,  143.4 , 177.0 , 4.0 , 0.2, 0.2 ))
  SET_CHAR_OBJECTIVE (char5pitlane6, WAIT_ON_FOOT)
 ENDIF
ENDIF 

ENDIF 

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX      OPENING PITLANE       XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ((IS_CAR_IN_BLOCK ( gt1_bmwsauber , 176.5 , 164.5 , 4.0 , 1.0 , 5.0 ))
AND ( pitlane1_ready = 1 ))
 SET pitlane1_ready = 2
ENDIF

IF ((IS_CAR_IN_BLOCK ( gt1_ferrari , 176.5 , 164.5 , 4.0 , 1.0 , 5.0  ))
AND ( pitlane2_ready = 1 ))
 SET pitlane2_ready = 2
ENDIF

IF ((IS_CAR_IN_BLOCK ( gt1_brawn , 176.5 , 164.5 , 4.0 , 1.0 , 5.0 ))
AND ( pitlane3_ready = 1 ))
 SET pitlane3_ready = 2
ENDIF

IF ((IS_CAR_IN_BLOCK ( gt1_redbull , 176.5 , 164.5 , 4.0 , 1.0 , 5.0 ))
AND ( pitlane4_ready = 1 ))
 SET pitlane4_ready = 2
ENDIF

IF ((IS_CAR_IN_BLOCK ( gt1_mclaren , 176.5 , 164.5 , 4.0 , 1.0 , 5.0 ))
AND ( pitlane5_ready = 1 ))
 SET pitlane5_ready = 2
ENDIF

IF ((IS_CAR_IN_BLOCK ( gt1_renault , 176.5 , 164.5 , 4.0 , 1.0 , 5.0 ))
AND ( pitlane6_ready = 1 ))
 SET pitlane6_ready = 2
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXX                           XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXX   CONFIGURATION PITLANE   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXX                           XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// 1 CONFIGURATION BMW PITLANE 

IF (((IS_CAR_IN_BLOCK ( gt1_bmwsauber , 102.55 , 176.3 , 4.0 , 0.3 , 0.2 ))
AND (IS_CAR_IN_BLOCK ( gt1_bmwsauber , 103.55 , 176.7 , 4.0 , 0.3 , 0.2 )))
AND (NOT(CHECK_CAR_SPEED (gt1_bmwsauber , 1)))) 
 SET bmw_pitstop = 1
 IF (( pitlane1_ready = 2 )
 AND ( bmw_position = 0))
  SET bmw_poinst = 1
  CHANGE_BLOCK LID  ( 101 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  170 
  IF(NOT(DELAY ( 120 )))
   sprayshopN = CREATE_OBJ ( 103.0 , 176.5 , 4.0 ) 0 CAR_SHOP 0 END
   DELETE_ITEM (sprayshopN)
   SET pitlane1_ready = 3
  ENDIF
 ENDIF
ENDIF

IF ((bmw_paliwo = 0)
AND (pitlane1_ready = 3))
 SET pitlane1_ready = 1
 SET bmw_position = 0
 CHANGE_BLOCK LID  ( 101 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF (CHECK_CAR_SPEED (gt1_bmwsauber , 0))
 SET bmw_pitstop = 0
 CHANGE_BLOCK LID  ( 101 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ((bmw_position = 1)
AND (NOT(DELAY (45))))
 SET bmw_position = 0
ENDIF

// 2 CONFIGURATION FERRARI PITLANE 

IF (((IS_CAR_IN_BLOCK ( gt1_ferrari , 110.55 , 176.3 , 4.0 , 0.3 , 0.2 ))
AND (IS_CAR_IN_BLOCK ( gt1_ferrari , 111.55 , 176.7 , 4.0 , 0.3 , 0.2 )))
AND (NOT(CHECK_CAR_SPEED (gt1_ferrari , 1))))
 SET ferrari_pitstop = 1
 IF (( pitlane2_ready = 2 ) 
 AND ( ferrari_position = 0 ))
  CHANGE_BLOCK LID  ( 109 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  170 
  IF (NOT(DELAY ( 120 )))
   SET ferrari_poinst = 1
   sprayshopN = CREATE_OBJ ( 111.0 , 176.5 , 4.0 ) 0 CAR_SHOP 0 END
   DELETE_ITEM (sprayshopN)
   SET pitlane2_ready = 3
  ENDIF 
 ENDIF
ENDIF

IF ((ferrari_paliwo = 0)
AND (pitlane2_ready = 3))
 SET pitlane2_ready = 1
 SET ferrari_position = 0
 CHANGE_BLOCK LID  ( 109 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ( CHECK_CAR_SPEED (gt1_ferrari , 0))
 SET ferrari_pitstop = 0
 CHANGE_BLOCK LID  ( 109 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ((ferrari_position = 1)
AND (NOT(DELAY (45))))
 SET ferrari_position = 0
ENDIF

// 3 CONFIGURATION BRAWN PITLANE 

IF (((IS_CAR_IN_BLOCK ( gt1_brawn , 118.55 , 176.3 , 4.0 , 0.3 , 0.2 ))
AND (IS_CAR_IN_BLOCK ( gt1_brawn , 119.55 , 176.7 , 4.0 , 0.3 , 0.2 )))
AND (NOT(CHECK_CAR_SPEED (gt1_brawn , 1))))
 SET brawn_pitstop = 1
 IF (( pitlane3_ready = 2 ) 
 AND ( brawn_position = 0 ))
  CHANGE_BLOCK LID  ( 117 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  170 
  IF (NOT(DELAY ( 120 )))
   SET brawn_poinst = 1
   sprayshopN = CREATE_OBJ ( 119.0 , 176.5 , 4.0 ) 0 CAR_SHOP 0 END
   DELETE_ITEM (sprayshopN)
   SET pitlane3_ready = 3
  ENDIF 
 ENDIF
ENDIF
IF ((brawn_paliwo = 0)
AND (pitlane3_ready = 3))
 SET pitlane3_ready = 1
 SET brawn_position = 0
 CHANGE_BLOCK LID  ( 117 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ( CHECK_CAR_SPEED (gt1_brawn , 0))
 SET brawn_pitstop = 0
 CHANGE_BLOCK LID  ( 117 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ((brawn_position = 1)
AND (NOT(DELAY (45))))
 SET brawn_position = 0
ENDIF

// 4 CONFIGURATION REDBULL PITLANE 

IF (((IS_CAR_IN_BLOCK ( gt1_redbull , 126.55 , 176.3 , 4.0 , 0.3 , 0.2 ))
AND (IS_CAR_IN_BLOCK ( gt1_redbull , 127.55 , 176.7 , 4.0 , 0.3 , 0.2 )))
AND (NOT(CHECK_CAR_SPEED (gt1_redbull , 1))))
 SET redbull_pitstop = 1
 IF (( pitlane4_ready = 2 ) 
 AND ( redbull_position = 0 ))
  CHANGE_BLOCK LID  ( 125 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  170 
  IF (NOT(DELAY ( 120 )))
   SET redbull_poinst = 1
   sprayshopN = CREATE_OBJ ( 127.0 , 176.5 , 4.0 ) 0 CAR_SHOP 0 END
   DELETE_ITEM (sprayshopN)
   SET pitlane4_ready = 3
  ENDIF 
 ENDIF
ENDIF
IF ((redbull_paliwo = 0)
AND (pitlane4_ready = 3))
 SET pitlane4_ready = 1
 SET redbull_position = 0
 CHANGE_BLOCK LID  ( 125 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ( CHECK_CAR_SPEED (gt1_redbull , 0))
 SET redbull_pitstop = 0
 CHANGE_BLOCK LID  ( 125 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ((redbull_position = 1)
AND (NOT(DELAY (45))))
 SET redbull_position = 0
ENDIF

// 5 CONFIGURATION MCLAREN PITLANE 

IF (((IS_CAR_IN_BLOCK ( gt1_mclaren , 134.55 , 176.3 , 4.0 , 0.3 , 0.2 ))
AND (IS_CAR_IN_BLOCK ( gt1_mclaren , 135.55 , 176.7 , 4.0 , 0.3 , 0.2 )))
AND (NOT(CHECK_CAR_SPEED (gt1_mclaren , 1))))
 SET mclaren_pitstop = 1
 IF (( pitlane5_ready = 2 ) 
 AND ( mclaren_position = 0 ))
  CHANGE_BLOCK LID  ( 133 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  170 
  IF (NOT(DELAY ( 120 )))
   SET mclaren_poinst = 1
   sprayshopN = CREATE_OBJ ( 135.0 , 176.5 , 4.0 ) 0 CAR_SHOP 0 END
   DELETE_ITEM (sprayshopN)
   SET pitlane5_ready = 3
  ENDIF 
 ENDIF
ENDIF
IF ((mclaren_paliwo = 0)
AND (pitlane5_ready = 3))
 SET pitlane5_ready = 1
 SET mclaren_position = 0
 CHANGE_BLOCK LID  ( 133 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ( CHECK_CAR_SPEED (gt1_mclaren , 0))
 SET mclaren_pitstop = 0
 CHANGE_BLOCK LID  ( 133 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ((mclaren_position = 1)
AND (NOT(DELAY (45))))
 SET mclaren_position = 0
ENDIF

// 6 CONFIGURATION RENAULT PITLANE 

IF (((IS_CAR_IN_BLOCK ( gt1_renault , 142.55 , 176.3 , 4.0 , 0.3 , 0.2 ))
AND (IS_CAR_IN_BLOCK ( gt1_renault , 143.55 , 176.7 , 4.0 , 0.3 , 0.2 )))
AND (NOT(CHECK_CAR_SPEED (gt1_renault , 1))))
 SET renault_pitstop = 1
 IF (( pitlane6_ready = 2 ) 
 AND ( renault_position = 0 ))
  CHANGE_BLOCK LID  ( 141 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  170 
  IF (NOT(DELAY ( 120 )))
   SET renault_poinst = 1
   sprayshopN = CREATE_OBJ ( 143.0 , 176.5 , 4.0 ) 0 CAR_SHOP 0 END
   DELETE_ITEM (sprayshopN)
   SET pitlane6_ready = 3
  ENDIF 
 ENDIF
ENDIF
IF ((renault_paliwo = 0)
AND (pitlane6_ready = 3))
 SET pitlane6_ready = 1
 SET renault_position = 0
 CHANGE_BLOCK LID  ( 141 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ( CHECK_CAR_SPEED (gt1_renault , 0))
 SET renault_pitstop = 0
 CHANGE_BLOCK LID  ( 141 , 176 , 3 ) NOT_FLAT NOT_FLIP  0  0  119
ENDIF
IF ((renault_position = 1)
AND (NOT(DELAY (45))))
 SET renault_position = 0
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX   KOORDYNATY DLA PLAYERA   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX            1               XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// P1 BMW

IF (IS_CHARACTER_IN_CAR (p1 , gt1_bmwsauber))
 IF ((bmw_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p1 , 4999 ))))
  ADD_SCORE_NO_MULT ( p1 , 5000 )
  SET bmw_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p1))
 AND (IS_CAR_IN_BLOCK ( gt1_bmwsauber , 103.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET bmw_paliwo = 1
 ELSE
  SET bmw_paliwo = 0
 ENDIF
 IF (( czas_bmwsauber > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))))
  SET plus_gta1 = 1
  SET czas_bmwsauber = 0
 ENDIF
 IF ((((((bmw_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta1 , -4 )))
 AND (pitlane1_ready > 1))
 AND (bmw_pitstop = 1))
 AND (bmw_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_bmwsauber = 0
  SET minus_gta1 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))
 AND (bmw_char_alive = 0))
  bmw_char = CREATE_CHAR_INSIDE_CAR ( gt1_bmwsauber ) 13 criminal END
  SET bmw_char_alive = 1
 ENDIF
 IF (((bmw_pitstop = 1)
 AND (pitlane1_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p1))
   SET pitlane1_ready = 2
   SET bmw_position = 1
  ENDIF
 ENDIF
ENDIF
 
// P1 FERRARI

IF (IS_CHARACTER_IN_CAR (p1 , gt1_ferrari))
 IF ((ferrari_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p1 , 4999 ))))
  ADD_SCORE_NO_MULT ( p1 , 5000 )
  SET ferrari_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p1))
 AND (IS_CAR_IN_BLOCK ( gt1_ferrari , 111.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET ferrari_paliwo = 1
 ELSE
  SET ferrari_paliwo = 0
 ENDIF
 IF (( czas_ferrari > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))))
  SET plus_gta1 = 1
  SET czas_ferrari = 0
 ENDIF
 IF ((((((ferrari_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta1 , -4 )))
 AND (pitlane2_ready > 1))
 AND (ferrari_pitstop = 1))
 AND (ferrari_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_ferrari = 0
  SET minus_gta1 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))
 AND (ferrari_char_alive = 0))
  ferrari_char = CREATE_CHAR_INSIDE_CAR ( gt1_ferrari ) 13 criminal END
  SET ferrari_char_alive = 1
 ENDIF
 IF (((ferrari_pitstop = 1)
 AND (pitlane2_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p1))
   SET pitlane2_ready = 2
   SET ferrari_position = 1
  ENDIF
 ENDIF
ENDIF

// P1 BRAWN

IF (IS_CHARACTER_IN_CAR (p1 , gt1_brawn))
 IF ((brawn_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p1 , 4999 ))))
  ADD_SCORE_NO_MULT ( p1 , 5000 )
  SET brawn_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p1))
 AND (IS_CAR_IN_BLOCK ( gt1_brawn , 119.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET brawn_paliwo = 1
 ELSE
  SET brawn_paliwo = 0
 ENDIF
 IF (( czas_brawn > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))))
  SET plus_gta1 = 1
  SET czas_brawn = 0
 ENDIF
 IF ((((((brawn_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta1 , -4 )))
 AND (pitlane3_ready > 1))
 AND (brawn_pitstop = 1))
 AND (brawn_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_brawn = 0
  SET minus_gta1 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))
 AND (brawn_char_alive = 0))
  brawn_char = CREATE_CHAR_INSIDE_CAR ( gt1_brawn ) 13 criminal END
  SET brawn_char_alive = 1
 ENDIF
 IF (((brawn_pitstop = 1)
 AND (pitlane3_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p1))
   SET pitlane3_ready = 2
   SET brawn_position = 1
  ENDIF
 ENDIF
ENDIF

// P1 REBULL

IF (IS_CHARACTER_IN_CAR (p1 , gt1_redbull))
 IF ((redbull_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p1 , 4999 ))))
  ADD_SCORE_NO_MULT ( p1 , 5000 )
  SET redbull_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p1))
 AND (IS_CAR_IN_BLOCK ( gt1_redbull , 127.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET redbull_paliwo = 1
 ELSE
  SET redbull_paliwo = 0
 ENDIF
 IF (( czas_redbull > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))))
  SET plus_gta1 = 1
  SET czas_redbull = 0
 ENDIF
 IF ((((((redbull_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta1 , -4 )))
 AND (pitlane4_ready > 1))
 AND (redbull_pitstop = 1))
 AND (redbull_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_redbull = 0
  SET minus_gta1 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))
 AND (redbull_char_alive = 0))
  redbull_char = CREATE_CHAR_INSIDE_CAR ( gt1_redbull ) 13 criminal END
  SET redbull_char_alive = 1
 ENDIF
 IF (((redbull_pitstop = 1)
 AND (pitlane4_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p1))
   SET pitlane4_ready = 2
   SET redbull_position = 1
  ENDIF
 ENDIF
ENDIF

// P1 MCLAREN

IF (IS_CHARACTER_IN_CAR (p1 , gt1_mclaren))
 IF ((mclaren_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p1 , 4999 ))))
  ADD_SCORE_NO_MULT ( p1 , 5000 )
  SET mclaren_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p1))
 AND (IS_CAR_IN_BLOCK ( gt1_mclaren , 135.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET mclaren_paliwo = 1
 ELSE
  SET mclaren_paliwo = 0
 ENDIF
 IF (( czas_mclaren > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))))
  SET plus_gta1 = 1
  SET czas_mclaren = 0
 ENDIF
 IF (((((( mclaren_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta1 , -4 )))
 AND (pitlane5_ready > 1))
 AND (mclaren_pitstop = 1))
 AND (mclaren_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_mclaren = 0
  SET minus_gta1 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))
 AND (mclaren_char_alive = 0))
  mclaren_char = CREATE_CHAR_INSIDE_CAR ( gt1_mclaren ) 13 criminal END
  SET mclaren_char_alive = 1
 ENDIF
 IF (((mclaren_pitstop = 1)
 AND (pitlane5_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p1))
   SET pitlane5_ready = 2
   SET mclaren_position = 1
  ENDIF
 ENDIF
ENDIF

// P1 RENAULT

IF (IS_CHARACTER_IN_CAR (p1 , gt1_renault))
 IF ((renault_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p1 , 4999 ))))
  ADD_SCORE_NO_MULT ( p1 , 5000 )
  SET renault_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p1))
 AND (IS_CAR_IN_BLOCK ( gt1_renault , 143.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET renault_paliwo = 1
 ELSE
  SET renault_paliwo = 0
 ENDIF
 IF (( czas_renault > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))))
  SET plus_gta1 = 1
  SET czas_renault = 0
 ENDIF
 IF (((((( renault_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta1 , -4 )))
 AND (pitlane6_ready > 1))
 AND (renault_pitstop = 1))
 AND (renault_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_renault = 0
  SET minus_gta1 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta1 , 3 ))
 AND (renault_char_alive = 0))
  renault_char = CREATE_CHAR_INSIDE_CAR ( gt1_renault ) 13 criminal END
  SET renault_char_alive = 1
 ENDIF
 IF (((renault_pitstop = 1)
 AND (pitlane6_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p1))
   SET pitlane6_ready = 2
   SET renault_position = 1
  ENDIF
 ENDIF
ENDIF


// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX   KOORDYNATY DLA PLAYERA   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX            2               XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// P2 BMW

IF (IS_CHARACTER_IN_CAR (p2 , gt1_bmwsauber))
 IF ((bmw_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p2 , 4999 ))))
  ADD_SCORE_NO_MULT ( p2 , 5000 )
  SET bmw_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p2))
 AND (IS_CAR_IN_BLOCK ( gt1_bmwsauber , 103.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET bmw_paliwo = 1
 ELSE
  SET bmw_paliwo = 0
 ENDIF
 IF (( czas_bmwsauber > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))))
  SET plus_gta2 = 1
  SET czas_bmwsauber = 0
 ENDIF
 IF ((((((bmw_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta2 , -4 )))
 AND (pitlane1_ready > 1))
 AND (bmw_pitstop = 1))
 AND (bmw_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_bmwsauber = 0
  SET minus_gta2 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))
 AND (bmw_char_alive = 0))
  bmw_char = CREATE_CHAR_INSIDE_CAR ( gt1_bmwsauber ) 13 criminal END
  SET bmw_char_alive = 1
 ENDIF
 IF (((bmw_pitstop = 1)
 AND (pitlane1_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p2))
   SET pitlane1_ready = 2
   SET bmw_position = 1
  ENDIF
 ENDIF
ENDIF
 
// P2 FERRARI

IF (IS_CHARACTER_IN_CAR (p2 , gt1_ferrari))
 IF ((ferrari_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p2 , 4999 ))))
  ADD_SCORE_NO_MULT ( p2 , 5000 )
  SET ferrari_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p2))
 AND (IS_CAR_IN_BLOCK ( gt1_ferrari , 111.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET ferrari_paliwo = 1
 ELSE
  SET ferrari_paliwo = 0
 ENDIF
 IF (( czas_ferrari > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))))
  SET plus_gta2 = 1
  SET czas_ferrari = 0
 ENDIF
 IF ((((((ferrari_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta2 , -4 )))
 AND (pitlane2_ready > 1))
 AND (ferrari_pitstop = 1))
 AND (ferrari_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_ferrari = 0
  SET minus_gta2 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))
 AND (ferrari_char_alive = 0))
  ferrari_char = CREATE_CHAR_INSIDE_CAR ( gt1_ferrari ) 13 criminal END
  SET ferrari_char_alive = 1
 ENDIF
 IF (((ferrari_pitstop = 1)
 AND (pitlane2_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p2))
   SET pitlane2_ready = 2
   SET ferrari_position = 1
  ENDIF
 ENDIF
ENDIF

// P2 BRAWN

IF (IS_CHARACTER_IN_CAR (p2 , gt1_brawn))
 IF ((brawn_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p2 , 4999 ))))
  ADD_SCORE_NO_MULT ( p2 , 5000 )
  SET brawn_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p2))
 AND (IS_CAR_IN_BLOCK ( gt1_brawn , 119.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET brawn_paliwo = 1
 ELSE
  SET brawn_paliwo = 0
 ENDIF
 IF (( czas_brawn > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))))
  SET plus_gta2 = 1
  SET czas_brawn = 0
 ENDIF
 IF ((((((brawn_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta2 , -4 )))
 AND (pitlane3_ready > 1))
 AND (brawn_pitstop = 1))
 AND (brawn_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_brawn = 0
  SET minus_gta2 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))
 AND (brawn_char_alive = 0))
  brawn_char = CREATE_CHAR_INSIDE_CAR ( gt1_brawn ) 13 criminal END
  SET brawn_char_alive = 1
 ENDIF
 IF (((brawn_pitstop = 1)
 AND (pitlane3_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p2))
   SET pitlane3_ready = 2
   SET brawn_position = 1
  ENDIF
 ENDIF
ENDIF

// P2 REBULL

IF (IS_CHARACTER_IN_CAR (p2 , gt1_redbull))
 IF ((redbull_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p2 , 4999 ))))
  ADD_SCORE_NO_MULT ( p2 , 5000 )
  SET redbull_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p2))
 AND (IS_CAR_IN_BLOCK ( gt1_redbull , 127.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET redbull_paliwo = 1
 ELSE
  SET redbull_paliwo = 0
 ENDIF
 IF (( czas_redbull > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))))
  SET plus_gta2 = 1
  SET czas_redbull = 0
 ENDIF
 IF ((((((redbull_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta2 , -4 )))
 AND (pitlane4_ready > 1))
 AND (redbull_pitstop = 1))
 AND (redbull_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_redbull = 0
  SET minus_gta2 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))
 AND (redbull_char_alive = 0))
  redbull_char = CREATE_CHAR_INSIDE_CAR ( gt1_redbull ) 13 criminal END
  SET redbull_char_alive = 1
 ENDIF
 IF (((redbull_pitstop = 1)
 AND (pitlane4_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p2))
   SET pitlane4_ready = 2
   SET redbull_position = 1
  ENDIF
 ENDIF
ENDIF

// P2 MCLAREN

IF (IS_CHARACTER_IN_CAR (p2 , gt1_mclaren))
 IF ((mclaren_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p2 , 4999 ))))
  ADD_SCORE_NO_MULT ( p2 , 5000 )
  SET mclaren_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p2))
 AND (IS_CAR_IN_BLOCK ( gt1_mclaren , 135.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET mclaren_paliwo = 1
 ELSE
  SET mclaren_paliwo = 0
 ENDIF
 IF (( czas_mclaren > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))))
  SET plus_gta2 = 1
  SET czas_mclaren = 0
 ENDIF
 IF (((((( mclaren_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta2 , -4 )))
 AND (pitlane5_ready > 1))
 AND (mclaren_pitstop = 1))
 AND (mclaren_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_mclaren = 0
  SET minus_gta2 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))
 AND (mclaren_char_alive = 0))
  mclaren_char = CREATE_CHAR_INSIDE_CAR ( gt1_mclaren ) 13 criminal END
  SET mclaren_char_alive = 1
 ENDIF
 IF (((mclaren_pitstop = 1)
 AND (pitlane5_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p2))
   SET pitlane5_ready = 2
   SET mclaren_position = 1
  ENDIF
 ENDIF
ENDIF

// P2 RENAULT

IF (IS_CHARACTER_IN_CAR (p2 , gt1_renault))
 IF ((renault_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p2 , 4999 ))))
  ADD_SCORE_NO_MULT ( p2 , 5000 )
  SET renault_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p2))
 AND (IS_CAR_IN_BLOCK ( gt1_renault , 143.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET renault_paliwo = 1
 ELSE
  SET renault_paliwo = 0
 ENDIF
 IF (( czas_renault > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))))
  SET plus_gta2 = 1
  SET czas_renault = 0
 ENDIF
 IF (((((( renault_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta2 , -4 )))
 AND (pitlane6_ready > 1))
 AND (renault_pitstop = 1))
 AND (renault_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_renault = 0
  SET minus_gta2 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta2 , 3 ))
 AND (renault_char_alive = 0))
  renault_char = CREATE_CHAR_INSIDE_CAR ( gt1_renault ) 13 criminal END
  SET renault_char_alive = 1
 ENDIF
 IF (((renault_pitstop = 1)
 AND (pitlane6_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p2))
   SET pitlane6_ready = 2
   SET renault_position = 1
  ENDIF
 ENDIF
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX   KOORDYNATY DLA PLAYERA   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX            3               XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// P3 BMW

IF (IS_CHARACTER_IN_CAR (p3 , gt1_bmwsauber))
 IF ((bmw_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p3 , 4999 ))))
  ADD_SCORE_NO_MULT ( p3 , 5000 )
  SET bmw_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p3))
 AND (IS_CAR_IN_BLOCK ( gt1_bmwsauber , 103.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET bmw_paliwo = 1
 ELSE
  SET bmw_paliwo = 0
 ENDIF
 IF (( czas_bmwsauber > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))))
  SET plus_gta3 = 1
  SET czas_bmwsauber = 0
 ENDIF
 IF ((((((bmw_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta3 , -4 )))
 AND (pitlane1_ready > 1))
 AND (bmw_pitstop = 1))
 AND (bmw_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_bmwsauber = 0
  SET minus_gta3 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))
 AND (bmw_char_alive = 0))
  bmw_char = CREATE_CHAR_INSIDE_CAR ( gt1_bmwsauber ) 13 criminal END
  SET bmw_char_alive = 1
 ENDIF
 IF (((bmw_pitstop = 1)
 AND (pitlane1_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p3))
   SET pitlane1_ready = 2
   SET bmw_position = 1
  ENDIF
 ENDIF
ENDIF
 
// P3 FERRARI

IF (IS_CHARACTER_IN_CAR (p3 , gt1_ferrari))
 IF ((ferrari_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p3 , 4999 ))))
  ADD_SCORE_NO_MULT ( p3 , 5000 )
  SET ferrari_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p3))
 AND (IS_CAR_IN_BLOCK ( gt1_ferrari , 111.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET ferrari_paliwo = 1
 ELSE
  SET ferrari_paliwo = 0
 ENDIF
 IF (( czas_ferrari > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))))
  SET plus_gta3 = 1
  SET czas_ferrari = 0
 ENDIF
 IF ((((((ferrari_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta3 , -4 )))
 AND (pitlane2_ready > 1))
 AND (ferrari_pitstop = 1))
 AND (ferrari_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_ferrari = 0
  SET minus_gta3 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))
 AND (ferrari_char_alive = 0))
  ferrari_char = CREATE_CHAR_INSIDE_CAR ( gt1_ferrari ) 13 criminal END
  SET ferrari_char_alive = 1
 ENDIF
 IF (((ferrari_pitstop = 1)
 AND (pitlane2_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p3))
   SET pitlane2_ready = 2
   SET ferrari_position = 1
  ENDIF
 ENDIF
ENDIF

// P3 BRAWN

IF (IS_CHARACTER_IN_CAR (p3 , gt1_brawn))
 IF ((brawn_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p3 , 4999 ))))
  ADD_SCORE_NO_MULT ( p3 , 5000 )
  SET brawn_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p3))
 AND (IS_CAR_IN_BLOCK ( gt1_brawn , 119.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET brawn_paliwo = 1
 ELSE
  SET brawn_paliwo = 0
 ENDIF
 IF (( czas_brawn > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))))
  SET plus_gta3 = 1
  SET czas_brawn = 0
 ENDIF
 IF ((((((brawn_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta3 , -4 )))
 AND (pitlane3_ready > 1))
 AND (brawn_pitstop = 1))
 AND (brawn_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_brawn = 0
  SET minus_gta3 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))
 AND (brawn_char_alive = 0))
  brawn_char = CREATE_CHAR_INSIDE_CAR ( gt1_brawn ) 13 criminal END
  SET brawn_char_alive = 1
 ENDIF
 IF (((brawn_pitstop = 1)
 AND (pitlane3_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p3))
   SET pitlane3_ready = 2
   SET brawn_position = 1
  ENDIF
 ENDIF
ENDIF

// P3 REBULL

IF (IS_CHARACTER_IN_CAR (p3 , gt1_redbull))
 IF ((redbull_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p3 , 4999 ))))
  ADD_SCORE_NO_MULT ( p3 , 5000 )
  SET redbull_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p3))
 AND (IS_CAR_IN_BLOCK ( gt1_redbull , 127.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET redbull_paliwo = 1
 ELSE
  SET redbull_paliwo = 0
 ENDIF
 IF (( czas_redbull > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))))
  SET plus_gta3 = 1
  SET czas_redbull = 0
 ENDIF
 IF ((((((redbull_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta3 , -4 )))
 AND (pitlane4_ready > 1))
 AND (redbull_pitstop = 1))
 AND (redbull_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_redbull = 0
  SET minus_gta3 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))
 AND (redbull_char_alive = 0))
  redbull_char = CREATE_CHAR_INSIDE_CAR ( gt1_redbull ) 13 criminal END
  SET redbull_char_alive = 1
 ENDIF
 IF (((redbull_pitstop = 1)
 AND (pitlane4_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p3))
   SET pitlane4_ready = 2
   SET redbull_position = 1
  ENDIF
 ENDIF
ENDIF

// P3 MCLAREN

IF (IS_CHARACTER_IN_CAR (p3 , gt1_mclaren))
 IF ((mclaren_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p3 , 4999 ))))
  ADD_SCORE_NO_MULT ( p3 , 5000 )
  SET mclaren_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p3))
 AND (IS_CAR_IN_BLOCK ( gt1_mclaren , 135.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET mclaren_paliwo = 1
 ELSE
  SET mclaren_paliwo = 0
 ENDIF
 IF (( czas_mclaren > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))))
  SET plus_gta3 = 1
  SET czas_mclaren = 0
 ENDIF
 IF (((((( mclaren_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta3 , -4 )))
 AND (pitlane5_ready > 1))
 AND (mclaren_pitstop = 1))
 AND (mclaren_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_mclaren = 0
  SET minus_gta3 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))
 AND (mclaren_char_alive = 0))
  mclaren_char = CREATE_CHAR_INSIDE_CAR ( gt1_mclaren ) 13 criminal END
  SET mclaren_char_alive = 1
 ENDIF
 IF (((mclaren_pitstop = 1)
 AND (pitlane5_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p3))
   SET pitlane5_ready = 2
   SET mclaren_position = 1
  ENDIF
 ENDIF
ENDIF

// P3 RENAULT

IF (IS_CHARACTER_IN_CAR (p3 , gt1_renault))
 IF ((renault_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p3 , 4999 ))))
  ADD_SCORE_NO_MULT ( p3 , 5000 )
  SET renault_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p3))
 AND (IS_CAR_IN_BLOCK ( gt1_renault , 143.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET renault_paliwo = 1
 ELSE
  SET renault_paliwo = 0
 ENDIF
 IF (( czas_renault > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))))
  SET plus_gta3 = 1
  SET czas_renault = 0
 ENDIF
 IF (((((( renault_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta3 , -4 )))
 AND (pitlane6_ready > 1))
 AND (renault_pitstop = 1))
 AND (renault_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_renault = 0
  SET minus_gta3 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta3 , 3 ))
 AND (renault_char_alive = 0))
  renault_char = CREATE_CHAR_INSIDE_CAR ( gt1_renault ) 13 criminal END
  SET renault_char_alive = 1
 ENDIF
 IF (((renault_pitstop = 1)
 AND (pitlane6_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p3))
   SET pitlane6_ready = 2
   SET renault_position = 1
  ENDIF
 ENDIF
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX   KOORDYNATY DLA PLAYERA   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX            4               XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// P4 BMW

IF (IS_CHARACTER_IN_CAR (p4 , gt1_bmwsauber))
 IF ((bmw_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p4 , 4999 ))))
  ADD_SCORE_NO_MULT ( p4 , 5000 )
  SET bmw_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p4))
 AND (IS_CAR_IN_BLOCK ( gt1_bmwsauber , 103.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET bmw_paliwo = 1
 ELSE
  SET bmw_paliwo = 0
 ENDIF
 IF (( czas_bmwsauber > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))))
  SET plus_gta4 = 1
  SET czas_bmwsauber = 0
 ENDIF
 IF ((((((bmw_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta4 , -4 )))
 AND (pitlane1_ready > 1))
 AND (bmw_pitstop = 1))
 AND (bmw_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_bmwsauber = 0
  SET minus_gta4 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))
 AND (bmw_char_alive = 0))
  bmw_char = CREATE_CHAR_INSIDE_CAR ( gt1_bmwsauber ) 13 criminal END
  SET bmw_char_alive = 1
 ENDIF
 IF (((bmw_pitstop = 1)
 AND (pitlane1_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p4))
   SET pitlane1_ready = 2
   SET bmw_position = 1
  ENDIF
 ENDIF
ENDIF
 
// P4 FERRARI

IF (IS_CHARACTER_IN_CAR (p4 , gt1_ferrari))
 IF ((ferrari_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p4 , 4999 ))))
  ADD_SCORE_NO_MULT ( p4 , 5000 )
  SET ferrari_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p4))
 AND (IS_CAR_IN_BLOCK ( gt1_ferrari , 111.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET ferrari_paliwo = 1
 ELSE
  SET ferrari_paliwo = 0
 ENDIF
 IF (( czas_ferrari > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))))
  SET plus_gta4 = 1
  SET czas_ferrari = 0
 ENDIF
 IF ((((((ferrari_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta4 , -4 )))
 AND (pitlane2_ready > 1))
 AND (ferrari_pitstop = 1))
 AND (ferrari_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_ferrari = 0
  SET minus_gta4 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))
 AND (ferrari_char_alive = 0))
  ferrari_char = CREATE_CHAR_INSIDE_CAR ( gt1_ferrari ) 13 criminal END
  SET ferrari_char_alive = 1
 ENDIF
 IF (((ferrari_pitstop = 1)
 AND (pitlane2_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p4))
   SET pitlane2_ready = 2
   SET ferrari_position = 1
  ENDIF
 ENDIF
ENDIF

// P4 BRAWN

IF (IS_CHARACTER_IN_CAR (p4 , gt1_brawn))
 IF ((brawn_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p4 , 4999 ))))
  ADD_SCORE_NO_MULT ( p4 , 5000 )
  SET brawn_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p4))
 AND (IS_CAR_IN_BLOCK ( gt1_brawn , 119.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET brawn_paliwo = 1
 ELSE
  SET brawn_paliwo = 0
 ENDIF
 IF (( czas_brawn > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))))
  SET plus_gta4 = 1
  SET czas_brawn = 0
 ENDIF
 IF ((((((brawn_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta4 , -4 )))
 AND (pitlane3_ready > 1))
 AND (brawn_pitstop = 1))
 AND (brawn_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_brawn = 0
  SET minus_gta4 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))
 AND (brawn_char_alive = 0))
  brawn_char = CREATE_CHAR_INSIDE_CAR ( gt1_brawn ) 13 criminal END
  SET brawn_char_alive = 1
 ENDIF
 IF (((brawn_pitstop = 1)
 AND (pitlane3_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p4))
   SET pitlane3_ready = 2
   SET brawn_position = 1
  ENDIF
 ENDIF
ENDIF

// P4 REBULL

IF (IS_CHARACTER_IN_CAR (p4 , gt1_redbull))
 IF ((redbull_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p4 , 4999 ))))
  ADD_SCORE_NO_MULT ( p4 , 5000 )
  SET redbull_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p4))
 AND (IS_CAR_IN_BLOCK ( gt1_redbull , 127.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET redbull_paliwo = 1
 ELSE
  SET redbull_paliwo = 0
 ENDIF
 IF (( czas_redbull > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))))
  SET plus_gta4 = 1
  SET czas_redbull = 0
 ENDIF
 IF ((((((redbull_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta4 , -4 )))
 AND (pitlane4_ready > 1))
 AND (redbull_pitstop = 1))
 AND (redbull_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_redbull = 0
  SET minus_gta4 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))
 AND (redbull_char_alive = 0))
  redbull_char = CREATE_CHAR_INSIDE_CAR ( gt1_redbull ) 13 criminal END
  SET redbull_char_alive = 1
 ENDIF
 IF (((redbull_pitstop = 1)
 AND (pitlane4_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p4))
   SET pitlane4_ready = 2
   SET redbull_position = 1
  ENDIF
 ENDIF
ENDIF

// P4 MCLAREN

IF (IS_CHARACTER_IN_CAR (p4 , gt1_mclaren))
 IF ((mclaren_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p4 , 4999 ))))
  ADD_SCORE_NO_MULT ( p4 , 5000 )
  SET mclaren_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p4))
 AND (IS_CAR_IN_BLOCK ( gt1_mclaren , 135.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET mclaren_paliwo = 1
 ELSE
  SET mclaren_paliwo = 0
 ENDIF
 IF (( czas_mclaren > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))))
  SET plus_gta4 = 1
  SET czas_mclaren = 0
 ENDIF
 IF (((((( mclaren_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta4 , -4 )))
 AND (pitlane5_ready > 1))
 AND (mclaren_pitstop = 1))
 AND (mclaren_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_mclaren = 0
  SET minus_gta4 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))
 AND (mclaren_char_alive = 0))
  mclaren_char = CREATE_CHAR_INSIDE_CAR ( gt1_mclaren ) 13 criminal END
  SET mclaren_char_alive = 1
 ENDIF
 IF (((mclaren_pitstop = 1)
 AND (pitlane5_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p4))
   SET pitlane5_ready = 2
   SET mclaren_position = 1
  ENDIF
 ENDIF
ENDIF

// P4 RENAULT

IF (IS_CHARACTER_IN_CAR (p4 , gt1_renault))
 IF ((renault_poinst = 1)
 AND (NOT ( CHECK_SCORE_GREATER ( p4 , 4999 ))))
  ADD_SCORE_NO_MULT ( p4 , 5000 )
  SET renault_poinst = 0
 ENDIF
 IF ((IS_CHAR_PRESSING_HORN (p4))
 AND (IS_CAR_IN_BLOCK ( gt1_renault , 143.5 , 176.5 , 4.0 , 0.3 , 0.3 )))
  SET renault_paliwo = 1
 ELSE
  SET renault_paliwo = 0
 ENDIF
 IF (( czas_renault > 3100)
 AND (NOT(CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))))
  SET plus_gta4 = 1
  SET czas_renault = 0
 ENDIF
 IF (((((( renault_paliwo = 1)
 AND (CHECK_RESPECT_GREATER ( p1 , gta4 , -4 )))
 AND (pitlane6_ready > 1))
 AND (renault_pitstop = 1))
 AND (renault_position = 0))
 AND (NOT(DELAY (40))))
  SET czas_renault = 0
  SET minus_gta4 = 1
 ENDIF
 IF ((CHECK_RESPECT_GREATER ( p1 , gta4 , 3 ))
 AND (renault_char_alive = 0))
  renault_char = CREATE_CHAR_INSIDE_CAR ( gt1_renault ) 13 criminal END
  SET renault_char_alive = 1
 ENDIF
 IF (((renault_pitstop = 1)
 AND (pitlane6_ready = 1))
 AND (NOT(DELAY (45))))
  IF (IS_CHAR_PRESSING_HORN (p4))
   SET pitlane6_ready = 2
   SET renault_position = 1
  ENDIF
 ENDIF
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXX                        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXX  BOT'S & STOP DRIVING  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXX                        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF (( bmw_char_alive = 1)
AND (NOT(DELAY(30))))
 STOP_CHAR_DRIVING ( bmw_char )
 IF (NOT(laps_bmw > 90))
  DISPLAY_BRIEF ( 3001 ) //#BMW Sauber# out of #FUEL#.
 ENDIF
 SET bmw_char_alive = 2
ENDIF

IF ((ferrari_char_alive = 1)
AND (NOT(DELAY(30))))
 STOP_CHAR_DRIVING ( ferrari_char )
 IF (NOT(laps_ferrari > 90))
  DISPLAY_BRIEF ( 3002 ) //#Ferrari# out of #FUEL#.
 ENDIF 
 SET ferrari_char_alive = 2
ENDIF

IF ((brawn_char_alive = 1)
AND (NOT(DELAY(30))))
 STOP_CHAR_DRIVING ( brawn_char )
 IF (NOT(laps_brawn > 90))
  DISPLAY_BRIEF ( 3003 ) //#Brawn GP# out of #FUEL#.
 ENDIF  
 SET brawn_char_alive = 2
ENDIF

IF (( redbull_char_alive = 1)
AND (NOT(DELAY(30))))
 STOP_CHAR_DRIVING ( redbull_char )
 IF (NOT(laps_redbull > 90))
  DISPLAY_BRIEF ( 3004 ) //#Red Bull# out of #FUEL#.
 ENDIF
 SET redbull_char_alive = 2
ENDIF

IF (( mclaren_char_alive = 1)
AND (NOT(DELAY(30))))
 STOP_CHAR_DRIVING ( mclaren_char )
 IF (NOT(laps_mclaren > 90))
  DISPLAY_BRIEF ( 3005 ) //#McLaren# out of #FUEL#.
 ENDIF
 SET mclaren_char_alive = 2
ENDIF

IF ((renault_char_alive = 1)
AND (NOT(DELAY(30))))
 STOP_CHAR_DRIVING ( renault_char )
 IF (NOT(laps_renault > 90))
  DISPLAY_BRIEF ( 3006 ) //#Renault# out of #FUEL#.
 ENDIF
 SET renault_char_alive = 2
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX     ANTI-CRASH FUEL     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ((CHECK_CHARACTER_HEALTH ( p1 , 0))
AND (CHECK_SCORE_GREATER ( p1 , -1)))
  ++ scorep1
ENDIF 

IF ((CHECK_CHARACTER_HEALTH ( p2 , 0))
AND (CHECK_SCORE_GREATER ( p2 , -1)))
  ++ scorep2
ENDIF

IF ((CHECK_CHARACTER_HEALTH ( p3 , 0))
AND (CHECK_SCORE_GREATER ( p3 , -1)))
  ++ scorep3
ENDIF

IF ((CHECK_CHARACTER_HEALTH ( p4 , 0))
AND (CHECK_SCORE_GREATER ( p4 , -1)))
  ++ scorep4
ENDIF

// p1
IF  (((scorep2 < scorep1)
AND   (scorep3 < scorep1))
AND   (scorep4 < scorep1))
 SET group = 1
ENDIF

// p1 + p2
IF  (((scorep2 = scorep1)
AND   (scorep3 < scorep1))
AND   (scorep4 < scorep1))
 SET group = 2
ENDIF

// p1 + p3
IF  (((scorep2 < scorep1)
AND   (scorep3 = scorep1))
AND   (scorep4 < scorep1))
 SET group = 3
ENDIF

// p1 + p4
IF  (((scorep2 < scorep1)
AND   (scorep3 < scorep1))
AND   (scorep4 = scorep1))
 SET group = 4
ENDIF

// p1 + p2 + p3
IF  (((scorep2 = scorep1)
AND   (scorep3 = scorep1))
AND   (scorep4 < scorep1))
 SET group = 5
ENDIF

// p1 + p2 + p4
IF  (((scorep2 = scorep1)
AND   (scorep3 < scorep1))
AND   (scorep4 = scorep1))
 SET group = 6
ENDIF

// p1 + p3 + p4
IF  (((scorep2 < scorep1)
AND   (scorep3 = scorep1))
AND   (scorep4 = scorep1))
 SET group = 7
ENDIF

// p1 + p2 + p3 + p4
IF  (((scorep2 = scorep1)
AND   (scorep3 = scorep1))
AND   (scorep4 = scorep1))
 SET group = 8
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX           PLUS          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// DLA P1
IF (plus_gta1 = 1 )

 IF ( group = 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , 1 )
  SET plus_gta1 = 0
 ENDIF

 IF ( group = 2 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p2 , 1 )
  SET plus_gta1 = 0
 ENDIF

 IF ( group = 3 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p3 , 1 )
  SET plus_gta1 = 0
 ENDIF

 IF ( group = 4 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p4 , 1 )
  SET plus_gta1 = 0
 ENDIF

 IF ( group = 5 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p2 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p3 , 1 )
  SET plus_gta1 = 0
 ENDIF
 
 IF ( group = 6 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p2 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p4 , 1 )
  SET plus_gta1 = 0
 ENDIF
 
 IF ( group = 7 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p3 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p4 , 1 )
  SET plus_gta1 = 0
 ENDIF
 
 IF ( group = 8 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p2 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p3 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p4 , 1 )
  SET plus_gta1 = 0
 ENDIF
 
ENDIF

// DLA P2

IF (plus_gta2 = 1 )

 IF ( group = 2 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p2 , 1 )
  SET plus_gta2 = 0
 ENDIF

 IF ( group = 5 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p2 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p3 , 1 )
  SET plus_gta2 = 0
 ENDIF
 
 IF ( group = 6 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p2 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p4 , 1 )
  SET plus_gta2 = 0
 ENDIF
 
 IF ( group = 8 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p2 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p3 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p4 , 1 )
  SET plus_gta2 = 0
 ENDIF
 
ENDIF

// DLA P3

IF (plus_gta3 = 1 )

 IF ( group = 3 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p3 , 1 )
  SET plus_gta3 = 0
 ENDIF
 
 IF ( group = 5 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p2 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p3 , 1 )
  SET plus_gta3 = 0
 ENDIF 
 
 IF ( group = 7 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p3 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p4 , 1 )
  SET plus_gta3 = 0
 ENDIF  
 
 IF ( group = 8 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p2 , 1 )  
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p3 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p4 , 1 )
  SET plus_gta3 = 0
 ENDIF  
  
ENDIF

// DLA P4

IF (plus_gta4 = 1 )

 IF ( group = 4 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p4 , 1 )
  SET plus_gta4 = 0
 ENDIF
 
 IF ( group = 6 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p2 , 1 )    
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p4 , 1 )
  SET plus_gta4 = 0
 ENDIF
 
 IF ( group = 7 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p3 , 1 )  
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p4 , 1 )
  SET plus_gta4 = 0
 ENDIF
 
 IF ( group = 8 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p1 , 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p2 , 1 )   
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p3 , 1 )  
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p4 , 1 )
  SET plus_gta4 = 0
 ENDIF
 
 
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX           MINUS         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// DLA P1
IF (minus_gta1 = 1 )

 IF ( group = 1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , -1 )
  SET minus_gta1 = 0
 ENDIF

 IF ( group = 2 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p2 , -1 )
  SET minus_gta1 = 0
 ENDIF

 IF ( group = 3 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p3 , -1 )
  SET minus_gta1 = 0
 ENDIF

 IF ( group = 4 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p4 , -1 )
  SET minus_gta1 = 0
 ENDIF

 IF ( group = 5 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p2 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p3 , -1 )
  SET minus_gta1 = 0
 ENDIF
 
 IF ( group = 6 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p2 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p4 , -1 )
  SET minus_gta1 = 0
 ENDIF
 
 IF ( group = 7 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p3 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p4 , -1 )
  SET minus_gta1 = 0
 ENDIF
 
 IF ( group = 8 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p2 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p3 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta1  , p4 , -1 )
  SET minus_gta1 = 0
 ENDIF
 
ENDIF

// DLA P2

IF (minus_gta2 = 1 )

 IF ( group = 2 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p2 , -1 )
  SET minus_gta2 = 0
 ENDIF

 IF ( group = 5 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p2 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p3 , -1 )
  SET minus_gta2 = 0
 ENDIF
 
 IF ( group = 6 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p2 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p4 , -1 )
  SET minus_gta2 = 0
 ENDIF
 
 IF ( group = 8 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p2 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p3 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta2  , p4 , -1 )
  SET minus_gta2 = 0
 ENDIF
 
ENDIF

// DLA P3

IF (minus_gta3 = 1 )

 IF ( group = 3 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p3 , -1 )
  SET minus_gta3 = 0
 ENDIF
 
 IF ( group = 5 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p2 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p3 , -1 )
  SET minus_gta3 = 0
 ENDIF 
 
 IF ( group = 7 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p3 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p4 , -1 )
  SET minus_gta3 = 0
 ENDIF  
 
 IF ( group = 8 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p2 , -1 )  
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p3 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta3  , p4 , -1 )
  SET minus_gta3 = 0
 ENDIF  
  
ENDIF

// DLA P4

IF (minus_gta4 = 1 )

 IF ( group = 4 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p4 , -1 )
  SET minus_gta4 = 0
 ENDIF
 
 IF ( group = 6 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p2 , -1 ) 
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p4 , -1 )
  SET minus_gta4 = 0
 ENDIF
 
 IF ( group = 7 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p3 , -1 )  
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p4 , -1 )
  SET minus_gta4 = 0
 ENDIF
 
 IF ( group = 8 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p1 , -1 )
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p2 , -1 )   
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p3 , -1 )  
  CHANGE_GANG_CHAR_RESPECT ( gta4  , p4 , -1 )
  SET minus_gta4 = 0
 ENDIF

ENDIF


// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX    BMW  CHECKPOINTS     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ((IS_CAR_IN_BLOCK ( gt1_bmwsauber , 100.3 , 187.5 , 4.0 , 1.0 , 7.0 ))
OR (IS_CAR_IN_BLOCK ( gt1_bmwsauber ,  90.3 , 178.5 , 4.0 , 1.0 , 7.0 )))
 IF (position_start_bmw = 10)
  SET position_start_bmw = 9
  ++ laps_bmw
 ENDIF
ENDIF

IF (IS_CAR_IN_BLOCK ( gt1_bmwsauber , 127.5 , 118.5 , 4.0 , 1.0 , 7.0 ))
 SET position_start_bmw = 10
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX   FERRARI CHECKPOINTS   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ((IS_CAR_IN_BLOCK ( gt1_ferrari , 100.3 , 187.5 , 4.0 , 1.0 , 7.0 ))
OR (IS_CAR_IN_BLOCK ( gt1_ferrari ,  90.3 , 178.5 , 4.0 , 1.0 , 7.0 )))
 IF (position_start_ferrari = 10)
  SET position_start_ferrari = 9
  ++ laps_ferrari
 ENDIF
ENDIF

IF (IS_CAR_IN_BLOCK ( gt1_ferrari , 127.5 , 118.5 , 4.0 , 1.0 , 7.0 ))
 SET position_start_ferrari = 10
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX    BRAWN CHECKPOINTS    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ((IS_CAR_IN_BLOCK ( gt1_brawn , 100.3 , 187.5 , 4.0 , 1.0 , 7.0 ))
OR (IS_CAR_IN_BLOCK ( gt1_brawn ,  90.3 , 178.5 , 4.0 , 1.0 , 7.0 )))
 IF (position_start_brawn = 10)
  SET position_start_brawn = 9
  ++ laps_brawn
 ENDIF
ENDIF

IF (IS_CAR_IN_BLOCK ( gt1_brawn , 127.5 , 118.5 , 4.0 , 1.0 , 7.0 ))
 SET position_start_brawn = 10
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX   REDBULL CHECKPOINTS   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ((IS_CAR_IN_BLOCK ( gt1_redbull , 100.3 , 187.5 , 4.0 , 1.0 , 7.0 ))
OR (IS_CAR_IN_BLOCK ( gt1_redbull ,  90.3 , 178.5 , 4.0 , 1.0 , 7.0 )))
 IF (position_start_redbull = 10)
  SET position_start_redbull = 9
  ++ laps_redbull
 ENDIF
ENDIF

IF (IS_CAR_IN_BLOCK ( gt1_redbull , 127.5 , 118.5 , 4.0 , 1.0 , 7.0 ))
 SET position_start_redbull = 10
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX   MCLAREN CHECKPOINTS   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ((IS_CAR_IN_BLOCK ( gt1_mclaren , 100.3 , 187.5 , 4.0 , 1.0 , 7.0 ))
OR (IS_CAR_IN_BLOCK ( gt1_mclaren ,  90.3 , 178.5 , 4.0 , 1.0 , 7.0 )))
 IF (position_start_mclaren = 10)
  SET position_start_mclaren = 9
  ++ laps_mclaren
 ENDIF
ENDIF

IF (IS_CAR_IN_BLOCK ( gt1_mclaren , 127.5 , 118.5 , 4.0 , 1.0 , 7.0 ))
 SET position_start_mclaren = 10
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX   RENAULT CHECKPOINTS   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ((IS_CAR_IN_BLOCK ( gt1_renault , 100.3 , 187.5 , 4.0 , 1.0 , 7.0 ))
OR (IS_CAR_IN_BLOCK ( gt1_renault ,  90.3 , 178.5 , 4.0 , 1.0 , 7.0 )))
 IF (position_start_renault = 10)
  SET position_start_renault = 9
  ++ laps_renault
 ENDIF
ENDIF

IF (IS_CAR_IN_BLOCK ( gt1_renault , 127.5 , 118.5 , 4.0 , 1.0 , 7.0 ))
 SET position_start_renault = 10
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX        ENIGMA LAPS      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF (((((( laps_bmw = laps_counter )
OR ( laps_ferrari = laps_counter ))
OR ( laps_brawn = laps_counter ))
OR ( laps_redbull = laps_counter ))
OR ( laps_mclaren = laps_counter ))
OR ( laps_renault = laps_counter ))
 IF (laps > 0)
  ++ laps_counter
  -- laps
 ENDIF
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX          1 PLACE        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ( podium = 1 )
 IF ( laps_bmw = laps_many)
  DISPLAY_BRIEF ( 3067 ) // "Congratulation. The #BMW Sauber team# claimed 1st place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_bmw = 91
  SET podium = 2
 ENDIF
 IF ( laps_ferrari = laps_many)
  DISPLAY_BRIEF ( 3071 ) // "Congratulation. The #Ferrari team# claimed 1st place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_ferrari = 91
  SET podium = 2
 ENDIF
 IF ( laps_brawn = laps_many)
  DISPLAY_BRIEF ( 3075 ) // "Congratulation. The #Brawn team# claimed 1st place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_brawn = 91
  SET podium = 2
 ENDIF
 IF ( laps_redbull = laps_many)
  DISPLAY_BRIEF ( 3079 ) // "Congratulation. The #Brawn team# claimed 1st place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_redbull = 91
  SET podium = 2
 ENDIF 
 IF ( laps_mclaren = laps_many)
  DISPLAY_BRIEF ( 3083 ) // "Congratulation. The #Mclaren team# claimed 1st place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_mclaren = 91
  SET podium = 2
 ENDIF
 IF ( laps_renault = laps_many)
  DISPLAY_BRIEF ( 3087 ) // "Congratulation. The #Renault team# claimed 1st place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_renault = 91
  SET podium = 2
 ENDIF
ENDIF 

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX          2 PLACE        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ( podium = 2 )
 IF ( laps_bmw = laps_many)
  DISPLAY_BRIEF ( 3068 ) // "The #BMW Sauber team# claimed 2nd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_bmw = 92
  SET podium = 3
 ENDIF
 IF ( laps_ferrari = laps_many)
 DISPLAY_BRIEF ( 3072 ) // The #Ferrari team# claimed 2nd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_ferrari = 92
  SET podium = 3
 ENDIF
 IF ( laps_brawn = laps_many)
 DISPLAY_BRIEF ( 3076 ) // The #Brawn team# claimed 2nd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_brawn = 92
  SET podium = 3
 ENDIF
 IF ( laps_redbull = laps_many)
 DISPLAY_BRIEF ( 3080 ) // The #RedBull team# claimed 2nd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_redbull = 92
  SET podium = 3
 ENDIF 
 IF ( laps_mclaren = laps_many)
 DISPLAY_BRIEF ( 3084 ) // The #McLaren team# claimed 2nd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_mclaren = 92
  SET podium = 3
 ENDIF
 IF ( laps_renault = laps_many)
 DISPLAY_BRIEF ( 3088 ) // The #Renault team# claimed 2nd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_renault = 92
  SET podium = 3
 ENDIF
ENDIF 
 
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX          3 PLACE        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
IF ( podium = 3 )
 IF ( laps_bmw = laps_many)
  DISPLAY_BRIEF ( 3069 ) //The #BMW Sauber team# claimed 3rd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_bmw = 93
  SET podium = 4
 ENDIF
 IF ( laps_ferrari = laps_many)
  DISPLAY_BRIEF ( 3073 ) //The #Ferrari team# claimed 3rd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_ferrari = 93
  SET podium = 4
 ENDIF
 IF ( laps_brawn = laps_many)
  DISPLAY_BRIEF ( 3077 ) //The #Brawn team# claimed 3rd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_brawn = 93
  SET podium = 4
 ENDIF
 IF ( laps_redbull = laps_many)
  DISPLAY_BRIEF ( 3081 ) //The #Redbull team# claimed 3rd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_redbull = 93
  SET podium = 4
 ENDIF 
 IF ( laps_mclaren = laps_many)
  DISPLAY_BRIEF ( 3085 ) //The #McLaren team# claimed 3rd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_mclaren = 93
  SET podium = 4
 ENDIF
 IF ( laps_renault = laps_many)
  DISPLAY_BRIEF ( 3089 ) //The #Renault team# claimed 3rd place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_renault = 93
  SET podium = 4
 ENDIF
ENDIF 
 
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX          4 PLACE        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
IF ( podium = 4 )
 IF ( laps_bmw = laps_many)
  DISPLAY_BRIEF ( 3070 ) //The #Bmw Sauber team# claimed 4th place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_bmw = 94
  SET podium = 5
 ENDIF
 IF ( laps_ferrari = laps_many)
  DISPLAY_BRIEF ( 3074 ) //The #Ferrari team# claimed 4th place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_ferrari = 94
  SET podium = 5
 ENDIF
 IF ( laps_brawn = laps_many)
  DISPLAY_BRIEF ( 3078 ) //The #Brawn team# claimed 4th place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_brawn = 94
  SET podium = 5
 ENDIF
 IF ( laps_redbull = laps_many)
  DISPLAY_BRIEF ( 3082 ) //The #Redbull team# claimed 4th place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_redbull = 94
  SET podium = 5
 ENDIF 
 IF ( laps_mclaren = laps_many)
  DISPLAY_BRIEF ( 3086 ) //The #McLaren team# claimed 4th place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_mclaren = 94
  SET podium = 5
 ENDIF
 IF ( laps_renault = laps_many)
  DISPLAY_BRIEF ( 3090 ) //The #Renault team# claimed 4th place.
  DISPLAY_MESSAGE ( 2911 ) // Flag
  SET laps_renault = 94
  SET podium = 5
 ENDIF
ENDIF 

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX        RACE OVER        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ((wreck_bmwsauber = 3)
OR ( bmw_char_alive = 2))
 IF ( wreck_bmw_block = 0 )
  -- pseudo_count
  SET wreck_bmw_block = 1
 ENDIF
ENDIF

IF ((wreck_ferrari = 3)
OR ( ferrari_char_alive = 2))
 IF ( wreck_ferrari_block = 0 )
  -- pseudo_count
  SET wreck_ferrari_block = 1
 ENDIF
ENDIF

IF ((wreck_brawn = 3)
OR ( brawn_char_alive = 2))
 IF ( wreck_brawn_block = 0 )
  -- pseudo_count
  SET wreck_brawn_block = 1
 ENDIF
ENDIF

IF ((wreck_redbull = 3)
OR ( redbull_char_alive = 2))
 IF ( wreck_redbull_block = 0 )
  -- pseudo_count
  SET wreck_redbull_block = 1
 ENDIF
ENDIF

IF ((wreck_mclaren = 3)
OR ( mclaren_char_alive = 2))
 IF ( wreck_mclaren_block = 0 )
  -- pseudo_count
  SET wreck_mclaren_block = 1
 ENDIF
ENDIF

IF ((wreck_renault = 3)
OR ( renault_char_alive = 2))
 IF ( wreck_renault_block = 0 )
  -- pseudo_count
  SET wreck_renault_block = 1
 ENDIF
ENDIF

IF ( pseudo_count = 0 )
 IF (( podium > 0 )
 AND (NOT(DELAY(120))))
  DISPLAY_MESSAGE ( 5501 ) // Race Over!
  SET pseudo_count = 99
 ENDIF
ENDIF 

IF ( pseudo_count = 1 )
 IF (( podium = 2 )
 AND (NOT(DELAY(120))))
  DISPLAY_MESSAGE ( 5501 ) // Race Over!
  SET pseudo_count = 99
 ENDIF
ENDIF 

IF ( pseudo_count = 2 )
 IF (( podium = 3 )
 AND (NOT(DELAY(120))))
  DISPLAY_MESSAGE ( 5501 ) // Race Over!
  SET pseudo_count = 99
 ENDIF
ENDIF 

IF ( pseudo_count = 3 )
 IF (( podium = 4 )
 AND (NOT(DELAY(120))))
  DISPLAY_MESSAGE ( 5501 ) // Race Over!
  SET pseudo_count = 99
 ENDIF
ENDIF 

IF ( pseudo_count = 4 )
 IF (( podium = 5 )
 AND (NOT(DELAY(120))))
  DISPLAY_MESSAGE ( 5501 ) // Race Over!
  SET pseudo_count = 99
 ENDIF
ENDIF 

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX       WRECKED CARS      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


IF ((IS_CAR_WRECKED (gt1_bmwsauber))
AND (wreck_bmwsauber = 0))
 SET wreck_bmwsauber = 3
ENDIF

IF ((IS_CAR_WRECKED (gt1_ferrari))
AND (wreck_ferrari = 0))
 SET wreck_ferrari = 3
ENDIF

IF ((IS_CAR_WRECKED (gt1_brawn))
AND (wreck_brawn = 0))
 SET wreck_brawn = 3 
ENDIF

IF ((IS_CAR_WRECKED (gt1_redbull))
AND (wreck_redbull = 0))
 SET wreck_redbull = 3
ENDIF

IF ((IS_CAR_WRECKED (gt1_mclaren))
AND (wreck_mclaren = 0))
 SET wreck_mclaren = 3
ENDIF

IF ((IS_CAR_WRECKED (gt1_renault))
AND (wreck_renault = 0))
 SET wreck_renault = 3
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX       LOCKED CARS       XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

//bmw
IF (((NOT(HAS_CAR_GOT_DRIVER (gt1_bmwsauber)))
AND (NOT(bmw_char_alive = 2)))
AND (NOT(wreck_bmwsauber > 0)))
 CHANGE_CAR_LOCK ( gt1_bmwsauber , UNLOCKED )
ENDIF
IF (HAS_CAR_GOT_DRIVER (gt1_bmwsauber))
 CHANGE_CAR_LOCK ( gt1_bmwsauber , LOCKED )
ENDIF

//ferrari
IF (((NOT(HAS_CAR_GOT_DRIVER (gt1_ferrari)))
AND (NOT(ferrari_char_alive = 2)))
AND (NOT(wreck_ferrari > 0)))
 CHANGE_CAR_LOCK ( gt1_ferrari , UNLOCKED )
ENDIF
IF (HAS_CAR_GOT_DRIVER (gt1_ferrari))
 CHANGE_CAR_LOCK ( gt1_ferrari , LOCKED )
ENDIF

//brawn
IF (((NOT(HAS_CAR_GOT_DRIVER (gt1_brawn)))
AND (NOT(brawn_char_alive = 2)))
AND (NOT(wreck_brawn > 0)))
 CHANGE_CAR_LOCK ( gt1_brawn , UNLOCKED )
ENDIF
IF (HAS_CAR_GOT_DRIVER (gt1_brawn))
 CHANGE_CAR_LOCK ( gt1_brawn , LOCKED )
ENDIF

//redbull
IF (((NOT(HAS_CAR_GOT_DRIVER (gt1_redbull)))
AND (NOT(redbull_char_alive = 2)))
AND (NOT(wreck_redbull > 0)))
 CHANGE_CAR_LOCK ( gt1_redbull , UNLOCKED )
ENDIF
IF (HAS_CAR_GOT_DRIVER (gt1_redbull))
 CHANGE_CAR_LOCK ( gt1_redbull , LOCKED )
ENDIF

//mclaren
IF (((NOT(HAS_CAR_GOT_DRIVER (gt1_mclaren)))
AND (NOT(mclaren_char_alive = 2)))
AND (NOT(wreck_mclaren > 0)))
 CHANGE_CAR_LOCK ( gt1_mclaren , UNLOCKED )
ENDIF
IF (HAS_CAR_GOT_DRIVER (gt1_mclaren))
 CHANGE_CAR_LOCK ( gt1_mclaren , LOCKED )
ENDIF

//renault
IF (((NOT(HAS_CAR_GOT_DRIVER (gt1_renault)))
AND (NOT(renault_char_alive = 2)))
AND (NOT(wreck_renault > 0)))
 CHANGE_CAR_LOCK ( gt1_renault , UNLOCKED )
ENDIF
IF (HAS_CAR_GOT_DRIVER (gt1_renault))
 CHANGE_CAR_LOCK ( gt1_renault , LOCKED )
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX      ADD SCORE          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX      RACE OVER          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF ((pseudo_count = 99)
AND (NOT(DELAY ( 30 ))))
 LAUNCH_MISSION ( pkt.mis )
 SET pseudo_count = 100
ENDIF

ENDWHILE

LEVELEND
