/*Tiny Town revised by Gustavob
Thanks to Lantyz for initial script, B-$hep for finding player starting coordinates, Sektor for starting with Face Off Revised, and
Razor for giving the idea of making other default maps revised*/

//Players
PLAYER_PED player1 = ( 62.5 , 193.5 , 2.0 ) 10 0
PLAYER_PED player2 = ( 83.5 , 179.5 , 2.0 ) 9 90
PLAYER_PED player3 = ( 115.5 , 169.5 , 2.0 ) 8 270
PLAYER_PED player4 = ( 53.5 , 164.5 , 2.0 ) 6 90
PLAYER_PED player5 = ( 77.5 , 170.5 , 2.0 ) 7 90
PLAYER_PED player6 = ( 84.5 , 192.5 , 2.0 ) 0 270

//Parked cars
PARKED_CAR_DATA gta1 = ( 81.8 , 181.5 , 2.0 ) 2 90 GT24640
PARKED_CAR_DATA ztype = ( 81.8 , 182.5 , 2.0 ) 1 90 VTYPE
PARKED_CAR_DATA spritzer = ( 81.8 , 183.5 , 2.0 ) 0 90 SPRITE
PARKED_CAR_DATA bus = ( 88.4 , 182.6 , 2.0 ) -1 180 BUS
PARKED_CAR_DATA beamer = ( 105.5 , 193.5 , 2.0 ) 1 0 BMW
PARKED_CAR_DATA morton = ( 103.5 , 193.5 , 2.0 ) 0 0 MORGAN
PARKED_CAR_DATA arachnid = ( 106.5 , 196.4 , 2.0 ) 0 180 SPIDER
PARKED_CAR_DATA panto = ( 104.5 , 196.4 , 2.0 ) 2 180 FIAT
PARKED_CAR_DATA truktrns = ( 61.5 , 201.5 , 2.0 ) 2 180 TRUKTRNS

//Radio Stations
RADIO_STATION heavenly = STATION_KRISHNA ( 242.5 , 214.5 )
RADIO_STATION kgbh = STATION_RUSSIAN ( 201.5 , 21.5 )
RADIO_STATION futuro = STATION_ZAIBATSU ( 20.5 , 230.5 )
RADIO_STATION lofi = STATION_INDUSTRIAL ( 110.5 , 108.5 )

//Weapons
GENERATOR pistol1 = ( 61.0 , 195.0 , 2.0 ) 0 COLLECT_00 6000 6000 40
GENERATOR pistol2 = ( 92.5 , 176.5 , 2.0 ) 0 COLLECT_00 6000 6000 40
GENERATOR dualpistol = ( 50.0 , 177.0 , 2.0 ) 0 COLLECT_10 6000 6000 30
GENERATOR mac1 = ( 71.5 , 170.5 , 3.0 ) 0 COLLECT_01 6000 6000 10
GENERATOR mac2 = ( 111.5 , 170.5 , 2.0 ) 0 COLLECT_01 6000 6000 10
GENERATOR shotgun = ( 78.5 , 192.5 , 2.0 ) 0 COLLECT_06 6000 6000 12
GENERATOR electro = ( 98.0 , 159.0 , 2.0 ) 0 COLLECT_03 6000 6000 6
GENERATOR flamer = ( 60.0 , 186.5 , 4.0 ) 0 COLLECT_08 6000 6000 10
GENERATOR molotovs1 = ( 68.0 , 194.5 , 4.0 ) 0 COLLECT_04 6000 6000 8
GENERATOR molotovs2 = ( 50.5 , 172.5 , 4.0 ) 0 COLLECT_04 6000 6000 8
GENERATOR grenades = ( 98.5 , 188.5 , 2.0 ) 0 COLLECT_05 6000 6000 12
GENERATOR rockets1 = ( 114.0 , 195.0 , 2.0 ) 0 COLLECT_02 6000 6000 5
GENERATOR rockets2 = ( 89.5 , 185.5 , 2.0 ) 0 COLLECT_02 6000 6000 5 //Was an Invulnerability* in original

//Vehicle weapons
GENERATOR vehmac = ( 118.5 , 177.5 , 2.0 ) 0 COLLECT_18 6000 6000 10
GENERATOR vehmines = ( 73.5 , 179.5 , 5.0 ) 0 COLLECT_17 6000 6000 4
GENERATOR vehoil = ( 61.5 , 175.5 , 2.0 ) 0 COLLECT_16 6000 6000 6

//Powerups
GENERATOR health = ( 62.5 , 171.5 , 4.0 ) 0 COLLECT_30 6000 6000
GENERATOR armor = ( 100.5 , 172.5 , 2.0 ) 0 COLLECT_31 6000 6000
GENERATOR gang = ( 63.0 , 184.0 , 2.0 ) 0 COLLECT_40 6000 6000
//There was an Invulnerability* here

COUNTER loop = 1

DECLARE_POLICELEVEL ( 5 )

LEVELSTART

//Shading and brightness
SET_SHADING_LEVEL  ( 27 )
SET_AMBIENT_LEVEL  ( 0.3 , 3 )

//SET_CAR_NUMBER_GRAPHIC ( gta1 , 8 ) --> no need for this since its automatically set as 8

//Make the weapons spawn!
SWITCH_GENERATOR ( pistol1 , ON )
SWITCH_GENERATOR ( pistol2 , ON )
SWITCH_GENERATOR ( dualpistol , ON )
SWITCH_GENERATOR ( mac1 , ON )
SWITCH_GENERATOR ( mac2 , ON )
SWITCH_GENERATOR ( shotgun , ON )
SWITCH_GENERATOR ( flamer , ON )
SWITCH_GENERATOR ( electro , ON )
SWITCH_GENERATOR ( rockets1 , ON )
SWITCH_GENERATOR ( rockets2 , ON ) //Was an Invulnerability* pickup on original.
SWITCH_GENERATOR ( grenades , ON )
SWITCH_GENERATOR ( molotovs1 , ON )
SWITCH_GENERATOR ( molotovs2 , ON )

//Make the vehicle weapons spawn!
SWITCH_GENERATOR ( vehmines , ON )
SWITCH_GENERATOR ( vehoil , ON )
SWITCH_GENERATOR ( vehmac , ON )

//Make the powerups spawn
SWITCH_GENERATOR ( health , ON )
SWITCH_GENERATOR ( armor , ON )
SWITCH_GENERATOR ( gang , ON )
//There was an Invulnerability* here

WHILE ( loop = 1 )
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//Make the vehicles respawn!XXXXXXXXXXXXXXXX
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IF (IS_CAR_WRECKED(gta1))
IF (NOT (DELAY (50)))
  IF (NOT (IS_POINT_ONSCREEN(81.5 , 181.5 , 2.0)))
   IF (IS_CAR_IN_BLOCK(gta1, 81.5,181.5,2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (gta1, truktrns)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (gta1) //Delete the wreck
   gta1 = CREATE_CAR (81.5,182.5,2.0) 2 90 GT24640 END
  ENDIF
ENDIF
ENDIF

IF (IS_CAR_WRECKED(ztype))
IF (NOT (DELAY (50)))
  IF (NOT (IS_POINT_ONSCREEN(81.5 , 182.5 , 2.0)))
   IF (IS_CAR_IN_BLOCK(ztype, 81.5,182.5,2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (ztype, truktrns)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (ztype) //Delete the wreck
   ztype = CREATE_CAR (81.5,182.5,2.0) 1 90 VTYPE END
  ENDIF
ENDIF
ENDIF

IF (IS_CAR_WRECKED(spritzer))
IF (NOT (DELAY (50)))
  IF (NOT (IS_POINT_ONSCREEN(81.5 , 183.5 , 2.0)))
   IF (IS_CAR_IN_BLOCK(spritzer, 81.5,183.5,2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (spritzer, truktrns)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (spritzer) //Delete the wreck
   spritzer = CREATE_CAR (88.4 , 182.6 , 2.0) 0 90 SPRITE END
  ENDIF
ENDIF
ENDIF

IF (IS_CAR_WRECKED(bus))
IF (NOT (DELAY (50)))
  IF (NOT (IS_POINT_ONSCREEN(88.4 , 182.6 , 2.0)))
   IF (IS_CAR_IN_BLOCK(bus, 88.4 , 182.6 , 2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (bus, truktrns)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (bus) //Delete the wreck
   bus = CREATE_CAR (88.4 , 182.6 , 2.0) -1 180 BUS END
  ENDIF
ENDIF
ENDIF

IF (IS_CAR_WRECKED(beamer))
IF (NOT (DELAY (50)))
  IF (NOT (IS_POINT_ONSCREEN(105.5 , 193.5 , 2.0)))
   IF (IS_CAR_IN_BLOCK(beamer, 105.5 , 193.5 , 2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (beamer, truktrns)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (beamer) //Delete the wreck
   beamer = CREATE_CAR (105.5 , 193.5 , 2.0) 1 0 BMW END
  ENDIF
ENDIF
ENDIF

IF (IS_CAR_WRECKED(morton))
IF (NOT (DELAY (50)))
  IF (NOT (IS_POINT_ONSCREEN(103.5 , 193.5 , 2.0)))
   IF (IS_CAR_IN_BLOCK(morton, 103.5 , 193.5 , 2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (morton, truktrns)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (morton) //Delete the wreck
   morton = CREATE_CAR (103.5 , 193.5 , 2.0) 0 0 MORGAN END
  ENDIF
ENDIF
ENDIF

IF (IS_CAR_WRECKED(arachnid))
IF (NOT (DELAY (50)))
  IF (NOT (IS_POINT_ONSCREEN(106.5 , 196.4 , 2.0)))
   IF (IS_CAR_IN_BLOCK(arachnid, 106.5 , 196.4 , 2.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (arachnid, truktrns)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (arachnid) //Delete the wreck
   bus = CREATE_CAR (106.5 , 196.4 , 2.0) 0 180 SPIDER END
  ENDIF
ENDIF
ENDIF

IF (IS_CAR_WRECKED(panto))
IF (NOT (DELAY (50)))
  IF (NOT (IS_POINT_ONSCREEN(104.5 , 196.4 , 2.0)))
   IF (IS_CAR_IN_BLOCK(panto, 104.5 , 196.4 , 2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (panto, truktrns)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (panto) //Delete the wreck
   panto = CREATE_CAR (104.5 , 196.4 , 2.0) 2 180 FIAT END
  ENDIF
ENDIF
ENDIF

ENDWHILE

LEVELEND
